Self-Consistency is a decoding strategy that samples multiple chain-of-thought reasoning paths from the LLM and selects the final answer by majority vote. By generating diverse reasoning traces and aggregating results, it reduces errors from any single reasoning path.
At a Glance
- Problem: Sampling at any temperature above zero can return a different answer each time, and for tasks with one correct answer you cannot tell from a single response whether it landed on the right one.
- Forces: Reliability versus cost that scales linearly with sample count; enough temperature for diverse reasoning paths versus samples too noisy to trust individually; parallel calls that hold latency down versus extra infrastructure to build.
- Solution: Send the same chain-of-thought prompt several times with temperature above zero, extract and normalize the final answer from each sample, and return the answer that appears most often.
- Consequences: Gains: random reasoning errors cancel out on tasks with extractable answers. Costs: one API call per sample, answer normalization and tie handling, and no help against systematic bias, where the vote confidently agrees on a wrong answer.
What problem does Self-Consistency solve?
Language models are stochastic. Ask the same question twice with any temperature above zero and you might get two different answers. One might be correct and the other plausible but wrong, and a single response gives you no reliable way to tell which is which.
For creative tasks the randomness helps, since you want variation when brainstorming or writing fiction. For tasks with a definitive correct answer, like math problems, factual questions, or logical deductions, it works against you. Every API call is a roll of a die, and sometimes the die lands on the wrong face.
The problem gets worse when tasks involve multiple reasoning steps. Each step introduces its own chance of error. A five-step reasoning chain where each step has 90% accuracy only produces the correct final answer about 59% of the time. One bad step anywhere in the chain can derail the entire result. A single call leaves you exposed to every one of those failure points.
How does Self-Consistency work?
Self-consistency rests on a simple idea. If you ask multiple people the same question independently and most of them agree on the answer, that answer is probably correct. The same logic applies to multiple samples from a language model.
You send the same prompt to the model multiple times with a temperature above zero, generating several independent responses. Each response follows its own reasoning path and arrives at its own answer. You extract the final answer from each response and pick the one that appears most frequently.
It works best combined with Chain-of-Thought prompting. Each sample generates a full reasoning trace, not just a bare answer. Different samples will take different reasoning paths. Some paths will contain errors, but the errors tend to be different across samples. The correct answer, on the other hand, can be reached through many valid reasoning paths. So the correct answer shows up more often than any particular wrong answer.
Diverse samples let the errors cancel out. A single wrong answer might be convincing on its own, but when five out of seven samples agree on a different answer, you have strong evidence that the majority is right. The same randomness that caused the problem supplies the diversity the vote needs.
When should you use Self-Consistency?
Self-consistency pays off most when the task has a clear, extractable answer: math problems, multiple-choice questions, yes/no decisions, classifications with a fixed label set, or anything else where you can unambiguously identify and compare the final answers across samples.
It works well on reasoning-heavy tasks where Chain-of-Thought is already improving accuracy. CoT gets you part of the way there by making the model show its work. Self-consistency gets you further by aggregating across multiple reasoning attempts.
Use it when correctness matters more than speed or cost. If a wrong answer has serious consequences and you can tolerate higher latency and API costs, self-consistency is a straightforward way to buy reliability.
It is less useful for open-ended generation tasks. If you ask the model to write an email, there is no single correct answer to vote on. Each sample will be different in legitimate ways, and "majority vote" does not have a clear meaning. Similarly, if the task is so easy that the model gets it right on the first try nearly every time, self-consistency adds cost without adding value.
When not to use it: Skip it when the model errs systematically on a problem type, since more samples only produce a confident majority for the wrong answer; fix the prompt, supply missing context with Basic RAG, or verify results with Code Execution instead. On high-volume or latency-sensitive paths where you cannot run samples in parallel, the multiplied cost and latency rarely pay off; use Chain-of-Thought alone, or sample only when a Self-Check flags low confidence.
Worked Example: Cost and Latency
A grading service checks 10,000 math answers a day with the large model. Assume a 300-token Chain-of-Thought prompt, a 400-token reasoning trace per sample, and seven samples, inside the five-to-ten range this page suggests.
| Setup | Calls per request | Tokens per request (in / out) | Cost per 1,000 requests | Latency per request |
|---|---|---|---|---|
| Single Chain-of-Thought call | 1 | 300 / 400 | $6.90 | ≈ 7.2 s |
| Self-Consistency, 7 samples in parallel | 7 | 2,100 / 2,800 | $48.30 | ≈ 7.2 s |
| Self-Consistency, 7 samples in sequence | 7 | 2,100 / 2,800 | $48.30 | ≈ 50.2 s |
One sample costs 300 input tokens × $3.00 per million = $0.0009 plus 400 output tokens × $15.00 per million = $0.006, so $6.90 per 1,000 requests. Seven samples cost seven times that: $48.30 per 1,000, or about $483 a day at 10,000 requests versus $69. Latency per sample is 0.5 s + 400 / 60 s ≈ 7.2 s. Parallel calls take the max, so latency stays at about 7.2 s; sequential calls add up to 7 × 7.2 s ≈ 50.2 s.
Seven-way voting is worth roughly 4 cents more per request when a wrong answer costs much more than that and the calls can run in parallel; when the model already gets the answer right nearly every time, the extra $41.40 per 1,000 requests buys little.
What are the common pitfalls?
The most fundamental failure is systematic bias. If the model consistently gets a particular type of problem wrong, generating more samples will not help. You will get a confident majority vote on the wrong answer. Self-consistency corrects for random errors, not systematic ones. If there is a flaw in how the model understands the problem, all samples will share that flaw.
Answer extraction is harder than it looks. Different samples may express the same answer in different ways. "42," "the answer is 42," "forty-two," and "approximately 42.0" are all the same answer, but naive string matching will treat them as four different responses. You need a reliable extraction and normalization step. If it is wrong, it quietly undermines the whole technique.
No single sample count suits every task. Too few samples and the vote is unreliable. Too many and you are burning tokens for diminishing returns. For most tasks, five to ten samples is a reasonable starting point, but the best number depends on the difficulty of the task and the baseline accuracy of the model.
Temperature selection is another tuning knob. Too low and all samples will be nearly identical, defeating the purpose. Too high and the samples become unreliable individually, which can reduce the quality of the aggregate. You want enough diversity for different reasoning paths without introducing so much noise that the samples are nonsensical.
What are the trade-offs?
Cost scales linearly with the number of samples. If you generate seven samples, you pay for seven API calls. For high-volume applications, this can be too expensive. Work out whether the accuracy improvement justifies the multiplied cost; the answer depends on what a wrong answer costs your users or your business.
Latency depends on your infrastructure. If you can make all the API calls in parallel, latency is roughly the same as a single call (bounded by the slowest response). If you must make them sequentially, latency multiplies just like cost. Run them in parallel whenever you can.
Self-consistency does not improve the model's ceiling. It cannot produce correct answers that none of the individual samples would have produced. It filters noise from a distribution that already contains the right answer somewhere. If the model cannot solve the problem at all, more samples will not help.
There is also an implementation complexity cost. You need to handle multiple API calls, extract answers from each response, normalize them for comparison, implement the voting logic, and handle edge cases like ties. None of this is difficult, but it is infrastructure that you need to build and maintain.
Goes Well With
Chain-of-Thought is the usual pairing. CoT generates diverse reasoning paths, and self-consistency aggregates across them. Without CoT, the model's direct answers may not vary enough across samples for the vote to be meaningful.
Reflection offers a different approach to the same goal. Where self-consistency uses parallel samples and voting, reflection uses sequential iteration and critique. You could combine both: generate multiple samples, vote on the best answer, and then run a reflection loop to verify and refine the winner.
LLM-as-Judge offers a different way to aggregate than majority vote. Instead of counting which answer appears most often, you have a judge model evaluate each sample's reasoning and select the best-argued answer rather than the most common one. It costs more but can be more accurate when the samples are close.
References
- Wang, X., et al. (2023). Self-Consistency Improves Chain of Thought Reasoning in Language Models. ICLR 2023. arXiv
Further Reading
- Wang et al., "Self-Consistency Improves Chain of Thought Reasoning in Language Models" (2022). Introduces the idea of sampling multiple reasoning paths and taking the majority answer, showing large accuracy gains over single-path chain-of-thought. arXiv:2203.11171