What is chain-of-thought reasoning?
Having a model write out the steps of its reasoning before it gives an answer. Once a prompting trick, now built into "thinking" models.
intermediate · Also called Chain-of-Thought Prompting, CoT, Thinking, Reasoning
Ask a person "what is 17 times 24?" and most will not answer at once. They work it out in steps: 17 times 20, then 17 times 4, then add. A language model gets more of these questions right when it does the same, writing the steps out before the answer. That written-out working is a chain of thought.
Where the idea came from
In 2022 a team of researchers, with Jason Wei as first author, showed a model a handful of worked examples where the answer came after the reasoning, then gave it a new problem. The model copied the pattern, wrote its own steps and solved far more problems. With 8 such examples, their largest model set a new best score on a standard set of school maths word problems.
Why does it work? A model writes one TokenTokenThe small piece of text a language model reads and writes, often part of a word. Prices, limits and the context window are all counted in tokens. at a time, and each token is predicted from everything written so far. Steps on the page give the next prediction more to stand on. A model that jumps straight to "408" has to get it in one guess.
From trick to built-in
You rarely need to ask for it now. Today's "thinking" or "reasoning" models are trained to do this by themselves. OpenAI trains its reasoning models to think before they answer and to spot and fix their own mistakes along the way. Claude decides for each request whether to think and how much: a simple fact may get none, a hard maths problem a lot.
What it costs
Thinking is written text, so it is paid for as output, the expensive kind of TokenTokenThe small piece of text a language model reads and writes, often part of a word. Prices, limits and the context window are all counted in tokens.. It also takes time. A long chain of thought on a short question is waste, which is why some makers let you pick an effort level. Kimi K3, for one, offers low, high and max.
How to use it
For a question with several steps (a calculation, a plan, a comparison, a bug) give the model room to think, or turn thinking on. For a quick fact or a rewrite, leave it off. And read the reasoning when it is shown: a wrong step on the way is often easier to spot than a wrong answer at the end.
Sources