What is the difference between zero-shot and few-shot prompting?
Zero-shot prompting gives the model only an instruction and no examples, relying on what it already learned. Few-shot prompting includes a handful of example input-output pairs (typically 1 to 5) that demonstrate the task, so the model pattern-matches. Few-shot usually improves accuracy and format consistency on tricky tasks; zero-shot is simpler and shorter.
Why — the first-principles explanation
Both terms describe how many demonstrations you put in the prompt. 'Shot' means example. Zero-shot = zero examples, you just describe the task. Few-shot = a few examples showing input and the desired output. The model isn't retrained either way; it learns the pattern on the fly from what's in the prompt, a behavior called in-context learning.
Why does showing examples help? Because a language model is a pattern-completer. When it sees two or three cases of 'input to output,' it infers the rule and continues the pattern for your new input. This is especially powerful for tasks that are hard to describe in words but easy to show, a specific tone, a JSON shape, a labeling scheme.
The trade-off is length and cost versus reliability. Zero-shot is short, cheap, and often fine for simple, common tasks the model already knows. Few-shot costs more tokens but boosts accuracy and format consistency on unusual or ambiguous tasks. The term itself comes from the 2020 GPT-3 research showing large models are strong 'few-shot learners.'
An example that makes it click
Imagine asking a friend to sort your photos into 'keep' and 'delete.' Zero-shot is just saying 'sort these,' they'll use their own judgment and might not match your taste. Few-shot is first showing them five photos you already sorted: 'this blurry one, delete; this birthday one, keep.'
Now they get the pattern and sort the rest the way you would. You didn't teach them a new skill; you gave a few examples, and they matched it. That's few-shot prompting, and it's why examples so often beat instructions alone.
How to do it
- Try zero-shot first: give a clear instruction with no examples, it's shortest and often enough.
- If the output is inconsistent or off-format, switch to few-shot by adding 1 to 5 example input-output pairs.
- Make examples diverse and representative of real inputs, including tricky edge cases.
- Match the example format exactly to the output you want (same structure, labels, and style).
- Balance count vs. cost: more examples use more tokens; add only as many as you need for consistency.
Key facts
- 'Shot' means example: zero-shot uses none; few-shot uses a small number, typically 1 to 5, of demonstrations.
- Neither retrains the model; the model learns the pattern from the prompt (in-context learning).
- Few-shot usually improves accuracy and format consistency on ambiguous or unusual tasks.
- Zero-shot is shorter and cheaper and often suffices for simple, common tasks.
- The terms were popularized by the 2020 GPT-3 paper 'Language Models are Few-Shot Learners.'
▶ The 60-second explainer (script)
What's the difference between zero-shot and few-shot prompting? It's just how many examples you include. 'Shot' means example. Zero-shot means zero examples, you simply describe the task and let the model use what it already knows. Few-shot means you include a few examples, usually one to five, showing an input and the exact output you want. Neither one retrains the model. Instead, the model learns the pattern right there in the prompt, which is called in-context learning. Why do examples help so much? Because a language model is a pattern-completer. Show it three cases of input-to-output and it infers the rule, then applies it to your new input. That's gold for tasks that are hard to describe but easy to show, a certain tone, a JSON shape, a labeling scheme. The trade-off: zero-shot is short and cheap and fine for simple tasks; few-shot costs more tokens but boosts accuracy and consistency on tricky ones. Start zero-shot, and add examples when the output drifts.
What authoritative sources say
People also ask
How many examples make it 'few-shot'?
Typically one to five. One example is sometimes called 'one-shot.' The exact number isn't fixed, use enough to show the pattern.
Does few-shot retrain the model?
No. The model learns the pattern only from the examples in that prompt (in-context learning); nothing is permanently changed.
When should I use zero-shot?
For simple, common tasks the model already handles well, where you want a short, cheap prompt and don't need strict formatting.
Why do examples work better than instructions?
Because models complete patterns. A few input-output pairs show the exact target, which is often clearer than describing it in words.