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.
+ one chainjudge
trained on solutions marked right or wronghow 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
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
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