Differentiate zero-shot, one-shot, and few-shot prompting. Write an example of all three for the same task and discuss when each prompting strategy is most suitable.
What's actually being asked
Define zero-shot, one-shot, and few-shot prompting, show the same task prompted all three ways, and explain which situations call for which.
Answer
The core difference
All three ask a pretrained LLM to do a task without updating its weights — the only thing that changes is how much demonstration you put inside the prompt itself (in-context learning), not any fine-tuning:
| Demonstrations in prompt | Relies on | |
|---|---|---|
| Zero-shot | 0 | the model's general instruction-following ability |
| One-shot | 1 | a single example to pin down format/label vocabulary |
| Few-shot | 2+ | pattern induction from several examples |
Same task, all three prompts
Task: classify a movie review's sentiment as positive or negative.
Zero-shot — only an instruction, no examples:
Classify the sentiment of this review as positive or negative.
Review: "The movie's pacing was slow but the ending was fantastic."
Sentiment:One-shot — one worked example before the real query:
Review: "Terrible acting, I walked out halfway." → Sentiment: negative
Review: "The movie's pacing was slow but the ending was fantastic." → Sentiment:Few-shot — multiple examples, ideally covering different patterns (clear positive, clear negative, and a mixed one like the target):
Review: "Terrible acting, I walked out halfway." → Sentiment: negative
Review: "Loved every second, best film this year." → Sentiment: positive
Review: "Visuals were stunning but the plot made no sense." → Sentiment: negative
Review: "The movie's pacing was slow but the ending was fantastic." → Sentiment:When each is most suitable
- Zero-shot: large, instruction-tuned models (RLHF-trained chat models) on common, well-understood tasks — sentiment, translation, simple summarization. Cheapest (shortest prompt, lowest latency/cost), and preferred by default when it already works, since every extra example costs context-window tokens.
- One-shot: when the task itself is easy but the output format or label vocabulary is ambiguous (e.g., should the answer be "positive" or "Positive" or "4/5 stars"?) — one example disambiguates that without much extra cost.
- Few-shot: niche, domain-specific, or structurally unusual tasks where the model needs to see the pattern across multiple examples to generalize correctly — e.g., extracting data into a specific JSON schema, following an idiosyncratic classification scheme, or a task the base model wasn't strongly instruction-tuned for. Few-shot also helps when examples need to show edge cases (like the mixed-sentiment review above), since one example can't cover every pattern.
Trade-off to mention: more examples = more tokens = higher cost/latency, and the model can be sensitive to the order and selection of examples (a known brittleness of in-context learning) — so few-shot isn't strictly "always better," it's a cost/robustness trade.
Exam tip
Don't confuse this axis (how many examples, in-context) with fine-tuning (which actually updates weights on many examples offline) — zero/one/few-shot all happen entirely within a single frozen-model forward pass at inference time.