A practical comparison of few-shot and zero-shot prompting techniques. Learn when examples help, when they hurt, and how to design effective few-shot prompts.
Zero-shot means asking the model to do something without any examples — just instructions.
Few-shot means providing 2-5 examples of the input-output pattern you want before giving your actual request.
Zero-shot works best when the task is well-defined and the model already understands the format:
Classify this customer review as POSITIVE, NEGATIVE, or NEUTRAL:
"The delivery was fast but the packaging was damaged."
Few-shot prompting shows the model exactly what you want:
Convert these product descriptions to one-line taglines:
Product: A waterproof Bluetooth speaker with 24-hour battery life
Tagline: Music that goes everywhere you do — rain or shine.
Product: An AI-powered calendar that schedules meetings automatically
Tagline: Your schedule, managed by intelligence, not effort.
Product: A standing desk that adjusts height based on your posture
Tagline: [model completes this]
| Examples | Best For |
|---|---|
| 1-2 | Simple format demonstration |
| 3-5 | Consistent style and quality |
| 5-10 | Complex patterns with edge cases |
| 10+ | Rarely needed — consider fine-tuning |
Rule of thumb: Start with 3 examples. Add more only if output quality is inconsistent.
Bad: 3 examples all about the same topic. The model learns the topic, not the pattern.
Good: 3 examples covering different topics but using the same format.
If your examples disagree on format, the model will be confused. Keep formatting, length, and style consistent across all examples.
Examples consume tokens. If zero-shot gives 90% quality, adding examples for the last 10% may not be worth the token cost.
Show examples WITH reasoning:
Q: Is this email spam? "Congratulations! You've won $1,000,000!"
Reasoning: Uses urgency ("Congratulations!"), promises unrealistic reward ($1M), no sender context.
Answer: SPAM
Q: Is this email spam? "Your order #4521 has shipped. Track at..."
Reasoning: References specific order number, standard shipping notification format.
Answer: NOT SPAM
Q: Is this email spam? "[your email here]"
Show what you DON'T want alongside what you do:
Good response: "Revenue increased 23% due to the new pricing model."
Bad response: "Revenue went up a lot because of changes we made."
Now write a summary of this data: [data]
Ask yourself:
Sign in to join the discussion.
No comments yet. Share your thoughts on this article.