Ask GPT-4 to solve a tricky math problem. It answers in 2 seconds. Wrong.
Ask o1 the same problem. It "thinks" for 30 seconds. Right.
What happened in those 30 seconds? The model didn't go look anything up. It didn't call an API. It literally thought harder β generating hundreds of internal reasoning tokens before giving you the final answer.
This is test-time compute β the idea that you can make a model smarter by letting it use more compute during inference. Not by training a bigger model. Not by giving it more data. Just by letting it think longer on your question.
And it's changing the economics of AI completely.
The Two Levers of AI Intelligence
Traditionally, making AI smarter meant one thing: train bigger models on more data. That's training-time compute β investing billions upfront to create a better model.
But there's a second lever: test-time compute β investing more compute when the model is actually answering your question.
Lever When Cost Example
| Training-time compute | Before deployment | $100Mβ$1B (one-time) | Train GPT-5 on 50K GPUs for 6 months |
|---|---|---|---|
| Test-time compute | During inference | Per-query cost | Let o1 "think" for 30 seconds on your question |
The breakthrough insight: a smaller model with more test-time compute can beat a larger model with less. A 70B model that "thinks" for 60 seconds can outperform a 405B model that answers in 2 seconds β on reasoning tasks.
How Thinking Tokens Work
When o1 or DeepSeek-R1 "thinks," it generates a long chain of internal reasoning tokens before producing the final answer. These thinking tokens are:
Generated by the model β they're real tokens, not a special mechanism
Hidden from the user β you see "thinking..." but not the actual reasoning (usually)
Used as context β each thinking token informs the next, building up a solution step by step
What the Thinking Looks Like
User: "What is 37 Γ 48?"
Model's internal thinking tokens:
Let me solve 37 Γ 48 step by step.
I can break this down:
37 Γ 48 = 37 Γ 50 - 37 Γ 2
37 Γ 50 = 1850
37 Γ 2 = 74
1850 - 74 = 1776
Let me verify: 37 Γ 48
= (30 + 7) Γ 48
= 30 Γ 48 + 7 Γ 48
= 1440 + 336
= 1776 β
The answer is 1776.
Final answer to user: "37 Γ 48 = 1,776"
The user just sees "1,776" β but the model generated 100+ tokens of reasoning to get there. And those reasoning tokens cost compute and money.
π§
Chain-of-Thought: The Foundation
Test-time compute builds on Chain-of-Thought (CoT) prompting, discovered in 2022. The observation: if you ask a model to "think step by step," it performs dramatically better on reasoning tasks.
Without CoT:
Q: "If a train travels 120 km in 2 hours, and then 180 km in 3 hours,
what's the average speed?"A: "72 km/h" β (just guessed)
With CoT:
Q: (same question, but add "think step by step")
A: "Total distance = 120 + 180 = 300 km
Total time = 2 + 3 = 5 hours
Average speed = 300/5 = 60 km/h" β
CoT works because it forces the model to allocate compute to intermediate steps. Without CoT, the model must compute the answer in a single forward pass β one matrix multiply per token. With CoT, each reasoning step gets its own forward pass, dramatically increasing total compute.
Why More Tokens = More Compute
This is the key insight. Remember from Episode 4: each output token requires a full forward pass through the entire model. More tokens = more forward passes = more compute.
Standard answer: 5 tokens Γ 1 forward pass each = 5 forward passes
CoT answer: 50 tokens Γ 1 forward pass each = 50 forward passes
10x more compute β much better reasoning
The model is literally using its own output tokens as "scratch paper" for computation.
π
o1: Scaling Test-Time Compute
OpenAI's o1 (September 2024) was the first model designed specifically to scale test-time compute. It was trained with reinforcement learning to generate effective reasoning chains.
How o1 Was Trained
Standard LLM training:
Input β Model β Output β Compare with ground truth β Update weightso1's training (simplified):
Input β Model β Generate long reasoning chain β Get final answerβ Was the answer correct? β Reward signal β Update via RL
β Also: was the reasoning efficient? β Process reward β Update via RL
The key difference: o1 wasn't just trained to get the right answer. It was trained to think productively β to generate reasoning steps that actually help reach the correct conclusion. Bad reasoning gets penalized. Circular reasoning gets penalized. Productive reasoning gets rewarded.
Scaling Behavior
The remarkable finding: o1's performance scales predictably with thinking time:
Thinking Time AIME Math Score Improvement
| 1 second | 56% | Baseline |
|---|---|---|
| 10 seconds | 72% | +16 points |
| 60 seconds | 83% | +27 points |
| 5 minutes | 89% | +33 points |
More thinking = better answers, with a smooth, predictable curve. This is a scaling law for inference β analogous to the training scaling laws we've known about for years.
DeepSeek-R1: Open-Source Reasoning
DeepSeek-R1 (January 2025) showed that test-time compute models could be built without OpenAI's proprietary techniques. And they open-sourced everything.
The Remarkable Discovery
DeepSeek found that if you train a model with pure reinforcement learning on reasoning tasks (no supervised CoT data), the model spontaneously develops reasoning behaviors:
Training signal: Only "was the final answer correct?"
No examples of reasoning chains provided.
Result: The model learns to:
- Break problems into steps
- Try multiple approaches
- Check its own work
- Backtrack when stuck
- Verify answers before committing
The model invented chain-of-thought reasoning on its own, just from the reward signal of correct answers. It even developed "aha moments" β moments where it realizes its approach is wrong and pivots:
Let me try approach A...
Hmm, that gives me 847, which seems too large.
Wait, I think I made an error in step 3.
Let me reconsider...
Actually, I should use approach B instead.
...
Yes, approach B gives 127, which makes much more sense.
R1's Architecture
Base model: DeepSeek-V3 (671B MoE, 37B active)
Training: Multi-stage
Stage 1: Cold start with a few thousand CoT examples
Stage 2: Large-scale RL with GRPO (Group Relative Policy Optimization)
Stage 3: Rejection sampling + supervised fine-tuning
Stage 4: Final RL for helpfulness + safety
Distillation: DeepSeek also showed you can distill R1's reasoning into smaller models. R1-distilled versions at 7B, 14B, and 32B parameters still show strong reasoning β they learned the pattern of productive thinking from the larger model.
The Economics of Thinking
Test-time compute fundamentally changes AI pricing:
Token Costs
Standard query (GPT-4):
Input: 500 tokens Γ $10/M = $0.005
Output: 200 tokens Γ $30/M = $0.006
Total: $0.011
Thinking query (o1):
Input: 500 tokens Γ $15/M = $0.0075
Thinking: 5,000 tokens Γ $60/M = $0.30 β THIS IS THE EXPENSIVE PART
Output: 200 tokens Γ $60/M = $0.012
Total: $0.32
A thinking query costs 30x more than a standard query. But for hard problems (math, code, analysis), it's worth it because the answer is actually correct.
When to Use Thinking Models
| Task | Standard Model | Thinking Model | Use Thinking? |
|---|---|---|---|
| "What's the weather?" | β Fine | β οΈ Overkill | No |
| "Summarize this email" | β Fine | β οΈ Overkill | No |
| "Solve this integral" | β Often wrong | β Usually correct | Yes |
| "Debug this race condition" | β Misses edge cases | β Thorough | Yes |
| "Plan a DB migration" | β οΈ Superficial | β Considers edge cases | Yes |
| "Write a poem" | β Creative | β Over-thinks it | No |
The rule: Use thinking models for tasks with verifiable correct answers. Math, logic, code, analysis. Don't use them for creative writing or simple lookups.
π¬
Process Reward Models (PRMs)
A key enabler of test-time compute is the Process Reward Model β a separate model that evaluates each step of reasoning, not just the final answer.
Outcome vs Process Reward
Outcome Reward Model (ORM):
"Your final answer is correct" β reward = 1.0
"Your final answer is wrong" β reward = 0.0No feedback on intermediate steps.
Process Reward Model (PRM):
Step 1: "120 + 180 = 300" β reward = 1.0 (correct step)
Step 2: "300 / 2 = 150" β reward = 0.0 (wrong step! should be /5)
Step 3: "Speed = 150 km/h" β reward = 0.0 (wrong, follows from bad step)PRMs enable:
Better RL training β reward good reasoning, not just lucky answers
Search during inference β generate multiple reasoning paths, use PRM to pick the best one
Early termination β stop a bad reasoning chain before wasting more tokens
π‘οΈ
Search Strategies at Inference
With enough test-time compute, you can search for the best answer:
Best-of-N Sampling
Generate N complete solutions, pick the one the PRM scores highest:
Query: "Solve this optimization problem"
Solution 1: [reasoning...] β Answer: 42 β PRM score: 0.85
Solution 2: [reasoning...] β Answer: 37 β PRM score: 0.45
Solution 3: [reasoning...] β Answer: 42 β PRM score: 0.92 β β Pick this one
Solution 4: [reasoning...] β Answer: 45 β PRM score: 0.31
Tree Search
Instead of generating complete solutions, explore a tree of reasoning steps:
Start β Step A1 (PRM: 0.9) β Step A2 (PRM: 0.85) β Answer (correct β)
β Step B1 (PRM: 0.3) β pruned (bad start)
β Step C1 (PRM: 0.7) β Step C2 (PRM: 0.4) β pruned (went wrong)This is more compute-efficient than best-of-N because bad paths get pruned early.
π¦
The Scaling Laws of Inference
The most important finding from test-time compute research:
Training compute and inference compute are partially substitutable.
A smaller model with more inference compute can match a larger model with less:
Equivalent performance:
405B model Γ 1 second thinking β 70B model Γ 60 seconds thinking
The smaller model "thinks harder" to compensate for fewer parameters.
This has profound implications:
Cheaper deployment β serve a 70B model instead of 405B
Pay per difficulty β easy questions get fast answers, hard questions get more thinking
Adaptive compute β the model itself can decide how hard to think
π
Practical Takeaways
Test-time compute = spending more inference compute on hard problems β thinking tokens are real tokens that cost moneyChain-of-thought is the mechanism β each reasoning token is a forward pass, giving the model more compute
Performance scales with thinking time β more thinking = better answers, predictably
Use thinking models for verifiable tasks β math, code, logic β not creative writing or simple lookups
Thinking queries cost 10-30x more β but correctness on hard problems makes it worth it
Training and inference compute are substitutable β smaller models can compensate with more thinking
π
What's Next?
Episode 63: What's Next in AI β Agents, world models, embodied AI, the reasoning frontier. Where is this all heading? Are we hitting scaling law plateaus? We'll look at the cutting edge and the next 3-5 years of AI.
β Previous
Ep 61: State Space Models
Next β
Ep 63: What's Next in AI
Next: Episode 63 β What's Next in AI
You now understand how modern AI actually works β not as a user, but as an engineer. So where is all of this heading?
This is part of a 98-episode series covering AI engineering from tokens to production deployment.