Act 2 · The Toolbox
7. Frequency Voting
Download the frequency voting notebook (ipynb, 145 KB) ↓A longer chain of thought gives a model more room, but it is still one attempt at the problem. Ask the same question many times instead, and each attempt can reason its way there differently. Keep the answer that comes up most often, and you have frequency voting.
1. Many reasons, one answer
A teacher writes the puzzle below on the board. Twenty-five students solve it alone, each in their own way, and the teacher collects only the final answers. Sixteen say 4. The other nine are scattered across incorrect answers.
A farmyard has chickens and cows, with 10 heads and 28 legs between them. How many cows?
4 cows was the most common answer that 16 of the 25 students arrived at. Between them, they used four different reasoning approaches.
Guess and check5 students
5 cows, 5 chickens
20 + 10 = 30 legs, too many
4 cows, 6 chickens
16 + 12 = 28 legs ✓
Answer = 4 cows
A table4 students
| cows | chickens | legs |
|---|---|---|
| 1 | 9 | 22 |
| 2 | 8 | 24 |
| 3 | 7 | 26 |
| 4 | 6 | 28 ✓ |
Answer = 4 cows
Two equations4 students
c + h = 10
4c + 2h = 28
take away 2 × the first:
2c = 8, so c = 4
Answer = 4 cows
Everyone on two legs3 students
10 animals × 2 legs = 20
28 − 20 = 8 legs left over
each cow has 2 of them
8 ÷ 2 = 4
Answer = 4 cows
This is an illustrative example.
When different methods land on the same answer, it's probably right, and the nine students who got it wrong couldn't even agree with each other. But if everyone had copied one student's working, you'd only have one answer, which could be right or wrong. Asking a model the same question many times, letting it take different reasoning approaches and keeping the most common answer is majority voting, also called self-consistency.reference 1
2. Sixteen answers to the same question
Now the model is the whole class. Here are two problems: on one the vote is right, and on the other it ties. Each one went to Qwen2.5-3B-Instruct 16 times, with the same prompt every time. Every answer it came back with is tallied, like the answers on the board. Click a row to read the chains that landed there, wrong answers included, and use the arrows to step between them.
How many ways are there to put 5 balls in 2 boxes if the balls are not distinguishable and neither are the boxes?
MATH-500, level 3 · the answer is 3 · the vote returns 3 on 9 of 16 chains and it is right · drawn at random from 33 problems like it
3. Greedy decoding against majority voting
In the figure above, the 16 chains on the first problem gave 4 different answers. Each chain came from the exact same prompt, so why was the reasoning so different across them, even among chains that arrived at the same answer? Temperature is the hidden machinery behind this variation. It is a dial, written T on every chart on this page. At T = 0, every chain comes back identical, which is what is called greedy decoding. As you increase the temperature, to say 0.3, you introduce variation in the model's answers, even though the same prompt is being fed. The chart below shows how many different answers arise as you increase the temperature gradually, to 1.1.
Different answers among 16 chains, by temperature
Raising the temperature gives more different answers, but more answers do not mean better results. The chart below shows how often majority voting gets the right answer at each of the 11 temperatures from 0.1 to 1.1, in steps of 0.1, against greedy decoding, the dashed line. Step through the temperatures and you'll find the vote does best at T = 0.9. You'll also see that whichever temperature you pick, the vote at 16 chains still beats one greedy chain: it solves between 74% and 81%, against 68%. Two chains are the exception, due to tie votes. That is the only place we found majority voting doing worse than greedy decoding.
With 16 sampled chains at T = 0.9, majority voting solves 81%, 13 points above one greedy chain.
4. What majority voting costs
Majority voting is not free. Every chain is a full answer the model has to write, so each one you add costs as much as the first. Below is every chain the model wrote for the first problem in the figure above: one greedy chain, then the 16 chains the vote counted, each drawn as long as the tokens it wrote.
How many ways are there to put 5 balls in 2 boxes if the balls are not distinguishable and neither are the boxes?
greedy decoding · 259 tokens
majority voting, 16 chains at T = 0.9 · 5,722 tokens
each bar is one chain's tokens, on one scale up to the 2,048-token cap
16 chains write 9,330 tokens per problem, against 621 for one greedy chain, about 15 times as many, to go from 68% to 81%.
5. What the vote threw away
The pile knows more than the count. The right answer was somewhere in the 16 chains on 93% of these problems. The vote returned it on 81%. For the 12% in between, the model produced the right answer and the vote discarded it. This is because counting can only ever return the answer that comes up most, and on 5% of problems it could not even break a tie!