AIF-C01 Practice Question 35: Few Shot Prompting
AWS Certified AI Practitioner (AIF-C01) · Test 4 · question 5 of 10
A company uses a foundation model to label incoming emails as "Personal" or "Commercial". With only an instruction in the prompt, the model often chooses labels that don't match how the company defines the categories. The team has a handful of correctly labeled emails and wants better results today, without training or customizing the model. What should the team do?
Show answer and explanation
Answer:
Few-shot prompting, also called in-context learning, adds a few examples to the prompt to help the model calibrate its output to meet your expectations. Each *shot* is a paired example input and its desired output. Showing the model some real emails with the company's correct labels teaches it where the category boundaries are, with no training job and no change to the model (option B). A prompt with only an instruction and no examples is a *zero-shot* prompt, which is what the team has been using.
- A is wrong because fine-tuning is model customization, which the team wants to avoid. A handful of examples is also far too little data for a training job, and it can't deliver results today. - C is wrong because higher temperature makes outputs *more random*, which makes a classification task less consistent, not more accurate. - D is wrong because removing the instruction gives the model even less guidance about the company's definitions of the categories.
Reference: Prompt engineering concepts