Skip to content
Learning Lab · 5 min read

Zero-Shot vs Few-Shot vs Chain-of-Thought: Which Prompting Technique Actually Works

Three core prompting techniques, each with a different accuracy-speed trade-off. Learn when to use each one, what they cost in tokens, and how to decide which works for your task.

Zero-Shot vs Few-Shot Prompting: When to Use Each Technique

You have three minutes to extract structured data from customer emails. The model hallucinates fields. You try a more detailed prompt. Still hallucinates. You add examples. Better, but not reliable. You walk through the reasoning step-by-step. It works.

The difference between those attempts isn’t luck — it’s three distinct prompting patterns that trade off simplicity for accuracy. Understanding when each one fails matters more than knowing they exist.

Zero-Shot: Speed Over Accuracy

Zero-shot means you give the model a task with no examples. Just the instruction and the input.

# Zero-shot prompt
Extract the customer's order total, product name, and shipping address from this email:

---
[customer email here]
---

Respond in JSON format.

This works when: the task is simple, the domain is common (customer service, basic classification), and you care more about speed than precision. Claude Sonnet 4 and GPT-4o handle this well on straightforward tasks — typically 70–85% accuracy on structured extraction if the data is clearly present in the source text.

This fails fast when: the task requires domain knowledge, pattern recognition across edge cases, or multi-step logic. A zero-shot prompt asking a model to classify suspicious financial transactions without examples will miss subtle patterns a few-shot prompt catches immediately. The model has no reference point for what “subtle” looks like in your domain.

Token cost: lowest. You’re sending one instruction and one input. For high-volume tasks (thousands of inferences), this difference compounds.

Few-Shot: The Practical Middle Ground

Few-shot adds 2–5 examples before the actual task. The model learns the pattern from these examples without explicit retraining.

# Zero-shot version (baseline)
Classify this support ticket as urgent or routine:

Ticket: "My payment failed and my order was supposed to arrive today."

# Few-shot version (improved)
Classify this support ticket as urgent or routine.

Examples:

Ticket: "I can't log in to my account."
Classification: Routine

Ticket: "Payment failed and my order was supposed to arrive today."
Classification: Urgent

Ticket: "How do I reset my password?"
Classification: Routine

Ticket: "Server is down and customers can't check their order status."
Classification: Urgent

Now classify this:
Ticket: "My payment failed and my order was supposed to arrive today."
Classification:

The few-shot version shows the model exactly what you mean by “urgent” in your specific context. Payment failure + delivery promise = urgent. The model doesn’t guess at definitions — it extrapolates from your examples.

This works when: you have 3–10 clear, representative examples and the task has recognizable patterns. Few-shot consistently outperforms zero-shot by 15–30% on classification and extraction tasks across benchmarks (Anthropic internal testing, January 2025). It’s reliable enough for production use on medium-stakes tasks.

This fails when: your examples don’t cover edge cases, or the pattern is genuinely complex. If your “urgent” ticket examples all involve payment issues but a ticket about data privacy concerns also needs urgent handling, few-shot learns the wrong pattern. It’s only as good as your examples.

Token cost: higher than zero-shot, lower than chain-of-thought. Three examples add ~300–500 tokens per request. At scale, this matters.

Chain-of-Thought: Reasoning Over Pattern Matching

Chain-of-thought asks the model to explain its reasoning before answering. “Think through this step-by-step” is the simplest version. The model shows its work, and accuracy improves — sometimes dramatically.

# Few-shot without reasoning
A customer ordered 3 widgets at $50 each with $15 shipping.
They applied a 10% discount code. What's the final total?

Total: $165

# Few-shot with chain-of-thought
A customer ordered 3 widgets at $50 each with $15 shipping.
They applied a 10% discount code. What's the final total?

Let's work through this step-by-step:
1. Widget cost: 3 × $50 = $150
2. Add shipping: $150 + $15 = $165
3. Apply 10% discount: $165 × 0.90 = $148.50
4. Final total: $148.50

Final answer: $148.50

The model gets it right. Without the step-by-step breakdown, it might confuse the order of operations or apply the discount incorrectly. Chain-of-thought forces intermediate reasoning that exposes flawed logic.

This works when: the task involves math, logic, multi-step reasoning, or complex trade-offs. OpenAI’s research shows chain-of-thought can improve accuracy on math and reasoning tasks by 40–60% (Wei et al., 2022). In production at AlgoVesta, we use chain-of-thought for portfolio analysis prompts — the reasoning output also becomes auditable evidence of how a decision was made.

This fails when: you need speed and the task is simple. A classification task (“is this spam?”) doesn’t need chain-of-thought. The added tokens and latency waste time for no accuracy gain. Also, chain-of-thought can amplify hallucinations if the model confidently explains incorrect reasoning. It’s more transparent about being wrong, but still wrong.

Token cost: highest. The step-by-step reasoning output can double or triple token usage compared to zero-shot. At inference scale, this becomes a real cost constraint.

Which One to Use: A Decision Framework

  • Zero-shot: Simple classification, straightforward extraction, high-volume tasks where 80% accuracy is acceptable. Go here first — it’s the baseline.
  • Few-shot: Medium complexity, domain-specific patterns, 90%+ accuracy needed. Add examples when zero-shot misses edge cases.
  • Chain-of-thought: Reasoning required, math involved, multi-step logic, or when you need to audit the reasoning itself. Combine with few-shot examples for best results on complex tasks.

The three aren’t mutually exclusive. Production workflows often use zero-shot as a first pass (speed check), few-shot for cases that fail, and chain-of-thought for high-stakes decisions that need reasoning validation.

Start With Zero-Shot, Add Only If You Need To

Most teams waste tokens by starting with few-shot when zero-shot would work. Test zero-shot first. If accuracy drops below your threshold, add 3–5 examples and re-test. Only move to chain-of-thought if the task genuinely requires reasoning. In real production systems, you’ll use all three — at different stages of the same pipeline.

Batikan
· 5 min read
Topics & Keywords
Share

Stay ahead of the AI curve

Weekly digest of the most impactful AI breakthroughs, tools, and strategies.

Related Articles

Cursor vs GitHub Copilot vs Claude Code: Which Wins for Production Work
Learning Lab

Cursor vs GitHub Copilot vs Claude Code: Which Wins for Production Work

Three AI coding assistants dominate production environments. This isn't a feature list. It's a breakdown of what each actually does, where it fails, and which to use for architecture, boilerplate, and debugging.

· 10 min read
→
Analyze Spreadsheets With Claude and GPT-4o
Learning Lab

Analyze Spreadsheets With Claude and GPT-4o

Claude and GPT-4o can analyze your spreadsheets and CSVs, but only if you structure the data correctly and ask with precision. Learn how to upload files, write analysis prompts, and avoid hallucination pitfalls.

· 2 min read
→
LLM Hallucinations: Why They Happen and 5 Ways to Stop Them
Learning Lab

LLM Hallucinations: Why They Happen and 5 Ways to Stop Them

Why do language models confidently invent facts? Because they predict tokens, not truth. Learn how grounding, constraint prompting, and temperature settings cut hallucination rates from 15%+ to under 5% in production systems.

· 5 min read
→
Freelancer AI Workflows That Actually Increase Billable Hours
Learning Lab

Freelancer AI Workflows That Actually Increase Billable Hours

AI can double your freelance output without replacing your judgment. Learn four production workflows that compress administrative tasks and recover 10+ billable hours per month.

· 6 min read
→
Stop Hallucinating: How RAG Actually Grounds LLMs
Learning Lab

Stop Hallucinating: How RAG Actually Grounds LLMs

RAG grounds LLMs with your actual data, eliminating hallucinations. This guide explains how RAG works in production, why basic setups fail, and the specific patterns that work — with code examples and trade-offs.

· 6 min read
→
Where Your Prompts Go: Data Handling in ChatGPT, Claude, and Gemini
Learning Lab

Where Your Prompts Go: Data Handling in ChatGPT, Claude, and Gemini

ChatGPT stores your data and uses it for training by default. Claude doesn't train on web conversations unless you opt in. Gemini links your chats to your entire Google account. Here's what each model does with your prompts and how to protect sensitive information.

· 4 min read
→

More from Prompt & Learn

Otter vs Fireflies vs tl;dv: Meeting Transcription Shootout
AI Tools Directory

Otter vs Fireflies vs tl;dv: Meeting Transcription Shootout

Three tools promise to transcribe your meetings and extract action items. Only one integrates cleanly with your workflow. Here's the real comparison: Otter vs Fireflies vs tl;dv — accuracy data, pricing breakdowns, and honest pros/cons for each.

· 4 min read
→
Gamma vs Beautiful.ai vs Tome: Slide Generation Tested
AI Tools Directory

Gamma vs Beautiful.ai vs Tome: Slide Generation Tested

I tested Gamma, Beautiful.ai, and Tome on production presentations. Gamma generates fastest but struggles with branding. Beautiful.ai delivers visual consistency and data handling. Tome offers flexibility and collaboration. Here's what actually works in practice — and when each tool wins.

· 11 min read
→
App Store Launches Spike in 2026. AI Tooling Is the Catalyst
AI News

App Store Launches Spike in 2026. AI Tooling Is the Catalyst

Appfigures reports a measurable surge in app launches in 2026, driven by AI development tools that compress timelines from weeks to days. A solo developer with Claude or Mistral can now ship what required a full engineering team in 2022.

· 3 min read
→
Julius AI vs ChatGPT vs Claude for Data Analysis
AI Tools Directory

Julius AI vs ChatGPT vs Claude for Data Analysis

Julius AI, ChatGPT Advanced Data Analysis, and Claude Artifacts all handle data tasks, but execution speed, pricing, and workflow differ significantly. Here's how to pick the right one for your use case.

· 4 min read
→
Perplexity vs Google AI vs Consensus: Which Wins for Academic Research
AI Tools Directory

Perplexity vs Google AI vs Consensus: Which Wins for Academic Research

Perplexity, Google AI, and Consensus each excel at different research tasks. Perplexity wins on recent topics with real-time synthesis. Consensus delivers unmatched citation precision for peer-reviewed work. Google Scholar provides historical depth. This breakdown shows exactly which tool to use for your next paper—and why.

· 10 min read
→
Google’s Travel Tools Cut Planning Time in Half. Here’s What Actually Works
AI Tools Directory

Google’s Travel Tools Cut Planning Time in Half. Here’s What Actually Works

Google released seven integrated travel tools this spring. Price tracking predicts optimal booking windows, restaurant availability pulls real-time data, and offline maps work without cell coverage. Here's which features earn trust and where to set expectations.

· 3 min read
→

Stay ahead of the AI curve

Weekly digest of the most impactful AI breakthroughs, tools, and strategies. No noise, only signal.

Follow Prompt Builder Prompt Builder