GENERATIVE-AI-LEADER practice question 5 of 10

An organization wants to use generative AI to create a chatbot that can answer customer questions about their account balances. They need to ensure that the chatbot can access previous portions of the conversation with the customer. Which prompting technique should they use?

Full set: 76 questions

Domain Innovating with data and Google Cloud

Answer options
A: Use zero-shot prompting.
B: Use role prompting.
C: Use few-shot prompting.
D: Use prompt chaining. Correct answer
Correct Answer:
D. Use prompt chaining.
Explanation

Prompt chaining is the technique of using the output of one prompt as the input for a subsequent prompt. In the context of a conversational chatbot, this is essential for maintaining state and memory. To ensure the chatbot can access previous portions of the conversation, the application must chain the prompts by appending the new user query to the existing conversation history. This combined text is then sent to the model as the new prompt, allowing it to generate a response that is contextually aware of the entire interaction.

Why Incorrect

A. Use zero-shot prompting. This technique asks the model to perform a task without any prior examples in the prompt. It does not inherently manage or access conversational history across multiple turns.
B. Use role prompting. This sets the persona or character of the AI (e.g., "You are a helpful bank teller"). While useful for tone, it is not the mechanism for remembering past conversational context.
C. Use few-shot prompting. This provides a few examples of the desired input/output format within a single prompt to guide the model. It does not maintain the history of a multi-turn conversation. ---

References

1. Google Cloud Documentation, "Introduction to prompt design": This document defines prompt chaining: "Chaining is the practice of using the output of one prompt as the input of a second prompt. You can create sophisticated applications by chaining prompts together." This principle is directly applied in multi-turn conversations to maintain context.

2. Google Cloud Skills Boost, "Introduction to Large Language Models": In the module on "Prompt Engineering," the course explains that for multi-turn conversations, the prompt must be updated with the conversation history. It states, "To have a multi-turn conversation, you need to send the conversation history with each new turn." This is a direct application of the prompt chaining concept for building chatbots.

3. Google Cloud Blog, "An introduction to prompt design for generative AI": This article discusses building conversational experiences and notes the importance of including conversation history in the prompt. "For a chatbot to have a memory of the conversation, you need to include the conversation history in the prompt." This confirms that managing history is a key prompting strategy, achieved through chaining.

Scroll to Top