Zero-Shot vs. Few-Shot Prompting: Should You Show Examples?
Deciding whether to include examples in your prompt separates a generic output from an excellent one. Learn when to use each technique and which mistakes to avoid.
There's one simple decision that separates a generic LLM output from an excellent one: do you include examples in your prompt or not? That choice defines two fundamental prompting techniques: zero-shot and few-shot.
Zero-shot: a direct instruction, no examples
It means giving the model a direct instruction with no examples. Think of a brilliant intern: you ask them to translate "cheese" into French, they need no extra context, and the answer is unambiguous: fromage.
- Works best when the task is specific and well-defined.
- And when the model has little room to interpret the request in different ways.
- Typical use cases: translating a word, summarizing a short text, answering a factual question.
Few-shot: instruction + examples
It means including concrete examples of the expected output inside the prompt. It's ideal for tasks with subjective criteria or patterns that are hard to describe in words: examples let the model detect the pattern and reduce ambiguity to almost zero.
Example: classifying emotions as positive or negative. Emotions are not inherently positive or negative, so the task is ambiguous. But give examples…
- Negative: sadness, anger, fear.
- Positive: joy, happiness, excitement.
…and the model identifies the pattern and classifies accurately.
Real-world case: writing a tweet
Task: write a tweet about the impact of AI on employment.
| Approach | Result |
|---|---|
| Zero-shot | Generic tweet with clichés ("AI isn't here to steal our jobs") and hashtags that felt like 2015 |
| Few-shot | Tweet with a clear hook ("Plot twist"), specific data points, and a closing question that invites conversation |
How was few-shot applied? Real tweets from the profile were included, both high-engagement and low-engagement.
- High-engagement tweets were longer, included hard data, and some used emojis.
- Low-engagement tweets were short and lacked relevant information.
The difference in quality was huge.
How do I choose?
Ask yourself three questions:
- Is there ambiguity in the task?
- Is the task complex?
- Do I need precision or to replicate a specific format?
If all three answers are yes, few-shot is probably the best option. And the best practice: try both techniques and compare the results.
Common mistakes in few-shot prompting
Number of examples
- Too few: the model can't detect patterns.
- Too many: they create rigid boundaries, causing hallucinations on cases not covered.
- Ideal range, per research papers: 3 to 7 examples.
Variety of examples
- Showing only positive or only negative examples introduces bias.
- Always include both categories (e.g., high AND low engagement) so the model sees the full picture of patterns.
Order of examples
- Order can change prompt effectiveness by 50% to 90%.
- Recency effect: what appears last gets more attention from the model.
- Recommendation: use a random order, alternating positive and negative examples to avoid bias.
Key takeaways
- Zero-shot = direct instruction, ideal for simple, unambiguous tasks.
- Few-shot = instruction + examples, ideal for complex, ambiguous or format-sensitive tasks.
- Use 3–7 varied examples covering both sides (good and bad).
- Shuffle the order, alternating categories, because the last example weighs the most.
- When in doubt, compare zero-shot and few-shot on your own task and test the prompt across multiple use cases.