Prompting

Chain-of-ThoughtCoT

Also known as: step-by-step reasoning

A prompting technique where the model is encouraged to work through a problem step by step, which improves accuracy on harder tasks.

Choose your level

Chain-of-thought is a simple trick that makes AI smarter on tricky questions: ask it to think step by step instead of blurting out an answer. Just like a person is more likely to get a maths problem right by working it out on paper than by guessing, a model that lays out its reasoning tends to reach better answers.

Chain-of-thought (CoT) prompting asks a language model to produce intermediate reasoning steps before its final answer. Adding a phrase like "let's think step by step", or showing worked examples that include the reasoning, measurably improves performance on arithmetic, logic and multi-step problems.

Why it helps

Generating the steps gives the model more room to "work", each step conditions the next, so it is less likely to jump to a wrong conclusion. It also makes the answer easier to check, because you can see the path it took.

Related ideas

  • Few-shot CoT: include examples that show the reasoning (few-shot).
  • Self-consistency: sample several reasoning paths and take the most common answer.
  • Newer reasoning models are trained to do this kind of extended thinking automatically.

Chain-of-thought prompting elicits intermediate token sequences that decompose a problem before the final answer, improving performance on tasks requiring multi-step inference and showing emergent benefit at sufficient model scale (Wei et al. 2022). Mechanistically, the extra tokens provide additional test-time computation and an explicit scratchpad that conditions subsequent steps, mitigating the tendency of direct decoding to commit early.

Variants include zero-shot CoT (a trigger phrase), few-shot CoT (exemplars with rationales), self-consistency (marginalising over sampled reasoning paths), and tree/graph-of-thought search. The paradigm has since been internalised by reasoning models trained with reinforcement learning to generate long deliberate chains before answering, trading inference-time compute for accuracy. Caveats: a stated chain is not a faithful account of the model's internal computation, verbalised reasoning can be post-hoc or unfaithful, so it aids accuracy more reliably than it provides genuine interpretability.

← Back to the glossary

What are you looking for?