Flashcard: what is chain-of-thought (CoT) prompting?
Chain-of-thought prompting asks the model to write out its reasoning steps before the final answer, decomposing multi-step problems into sequential sub-problems each step can build on.
Imagine asking a student to solve 23 times 47 in their head and just shout the answer. Most people would get it wrong. Now ask the same student to show their working: 23 times 40 plus 23 times 7, then add them. Far more likely to be correct. The model works the same way. When you force it to write out the steps before the final answer, each step becomes input for the next step, and the model only has to do one small piece of reasoning at a time. The magic phrase that triggers this is something like Let us think step by step or Show your work first. The trick was discovered around 2022 and has become a default pattern for any multi-step problem.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Chain-of-thought prompting is the technique that turned LLMs from pattern-matchers into multi-step reasoners. The discovery in 2022 was small in form (add a phrase, show some examples) but large in consequence: tasks that were unsolvable for the largest models suddenly became solvable. The technique now underpins most agent loops, RAG pipelines, and reasoning workflows in production.
This deep dive defines CoT precisely, explains why it works mechanistically, walks through the variants (zero-shot, few-shot, self-consistency, tree of thoughts), and connects prompt-level CoT to the built-in reasoning modes of frontier 2026 models.
What CoT is and why it works
Chain-of-thought prompting asks the model to write out intermediate reasoning steps before producing the final answer. The simplest version (zero-shot CoT) is to append a phrase like 'Let's think step by step' to the prompt. The model then produces a sequence of reasoning tokens (the chain of thought) and finally produces the answer.
Why it works traces back to autoregressive generation. An LLM produces output one token at a time. Each token is predicted from the joint distribution conditioned on every prior token, including both the input prompt and the output tokens already generated. When the model writes reasoning before the answer, the reasoning tokens become part of the context for the final answer tokens. The model has effectively given itself scratch work.
For a hard multi-step problem (a math word problem, a logical deduction, a multi-hop QA query), the answer in one forward pass requires holding the entire reasoning state in the model's internal activations. The model has to compute the answer end to end without writing anything down. For sufficiently complex problems, this exceeds what the model can do in one pass and the answer is wrong.
With CoT, each intermediate result is materialized as output tokens. The model only has to do one small reasoning step at a time, with all prior steps available as input. The hard end to end computation becomes a sequence of much smaller sub-computations, which the model can solve sequentially.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- The original 2022 CoT paper from Wei et al. at Google Brain showed PaLM-540B going from 17 to 56 percent on GSM8K math word problems with explicit CoT prompting.
- Kojima et al.'s 2022 zero-shot-CoT paper showed that just adding 'Let's think step by step' unlocks reasoning on InstructGPT without any few-shot examples.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow does self-consistency CoT differ from plain CoT, and what does it cost?
Self-consistency samples N reasoning chains at temperature > 0 from the same CoT prompt and majority-votes the final answer. Costs N times more output tokens than plain CoT but reduces variance on hard math and logic problems.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Using CoT on every prompt as a default, including simple recall tasks where it just adds latency and cost without improving accuracy.
60 second bullets to scan on the way to the call.
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.