Act 2 · The Toolbox

8. Best-of-N and Verifiers: Generate, Then Select

Download the Best-of-N notebook (ipynb, 30 KB) ↓

Chain of thought lets a model reason through a problem step by step. Majority voting samples many of those chains and keeps the answer that comes up most often. But what if, instead of counting answers, we checked each one against a clear standard and kept the best? That approach is called Best-of-N sampling.

1. Generate, judge, keep the best

Best-of-N works in three steps: the model writes several chains of thought for the same question, a judge rates each chain on its own, and the chain with the highest rating is kept. Press Play to watch it on a small puzzle.

When I was 6, my sister was half my age. Now I'm 70. How old is my sister?

Step 1. The model answers the same question 4 times. Each answer is its own chain of thought, written without seeing the other 3.

Press Play.

Step 2. A judge, a second model, reads one chain at a time. Only the outcome is scored.

question
+ one chain
judge
trained on solutions marked right or wrong
how likely
it is right

Step 3. Keep the chain the judge rates highest.

This is an illustrative example.

That is the whole method. In the words of the paper that introduced it, you “generate many candidate solutions and select the one ranked highest by the verifier.”reference 1 The verifier is the judge: a second model, trained on solutions marked right or wrong.

2. Best-of-N on 100 problems

The same method on 100 real problems. For each one the model wrote 16 chains of thought, the judge rated every chain, and Best-of-N kept the one rated highest. Each dot below is one problem, placed by how many of its 16 chains are right and coloured by whether the kept chain was right.

  • measured
  • Qwen2.5-3B-Instruct
  • 100 MATH-500 problems, 16 chains each
  • kept chain right
  • kept chain wrong, a right one was written
  • no right chain written
012345678910111213141516chains right, of 16
On 36 problems every chain is right, so any pick works. On 7 none is, so there is nothing for the judge to find. The judge matters in the 57 between: there the kept chain is right on 47. Of its 10 misses, 4 had only one right chain to find.

3. Chain of thought, majority vote, Best-of-N

Three ways to answer the same 100 problems from the same chains: take one chain of thought, take the answer most of the 16 agree on, or take the chain the judge rates highest. Both ways of choosing need the chains to differ: with no randomness the model writes the same chain 16 times, and there is nothing to count or to judge.

  • measured
  • 100 problems
  • all three read the same chains
0%25%50%75%100%one chain of thought68% · 68 of 100majority vote over 1681% · 81 of 100Best-of-1683% · 83 of 100at least one chain was correct: 93.0%share of 100 problems solved
Both ways of choosing beat one chain. Best-of-N fixes 16 problems one chain got wrong and breaks 1; the vote fixes 13 and breaks 0. Against each other they are level: they disagree on only 10 problems, 6 going to Best-of-N and 4 to the vote, which is not a difference. And neither reaches the dashed line: the faint stretch past each bar is problems where a right chain was written and not picked.

Best-of-N costs what majority voting costs, 16 chains, plus a second model that reads each of them once.

4. Where this leaves us

Choosing works: majority voting and Best-of-N both solve more problems than one chain of thought. Against each other they finish level, and voting gets there without a second model.

That comparison is ours: self-consistency and Best-of-N are introduced in different chapters of the source we build onreference 2 and are never set against each other there.

A right chain was written on 93% of problems. Majority voting returns the right answer on 81% and Best-of-N on 83%, so a judge recovers only a little of what counting discards.reference 3