Few-shot and Chain-of-Thought: Raising Reasoning Accuracy

AI Navigate Original / 4/27/2026

💬 OpinionIdeas & Deep AnalysisTools & Practical Usage
共有:

Key Points

  • Few-shot: 3-5 examples make the LLM answer in the same manner
  • Example choice key: diversity, boundary cases, same format, order
  • CoT: think step by step; raises reasoning/math accuracy
  • Reasoning models auto-CoT; Few-shot still fixes format/tone

Few-shot Prompting

A technique where showing 3-5 examples of "for this kind of question, answer this way" makes the LLM answer in the same manner. Zero examples is Zero-shot, one is One-shot.

Example: Sentiment Classification

Classify the following reviews as "pos / neg / neutral":

Review: "The wait was long and tiring"
Class: neg

Review: "The food was good but the price is so-so"
Class: neutral

Review: "The staff was kind and it was comfortable"
Class: pos

Review: "[target]"
Class:

How You Pick Examples Is Key

  • Diversity: not only similar examples; include different patterns
  • Boundary cases: include one hard-to-judge intermediate example
  • Same format: unify output format in examples and production
  • Order effect: the last example influences the result more

Cases Where Few-shot Works

  • Unique output formats (CSV, special JSON)
  • Company-specific tone
  • Use of jargon
  • Examples including "this way of answering is bad"

Chain-of-Thought (CoT)

A "think step by step" prompt technique. Accuracy rises greatly for complex reasoning and math problems.

Simple Form

Solve the following problem step by step:
[problem]

Explicit Form

When solving the following problem, think in order:
1. Understand the problem
2. Organize the needed information
3. Build the calculation steps
4. Execute each step
5. Give the final answer.

Problem: [...]

Few-shot CoT

Combining examples and CoT is strongest. Include the reasoning process in examples too.

Example: What is 100 minus (30 + 25)?
Thinking: First 30 + 25 = 55. Then 100 - 55 = 45.
Answer: 45

Problem: What is 80 minus (17 + 23)?
Thinking:

Changes in 2025-2026

In reasoning models like OpenAI o-series, Claude thinking mode, Gemini Thinking, CoT is automatically done internally.

  • Auto-reasons without writing "step by step"
  • Accuracy rises with longer thinking time
  • But cost and latency are a trade-off

Selective Use

SituationRecommended
Simple classification/extractionZero-shot is enough
Unique output formatFew-shot
Logical reasoning/calculationCoT or reasoning model
Complex business judgmentFew-shot CoT
Unifying conversation toneFew-shot with example sentences

Advanced Techniques

Self-Consistency

Sample the same CoT 5 times, answer by majority. Averages probabilistic variance. Cost is 5x.

Tree of Thoughts

Not one reasoning path but explore multiple paths in parallel. Effective for complex planning problems but high cost.

ReAct (Reasoning + Acting)

A "Thought → Action → Observation" loop. The basic agent pattern.

Failure Patterns

  • Too many examples (over 10 becomes overfitting-like)
  • Example output format differs from production
  • Forcing CoT raises cost; unneeded for simple tasks
  • Verbosely instructing CoT to a reasoning model confuses it

Summary

Few-shot fixes format and tone; CoT draws out reasoning. Even as reasoning models spread, Few-shot remains effective for special formats and business-context fixing. How you pick examples greatly affects results.