AIF-C01 Question 126
Single answerA data scientist is tasked with building a natural language processing (NLP) workflow using a pre-trained large language model (LLM) on AWS. The scientist wants to generate better responses when querying the model. Initially, the model's responses are vague and lack depth. Which prompt engineering technique should the data scientist use to guide the model's reasoning process step-by-step and improve response quality?
- A
Zero-shot prompting
- B
Chain-of-thought prompting
- C
Single-shot prompting
- D
Few-shot prompting
Show answer and explanation
Correct answer: B
Explanation
Chain-of-thought prompting is the most appropriate technique in this scenario because it guides the model to break down problems into logical steps, improving response depth and accuracy. This is particularly beneficial when working with tasks that require reasoning, as opposed to simply relying on examples or a general prompt.
- A. Incorrect.
Zero-shot prompting involves asking the model to perform a task without providing examples or guidance, which is unlikely to improve response quality for complex tasks requiring reasoning.
- B. Correct.
Chain-of-thought prompting helps guide the model to reason through problems step-by-step, resulting in more detailed and accurate responses. This is particularly useful for tasks that require logical reasoning.
- C. Incorrect.
Single-shot prompting involves giving one example alongside the prompt. While it might improve the model's response slightly, it is not focused on step-by-step reasoning.
- D. Incorrect.
Few-shot prompting involves providing multiple examples to guide the model. Although it can improve performance, it does not specifically target step-by-step reasoning like chain-of-thought prompting does.