Two ways to make reasoning more reliable by exploring multiple reasoning paths.
A single chain-of-thought can take a wrong turn. Self-consistency samples many independent reasoning paths and takes a majority vote on the final answer.
Same CoT prompt, temperature ≈ 0.7, run N times
Path 1 → 28
Path 2 → 28
Path 3 → 31 ← outlier
Path 4 → 28
Majority answer → 28
Generalises CoT into a search: at each step the model proposes several candidate next steps, evaluates them, and explores the most promising branches (with backtracking).
Problem
/ | \
idea1 idea2 idea3 ← generate candidates
| ✗ | ← evaluate / prune
step (dead) step
| |
... solution
Good for problems where early commitment is costly: puzzles, planning, complex code design. More expensive and orchestration-heavy than self-consistency.
| Need | Technique | Relative cost |
|---|---|---|
| Better answer on a hard, single-answer problem | Self-consistency (majority vote) | N× |
| Exploration with backtracking over a search space | Tree-of-Thought | High |
| Cheap reasoning boost | Plain chain-of-thought | 1× |
1const answers = [];
2for (let i = 0; i < 7; i++) {
3 const r = await llm({ prompt: cotPrompt, temperature: 0.7 });
4 answers.push(extractAnswer(r));
5}
6const final = mode(answers); // most frequentRule of thumb: Reach for self-consistency when an answer is verifiable-but-hard and accuracy matters more than cost.