Topic 1 of 5 · 3 min read
Thinking tokens and test-time compute
Goal: Explain how reasoning models spend extra tokens before answering and why that improves multi-step problems.
A reasoning model writes a long stretch of working-out text before it gives its answer, and that extra writing is what makes it better at hard problems. Those working-out tokens are often called thinking tokens, and spending them is called test-time compute: compute spent while answering, not while training.
Check yourself · 1 of 3
What is a reasoning model doing before it shows you its final answer?
Why it matters
A language model produces one token at a time. Each new token can only use the text that came before it. If a problem needs five steps, a model that must answer in its first sentence has to do all five steps "in its head" in one pass. A model that first writes the steps out can use its own earlier lines as a scratchpad. That is why it gets more multi-step questions right.
Claude, ChatGPT, Gemini and open-weight models such as DeepSeek-R1 all now have reasoning modes. They are trained, with reinforcement learning on problems that have checkable answers, to produce useful chains of thought. You do not need to ask them to think step by step. They already do.
How it works
- You send a question.
- The model writes a thinking section: it breaks the problem down, tries an approach, checks it, and sometimes backs up and tries another.
- The model writes the final answer, which you read.
Thinking tokens are real output. They take time, they count toward the context window, and on most APIs you pay for them like any other output tokens, even when the interface only shows a short summary.
Before and after
Chat model, no thinking: "A shop sells pens only in packs of 6 and packs of 10. I need exactly 46 pens. What is the fewest number of packs I can buy?" The model may stop at the first split it finds, six packs of 6 and one of 10 (7 packs), or give a split that does not add up.
Reasoning model: It writes 6a + 10b = 46, tries each b from 0 to 4, finds two splits that work (6 + 1 and 1 + 4), compares them, and answers one pack of 6 and four packs of 10: 5 packs.
The difference is the checking, not extra knowledge.
What goes wrong
- Thinking does not add facts. A reasoning model that does not know a fact will still guess it, now with a longer and more convincing explanation.
- More thinking is not always better. Models can talk themselves into a wrong path or keep going on an easy question.
- People forget the cost. A short answer can hide thousands of thinking tokens behind it.
Examples
Same question, two modes
Ask a chat model and a reasoning model: "A train leaves at 9:40 and arrives at 14:15 after a 25-minute stop. How long was it moving?"
The fast model may jump to a number. The reasoning model works out total time (4 h 35 min), subtracts the stop, and answers 4 h 10 min.
The hidden bill
Your answer is 40 words long. The model may have written several thousand thinking tokens first. You pay and wait for both, so a short reply does not mean a cheap or quick one.
Key points
- A reasoning model writes a chain of thought before its final answer.
- Writing steps out gives the model a scratchpad, because each token can use the tokens before it.
- Spending extra tokens at answer time is called test-time compute.
- Thinking tokens cost time and money even when only a summary is shown.
- Thinking improves working-out, not knowledge: a missing fact is still a guess.
Common mistakes
- Assuming a reasoning model knows more facts than a standard one.
- Judging cost by the length of the visible answer only.
- Asking a reasoning model to think step by step as if it were not already doing so.
- Expecting more thinking to always give a better answer.
Check yourself · 2 of 3
Why do written-out steps help a model on a five-step problem?
Check yourself · 3 of 3
A reasoning model answers in two lines, but your bill is far higher than for a normal chat model. What is the most likely reason?
Practice items, not counted towards your mastery.
Start here
- Building with extended thinking (Claude docs) (opens in a new tab)DocsFree
Shows how thinking blocks, token budgets and summarized thinking work in a real API.
- Reasoning models (OpenAI API docs) (opens in a new tab)DocsFree
Explains reasoning tokens, effort levels and how to prompt reasoning models.
- Reasoning models don't always say what they think (Anthropic) (opens in a new tab)ArticleFree
Research on how often a model's visible reasoning leaves out what really drove its answer.
More for this topic
- DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning (opens in a new tab)PaperFree
An open-weight reasoning model and the training method behind long chains of thought.