ML//inference//extended thinking
Extended thinking makes a model generate intermediate reasoning tokens before the final answer, and it is the core technique behind reasoning models (o1, o3, R1, QwQ). It is one form of test-time compute, the one that spends the extra computation on a longer single answer rather than on many samples or a search.
Extended thinking makes a model generate intermediate reasoning tokens before the final answer, and it is the core technique behind reasoning models (o1, o3, R1, QwQ). It is one form of test-time compute, the one that spends the extra computation on a longer single answer rather than on many samples or a search.
The mechanical explanation of why it works: the transformer has no memory between tokens, only context, and thinking tokens literally change the context before the answer is generated. Without thinking, the context is just the question; with thinking, it is the question plus the reasoning, and the answer emerges from that richer, different context.
Without thinking1Question2Answer
With thinking1Question2Reasoning3Answer
This triggers a distributional shift. Reasoning followed by a conclusion is a distinct basin of attraction in latent space: during pretraining, explicit reasoning was followed by more coherent conclusions, and the thinking repositions the model into that basin.
There is no magic in it, only the geometry of the embedding space plus accumulated context. The thinking does not teach the model anything new; it positions it where it already knows how to produce quality output (the mechanism of in-context learning, fed with tokens the model generated itself). Each thinking token is a decoding step that moves the residual stream to a new point, so by the time the answer starts the model is in a completely different neighborhood.
Pretraining is the ceiling. SFT and RL post-training do not create new capabilities; they navigate toward useful regions of the distribution learned during pretraining. If the pretraining data did not contain high-quality reasoning, no amount of RL recovers it, and a small model with much RL stays below a large model with little RL.
It scales with compute: more thinking tokens give a richer context and a more precise positioning. o1 does linear thinking; o3 likely adds tree search (explore N branches, pick the best).
Chain of thought was the prompting version. Extended thinking is the trained, RL-optimized version with dedicated compute budgets. In RLHF and RLAIF, humans rate reasoned responses higher, so the model learned that showing reasoning produces a structure that leads to better-scored outputs.
It fails in three ways: overthinking on simple problems (a distributional shift to the wrong basin), exposure bias compounding (each generated token is context the model may never have seen in training), and path dependency in the residual stream.