Zero-shot prompting gives no examples. Few-shot prompting gives a handful. That difference — zero examples versus two or three — changes your output more than rewriting your instructions ever will.
Two Techniques, One Decision
Every time you write a prompt, you're making a choice: do I show the AI what I want, or just tell it?
Zero-shot means you tell it. You write instructions, set constraints, describe the format. The AI figures out the rest from its training data.
Few-shot means you show it. You provide two, three, maybe five examples of the input and the output you want. The AI spots the pattern and replicates it.
Both work. Neither is universally better. The right choice depends on what you're asking for — and understanding when to use each is the single biggest leverage point in prompt engineering.
This guide breaks down both techniques with side-by-side comparisons across real tasks. Every example is copy-paste ready. Use them directly or build your own with our AI prompt generator.
Zero-Shot Prompting: Just Instructions
Zero-shot prompting is what most people do by default. You describe the task. You give no examples.
Classify this customer review as positive, negative, or neutral:
"The shipping was fast but the product broke after two days."
That's it. No examples. No demonstrations. Just the task and the input.
Zero-shot works because large language models have seen billions of examples during training. They've internalized patterns for classification, summarization, translation, and thousands of other tasks. You're relying on that training — betting that the model's general knowledge is enough to handle your specific case.
When Zero-Shot Works Best
Common, well-defined tasks — Translation, summarization, simple classification. The model has seen millions of these.
Creative or open-ended work — Brainstorming, ideation, exploratory writing. You don't want the model anchored to specific examples.
When you can't define the output precisely — If you're exploring and don't know exactly what "good" looks like yet, examples would constrain you.
Simple formatting — "Write a bulleted list" or "respond in JSON" — the model knows these formats cold.
Speed — Zero-shot prompts are shorter. Faster to write, cheaper on tokens, quicker to iterate.
Zero-Shot Strengths and Weaknesses
The strengths are simplicity and flexibility. You write less. You iterate faster. You don't need to craft examples.
The weakness is consistency. Without examples, the model decides things you might not want it to decide: tone, length, format, level of detail, what to include, what to skip. Run the same zero-shot prompt three times and you may get three noticeably different outputs.
Few-Shot Prompting: Show, Don't Tell
Few-shot prompting adds examples before the actual task. You show the AI exactly what input looks like and what output should look like.
Classify these customer reviews as positive, negative, or neutral.
Review: "Absolutely love this product, best purchase this year!"
Classification: Positive
Review: "Arrived damaged. Customer service was unhelpful."
Classification: Negative
Review: "It works fine. Nothing special but gets the job done."
Classification: Neutral
Review: "The shipping was fast but the product broke after two days."
Classification:
Same task. Same input. But now the model has three demonstrations to learn from. It knows the exact format. It knows the exact labels. It has seen edge cases (like the neutral example that's lukewarm, not indifferent).
When Few-Shot Works Best
Consistent formatting matters — When every output needs to match a template: labels, structure, field order.
Tone or style matching — When the output needs to sound like your brand, your writing, your existing content.
Ambiguous tasks — When the task has judgment calls (is "fast shipping but broken product" positive or negative?), examples set the standard.
Custom categories or taxonomies — Your labels, your classification scheme, your scoring rubric. The model won't know these by default.
Nuanced extraction — Pulling specific fields from unstructured text in a specific format. Examples make the pattern crystal clear.
How Many Examples?
More isn't always better. Research consistently shows diminishing returns after 3-5 examples.
| Example Count | Effect | Best For |
|---|---|---|
| 1 (one-shot) | Sets basic format and tone | Simple tasks with clear patterns |
| 2-3 | Covers format + edge cases | Most tasks — the sweet spot |
| 4-5 | Handles complex taxonomies or nuance | Ambiguous classification, style matching |
| 6+ | Diminishing returns, wastes tokens | Rarely worth it unless categories are numerous |
The sweet spot for most tasks is 2-3 examples. Use more only when you have genuinely different categories or edge cases to demonstrate.
Side-by-Side Comparisons
Theory is cheap. Let's see both techniques head-to-head across five real tasks.
1. Text Classification
The task: Classify support tickets by priority.
Zero-Shot:
Classify this support ticket as P1 (critical), P2 (high), P3 (medium), or P4 (low) priority.
Criteria:
- P1: Service is down, data loss, security breach
- P2: Major feature broken, significant user impact
- P3: Minor bug, workaround available
- P4: Enhancement request, cosmetic issue
Ticket: "Users in the EU region can't log in since 9am. Affecting approximately 2,000 accounts."
Few-Shot:
Classify support tickets by priority.
Ticket: "The entire payment processing system is down. No orders can be placed."
Priority: P1
Ticket: "Search results are returning incorrect products. Users can still browse categories."
Priority: P2
Ticket: "The date picker on the settings page doesn't work on Safari. Users can type the date manually."
Priority: P3
Ticket: "Can we add a dark mode option to the dashboard?"
Priority: P4
Ticket: "Users in the EU region can't log in since 9am. Affecting approximately 2,000 accounts."
Priority:
Zero-shot relies on your written criteria, which requires precision. If your priority definitions are ambiguous, the model interprets them its own way.
Few-shot shows the boundary between levels through concrete examples. The model learns that "can't log in, 2,000 affected" maps closest to the P1 pattern (service down, wide impact).
Verdict: Few-shot wins for classification. Examples communicate boundaries that descriptions can't.
2. Data Extraction
The task: Extract structured data from unstructured product reviews.
Zero-Shot:
Extract the following fields from this product review. Return as JSON.
Fields: product_name, sentiment (positive/negative/mixed), key_pros (list), key_cons (list), would_recommend (true/false)
Review: "I've been using the Bose QuietComfort 45 for three months now. The noise cancellation is genuinely best-in-class — I use them daily on the subway and can't hear a thing. Battery life is solid at about 22 hours. My only complaint is the carrying case feels cheap for a $329 product. Would I buy them again? Absolutely."
Few-Shot:
Extract structured data from product reviews.
Review: "The Sony WH-1000XM5 is comfortable for long sessions. Sound quality is excellent. However, they don't fold flat anymore which is annoying for travel. Still worth the price."
Output:
{
"product_name": "Sony WH-1000XM5",
"sentiment": "positive",
"key_pros": ["comfortable for long sessions", "excellent sound quality"],
"key_cons": ["don't fold flat for travel"],
"would_recommend": true
}
Review: "Bought the AirPods Max hoping for a premium experience. The build quality is great but $549 for headphones that have constant Bluetooth issues? No. Returned them after a week."
Output:
{
"product_name": "AirPods Max",
"sentiment": "negative",
"key_pros": ["great build quality"],
"key_cons": ["Bluetooth connectivity issues", "overpriced"],
"would_recommend": false
}
Review: "I've been using the Bose QuietComfort 45 for three months now. The noise cancellation is genuinely best-in-class — I use them daily on the subway and can't hear a thing. Battery life is solid at about 22 hours. My only complaint is the carrying case feels cheap for a $329 product. Would I buy them again? Absolutely."
Output:
Verdict: Few-shot wins. The examples establish exact JSON structure, key naming, how to phrase pros/cons (short fragments vs. sentences), and the threshold for would_recommend. Zero-shot works but the output format varies more between runs.
3. Creative Writing
The task: Write a product tagline.
Zero-Shot:
Write a tagline for a productivity app called "Flowstate" that helps remote workers maintain deep focus. The tagline should be under 8 words, memorable, and convey the feeling of effortless concentration. Avoid clichés like "unlock your potential" or "work smarter."
Few-Shot:
Write product taglines in this style:
Product: Meditation app for busy professionals
Tagline: "Silence is a skill. Build it."
Product: Note-taking app with AI organization
Tagline: "Think messy. Find clean."
Product: Productivity app for remote workers that helps maintain deep focus
Tagline:
Verdict: It depends. Zero-shot gives you wider creative range — the model explores different angles. Few-shot locks the style (short, punchy, parallel structure in this case) but constrains the creative space. Use zero-shot when exploring, few-shot when you know the voice.
4. Tone Matching
The task: Write a customer email in a specific brand voice.
Zero-Shot:
Write a response to a customer who received the wrong item.
Brand voice: Friendly, slightly informal, empathetic but not over-the-top apologetic. Use short sentences. Address the customer by first name. No corporate language. Sign off with a team member's first name.
Customer name: Sarah
Issue: Received blue jacket instead of black
Order: #48291
Few-Shot:
Write customer service emails in this brand voice:
Customer issue: Late delivery
Response:
"Hey Marcus,
That's on us — your order should've been there by Tuesday. I've checked the tracking and it shows delivery for Thursday now. Not ideal, I know.
I've added a $10 credit to your account for the wait. No code needed, it'll apply at checkout automatically.
Anything else I can sort out, just reply here.
— Jamie"
Customer issue: Sizing question post-purchase
Response:
"Hey Priya,
Good call checking before the tags come off. The medium runs slightly snug in the shoulders compared to our standard fit. If you're between sizes, I'd go up.
Want me to send a large instead? I can set up a free exchange right now — takes about 30 seconds on your end.
— Alex"
Customer issue: Received blue jacket instead of black. Order #48291.
Customer name: Sarah
Response:
Zero-shot tells the AI to be "friendly, slightly informal, empathetic." Each of those words is open to interpretation. The model decides what "slightly informal" means.
Few-shot shows exactly what the voice sounds like: sentence length, greeting style, how empathy is expressed, the sign-off format. The model replicates the pattern, not its interpretation of adjectives.
Verdict: Few-shot wins decisively. Tone is almost impossible to describe in words alone. Examples are the only reliable way to transfer voice.
5. Code Generation
The task: Write a utility function.
Zero-Shot:
Write a TypeScript function that validates an email address.
Requirements:
- Accept a string parameter
- Return an object with { valid: boolean, reason?: string }
- Check for: missing @, invalid domain, disposable email domains
- Include JSDoc comment
- No external dependencies
Few-Shot:
Write TypeScript utility functions following this pattern:
function validatePhoneNumber(phone: string): ValidationResult {
const cleaned = phone.replace(/[\s\-\(\)]/g, '');
if (!cleaned) {
return { valid: false, reason: 'Phone number is required' };
}
if (!/^\+?[1-9]\d{6,14}$/.test(cleaned)) {
return { valid: false, reason: 'Invalid phone number format' };
}
return { valid: true };
}
Now write: validateEmail(email: string): ValidationResult
Requirements: Check for missing @, invalid domain, disposable email domains (mailinator.com, tempmail.com, guerrillamail.com).
Verdict: Zero-shot often wins for code. Developers are precise with requirements, and the model's training data is full of code examples already. Few-shot helps when you need to match a specific coding style, error handling pattern, or naming convention across a codebase. If you care about consistency with existing code, provide an example. If you just need a working function, zero-shot with clear requirements is faster.
Combined Approach: The Best of Both
The real power move is combining both techniques. Use zero-shot instructions for the rules and few-shot examples for the pattern.
You are a senior content editor. Rewrite product descriptions to be benefit-focused,
concise, and specific. Remove vague adjectives. Add concrete details where possible.
Here are examples of the transformation:
Original: "This premium quality backpack features an innovative design with multiple compartments for all your storage needs. Perfect for the modern professional."
Rewritten: "15L backpack with padded laptop sleeve, two quick-access side pockets, and a hidden passport compartment. Water-resistant 500D nylon. 1.2 lbs."
Original: "Our revolutionary new headphones deliver an unparalleled audio experience with cutting-edge technology and supreme comfort for extended listening sessions."
Rewritten: "40mm drivers with 24-bit audio. Memory foam ear cups that stay comfortable past hour four. 30-hour battery. Folds flat for your bag."
Now rewrite this:
Original: "Experience the ultimate in home comfort with our luxurious, artisanally crafted throw blanket made from the finest materials for those cozy nights in."
Rewritten:
The instructions set the rules (benefit-focused, concise, specific). The examples show exactly what that looks like in practice. The AI gets both the "what" and the "how."
This combined approach works especially well with the builder — you can save the instruction block as a template and swap in different examples depending on the task.
Common Mistakes
Mistake 1: Using Few-Shot When Zero-Shot Is Enough
Translate "Good morning" to French.
You don't need examples for this. The model has seen millions of translations. Adding examples wastes tokens and adds no value. If the task is common and unambiguous, keep it zero-shot.
Mistake 2: Examples That Don't Cover Edge Cases
If your task has ambiguous cases, your examples need to show how to handle them.
# Bad: examples are all clear-cut
Review: "Best product ever!" → Positive
Review: "Terrible, waste of money" → Negative
# Better: includes the edge case
Review: "Best product ever!" → Positive
Review: "Terrible, waste of money" → Negative
Review: "Works fine most days but crashes every Monday" → Negative
Review: "Not what I expected, but actually I like it more" → Positive
The edge cases are where few-shot prompting adds the most value. Don't waste your examples on obvious cases.
Mistake 3: Too Many Examples
After 3-5 examples, you're burning tokens for marginal improvement. If your task needs 8 examples to get right, the problem likely isn't the number of examples — it's that your task is too complex for a single prompt. Break it into smaller steps.
Mistake 4: Examples That Contradict Your Instructions
If your instructions say "be concise" but your examples are 200 words each, the model is getting mixed signals. The examples usually win — the model follows what it sees over what it's told.
Always make sure your examples demonstrate the same rules your instructions describe. If there's a conflict, the examples are what the model will follow.
Mistake 5: Using Zero-Shot for Style/Tone
This is the most common one. People write paragraphs describing their brand voice: "professional but approachable, authoritative yet warm, concise but thorough."
Those adjectives are ambiguous. "Professional but approachable" means different things to different people — and different things to different models. Two examples of your actual writing will communicate your voice more precisely than 500 words of description.
Decision Framework
Use this to pick the right approach:
| Ask Yourself | Zero-Shot | Few-Shot |
|---|---|---|
| Is the task common and well-defined? | ✅ | Overkill |
| Does formatting need to be exact? | Risky | ✅ |
| Does tone/voice need to match something specific? | Won't work | ✅ |
| Am I exploring creative options? | ✅ | Too constraining |
| Do I have clear examples I can provide? | Not needed | ✅ |
| Are there ambiguous judgment calls? | Inconsistent | ✅ |
| Am I optimizing for speed/tokens? | ✅ | Costs more |
| Is consistency across multiple runs critical? | Use few-shot | ✅ |
When in doubt, start zero-shot. If the output is inconsistent or doesn't match your expectations, add 2-3 examples. That simple escalation path handles 90% of cases.
Templates You Can Copy
Zero-Shot Template
[ROLE — optional, e.g., "You are a senior copywriter."]
[TASK — what you want done]
[INPUT — the content to process]
[CONSTRAINTS — format, length, tone, what to avoid]
[OUTPUT FORMAT — how to structure the response]
Few-Shot Template
[TASK DESCRIPTION — brief, one line]
[EXAMPLE 1]
Input: [example input]
Output: [example output]
[EXAMPLE 2]
Input: [example input]
Output: [example output]
[EXAMPLE 3 — edge case]
Input: [example input]
Output: [example output]
[ACTUAL TASK]
Input: [your real input]
Output:
Combined Template
[ROLE + INSTRUCTIONS — the rules]
[EXAMPLE 1 — demonstrates the rules in action]
[EXAMPLE 2 — shows an edge case]
[ACTUAL TASK — your input]
Going Deeper
This guide covers the zero-shot vs few-shot decision. But these techniques combine with others for even better results:
- Few-Shot Prompting Guide — deep dive into example selection, dynamic few-shot, and advanced patterns
- Chain-of-Thought Prompting — add reasoning steps to either approach for tasks that require logic
- Prompt Engineering Basics — the full foundation if you're starting from scratch
Or build and test your own prompts with the AI prompt generator — it handles the structure so you can focus on the content.
The core principle is simple. Tell when the task is clear. Show when the output needs to be precise. And when it needs to be both — do both.