Chapter 7 · About 8 minutes
Thinking step by step
A model that writes out its steps before the answer gets each step into its window, and models trained to do this solve much harder problems.
You will learn
- Explain why writing out steps can help a model that guesses one token at a time
- Say how reasoning models are trained, and what that costs
- Tell why written reasoning is not always how a model really decided
The first chapter showed how a model writes, one token at a time, each one added to the text before the next guess. This chapter is about using that on purpose.
Writing the steps down
- TextLily has 2 apples. Tom gives her 1 more, and Ben gives her 3. How many now? Let us count.
- ModelShe starts with 2. One more makes 3.
- ModelThree more makes 6.
- ModelSo Lily has 6 apples.
4 steps in order, each saying who acts and what they write.
Story
A model gets one pass through its layers for each token it writes. A question that needs several steps of work can be too much for the few tokens of a short answer.
Writing the steps down changes that. Each step the model writes becomes text in its window, so the next guess can build on it. One hard jump becomes several small ones. Showing a few worked examples with their steps in the prompt, so the model writes steps too, is called Chain of thought Steps a model writes before its answer. Each step joins the text it reads for the next guess. Open the glossary (Wei et al., 2022).
Numbers
With eight worked examples in the prompt, a large model with 540 billion learned numbers did better on school math word problems than any earlier result (Wei et al., 2022). Small models were not helped the same way, and our model, with about 1.3 million numbers, cannot add at all.
Why can writing out steps help a model that only ever guesses the next token?
Each written step joins the text in the window, so the next guess can use it. The model and its window stay the same. It just has more to read.
Models trained to reason
Story
A Reasoning model A model trained to write long reasoning before it answers, often with rewards for right answers. Open the glossary is trained to write long reasoning before it answers, without being asked. One way is to give it problems whose answers can be checked, such as math or code, and reward it when the final answer is right. Over many rounds, it learns on its own to try steps, check them, and start again when something looks wrong (DeepSeek-AI, 2025).
It is still the same kind of model, guessing one token at a time. What changed is the habit it learned, to think on the page first.
Thinking costs tokens
Story
Every token of reasoning is written like any other, with a full pass through the model. A model that thinks for a thousand tokens before answering does a thousand passes first. That takes time, costs money to run, and fills the context window.
So reasoning helps most on problems that really need steps, and is a waste on simple questions.
Numbers
A pass of our tiny model takes a tiny fraction of a second in your browser. A large model needs far more work per token, which is why long reasoning can take a minute or more.
500 plus 50 is 550 tokens. 550 times 0.02 is 11 seconds.
Common myth
The written steps are not always how the model really reached its answer. In one study, a pattern in the prompt, such as the right answer always being (A), pushed models toward an answer, and their written reasoning almost never mentioned it, while still sounding convincing (Turpin et al., 2023). Treat the steps as a helpful draft, not a window into the model.
Recap
- Each step a model writes becomes text it reads for the next guess, so a hard jump becomes several small ones.
- Reasoning models are trained with rewards for right answers on problems that can be checked, and learn to write long reasoning.
- Every written token costs a full pass of the model, so thinking longer takes more time and more of the window.
- Written reasoning can sound right and still leave out what really drove the answer.
Go deeper
- Wei et al., 2022. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- DeepSeek-AI, 2025. DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning
- Turpin et al., 2023. Language Models Don't Always Say What They Think: Unfaithful Explanations in Chain-of-Thought Prompting