AIF-C01 Question 127
Single answerA data scientist is building a chatbot using a Large Language Model (LLM) deployed on Amazon SageMaker. The chatbot needs to handle customer queries effectively, even when it has not seen similar examples during training. Which prompt engineering technique should the data scientist use to guide the model in generating accurate responses by providing multiple examples within the prompt?
- A
Zero-shot prompting
- B
Few-shot prompting
- C
Single-shot prompting
- D
Chain-of-thought prompting
Show answer and explanation
Correct answer: B
Explanation
Few-shot prompting is the most appropriate technique in this scenario as it includes a small number of examples within the prompt, helping the LLM understand the context for generating accurate and relevant responses. This is particularly effective when handling queries that the model may not have explicitly seen during training.
- A. Incorrect.
Zero-shot prompting does not provide any examples in the prompt and relies on the model to infer the task directly from the instructions. This is not the best approach for guiding the model with examples.
- B. Correct.
Few-shot prompting involves including a few examples of the task within the prompt to help the model understand the context and generate better responses. This technique is suitable for guiding the model effectively when handling customer queries.
- C. Incorrect.
Single-shot prompting provides only one example within the prompt. While it can help the model, it is less effective compared to providing multiple examples as in few-shot prompting.
- D. Incorrect.
Chain-of-thought prompting is used to encourage the model to reason through problems step by step. It is not primarily focused on providing examples to guide the model, making it less suitable in this scenario.