Few-Shot vs Zero-Shot Prompting: When Constraints Beat Examples, and When They Don't

You've been taught that few-shot examples make prompts better. More examples, better results. It's the first technique most people learn, and the one they reach for by default.
The research is more mixed than that. Several studies find that on strong instruction-tuned models, extra examples add little and sometimes hurt, while one major vendor still recommends including them in every prompt (Google, Prompt design strategies). This guide covers few-shot vs zero-shot prompting: when each wins, and how to test it on your own task.
Few-shot prompting means putting worked examples in the prompt; zero-shot prompting means giving only the instruction. Both are forms of in-context learning. For a classification build that tests this properly, see the classification prompt playbook.
The Over-Prompting Effect
Tang et al. call the effect of adding too many examples "over-prompting". Testing several models on software requirement classification, they found that "incorporating excessive domain-specific examples into prompts can paradoxically degrade performance in certain LLMs", and that a smaller, well-chosen set did better (Tang et al., 2025).
Results also swing by task. An NDSS 2025 study of LLMs on vulnerability detection found performance "fluctuates significantly across programming languages and learning modes (zero- vs. few-shot)" (Lin and Mohaisen, NDSS 2025).
Few-Shot Isn't Learning What You Think
Here's the part that should change how you prompt. Min et al. ran an experiment where they randomly replaced the labels in few-shot examples, across 12 models including GPT-3 (Min et al., EMNLP 2022). Many examples ended up with the wrong label. Performance barely changed.
The models weren't learning input-label mappings from your examples. They were picking up format cues and token distribution patterns. The paper found the examples mattered for showing the label space, the kind of input text and the overall format, more than for the correctness of each label.
This means few-shot "learning" is really few-shot "formatting" for classification tasks like these. And if all you need is output formatting, written constraints are often a shorter way to get it.
When Constraints Beat Examples
Structured constraints tell the model exactly what you want without the ambiguity of learning-by-example. A constraint like "respond in JSON with keys: category, confidence, reasoning, each under 50 words" is unambiguous. An example of the same output format leaves the model guessing which aspects of the example matter.
Here's what this looks like in practice.
The few-shot approach (longer):
Classify the following support ticket. Here are examples:
Ticket: "My payment failed at checkout"
Category: billing
Priority: high
Summary: Payment processing failure during purchase
Ticket: "How do I change my password?"
Category: account
Priority: low
Summary: Password reset inquiry
Ticket: "The app crashes when I upload photos larger than 10MB"
Category: bug
Priority: medium
Summary: Application crash on large file upload
Now classify this ticket: "I was charged twice for my subscription"
The zero-shot with constraints approach (shorter):
Classify this support ticket.
Rules:
- Category: one of [billing, account, bug, feature-request, general]
- Priority: one of [critical, high, medium, low] based on revenue impact and user count affected
- Summary: one sentence, under 20 words, stating the core issue without editorializing
Ticket: "I was charged twice for my subscription"
Respond in exactly this format:
Category: [value]
Priority: [value]
Summary: [value]
Why This Works: The constraint version defines the output space explicitly. The model doesn't have to reverse-engineer your intentions from examples. It knows the valid categories, the priority logic, and the summary requirements. No ambiguity, and roughly half the tokens.
Expected Output:
Category: billing
Priority: high
Summary: Customer reports duplicate subscription charge requiring immediate refund investigation.
The few-shot version uses ~150 tokens on examples. The constraint version uses ~80 tokens on rules. At high volume, that difference adds up. Our token budget and cost estimator playbook shows how to work out what it costs you.
Zero-Shot Chain-of-Thought Can Match Few-Shot on Strong Models
Chain-of-thought prompting was the one area where few-shot seemed bulletproof. Show the model examples of step-by-step reasoning, get better reasoning out. Cheng et al. put that assumption to the test on recent strong models (Cheng et al., 2025).
For strong models such as the Qwen2.5 series, adding traditional chain-of-thought examples didn't improve math reasoning compared with zero-shot chain-of-thought. The authors found models "tend to ignore the exemplars and focus primarily on the instructions". The exemplars mainly served to align the output format. On those models, zero-shot chain-of-thought did as well as adding chain-of-thought examples.
Zero-shot chain-of-thought itself comes from Kojima et al., 2022. On reasoning models that think before they answer, you usually don't need the phrase at all; set the reasoning effort instead (see our guide to reasoning effort).
If the model already knows how to reason about your task, showing it examples of reasoning is redundant. You're paying tokens for information the model already has.
Zero-Shot CoT With Constraints:
A SaaS company has 10,000 users paying $50/month. They're considering a price
increase to $60/month but estimate 15% churn from the change. They also expect
the higher price point to reduce new signups by 10% from their current rate
of 500/month.
Calculate whether the price increase is profitable over 12 months.
Think through this step by step. Show your math at each stage. State your
assumptions explicitly. Give a final recommendation with the break-even
timeline.
Why This Works: No examples needed. The constraints ("show your math," "state assumptions," "give break-even timeline") direct the reasoning structure. The model knows how to do financial math. Your job is to tell it what outputs you need, not show it how to think.
Expected Output:
Current annual revenue: 10,000 users x $50/month x 12 = $6,000,000
Post-increase scenario: Immediate churn: 10,000 x 15% = 1,500 users lost
Remaining users: 8,500 x $60/month = $510,000/month
New signup rate: 500 x 0.90 = 450/month
Monthly user growth: 450 new users at $60 = $27,000 incremental/month
Break-even analysis: Month 1 revenue: 8,500 x $60 = $510,000 (vs $500,000 current = +$10,000)
The price increase is immediately profitable despite 15% churn...
When Few-Shot Still Earns Its Tokens
Examples are still the right tool in several cases.
Subjective style matching. If you need output that matches a specific voice or aesthetic and you can't fully capture it in constraints, two or three examples of the target style still work. Tone is hard to specify declaratively.
Genuinely novel output formats. If you've invented a custom format the model has never seen, one or two examples teach it faster than a paragraph of structural constraints. But if the format maps to JSON, markdown, CSV, or any common structure, constraints are usually enough.
Specialized domains without instruction tuning. Smaller or older models that haven't been tuned for your specific task still benefit from examples. The weaker the model's baseline understanding, the more examples help. Strong instruction-tuned models need fewer examples for common formats, but test before you assume.
Vendor guidance differs. Google's prompting guide says "We recommend to always include few-shot examples in your prompts" and that prompts without them "are likely to be less effective" (Google, Prompt design strategies). Anthropic's guide calls examples "one of the most reliable ways to steer Claude's output format, tone, and structure" and recommends including 3 to 5 examples for best results (Anthropic, Prompting best practices). That's a strong reason to test both on your own task rather than drop examples on principle.
The pattern: if the model already knows how to do the task, examples are overhead. If the model genuinely lacks the knowledge, examples teach it. Test both. Measure. Don't assume.
If you do keep examples, choose them per input rather than hard-coding them. Adaptive few-shot prompting shows how to retrieve the most similar examples for each request. Use constraints when you're teaching a format; use retrieved examples when you're teaching a judgment the model can't infer from a rule.
The Decision Framework
Before adding few-shot examples to any prompt, ask two questions:
Am I teaching format or knowledge? If format, try constraints first. They're explicit and usually shorter, but Anthropic still calls examples one of the most reliable ways to steer output format, so compare both on the same inputs.
Does this model already know how to do this task? Test zero-shot first. If zero-shot output is close to what you need, add constraints to close the gap first, then try two to five examples and compare on the same test set.
The shift isn't from prompting to no prompting. It's a move toward prompts that state the rules precisely and use examples only where a rule can't do the job.
Your prompts should be getting shorter, more specific, and more structured. If you add examples to every prompt by habit, test whether they still help. Anthropic recommends 3 to 5 when you use them, and the only way to know for your task is to compare with and without on the same inputs.
Try the prompt without examples, add constraints, and measure the difference before you decide.
Want hands-on training on constraint-based prompting and modern techniques for your team? Connect with Kief Studio on Discord or schedule a session.
Frequently asked questions
What is the difference between few-shot and zero-shot prompting?
Zero-shot prompting gives the model only the instruction. Few-shot prompting adds a few worked examples of input and output. Google's guide defines them the same way: "Prompts that contain a few examples are called few-shot prompts," and prompts with none are zero-shot (Google, Prompt design strategies).
Is few-shot prompting better than zero-shot?
It depends on the task and model. Studies have found extra examples add little or even hurt on some strong models and tasks (Tang et al., 2025; Cheng et al., 2025), while Google recommends always including examples (Google) and Anthropic recommends 3 to 5 (Anthropic). Test both on 20 or more real inputs.
How many examples should a few-shot prompt have?
Vendor guidance and research point to a small number. Anthropic recommends 3 to 5 examples for best results (Anthropic, Prompting best practices), and Tang et al. found that too many domain-specific examples can degrade performance on some models (Tang et al., 2025). Use two to five, then test: compare each count on the same set of real inputs and keep the smallest one that does the job.
Do the labels in few-shot examples need to be correct?
Less than you'd expect. Min et al. found that randomly replacing labels in examples "barely hurts performance" on a range of classification tasks, because examples mostly show the label space, input style and format (Min et al., 2022). Use correct labels anyway; there's no reason to risk it.
When should I use few-shot prompting?
When you need a tone or style that's hard to describe, an unusual output format, or a judgment the model can't infer from a rule. For standard formats like JSON or a fixed label set, written constraints are usually shorter and clearer.
Terms in this article
From the library
Rather have someone set it up for you?
That's a fair call. LTFI, the agentic business operating system from Kief Studio, can set up the work these guides describe and run it with you. No website yet? Kief Studio will build you one for free.

