All courses

Scaling test-time compute: parallel vs sequential

Compare two ways of spending inference compute. In parallel: sample many answers, then take a majority vote or let a verifier (a checker or scoring model) pick one. Sequentially: produce longer reasoning chains. Explain why accuracy rises roughly log-linearly with thinking tokens and when each strategy wins.

Builds on: Chain of thought as extra computation, Temperature

▶ Watch this lesson Start the whole course

What the animation says

Chances or depth?

You have extra compute for one hard problem. You can spend it two ways. Sixteen independent attempts side by side, or one chain of thought sixteen times longer. Both generate about the same number of tokens, so the cost is about the same. The long chain costs slightly more, because attention over a longer context adds work. Parallel buys more chances. Sequential buys more depth: more steps in a row, and room to check and revise. This problem needs ten dependent steps, and a short chain manages four. Which spend can solve it?

Coverage

The long chain wins there. Every short attempt has the same reach, so sampling more never adds steps. Parallel helps when one attempt sometimes succeeds. Sample at nonzero temperature so the attempts differ. Say each attempt is right thirty percent of the time, independently. Take eight. All eight miss with chance point seven to the eighth, about six percent. So coverage, the chance at least one is right, is about ninety-four percent. A perfect verifier picks that right one every time. Without a checker, you vote.

Majority vote

Majority vote picks the most common final answer. Where it lands depends on the wrong answers. Case one: the correct answer at thirty percent, and seven wrong answers at ten percent each. Case two: the correct answer still at thirty percent, but one wrong answer at fifty. In both cases, coverage climbs toward one hundred percent as you sample more. As the number of votes grows, what happens to vote accuracy in case two?

Simulate the vote

Here's a simulation. This line draws n answers per trial, and this line picks the most common one. With one sample, both cases score thirty percent. With scattered wrong answers, the vote reaches about sixty percent at five votes, and about eighty-five at twenty-five. With one popular wrong answer, it barely moves at five votes, then sinks below twenty percent at twenty-five, heading to zero. Yet coverage nears one hundred percent. The right answer is in the pile, but the vote can't find it. A verifier could.

Each doubling, same gain

For one long chain, accuracy grows by about the same amount each time thinking tokens double. Each problem is solved once the budget passes its own threshold. Those thresholds spread evenly on a log scale: about as many problems need one to two thousand tokens as need two to four thousand. So each doubling unlocks a similar slice, until accuracy saturates. Forty percent at one thousand tokens, forty-eight at two thousand, fifty-six at four thousand. Tap the budget that reaches seventy-two.

Which to buy

Sixteen times the tokens bought thirty-two more points. Each extra eight points doubles the cost. So pick the spend that matches the problem. Parallel buys chances. Use it when single attempts sometimes succeed, when answers can be voted on or checked, and when latency matters. Sequential buys depth. Use it when the problem needs more dependent steps than a short chain can take. And before you trust a vote, ask whether one wrong answer is more popular than the right one.

16 attempts, or one 16× longer attempt?

You have extra inference compute for a hard problem. You can sample 16 independent answers, or let one chain of thought run 16× longer. Both generate about the same number of tokens, so both cost about $2N$ FLOPs × tokens. The long chain costs a bit more, since attention over a longer context adds FLOPs. Which gives higher accuracy, and when? And why do plots show accuracy rising by a roughly constant amount **each time thinking tokens double**?

More chances vs more depth

**Parallel:** sample at $\tau>0$ so the attempts differ, then pick one. Either take a **majority vote** over final answers, or let a **verifier** (a checker or scoring model) choose. This only helps if single attempts *sometimes* succeed. Each attempt keeps the same serial reach. **Sequential:** a longer chain gets more serial steps and working memory. It can check and revise its work, so it can solve problems short chains never solve. The cost is latency, which grows with length.

Coverage, voting, and the log-linear trend

Suppose each sample is correct with probability $p$, independently. Then **coverage** $=1-(1-p)^n$, the chance at least one of $n$ is right. A perfect verifier reaches this. A majority vote converges to the model's *most likely* answer as $n\to\infty$. Its accuracy goes to 1 if that answer is correct and to 0 if not. $$\text{acc}\approx a+b\log_2(\text{tokens})$$ Why: each problem gets solved once the budget passes its own threshold. These thresholds span orders of magnitude and are spread roughly evenly on a log scale. About as many problems need 1k–2k tokens as need 2k–4k or 4k–8k. So each doubling unlocks a similar slice, until accuracy saturates.

Numbers for both strategies

Take $p=0.3$ and $n=8$: $0.7^8\approx0.058$, so coverage is $\approx94\%$. Majority vote depends on the wrong answers: - If they are scattered, each under 10%, the correct answer usually wins. - If one wrong answer has 50%, the vote picks it, and accuracy heads to 0 as $n$ grows. Log-linear: suppose accuracy is 40% at 1k tokens, 48% at 2k and 56% at 4k. Reaching 72% needs 16k tokens: 16× the tokens for +32 points.

Simulate majority vote

Answer 0 is correct with probability 0.3 in both cases. With scattered wrong answers, voting accuracy climbs with $n$. With one popular wrong answer, it collapses, even though coverage approaches 1.
import numpy as np
rng = np.random.default_rng(0)
def vote_acc(probs, n, trials=5000):  # answer 0 is correct; ties go to 0
    s = rng.choice(len(probs), size=(trials, n), p=probs)
    counts = np.apply_along_axis(np.bincount, 1, s, minlength=len(probs))
    return (counts.argmax(1) == 0).mean()
spread = [0.3] + [0.1] * 7   # wrong answers scattered
biased = [0.3, 0.5, 0.2]     # one popular wrong answer
for n in [1, 5, 25]:
    print(n, round(1 - 0.7**n, 3), vote_acc(spread, n), vote_acc(biased, n))

What to remember

**Parallel** buys more chances. It wins when single attempts sometimes succeed, answers can be voted on or checked, and latency matters. **Sequential** buys more depth. It wins when the problem needs more dependent steps than a short chain can do. Accuracy grows about linearly in log(compute). So each fixed gain multiplies the token cost by the same factor: in the example, every +8 points doubles it.

On Bytewise this lesson comes in small steps with a check at the end, and the app brings it back right before you would forget it.