AWS Certified AI Practitioner (AIF-C01) — Question 212
A company wants to use a large language model (LLM) to generate product descriptions. The company wants to give the model example descriptions that follow a format.
Which prompt engineering technique will generate descriptions that match the format?
Answer options
- A. Zero-shot prompting
- B. Chain-of-thought prompting
- C. One-shot prompting
- D. Few-shot prompting
Correct answer: D
Explanation
The correct answer is D, Few-shot prompting, as it allows the model to learn from a small number of examples, guiding it to generate descriptions that match the desired format. Zero-shot prompting (A) provides no examples, while One-shot prompting (C) gives only one example, which may not be sufficient for format adherence. Chain-of-thought prompting (B) focuses on reasoning processes rather than format-specific guidance.