Zero-shot vs Few-shot vs Chain-of-thought
Three prompting techniques stacked in order of hand-holding
Zero-shot asks the model to do a task cold; few-shot shows examples; chain-of-thought asks the model to reason step by step. They compose: few-shot chain-of-thought is often stronger than either alone.
Zero-shot
Glossary →Give the model a task description and no examples. Works surprisingly well on modern LLMs for common tasks.
Best for: Common tasks the model has clearly seen before.
Few-shot
Glossary →Include 1-10 worked examples in the prompt to demonstrate the format and quality expected. Also called in-context learning.
Best for: Custom formats and edge-case behaviors.
Chain-of-thought
Glossary →Prompt the model to reason step by step before answering (e.g., 'Let's think step by step'). Boosts math and multi-hop reasoning; also called CoT.
Best for: Multi-step reasoning, math, planning.
At a glance
| Dimension | Zero-shot | Few-shot | Chain-of-thought |
|---|---|---|---|
| Examples in prompt | A worked reasoning trace (optional) | 1-10 input/output pairs | None |
| Cost | More output tokens | More input tokens | Cheapest |
| Best for | Math, multi-hop | Custom formats, edge cases | Common tasks |
| Composes with each other | Yes | Yes | Baseline |
| Modern default | Built in (reasoning models) | For custom formats | For most tasks |
| Failure mode | Wrong reasoning still confidently stated | Overfitting to demo examples | Model guesses format |
Key differences
- 1Zero-shot uses no examples; few-shot uses a handful; CoT is orthogonal (about reasoning)
- 2CoT is a prompt trick that pairs with either zero-shot or few-shot
- 3Few-shot examples cost context tokens; CoT costs output tokens
- 4On reasoning-heavy tasks, few-shot CoT often beats plain few-shot by 10-30 points
- 5Reasoning-tuned models (o1, R1) reduce the need for explicit CoT prompting
In the interview
- Adding many-shot for a task the model already handles zero-shot
- Slapping 'think step by step' on classification tasks (no benefit, extra cost)
- Not distinguishing prompting from fine-tuning
How to choose
Standard task → zero-shot. Custom format → few-shot. Reasoning-heavy → CoT (compose with few-shot).
Common misconceptions
Myth: Chain-of-thought helps every task.
Reality: On classification or extraction it usually just adds cost. CoT wins on math, planning, and multi-hop QA.
Myth: More examples always help few-shot.
Reality: There's a sweet spot around 3-8. Too many either bloat context or bias the model toward superficial patterns in the demos.
Memory aid
Zero-shot: 'do this.' Few-shot: 'here are three like this.' CoT: 'think out loud while you do it.'
Can you combine them?
They compose freely. Few-shot chain-of-thought (show worked reasoning traces as examples) is often the strongest combination for math and planning.