Sampling several answers and voting
- : how many independent samples are drawn.
- : the final answer extracted from sample .
Ask the same question times at a non-zero temperature, take the answer that appears most often, and discard the reasoning that led there.
The chains differ. The answer, if the model knows it, tends not to, and that asymmetry is what the method exploits.
Why it works when the model is better than chance
- : the probability that one sample is right.
With and , the majority is right about 75 percent of the time, and the gain comes from nothing but repetition.
If , voting makes it worse.
That is the warning. Below a coin flip, the majority converges on the wrong answer faster than a single sample would.
Errors must also be independent for the count to mean anything. A model that fails the same way every time will agree with itself confidently and be wrong.
One question, in order
- Write the prompt so it asks for reasoning before the answer.
- Sample completions at a temperature around 0.7, not 0.
- Extract the final answer from each completion by a fixed rule.
- Count the distinct answers.
- Return the most common one, and use its share as a confidence signal.
Gains rise steeply to about ten samples and flatten after twenty, so the usual choice is between five and twenty depending on what the answer is worth.
What it costs, and where it does not apply
Ten samples cost ten times as much and take as long as the slowest one, which is why this is reserved for high-value questions rather than used everywhere.
Temperature 0 defeats it entirely. Identical samples cannot disagree, so there is nothing to count.
Free-form text breaks it too, because no two samples are identical.
The method needs answers that can be compared for equality, which makes it natural for arithmetic, multiple choice and extraction, and awkward for essays or code.
For open-ended output the usual substitute is to generate candidates and have a model pick the best, which is a judge rather than a vote and carries the judge's biases.
The vote share is the useful by-product.
A question where eight of ten samples agree is in a different state from one where three answers tie, and that is a better confidence estimate than the model's own stated certainty.