Concept

Chain-of-Thought Prompting

Showing worked reasoning before the answer makes multi-step tasks dramatically more reliable — when the task actually has steps.

Chain-of-thought prompting means showing the model examples where the reasoning is written out before the answer — and letting it imitate that pattern on your problem. The mechanism is not mystical. A transformer spends a roughly fixed amount of computation per token it generates, so a model that must answer '$47.50' immediately gets one token's worth of thinking. A model that first writes out the discount, the subtotal, and the tax gets hundreds of tokens of computation — and, crucially, each step conditions on the steps before it. Intermediate results become visible context instead of something held implicitly. Writing is the model's working memory.

The technique earned its reputation on tasks where answers depend on intermediate state: multi-step arithmetic, logic puzzles, planning, date math, anything with a 'first this, then that' structure. The original research-era results were dramatic — problems jumping from single-digit to majority accuracy just from worked exemplars — and the pattern still holds in 2026 for models that don't reason natively. A good CoT exemplar does two jobs: it demonstrates that reasoning should happen, and it demonstrates what kind — which decomposition, what to check, when to stop. Sloppy exemplars teach sloppy reasoning just as faithfully.

CoT is not free. Reasoning tokens are billed and take latency, and for single-hop tasks — lookups, simple classification, formatting — they buy nothing; you're paying the model to narrate the obvious. The decision rule: if you couldn't do the task yourself without scratch paper, CoT probably helps; if you'd answer instantly, skip it. One honest caveat: the visible reasoning is not guaranteed to be the real computation. Models can produce a correct answer atop a rationalized-after-the-fact chain, or a wrong answer atop plausible-looking steps. Treat the chain as a reliability tool and a debugging aid, not sworn testimony.

Craft notes for the exemplars you write: keep steps short and individually checkable; end with a clearly marked final answer so extraction is trivial; match the reasoning style to the domain — unit tracking for math, case enumeration for logic, criteria-then-verdict for judgments. Two or three tight worked examples beat five rambling ones, because the model imitates verbosity as faithfully as it imitates logic. And if you're on a reasoning model — Claude with extended thinking, the GPT o-series lineage, Gemini's thinking modes — much of this is built in; Lesson 12 covers exactly what changes.

Check your understanding
Q1. You add chain-of-thought to an 'extract the invoice number' task. Quality doesn't move, but cost triples. Why?
Q2. A model produces a beautifully reasoned chain that ends in the wrong answer. What's the correct takeaway?
· Score 100% on the quiz.