Skip to content Skip to footer

Creating workflows for Generative AI prompt chaining with human involvement.

Generative AI is a type of artificial intelligence that utilizes machine learning models and large amounts of data to create new content such as conversations, images, videos, and music. Generative AI works through foundation models (FMs), large pre-trained models capable of performing a variety of tasks based on input prompts.

Large Language Models (LLMs), a class of FMs, are designed for language-based tasks such as summarization, text generation, classification, open-ended conversations, and information extraction. These models can continue learning from data inputs and prompts during inference.

However, complex tasks can be challenging for LLMs, and they may fail to perform at the desired accuracy. This problem can be resolved by breaking down complex tasks into smaller subtasks, a technique known as prompt chaining. Effective results can be achieved by creating a series of focused prompts for each subtask, improving speed and reducing development time.

While Generative AI can generate highly realistic content, there can be outputs that are plausible but incorrect. Therefore, incorporating human judgment is critical, especially in complex and high-risk situations. This can be achieved by building a ‘human-in-the-loop’ process where humans play an active role alongside the AI system in decision making.

Applying these concepts, an illustration is presented where a retail company uses Generative AI to automate the process of responding to customer reviews. A Step Functions workflow is set to identify any harmful information in the review, determine the sentiment, generate a response, and involve a human for review approval. If the review or the auto-generated response shows uncertainty regarding toxicity or tone, it is flagged for human review.

Step Functions is a useful tool for prompt chaining and enables automation of evaluation activities to find the best responses from different LLMs. Here, human decision-making can be integrated into the workflow using a unique token issuing and return process. An event-driven architecture (EDA) is used for extensibility. EDA allows adding consumers at any point by subscribing them to the event, improving development speed, variable scaling, and fault tolerance.

Summing up, Generative AI, with prompt chaining and a human-review process, can enhance the accuracy and safety of applications. Moreover, event-driven architectures integrated with workflows can augment the functionality of existing applications with generative AI.

Leave a comment

0.0/5