|

Chain-of-Thought Prompting Explained (2026)

If you've ever typed "let's think step by step" into ChatGPT and watched the answer quality jump, you've already used chain-of-thought prompting without knowing it. That phrase isn't magic — it's a deliberate technique backed by peer-reviewed research. Here's how it works, when to use it, and how to get consistent results with copy-ready patterns.

person reasoning through a complex problem on a laptop at a clean modern workspace, thinking step by step, 4K
CoT prompting externalizes reasoning — making the AI's thinking process visible and verifiable.
+17pp
Accuracy gain on GSM8K (PaLM 540B: 57%→74%)
100B+
Parameter threshold where CoT works reliably
5 words
"Let's think step by step" — zero-shot CoT trigger
2022
Wei et al. formalized CoT at NeurIPS

What Is Chain-of-Thought Prompting?

Chain-of-thought (CoT) prompting is a technique where you instruct an AI model to reason through a problem step by step before delivering its final answer. Instead of predicting a response in one leap, the model generates a sequence of intermediate reasoning steps — the "chain of thought" — that leads to the solution. Formalized by Wei et al. (2022, NeurIPS), CoT dramatically improves accuracy on multi-step reasoning, math, logic, and planning tasks on large frontier models.

Language models work by predicting the next token. Without CoT, a model answering a complex math problem must compress all reasoning into a single prediction — it can't "work in its head" the way a human uses scratch paper. CoT changes that: each intermediate step becomes a scaffold that grounds the next, reducing the compounding error that makes AI unreliable on multi-step tasks.

The mechanism makes intuitive sense once you understand it. When a model writes "Step 1: identify the variables" before doing algebra, the context window now contains useful intermediate state — the next token is predicted against something much more constrained than the raw question. The model is, in effect, using its own output as working memory.

This is also why CoT is closely connected to prompt engineering as a field — it's one of the highest-leverage single techniques available without any fine-tuning or tooling. You change what you ask, and the model's behavior changes substantially.

Zero-Shot CoT vs. Few-Shot CoT: What's the Difference?

Zero-shot CoT requires only a trigger phrase — "Let's think step by step" — with no examples. The model reasons from scratch. Few-shot CoT provides two to five worked examples that demonstrate the reasoning process before the actual question, constraining the model's reasoning pattern more tightly. Zero-shot is easier to implement; few-shot is more reliable for specialized or high-stakes tasks where the reasoning format matters.

Zero-Shot CoT in Action

Kojima et al. (2022) showed in "Large Language Models are Zero-Shot Reasoners" that appending "Let's think step by step" to a question — without any examples — significantly improved accuracy across reasoning benchmarks. No examples needed. The trigger alone shifts the model into step-by-step mode.

This is powerful for general-purpose use: you write your prompt normally, then add the trigger. The model does the rest. See the before/after comparison below:

Without CoT — Direct Question
You

A store has 24 apples. They sell 1/3 in the morning and then receive a delivery of 18 more. They sell half of what they now have in the afternoon. How many apples are left?

AI Response

The store has 22 apples left.

With Zero-Shot CoT — "Think step by step"
You

A store has 24 apples. They sell 1/3 in the morning and then receive a delivery of 18 more. They sell half of what they now have in the afternoon. How many apples are left? Let's think step by step.

AI Response

Step 1: Start with 24 apples.

Step 2: Sell 1/3 in the morning: 24 ÷ 3 = 8 sold. Remaining: 24 − 8 = 16 apples.

Step 3: Receive delivery of 18: 16 + 18 = 34 apples.

Step 4: Sell half in the afternoon: 34 ÷ 2 = 17 sold. Remaining: 34 − 17 = 17 apples.

Answer: 17 apples remain.

Few-Shot CoT

Few-shot CoT goes further: you provide examples of the reasoning process itself — not just the question and answer, but the full chain of intermediate steps. The model then mimics that reasoning pattern on your actual question.

Dimension Zero-Shot CoT Few-Shot CoT
What you provide Trigger phrase only 2–5 worked examples + trigger
Prompt length Short Longer (examples take space)
Reliability Good for general tasks Higher for specialized tasks
Best for Quick reasoning boost on any problem Consistent format on a specific task type
Research basis Kojima et al. (2022) Wei et al. (2022)
API cost Low (fewer input tokens) Higher (examples increase token count)

For a deeper look at the few-shot approach as a standalone technique, see few-shot prompting explained. The two techniques often work together — few-shot examples that include reasoning steps are the most powerful form of CoT.

Why Chain-of-Thought Works: The Research Behind It

CoT prompting was formalized by Jason Wei et al. (2022) in "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models" (NeurIPS 2022). The key finding: CoT is an emergent capability that benefits large models (100B+ parameters) substantially but provides minimal or no gains on smaller ones. On the GSM8K math benchmark, CoT prompting pushed 540B PaLM from 57% to 74% accuracy — outperforming fine-tuned models.

Wei et al. (2022): Chain-of-thought prompting enabled 540B PaLM to reach 74% accuracy on GSM8K (grade-school math), compared to 57% with standard few-shot prompting — and surpassing fine-tuned models. Source: "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models," NeurIPS 2022, Google Brain.

Two findings from the research are especially useful for practitioners:

  1. Emergent threshold effect. Below roughly 100B parameters, CoT shows little improvement and can actually hurt by generating confident-sounding wrong reasoning chains. Above that threshold, gains are dramatic. This is why CoT matters specifically on GPT-4, Claude 3.5/3.7 Sonnet, and Gemini 1.5/2.0 Pro — not on smaller open-source models.
  2. Self-consistency amplifies CoT. A follow-up technique called "self-consistency" (Wang et al., 2022) samples multiple reasoning chains and takes a majority vote on the final answer. This further improves reliability on tasks with a single correct answer — useful for automated pipelines.

The second paper to know is Kojima et al. (2022), "Large Language Models are Zero-Shot Reasoners." They discovered that the phrase "Let's think step by step" alone — appended to any question — triggered reasoning behavior even without examples. This made CoT practical without needing a library of worked examples for every task type. If you want to understand how model behavior emerges from prompts, this paper is the best single reading alongside Wei et al.

Understanding the research matters because it defines the boundaries. CoT isn't a universal upgrade — it's a targeted tool for a specific class of problems. Knowing where those boundaries are prevents you from adding "think step by step" to every prompt and wondering why half of them don't improve.

When to Use CoT — and When to Skip It

Use chain-of-thought prompting for tasks that require multiple dependent reasoning steps: math, logic, planning, debugging, argument analysis, and research synthesis. Skip it for simple factual lookups, short creative tasks, and emotional/conversational contexts where verbose reasoning adds friction without benefit. CoT also costs more tokens — relevant for high-volume API usage.

Use CoT When...

  • Multi-step math or logic problems
  • Planning and scheduling tasks
  • Debugging code step by step
  • Argument analysis and evaluation
  • Complex research with multiple inferences
  • Decision-making with trade-offs
  • Comparing options across multiple criteria

A useful rule of thumb: if the task is one you'd solve on scratch paper, CoT will help. If it's one you'd answer off the top of your head, CoT will just make the response longer without improving accuracy. The goal is to match the prompting technique to the cognitive demand of the task.

CoT pairs naturally with other techniques. If you're already writing structured prompts with role and context, adding a reasoning instruction is a low-cost upgrade. For a broader look at how these techniques fit together, how to write better AI prompts covers the full stack. And if you're trying to reduce AI errors specifically, how to stop AI hallucinations explains where CoT fits in the broader reliability toolkit.

Copy-Ready CoT Prompt Patterns

The most effective CoT prompts combine a clear role and context with an explicit reasoning instruction and a structured output format. The six patterns below cover the most common use cases: universal zero-shot, math/logic, decision-making, debugging, writing analysis, and complex research. Each uses the four-element structure (Role, Context, Task, Format) and includes the CoT trigger.

Few-Shot CoT — Reasoning Walkthrough Example
You

Here's an example of how to reason through a decision:

Problem: Should I hire a freelancer or a full-time employee for a 3-month project?
Step 1: Define the time horizon — 3 months is short, suggesting a temporary need.
Step 2: Assess skill specificity — if the skill is specialized and rare, a freelancer avoids a long search.
Step 3: Consider cost — benefits and onboarding cost for a full-time hire on a 3-month project are typically high relative to value.
Step 4: Weigh future potential — if there's a strong chance of extending, a full-time hire may be worth the overhead.
Conclusion: For a fixed 3-month project with specialized needs, a freelancer is usually the better choice.

Now apply the same reasoning pattern to: Should I build a custom internal tool or use an existing SaaS product for my 10-person team?

AI — Few-Shot CoT Response

Step 1: Define the scale — 10 people is small, meaning a custom tool requires significant per-seat investment in engineering time relative to the user base.

Step 2: Assess specificity — if the need is generic (project management, CRM, communication), existing SaaS options almost certainly exist. If the workflow is highly unique and a core business differentiator, custom may be warranted.

Step 3: Consider total cost of ownership — custom tools require ongoing maintenance, security patching, and iteration. SaaS costs are predictable and maintenance-free on your side.

Step 4: Weigh future potential — will the team grow? A well-chosen SaaS scales effortlessly. A custom tool scales only with more engineering.

Conclusion: For a 10-person team with non-unique needs, an existing SaaS product is almost always the right starting point. Revisit custom only when the team is 50+ and the workflow is genuinely irreplaceable by any available product.

Few-Shot CoT Decision Reasoning

Prompt Pattern 1 — Universal Zero-Shot CoT Trigger

Zero-Shot CoT — Any Task

Task Format
(Task) [Your question or problem here.] Before you answer, reason through this step by step. Show your work clearly, then give your final answer in the last line labeled "Answer:"

Prompt Pattern 2 — Math and Logic with Few-Shot

Few-Shot CoT — Math / Logic

Role Context Task Format
(Role) You are a rigorous problem-solver who shows all working. (Context) Here is an example of how I want you to solve problems: Problem: [example problem] Step 1: [reasoning step] Step 2: [reasoning step] Answer: [final answer] (Task) Now solve this problem using the same step-by-step format: [your actual problem] (Format) Number each step. Show intermediate calculations. State your final answer clearly.

Prompt Pattern 3 — Decision-Making CoT

Decision Reasoning Chain

Role Context Task Format
(Role) You are a strategic advisor who reasons through decisions systematically. (Context) I'm choosing between [Option A] and [Option B] for [situation/goal]. (Task) Reason through the key factors step by step — assess each option against [criterion 1], [criterion 2], and [criterion 3]. (Format) Number each reasoning step. End with one clear recommendation and the single most important reason for it.

Prompt Pattern 4 — Code Debugging CoT

Step-by-Step Code Trace

Role Context Task Format
(Role) You are a senior [language] developer who traces bugs methodically. (Context) This function should [expected behavior] but instead it [actual behavior]. Here's the code: [paste code] (Task) Trace through the code step by step. At each step, state what the current value of the key variables should be and whether it matches what the code actually produces. (Format) Numbered steps. Identify the exact line where the logic diverges. End with a specific fix.

Prompt Pattern 5 — Argument Analysis CoT

Writing and Argument Evaluation

Role Context Task Format
(Role) You are a critical thinking coach who evaluates arguments rigorously. (Context) Here is a piece of writing or an argument I want evaluated: [paste text] (Task) Analyze it step by step: (1) identify the main claim, (2) list the supporting premises, (3) check each premise for validity or evidence, (4) identify any logical fallacies or gaps. (Format) Numbered steps for the analysis. End with a one-paragraph verdict on overall argument strength.

Prompt Pattern 6 — Research Synthesis CoT

Multi-Step Research Reasoning

Role Context Task Format
(Role) You are a research analyst who breaks complex topics into answerable sub-questions. (Context) I need to understand [complex topic or question] to [goal or use case]. (Task) Identify the three to five key sub-questions that must be answered to fully address this topic. Then reason through each one in order before synthesizing. (Format) Separate section per sub-question, numbered. Final section: "Synthesis" — two to three paragraphs connecting the answers. Flag any claim you are uncertain about.

For more structured prompting techniques that work well alongside CoT, AI prompt rewriting principles covers how to diagnose and fix prompts that aren't working. And if you want to know when to escalate from CoT to other techniques, how to get specific answers from AI covers the full specificity toolkit.

person writing notes thoughtfully at a desk, pen and notebook, focused reasoning, warm light, 4K cinematic
CoT prompting is the written equivalent of showing your work — it makes AI reasoning auditable and improvable.

Frequently Asked Questions

What is chain-of-thought prompting?

Chain-of-thought (CoT) prompting is a technique where you instruct an AI model to generate intermediate reasoning steps before giving its final answer. Rather than jumping directly to a conclusion, the model produces a visible "chain of thought" — each step building on the last. Formalized by Wei et al. (NeurIPS 2022), it dramatically improves accuracy on multi-step math, logic, planning, and analysis tasks on large frontier models.

Does "let's think step by step" really work?

Yes — this specific phrase was tested by Kojima et al. (2022) in "Large Language Models are Zero-Shot Reasoners" and shown to significantly improve performance on reasoning benchmarks without any examples. It works because the phrase cues the model to generate intermediate steps rather than predict a direct answer, creating a self-reinforcing reasoning scaffold in the context window. On large models like GPT-4 or Claude 3.5, the effect is consistent and measurable.

What's the difference between zero-shot and few-shot chain-of-thought?

Zero-shot CoT uses only a trigger phrase ("Let's think step by step") — the model reasons without any demonstrations. Few-shot CoT provides two to five worked examples that show the reasoning process before the actual question, constraining the model's approach more tightly. Zero-shot is easier and sufficient for most tasks. Few-shot CoT is worth the extra prompt length when you need a specific reasoning format to be consistent across many similar inputs.

Does chain-of-thought prompting work with all AI models?

No. Wei et al. (2022) found CoT is an emergent capability that primarily benefits models above roughly 100 billion parameters. On smaller models, CoT can actually hurt performance by generating confident-sounding but incorrect reasoning chains. It works reliably on GPT-4, Claude 3.5/3.7 Sonnet, and Gemini 1.5/2.0 Pro. If you're using a smaller or quantized model and CoT doesn't seem to help, that's likely why.

When should I NOT use chain-of-thought prompting?

Skip CoT for simple single-step lookups ("What year was X founded?"), creative writing where spontaneous flow matters more than rigor, short conversational exchanges, and emotional support contexts where verbose reasoning feels robotic. Also avoid CoT in high-volume API pipelines where token cost matters — CoT generates significantly more output tokens per request, which compounds at scale.

How many reasoning steps should I ask for?

You generally don't need to specify a count. The trigger "reason through this step by step" lets the model self-determine the appropriate depth. If you need more structure, "reason in numbered steps" works well. For very complex problems, you can add "If any step involves significant uncertainty, flag it explicitly before continuing" — this surfaces model uncertainty rather than hiding it in a confident-sounding chain.

Published June 17, 2026  |  Tangents by Sungwoo

Sources: Wei, J. et al. (2022). "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models." NeurIPS 2022. • Kojima, T. et al. (2022). "Large Language Models are Zero-Shot Reasoners." NeurIPS 2022. • Wang, X. et al. (2022). "Self-Consistency Improves Chain of Thought Reasoning in Language Models." arXiv:2203.11171.

Comments

Comments (0)

Leave a Comment

← Back to List