# What Is Test-Time Compute?

> What test-time compute is, the two ways to spend it, and why more answer-time work costs more, explained simply for your AI interview.

**In short:** Test-time compute is the work a model does each time it answers, such as thinking longer or drafting several answers and picking one. It can lift quality, but every extra token and try is billed, and the gain depends on how hard the task is.

AI and LLM interview question Q028, LLM fundamentals. Advanced, common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/what-is-test-time-compute

## Say it in 30 seconds

Test-time compute is the effort a model spends while it answers. Training compute is the effort spent building it. A model can think for longer, or draft several answers and keep the best one. The gain depends on how hard the task is, and it costs more tokens and more waiting time. At work, I'd set it per task: a simple FAQ gets little, a claim that moves money gets more, and a checker in code decides which answer wins.

## Say it in 2 minutes

For years the main lever was training compute, the work done once to build a model. Test-time compute is the second lever. It is the work the model does each time someone asks it something. OpenAI's o1 write-up says its results improved with both more training and more time spent thinking before it replied.

There are two common ways to spend it. The first is longer reasoning, where the model works through steps before it answers. The second is sampling, where it drafts several answers and a vote or a checker picks one. Research from 2024 found that which approach pays off depends on how hard the prompt is, so the spend should follow the task.

The cost is real. Reasoning tokens are billed, and they add waiting time. A coding agent that tries 250 fixes gets a much better solve rate in one study, but it also runs 250 test suites. So I set the effort per task, cap the spend per request, and measure cheap and expensive settings on the same questions.

Be honest about the limit. Without an automatic checker, majority voting and reward models stop improving after several hundred samples. More compute does not replace a check that can say no.

## What is test-time compute, in plain words?

Compute is the processing a model does to produce its output. A model uses it twice in its life. Training compute is spent once, to build the model. Test-time compute, also called inference-time compute, is spent every time the model answers a question. The work is counted in tokens, which are small pieces of text such as a word or part of one, and you pay per token.

OpenAI's o1 write-up, from 2024, says its results improved with both kinds of work: more training, and more time spent thinking before it replied.

Think of a claims adjuster at an insurer. A clerk who answers a simple claim in a minute is fine for a dented bumper. A senior adjuster given a messy injury claim takes an afternoon: rereads the policy, checks the medical notes and compares two estimates before signing. Same person, same training. The extra afternoon is the test-time compute. An AI claims triage agent works the same way: a clear claim gets a quick answer, and a messy one gets more time.

- **Training compute:** The work done once, to build the model.
- **Test-time compute:** The work done each time the model answers. Also called inference-time compute.
- **Reasoning tokens:** The working a reasoning model writes before its reply. You are billed for it.
- **Sampling:** Asking the same question several times to get several candidate answers.
- **Verifier:** A checker that says whether an answer is right, such as tests, a schema or a fee table.

## How does spending more compute at answer time help?

There are two common ways to spend it. The first is longer reasoning: the model works through steps internally before its answer, and an effort setting controls how hard it works. The second is sampling: the model writes several candidate answers, and a vote or a checker picks one.

*Diagram, Two ways to spend extra answer-time compute: Two ways to spend the same extra budget, side by side. Both can lift the answer. Both also bill more tokens and add waiting time, so the cost is shown too.*
1. The question goes to the model, which thinks before it answers.
2. The same question goes to a sampler that drafts several answers.
3. Longer thinking often gives a better single answer.
4. Several drafts, judged well, often give a better pick.
5. Longer thinking also bills more output tokens and takes longer.
6. Several drafts also multiply the bill and the wait.

> "We have found that the performance of o1 consistently improves with more reinforcement learning (train-time compute) and with more time spent thinking (test-time compute)" (OpenAI, on its o1 model)
>
> "the effectiveness of different approaches to scaling test-time compute critically varies depending on the difficulty of the prompt" (Snell and three co-authors, 2024)

That 2024 paper named two ways to scale test-time compute. One searches against a verifier that scores each step of the reasoning. The other lets the model adapt its own answer while it works. In a compute-matched test, on problems a smaller model already solves some of the time, the extra test-time compute beat a model 14 times larger.

Anthropic's docs call effort the recommended way to control thinking depth, where adaptive thinking is available. Adaptive thinking lets Claude decide, for each request, whether to think and how much. The older manual setting, a fixed token budget per request, is deprecated: Claude 4.7 and later models reject it with a 400 error, so the docs say to migrate to adaptive thinking.

Here is a small example of why a checker can beat a vote. A bank's support bot drafts eight answers to a late-fee question. The numbers are made up, but the pattern is real.

```python
# Made-up example: a bank's support bot is asked the late payment fee. We sample 8 drafts.
# The most common draft and a check against the fee table can disagree.
from collections import Counter

FEE_TABLE = 29  # the current fee, copied from the fee table (made-up)
drafts = [29, 35, 35, 29, 35, 19, 35, 29]

vote = Counter(drafts).most_common(1)[0][0]
print("Most common draft:", vote)
verified = [d for d in drafts if d == FEE_TABLE]
print("Drafts that match the fee table:", len(verified), "of", len(drafts))
print("Answer sent:", verified[0] if verified else "escalate to a person")
```

Output:

```text
Most common draft: 35
Drafts that match the fee table: 3 of 8
Answer sent: 29
```

The vote picks 35, because it is the most common draft, with 4 of 8. The check against the fee table keeps only the 29 drafts and sends that answer. A vote picks what is common. A checker picks what is right, but only where you can write the check.

## What does it cost, and where does it stall?

Every reasoning token is billed. OpenAI's guide says reasoning models use internal reasoning tokens before a reply, and that these are billed as output tokens even though you cannot see them through the API.

A worked example. A team runs a coding agent in its CI pipeline, the automatic test run every change goes through, and asks it to fix a reported bug. In a 2024 study, which used a coding test set called SWE-bench Lite, one model solved 15.9 percent of issues with one try and 56 percent with 250 tries. Coverage is the share of problems solved by at least one of the tries.

Made-up numbers for that team: one try costs 40 cents of model use and one test run. Two hundred and fifty tries cost about $100 of model use and 250 test runs. The team has to ask whether moving from roughly one fix in six to better than one in two is worth that bill, against the engineer hours it saves.

*Diagram, Who picks the right try?: Sampling helps most when something can pick the right try. Tests can confirm a fix. A vote can only find the most common answer, which can still be wrong.*
1. The agent sends its tries to a checker.
2. The same tries can go to a vote instead.
3. A passing test run shows the fix works for the cases it covers, so it goes forward.
4. A vote only picks the common answer, which can still be wrong.

> "In domains like coding and formal proofs, where answers can be automatically verified, these increases in coverage directly translate into improved performance." (Brown and co-authors, 2024 (Large Language Monkeys))
>
> "(majority voting and reward models) plateau beyond several hundred samples and fail to fully scale with the sample budget" (Brown and co-authors, 2024 (Large Language Monkeys))

So the limit is clear. Where a checker can confirm answers, more tries keep paying off. Without one, majority voting and reward models stop improving after several hundred samples, and more compute buys little.

> **Tip:** When asked about the cost, name the bill, the extra output tokens and the waiting time, then the test that shows the extra work was worth it.

### How would you decide how much compute an agent gets?

Start from the cost of a wrong answer. A customer FAQ can run on the default. A claim that moves money gets more effort, and a check in code before anything is sent.

1. **Set effort per task type:** Low for FAQs, high for disputed claims. Effort is the recommended control where adaptive thinking is available.
2. **Cap the spend per request:** One hard case should not run up the bill. Set a token limit and a retry limit, and stop when you reach them.
3. **Add checks in code:** Test the answer against a fee table, a schema or a test suite, so the extra try has something that can say no.
4. **Measure on a fixed test set:** Run the same questions at two settings and compare right answers and cost. Keep the cheapest setting that passes.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] A plain definition: compute spent when the model answers, not when it is trained.
- [ ] The two ways: longer reasoning, and sampling with a vote or a checker.
- [ ] Why it helps: the gain depends on the task's difficulty, so the spend should follow it.
- [ ] The cost: billed tokens, extra waiting time and more test runs.
- [ ] The limit: without a checker, picking among samples stalls.
- [ ] How you would set it per task, and measure the result.

**Common traps**

- Trap: "Just let it think longer, it is always better." Better: The gain depends on difficulty, and every extra token is billed. Set it per task and measure.
- Trap: "More samples always means a better answer." Better: Only with a checker that can tell right from wrong. Without one, majority voting and reward models stop improving after several hundred.
- Trap: "Reasoning is free because we cannot see it." Better: Hidden reasoning tokens are still billed as output and still take time.

## Can you spot the best plan?

**Spot the best plan:** A bank's support bot answers fee questions. Which plan uses extra test-time compute best?

A. Sample 20 drafts and take a vote, even for simple FAQ questions
B. Keep the default for FAQs, and spend more on disputed fees, checked against the fee table
C. Raise the effort on every request, with no cap on the bill
D. Ask the model to double-check itself once, then send whatever it says

**Answer:** B. Simple questions rarely need more thinking, and a disputed fee is where a wrong answer costs the most. The fee-table check in code gives the extra work something that can say no.

**Quick check:** Which statement about test-time compute is true?

A. It is spent once, when the model is trained.
B. It pays off most where a checker can confirm answers, and each try is billed.
C. It is the same thing as a bigger context window.
D. It means the model keeps learning from each user's chats after it is released.

**Answer:** B. It is spent per answer. Its gain is clearest where a checker can confirm the answer, and every extra token or try is billed.

## Can you answer these from memory?

**Flash cards**

- **What is test-time compute?** Compute spent each time a model answers, not when it is trained.
- **Training vs test-time compute?** Training is done once to build the model. Test-time is done per answer.
- **Two main ways to spend it?** Longer reasoning, and sampling several answers then picking one.
- **Where does it pay off most?** Tasks a checker can confirm, such as code with tests. The gain depends on difficulty.
- **Why does it cost more?** Reasoning tokens are billed as output, and they add waiting time.
- **What stalls it?** Without a checker, majority voting and reward models stop improving after several hundred samples.

## Likely follow-up questions

- Q027 What is a reasoning ("thinking") model? https://designervenkat.online/interview/ai/what-is-a-reasoning-model
- Q340 How do reasoning tokens affect cost and latency? (full answer coming)
- Q090 What is self-consistency? (full answer coming)
- Q019 What are scaling laws? https://designervenkat.online/interview/ai/what-are-scaling-laws
- Q322 What is model routing (cascades)? https://designervenkat.online/interview/ai/what-is-model-routing
