Skip to content
mentoor

Topic 4 of 6 · 5 min read

Scaling compute at inference time

Goal: Compare the cost and accuracy of a larger model against a smaller model with a bigger thinking budget for a stated task.

Extra compute at inference time, spent as longer reasoning or as several sampled answers, can raise accuracy on hard problems, which makes it a second scaling axis next to model size.

Check yourself · 1 of 3

What does scaling compute at inference time mean?

Choose one answer

Why it matters

Training size is fixed once the model ships. Inference-time compute is a dial you set per request. Reasoning models such as OpenAI's o-series, Claude with extended thinking and DeepSeek-R1 produce a long chain of thought before the answer. Snell et al. (2024) found that, on problems where a smaller model has some chance of success, spending test-time compute well can beat a model about 14 times larger at matched total FLOPs.

Two ways to spend it

  1. Think longer. The model writes a longer chain of reasoning, checks itself and backtracks. Cost grows with the number of generated tokens.
  2. Sample more. Draw k answers and pick one, by majority vote (for tasks with a checkable final answer) or by a verifier or reward model that scores them. Cost grows with k.

How to compare

Inference FLOPs per generated token are about 2N. For a request, cost is about 2 * N * tokens generated * samples, plus the cost of any verifier.

def request_flops(n_params, tokens, samples=1):
    return 2 * n_params * tokens * samples

large = request_flops(70e9, tokens=500)                    # 7.0e13
small = request_flops(8e9, tokens=4000)                    # 6.4e13
small_vote = request_flops(8e9, tokens=1000, samples=16)   # 2.6e14

The 8B model with a long thought costs about the same as the 70B direct answer. Sixteen votes cost about four times as much. Whether either is worth it depends on measured accuracy on your task, not on the formula.

Before and after

Weak: "Reasoning models are better, so always use the highest thinking budget."

Better: "On our 200 test tickets, the small model with 4,000 thinking tokens scores 81 percent, the large model without thinking 78 percent, at similar cost. We use the small model for hard tickets and skip thinking for simple ones."

What goes wrong

  • Majority voting on open-ended text, where no two answers match exactly.
  • Gains that flatten or reverse: more thinking does not fix a missing fact, and long chains can talk themselves into an error.
  • Ignoring latency: a long thought is seconds of waiting per request.
  • Paying for the high setting on easy requests.

Examples

Equal cost, different split

A 70B model answering in 500 tokens and an 8B model thinking for 4,000 tokens cost about the same in FLOPs. On a math-style task the thinking model may win; on a question about an obscure fact, the larger model's stored knowledge wins.

Voting only works with a checkable answer

Sixteen samples of a numeric answer can be voted on. Sixteen essay drafts cannot; there you need a verifier or a rubric to pick one.

Key points

  • Inference-time compute is a second scaling axis: longer reasoning, more sampled answers, or both.
  • Inference cost is about 2 x parameters x generated tokens x samples, plus any verifier.
  • A smaller model with a bigger thinking budget can match or beat a larger one at similar cost on some tasks.
  • Returns diminish, and thinking longer cannot supply knowledge the model lacks.
  • Measure accuracy, cost and latency on your own task before choosing a budget.

Common mistakes

  • Using majority vote on free-form text with no checkable answer.
  • Setting the highest thinking budget for every request, easy ones included.
  • Expecting more thinking to fix a gap in the model's knowledge.
  • Comparing cost by price per token alone and ignoring how many tokens each model generates.

Check yourself · 2 of 3

Which task benefits least from sampling 16 answers and taking a majority vote?

Choose one answer

Check yourself · 3 of 3

An 8B model uses 4,000 thinking tokens; a 70B model answers in 500 tokens. Roughly how do their per-request FLOPs compare?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic