Side-by-Side Comparison
| Zero-Shot | Few-Shot | |
|---|---|---|
| What you provide | Instruction (plus context and format) | Instruction plus 2–5 worked examples |
| Best for | Summaries, rewrites, translation, Q&A, drafting | Classification, extraction, strict formats, house style |
| Format control | Described in words | Demonstrated by examples |
| Token cost per call | Low | Higher (examples sent every time) |
| Main risk | Output format drifts | Model over-copies example quirks |
| Setup effort | Minimal | Curating good, varied examples |
When Zero-Shot Is Enough
Instruction-tuned models are trained to follow plain instructions, so zero-shot works for most everyday tasks. It fails mainly when you have an unusual format in mind, domain-specific labels, or a style that is easier to show than to describe. Before adding examples, try making the instruction more explicit: name the audience, the length and the exact output structure.
When to Switch to Few-Shot
- The output must match a fixed schema, label set or template exactly.
- You tried a more explicit zero-shot prompt and the format still drifts.
- The task depends on a house style or judgement call that is hard to put into words.
- You are classifying or extracting at scale and need consistent results.
Example Prompts
Zero-shot
Classify the sentiment of this customer review as Positive, Negative or Mixed. Reply with the label only. Review: "Setup took ages, but support fixed it in ten minutes and it has worked perfectly since."
Few-shot
Classify the sentiment of each review as Positive, Negative or Mixed. Review: "Arrived broken and nobody answered my emails." Label: Negative Review: "Great battery life, terrible keyboard." Label: Mixed Review: "Exactly what I needed, and it shipped a day early." Label: Positive Review: "Setup took ages, but support fixed it in ten minutes and it has worked perfectly since." Label:
Tips for Better Few-Shot Examples
- Vary length, wording and labels so the model learns the task, not a surface pattern.
- Put the hardest or most ambiguous case among the examples.
- Keep the example format identical to the format of the real input.
- Save the examples as a template so every teammate uses the same set.
Frequently Asked Questions
What is the difference between zero-shot and few-shot prompting?
Zero-shot prompting gives the model only an instruction. Few-shot prompting adds a handful of worked input and output examples before the real input, so the model can copy the pattern, format and level of detail shown in the examples.
How many examples should a few-shot prompt have?
Two to five examples cover most tasks. Add more only when the output still drifts, and make sure the examples are varied: if every example has the same length or label, the model will over-copy that feature.
When is zero-shot prompting enough?
When the task is common and the desired output is easy to describe in words: summaries, translations, rewrites, explanations and general questions. Modern instruction-tuned models handle these reliably without examples.
Is one-shot prompting the same as few-shot?
One-shot is the special case of few-shot with exactly one example. It is useful for showing a format, but a single example is easy to over-copy, so two or three varied examples are usually safer.
Do few-shot examples cost more?
Yes. Every example is sent with every request, so a few-shot prompt costs more tokens per call than a zero-shot prompt. For high-volume use, keep examples short or use prompt caching where your provider supports it.