Few-shot vs zero-shot — when do you use each?
easyAnswer
- Zero-shot: task description only.
- Best for well-known task formats or when tokens matter (long few-shot examples eat context).
- Few-shot: 1-5 example pairs.
- Best when: (1) output format is non-obvious and needs demonstration; (2) task is unfamiliar; (3) you want deterministic style.
- Modern instruction-tuned LLMs are strong zero-shot for common tasks, but few-shot still gives 2-10% gains on niche tasks.
- Rule: start zero-shot, add examples only if quality misses.
Check yourself — multiple choice
- Zero-shot is always better
- Zero-shot for common tasks / short prompts; few-shot when output format needs demonstration or on niche tasks (+2-10%)
- Few-shot always wins
- Same effectiveness
Zero-shot for familiar tasks; few-shot for format demonstration or niche domains.
#prompting#in-context-learning
Practise LLMs & GenAI
214 interview questions in this topic.
Related questions
- What is in-context learning (ICL) and how does it work?
- What are the pillars of good prompt engineering?
- What is chain-of-thought (CoT) prompting?
- How does self-consistency improve CoT?
- What is Tree of Thoughts (ToT) and when does it help?
- Does role-play prompting ('You are a senior lawyer...') actually help?