Zero-Shot, One-Shot and Few-Shot Prompting
What zero-shot, one-shot and few-shot prompting mean, when examples help and when they get in the way, and how to write examples that teach the pattern.
BeginnerVerdeshell Team · 8 min read · Last reviewed
Zero-shot gives the model only an instruction; one-shot adds one worked example; few-shot adds several. Examples are the fastest way to show a model the format and judgement you want — but they teach whatever pattern they contain, including the accidental ones.
Key takeaways
- Zero-shot prompting gives an instruction with no examples; one-shot gives one example; few-shot gives several.
- Examples pin down format, tone and borderline judgement calls faster than any description.
- Use varied, realistic examples — the model copies whatever they have in common, including accidents.
- For reasoning models, try zero-shot first and add examples only to fix the output format.
Where the terms come from
The vocabulary comes from the 2020 GPT-3 paper, “Language Models are Few-Shot Learners”. Its finding was that a large enough model could pick up a new task from examples written directly into the prompt — no retraining. The authors described three settings by how many examples the prompt contained: zero, one, or a few. The “shots” are examples.
This is sometimes called in-context learning: the model is not changed at all. The examples only influence the one response they are sent with, and you pay for them as extra input tokens on every request.
Zero-shot prompting
A zero-shot prompt contains only the instruction and the input. Modern models have been trained extensively on instruction-following, so zero-shot works well for common, well-defined tasks: summarise this, translate that, extract the dates.
Classify the sentiment of this customer review as positive, negative or mixed.
Reply with one word.
Review: "Delivery was quick, but the box arrived damaged."Start here. If the output is right, examples would only add cost. Zero-shot falls short when the task has a house style, an unusual format, or judgement calls the model cannot infer from the instruction — like whether that review is “mixed” or “negative” by your definition.
One-shot prompting
One-shot adds a single worked example. It is the quickest way to pin down an output format, because showing one finished answer communicates structure better than describing it.
Turn the meeting note into an action item.
Note: "Priya to send the revised quote to Acme by Friday."
Action: Priya — send revised quote to Acme — due Friday
Note: "Ops team needs to check the backup job before the release."
Action:The risk with one example is over-copying. The model may treat everything about it as part of the pattern — its length, its wording, even the fact that it mentions a client — when you meant only the format.
Few-shot prompting
Few-shot gives several examples, and with variety the model can separate what is meant to stay constant (the format, the judgement) from what changes (the content). Anthropic’s guidance suggests three to five examples, wrapped in tags so the model can tell them apart from the instructions.
Few-shot is the right tool when the task depends on judgement that is easier to show than to describe: how strict a classification should be, what a good summary leaves out, how formal a reply should sound for your brand.
Writing examples that teach the right pattern
Make them realistic. Examples drawn from real inputs teach the model the messiness it will actually see; tidy invented ones teach it to expect tidiness.
Make them varied. If every example is short, the answers will be short. If every example has the same label, you have taught a bias. Cover the range — including at least one hard or borderline case, since that is where your judgement differs from the model’s default.
Keep the format identical across examples, and clearly separate them from the instruction and from the real input. Then check what the model learned by testing on inputs unlike any of the examples.
Few-shot prompting or fine-tuning?
Both teach a model by example. Few-shot does it inside every request: nothing is trained, you can change the examples in minutes, and you pay for them each time. Fine-tuning bakes examples into a new version of the model: slower and costlier to set up, but the behaviour no longer needs to be described in every prompt.
Start with few-shot. Move to fine-tuning only when the examples needed are too many to send with every request, or the behaviour still will not hold — see prompting, RAG or fine-tuning.
With reasoning models
OpenAI’s guidance for its reasoning models is to try zero-shot first and add examples only if needed. These models work out their own approach, and examples can over-constrain it. Use examples to fix the shape of the output rather than to demonstrate the reasoning.
Want this built properly?
We design and build AI systems for clients. Tell us the problem and we will tell you honestly whether AI — and which kind — is the right fit for it.