Zero-Shot vs Few-Shot Prompting: What's the Difference
Zero-shot prompting asks an LLM to perform a task with no examples; few-shot includes sample input-output pairs in the prompt. When to use each.
Zero-shot prompting asks a large language model to complete a task using only an instruction, with no examples of what a correct answer looks like. Few-shot prompting instead includes a handful of example input-output pairs directly in the prompt before the actual request, showing the model the pattern it should follow. Both are ways of shaping a model’s output through the prompt alone, without touching its underlying weights — the choice between them is one of the simplest and most effective levers you have when working with an LLM.
Zero-shot: instruction only
A zero-shot prompt relies entirely on the model’s pretrained knowledge and its ability to follow a plain-language instruction. There’s no demonstration of the task, just a description of what to do:
Classify the sentiment of this review as positive, negative, or neutral.
Review: "The battery life is disappointing but the screen is gorgeous."
Modern instruction-tuned models are often surprisingly capable at zero-shot tasks, especially common ones like sentiment classification, summarization, or translation, because those patterns show up heavily in training data. Zero-shot is the cheapest possible prompt in terms of both tokens and the effort to write it — that matters because prompt length directly drives request cost. Our LLM token cost calculator is a quick way to see how much a longer, example-laden prompt actually costs compared to a bare instruction, especially at volume.
Few-shot: showing the pattern
A few-shot prompt adds one or more worked examples before the real question, letting the model infer the desired format, tone, or reasoning pattern from demonstration rather than description alone:
Classify the sentiment of each review as positive, negative, or neutral.
Review: "Fast shipping and great packaging."
Sentiment: Positive
Review: "Item arrived broken and support never responded."
Sentiment: Negative
Review: "The battery life is disappointing but the screen is gorgeous."
Sentiment:
The examples do two things a plain instruction can’t: they pin down an exact output format (here, a single word with no extra commentary), and they can nudge the model toward a specific interpretation of an ambiguous case by showing how similar ambiguous cases were handled. This is often more reliable than trying to describe the desired format in words — showing beats telling.
Why few-shot helps
Few-shot prompting leans on in-context learning — a model’s ability to pick up a pattern from examples present in its context window, without any weight updates. It tends to help most in a few concrete situations:
- Output format is strict. If you need JSON with exact field names, a fixed label set, or a particular tone, two or three examples communicate that far more reliably than a written specification.
- The task is unusual or ambiguous. Tasks that don’t map cleanly onto anything common in training data (a company-specific classification scheme, a niche style guide) benefit from concrete demonstrations.
- Edge cases matter. Including an example of a tricky boundary case (“this counts as neutral, not negative”) disambiguates behavior that an instruction alone might describe imprecisely.
The costs of few-shot
Few-shot isn’t free. Every example consumes tokens on every single request, which adds up quickly at scale — a five-example few-shot prompt sent a million times costs meaningfully more than the same request sent zero-shot, and it also eats into the model’s usable context window for other content, like a long document you’re asking the model to reason about alongside the examples.
Poorly chosen examples can also backfire. If your examples are unrepresentative, biased toward one category, or contain a subtle inconsistency, the model will faithfully learn the wrong pattern. And ordering matters more than it should: models can be sensitive to the order examples appear in, sometimes weighting the most recent example more heavily than earlier ones.
Zero-shot vs few-shot
| Zero-shot | Few-shot | |
|---|---|---|
| Prompt length | Shortest | Longer — grows with each example |
| Token cost | Lowest | Higher, scales with example count |
| Format control | Weaker — relies on instructions | Stronger — demonstrated directly |
| Best for | Common, well-understood tasks | Unusual formats, ambiguous or niche tasks |
| Failure mode | Vague or inconsistent output | Learns bad patterns from bad examples |
Where this fits with other prompting techniques
Zero-shot and few-shot are about what information you put in the prompt. They’re often combined with chain-of-thought prompting, which is about how the model reasons — asking it to work through steps explicitly rather than jumping straight to an answer. You can have a few-shot prompt where each example also shows a worked chain of reasoning, combining both techniques at once.
It’s also worth distinguishing few-shot prompting from fine-tuning. Few-shot examples only affect a single request — they exist in that one prompt and vanish afterward. Fine-tuning permanently updates a model’s weights based on many examples, which is more expensive and inflexible to set up but doesn’t cost prompt tokens on every subsequent call. For tasks you run occasionally or that change often, few-shot prompting is almost always the more practical starting point; fine-tuning becomes worth the investment only once you’re running the same task at real volume with a stable, well-understood pattern.
Choosing between them
Start zero-shot. If the model already handles your task reliably with a clear instruction, you’re done — it’s cheaper and simpler to maintain. Reach for few-shot when you hit a specific, repeatable failure: wrong output format, missed edge cases, or inconsistent tone across runs. Add just enough examples to fix the failure you’re seeing rather than piling on speculative ones “just in case” — each additional example is pure token cost that needs to earn its place. Two or three well-chosen examples usually outperform ten mediocre ones, and testing with a tool like retrieval-augmented generation pipelines shows the same pattern: relevant, curated context beats volume every time.
The takeaway
Zero-shot prompting asks for a task with instructions alone; few-shot adds worked examples that demonstrate the exact pattern you want. Zero-shot is cheaper and often good enough for common tasks; few-shot earns its extra tokens when output format needs to be exact, the task is unusual, or edge cases keep tripping the model up. Start with the simplest prompt that works, and add examples only to fix a specific, observed failure.
Tagged
Keep reading
Chisato · · 5 min read What Is Catastrophic Forgetting in AI Fine-Tuning?
Catastrophic forgetting is when training a model on new data erases skills it already had. Why it happens during fine-tuning, and how teams work around it.
Chisato · · 4 min read What Is DPO? Direct Preference Optimization Explained
DPO tunes a language model on human preference data directly, without training a separate reward model or running reinforcement learning.
Chisato · · 4 min read What Is Constitutional AI? Training Models on Principles
Constitutional AI trains language models to critique and revise their own outputs against a written set of principles, reducing reliance on human labels.