Quick Facts
- 1Typical few-shot range: 2β10 examples; gains usually flatten past roughly 8
- 2Origin: Brown et al. (2020), "Language Models are Few-Shot Learners" β the GPT-3 paper, 175B parameters
- 3Reported GPT-3 gain: 64.3% zero-shot β 71.2% few-shot on TriviaQA
- 4Token cost: 5 examples of ~120 tokens each adds roughly 600 input tokens to every request
- 5Prompt caching: a static few-shot block can cut repeat input cost by up to 90% on Claude's prompt caching
- 6Adoption threshold: ship few-shot when it adds β₯10 percentage points across a 50-case test set
What Zero Shot Prompting Is
π In One Sentence
Zero-shot prompting supplies a task instruction with no in-context demonstrations, relying entirely on the model's pre-training and instruction tuning.
π¬ In Plain Terms
Zero-shot is telling someone what to do and trusting they already know how. No worked examples β just the instruction.
Zero shot prompting asks the model to solve a task using only a clear instruction and no in-prompt examples. The model leans on its general knowledge and instruction-following capabilities learned during pre-training and alignment.
Zero shot is fast to set up because you do not need to design or curate example pairs. It works well for broad tasks such as generic Q&A, simple classification, summarization, or straightforward translation where the instructions alone are usually enough.
What Few Shot Prompting Is
π In One Sentence
Few-shot prompting prepends a small set of inputβoutput demonstrations to the instruction so the model infers the task pattern in-context, with no weight updates.
π¬ In Plain Terms
Few-shot is showing someone three finished examples before asking for a fourth. The model copies the pattern it can see.
Few shot prompting adds a small number of inputβoutput examples to the instruction so the model can infer the task pattern from concrete demonstrations. In practice, few shot usually means between two and ten examples.
These examples act like a mini training set inside the prompt, guiding how the model should interpret ambiguous tasks, specialized formats, or domain-specific language. Few shot prompting is especially helpful when you need a specific style, schema, or nuanced behavior that generic instructions do not capture.
Nothing is trained. The examples live in the context window for the duration of a single call and are discarded afterwards, which is why the technique is called in-context learning rather than fine-tuning.
Key Differences: Zero Shot vs Few Shot
Zero shot and few shot prompting differ mainly in setup effort, accuracy on specific tasks, and scalability across many use cases. Both rely on the same underlying model but trade example design effort for better task alignment.
Dimension | Zero Shot | Few Shot |
|---|---|---|
| Examples in prompt | None | 2β10+ representative examples |
| Setup speed | Very fast; no example curation | Slower; examples must be selected and maintained |
| Data requirements | No labeled examples needed | Requires at least a few labeled examples |
| Accuracy on narrow tasks | Often lower or more generic | Typically higher and more consistent on specific domains |
| Output format control | Depends on how precisely you can describe the format | Strong; the examples are the format specification |
| Input tokens per call | Instruction only | Instruction plus every example, on every call |
| Scalability across tasks | Highly scalable, easy to add new tasks | Less scalable; each task may need its own examples |
When to Use Zero Shot
You should use zero shot prompting when you need speed, have no labeled examples, and your task is reasonably general. This pattern works well as a first pass or baseline.
Typical zero shot scenarios:
- General Q&A, simple summaries, and basic sentiment classification.
- Rapid experimentation when you are still discovering the task shape.
- New domains or languages where you lack curated examples.
- High-volume, cost-sensitive pipelines where every extra input token multiplies across millions of calls.
When to Use Few Shot
You should use few shot prompting when the task is specialized, format-sensitive, or high risk, and you can provide good examples. In these cases, examples significantly improve reliability over pure instructions.
Common few shot scenarios:
- Domain-specific classification or extraction (legal, medical, finance) where precise labels and wording matter.
- Tasks with strict schemas, such as extracting structured JSON from messy text.
- Multilingual or localization tasks where a few examples per language help handle idioms and style.
- House style and tone matching, where "write like this" is easier to demonstrate than to describe.
- Smaller or local open-weight models, where instructions alone frequently drift off-format.
Example: Zero Shot vs Few Shot Prompt
The practical difference between zero shot and few shot appears clearly when you compare prompts for the same task. Here we classify support tickets by intent.
Bad Prompt β Unstructured
"Look at this support ticket and tell me what it is about."
Zero Shot Prompt
"Classify the following support ticket into one of these categories: `billing_issue`, `login_problem`, `feature_request`, `bug_report`, or `other`. Ticket: "I tried to reset my password three times today and the link always says it expired." Output only the category name."
Few Shot Prompt
"Classify each support ticket into one of these categories: `billing_issue`, `login_problem`, `feature_request`, `bug_report`, or `other`. Output only the category name. Example 1: Ticket: "You charged me twice this month for the same subscription." Label: `billing_issue` Example 2: Ticket: "Whenever I click 'export report' nothing happens, even after refreshing the page." Label: `bug_report` Example 3: Ticket: "Could you add support for exporting reports directly to Google Sheets?" Label: `feature_request` Now classify this ticket: "I tried to reset my password three times today and the link always says it expired."
The few shot version shows the pattern explicitly, which usually improves classification quality for nuanced or noisy tickets.
Example Quality Decides Few-Shot Performance
Three well-chosen examples routinely outperform ten near-duplicates, because the model learns the boundaries of the task from the variety you show it, not from the volume. Most disappointing few-shot results trace back to example selection rather than example count.
- 1Cover the range, not just the easy cases. Include the ambiguous ticket, the short one, and the badly written one β those are the inputs that fail in production.
- 2Balance the labels. If four of five examples are `bug_report`, the model will over-predict `bug_report`. Give each class roughly equal representation.
- 3Shuffle the order. Models weight the most recent examples most heavily, so avoid grouping identical labels together at the end of the block.
- 4Keep the format byte-identical across every example. Inconsistent spacing, quoting, or key ordering teaches the model that the format is negotiable.
- 5Draw examples from real production inputs. Hand-written clean examples teach the model to expect clean inputs it will never actually receive.
- 6Never paste real customer data into a prompt template. Anonymize or synthesize; few-shot blocks are stored, versioned, and shared like code.
Few-Shot Costs Tokens on Every Call
Few-shot examples are not a one-time setup cost β they are re-sent as input tokens with every single request. Five examples of roughly 120 tokens each add about 600 input tokens per call, which is negligible in testing and material at a million calls a month.
This is the practical reason to measure the zero-shot baseline first. If zero-shot already clears your accuracy bar, few-shot buys you nothing and bills you for it indefinitely.
π Cache the example block
A few-shot block that never changes between calls is an ideal prompt-caching candidate. Anthropic, OpenAI, and Google all discount cached input heavily β up to 90% on Claude prompt caching β which removes most of the cost argument against few-shot in high-volume pipelines.
Reasoning Models Narrowed the Zero-Shot Gap
Strong instruction tuning has closed much of the accuracy gap that few-shot prompting used to buy on frontier models. On Claude Opus 5, GPT-5.6, and Gemini 3.1 Pro, a precisely written zero-shot instruction now matches few-shot on many general tasks β but that convergence does not hold across the whole model landscape.
Where few-shot still earns its tokens is format and vocabulary: proprietary label sets, internal schemas, house tone, and edge cases the model has never encountered in pre-training. And on smaller or locally hosted models, few-shot remains the single most effective accuracy lever available without fine-tuning.
Model class | Zero-shot quality | Does few-shot still help? |
|---|---|---|
| Frontier reasoning (Claude Opus 5, GPT-5.6, Gemini 3.1 Pro) | High on general tasks | Mainly for output format, house style, and proprietary label sets |
| Frontier non-reasoning (Claude Sonnet 5, Gemini 3.7 Flash) | Good | Yes β for narrow domains and strict schemas |
| Small hosted (Claude Haiku 4.5, Gemini 3.5 Flash-Lite) | Mixed on specialized tasks | Yes β usually the largest single accuracy gain |
| Local open-weight 7β30B (Qwen3 8B, Llama 4 Scout, Gemma 4) | Variable; format drift is common | Yes β often the difference between usable and unusable output |
Common Mistakes
Most few-shot failures are process failures, not model failures. These five account for the majority of cases where adding examples made output worse instead of better.
β Adding examples before measuring the zero-shot baseline
Why it hurts: You pay input tokens forever without knowing whether the examples bought anything.
Fix: Run 50 test cases zero-shot first. Record accuracy. Only then add examples and re-measure.
β Every example showing the same label
Why it hurts: The model reads the imbalance as a prior and over-predicts that class on real inputs.
Fix: Balance classes across examples and shuffle them so identical labels are not adjacent.
β Examples that contradict the written instruction
Why it hurts: When instruction and demonstration disagree, the model usually follows the demonstration β silently.
Fix: Re-read the instruction against every example after each edit; treat the examples as the spec.
β Examples far longer or cleaner than real inputs
Why it hurts: The model learns to expect tidy input and degrades on the messy text it actually receives.
Fix: Sample examples from production traffic, including the ugly ones.
β Real customer data left inside the example block
Why it hurts: Prompt templates are versioned, shared, and logged β personal data in them becomes a compliance exposure.
Fix: Anonymize or synthesize every example before it enters a stored template.
How PromptQuorum Helps You Choose
PromptQuorum is a multi-model AI dispatch tool that lets you test zero shot and few shot prompts across multiple providers in one place. You can send the same instruction-only prompt and the same example-augmented prompt to models such as GPT-5.6, Claude Opus 5, and Gemini 3.1 Pro side by side.
Inside PromptQuorum, you can:
- Start with zero shot prompts using frameworks like Single Step, RTF, or CO-STAR for quick baselines.
- Upgrade to few shot prompts by embedding representative examples inside frameworks like SPECS or Google's Prompting Guide when you need tighter control.
- Save both zero shot and few shot versions as templates, then compare accuracy, latency, and token costs across models over time.
How to Choose Between Zero-Shot and Few-Shot Prompting
- 1For routine, straightforward tasks, start with zero-shot (no examples). Example: 'Classify this review as positive or negative.' If accuracy is sufficient, zero-shot is faster and cheaper.
- 2When zero-shot performance is poor (< 80% accuracy or quality), add 2β5 few-shot examples. Show the model 2β3 positive and 2β3 negative reviews with correct labels. Few-shot teaches by example.
- 3For tasks with subtle distinctions or rare patterns, add 5β10 examples (few-shot+). If your task requires detecting sarcasm, harmful bias, or domain-specific nuance, more examples help.
- 4Choose examples that span the range of inputs you expect. If you're classifying product reviews, include enthusiastic, lukewarm, and negative examples. Don't show only easy cases.
- 5Measure few-shot benefit on a test set before committing to it in production. Run the same prompt with 0 examples and 5 examples on 50 test cases. If few-shot adds 10+ percentage points of accuracy, include examples. If the gain is <5%, stick with zero-shot.
- 6Once few-shot is in production, cache the example block and re-check it each quarter. Stale examples quietly encode categories and formats your product no longer uses.
Frequently Asked Questions
How many examples is "few-shot"?
Between two and roughly ten. One example is called one-shot. Gains typically flatten past about eight examples, and beyond that you are mostly paying input tokens for diminishing returns. If you need dozens of examples to hit your accuracy target, fine-tuning is usually the better tool.
Is few-shot prompting the same as fine-tuning?
No. Few-shot prompting is in-context learning β the examples sit in the prompt for one call and change nothing about the model. Fine-tuning updates the model weights and persists across all calls. Few-shot costs input tokens per request; fine-tuning costs a training run plus a dedicated model to host.
Does few-shot prompting still help on reasoning models?
Less than it used to for raw accuracy, more than you would expect for format. On Claude Opus 5, GPT-5.6, and Gemini 3.1 Pro, a precise zero-shot instruction often matches few-shot on general tasks. But when you need an exact JSON schema, a proprietary label vocabulary, or a specific house tone, examples are still the most reliable way to get it.
Why did adding examples make my output worse?
Usually label imbalance, contradiction, or format drift. If most examples share one label, the model over-predicts it. If an example contradicts your written instruction, the model tends to follow the example. And if the examples are cleaner than real inputs, the model degrades on the messy text it actually receives.
Does the order of few-shot examples matter?
Yes. Models weight later examples more heavily than earlier ones, so a block that ends with three identical labels biases the prediction toward that label. Shuffle so classes are interleaved, and re-test after any reordering β order effects are real enough to move accuracy several points.
How do I keep few-shot prompts affordable at scale?
Use prompt caching. A static example block is identical on every call, which makes it an ideal cache target β Anthropic, OpenAI, and Google all bill cached input at a steep discount, up to roughly 90% off on Claude prompt caching. Keep the examples at the very start of the prompt so the cached prefix stays stable.
Can I combine few-shot with chain-of-thought prompting?
Yes, and it is one of the strongest combinations available. Few-shot chain-of-thought means your examples show the reasoning steps, not just the final answer. It costs more output tokens than either technique alone, but on multi-step tasks it is usually more reliable than zero-shot "think step by step."
Sources & Further Reading
- Brown, T., Mann, B., Ryder, N., et al. (2020). "Language Models are Few-Shot Learners." NeurIPS 2020. arXiv:2005.14165 β the paper that introduced few-shot, one-shot, and zero-shot as prompting regimes.
- Zhao, Z., Wallace, E., Feng, S., Klein, D., & Singh, S. (2021). "Calibrate Before Use: Improving Few-Shot Performance of Language Models." ICML 2021. arXiv:2102.09690 β on majority-label and recency bias in example ordering.
- Lu, Y., Bartolo, M., Moore, A., Riedel, S., & Stenetorp, P. (2022). "Fantastically Ordered Prompts and Where to Find Them." ACL 2022. arXiv:2104.08786 β on the sensitivity of few-shot accuracy to example order.
- Min, S., Lyu, X., Holtzman, A., et al. (2022). "Rethinking the Role of Demonstrations." EMNLP 2022. arXiv:2202.12837 β evidence that the format and input distribution of examples matter more than the correctness of their labels.
- Anthropic. "Prompt caching." Claude platform documentation β cached-input pricing for static prompt prefixes such as few-shot blocks.
