Models that compute before they answer
Why letting a model think first helps: chains of thought, test-time compute, and when the surcharge is worth it.
The idea
A language model has a fixed amount of computation available per token. Answering a hard question in a single token is therefore structurally hard, however good the model is.
Let it write twenty intermediate steps instead and it gets twenty times the computation. The intermediate steps are also a notepad on which partial results stay put.
When it helps
| Task | Gain |
|---|---|
| Multi-step arithmetic | large |
| Code with edge cases | large |
| Logical checks, contract terms | large |
| Planning with dependencies | medium |
| Summarising | small |
| Rephrasing, translating | none |
| Looking up facts | none, that needs retrieval |
The methods
| Method | Principle | Extra cost |
|---|---|---|
| Chain of thought in the prompt | "Think step by step" | small |
| Few examples with worked steps | A model in the prompt | small |
| Self-consistency | Compute several times, take the majority | 5 to 20 times |
| Trained reasoning model | Thinking steps were trained in | 3 to 30 times |
| Tool use | Hand the arithmetic to a calculator | small, more reliable |
The last row is often overlooked and is the best answer for arithmetic: a model that delegates a calculation to a calculator is more reliable and cheaper than one that works it out.
Self-consistency
from collections import Counter
def self_consistent(question, model, n=8):
# Compute several times at temperature > 0 and take the most common answer.
answers = [model(question, temperature=0.7)["final"] for _ in range(n)]
counts = Counter(answers)
best, freq = counts.most_common(1)[0]
return best, freq / n # the second value is a confidence measureThe second return value is the real gain: it is an empirical confidence measure. Below about 60 percent agreement, the case belongs in human review.
Test-time compute
At 2,000 thinking tokens and a 200-token answer, cost is eleven times that of a
direct answer. Empirically, accuracy on multi-step tasks improves roughly
logarithmically in T_think: doubling thinking time yields a roughly constant
increment until saturation.
The chain of thought is not a log
This is the most important caveat for any evidence purpose. The printed chain is itself generated text and need not match the computation that produced the answer. Studies show cases where a model demonstrably uses a hint in the prompt and does not mention it in its chain.
For practice that means:
- Treat the chain as a working aid, not a justification in the legal sense.
- For evidence, log the result, the inputs, the model version and the parameters.
- Where a justification is required, check it against the actual sources, not against the model's narrative.
- For high-risk applications, point human oversight at the result, not at the chain.
See Duties by role and Logging.
When the cost pays
Worked through: extra cost 0.02 EUR per request, accuracy improvement 6 percentage
points, error cost 15 EUR. Then 0.06 × 15 = 0.90 EUR > 0.02 EUR: the surcharge
pays back 45 times over. On a task with no error cost, such as rephrasing a text,
it never pays.
Related courses and sources
Chain-of-Thought Prompting
Intermediate steps in the prompt markedly improve multi-step tasks. The basis of today's models with reasoning steps.
For anyone writing prompts: the paper behind the intermediate-steps pattern.