Self-consistency and tree-of-thought
WHY does this exist?
Plain Chain-of-Thought (CoT) prompting asks the model to "think step by step" and produce ONE line of reasoning. Problem: a single chain is a greedy walk through a huge space of possible reasonings. One early mistake dooms the whole answer, and greedy decoding has no way to recover.
WHAT are the two methods?
| Axis | Chain-of-Thought | Self-Consistency | Tree-of-Thought |
|---|---|---|---|
| Structure | 1 linear chain | linear chains | branching tree |
| Combine by | — | majority vote | search + evaluation |
| Backtracking? | No | No | Yes |
| Cost | 1× | × | can be × |

HOW self-consistency works — from first principles
Goal. We want the most probable answer , marginalizing over the hidden reasoning path :
Monte Carlo estimate. We can't enumerate all , so we sample for (that is exactly what temperature sampling does). Each chain deterministically yields an answer . Then:
Why the mode beats one sample (the math)
Suppose each independent chain is correct with probability and each specific wrong answer is less likely. By the majority-vote (Condorcet) logic, the probability the majority is correct climbs toward 1 as grows:
HOW tree-of-thought works — from first principles
ToT is CoT reframed as state-space search. Define:
- State = the prompt + partial reasoning so far.
- Thought generator = LLM proposes candidate next thoughts.
- State evaluator = LLM (or heuristic) scores "how promising is this state?" (e.g. "sure / maybe / impossible", or a numeric value).
- Search = BFS keeps the top- states per depth (beam); DFS goes deep and backtracks when says a branch is dead.
Cost. A tree of depth , branching , kept width costs roughly
which is far more than SC's calls. Trade-off: ToT buys harder-problem capability; SC buys cheap accuracy gains.
Common mistakes (steel-manned)
The 80/20 (what actually earns marks)
- SC = sample many CoT chains + majority vote, needs temperature .
- It's a Monte-Carlo estimate of the answer marginal .
- ToT = reasoning as a searchable tree with generate + evaluate + prune + backtrack.
- SC cost ; ToT cost but solves harder search problems.
Flashcards
What decoding trick does self-consistency add on top of chain-of-thought?
Why must temperature be > 0 for self-consistency?
Self-consistency is a Monte-Carlo estimate of what quantity?
Why do correct answers win the vote?
What are the three functional components of Tree-of-Thought?
Key capability ToT has that CoT and SC lack?
Cost comparison CoT vs SC vs ToT?
If single-chain accuracy p>0.5, what happens to majority accuracy as N grows?
Recall Feynman: explain to a 12-year-old
Imagine a hard homework problem. If you ask one friend, they might slip up. So you ask forty friends who each solve it their own way, then you go with the answer most of them gave — the correct answer usually shows up again and again, while wrong answers are all different, so it loses. That's self-consistency. Tree-of-thought is like solving a maze: at each fork you try a few directions, quickly check "is this leading somewhere good?", and if a path is a dead end you walk back and try another. The computer branches, checks, and backtracks instead of blindly walking straight ahead.
Connections
- Chain-of-Thought Prompting — the base technique both methods extend.
- Monte Carlo Estimation — SC is MC marginalization over reasoning paths.
- Beam Search and BFS/DFS — the search backbone of ToT.
- Ensemble Methods and Majority Voting — statistical justification for the vote.
- Temperature and Sampling in LLMs — why diversity requires temp > 0.
- Retrieval-Augmented Generation (RAG) — can supply verified facts to each branch/chain.
Concept Map
Hinglish (regional understanding)
Intuition Hinglish mein samjho
Dekho, jab hum LLM se "step by step socho" (chain-of-thought) bolte hain, toh model ek hi reasoning ka rasta pakadta hai. Problem yeh hai ki agar shuru mein hi ek chhoti galti ho gayi, toh pura answer galat. Isliye self-consistency ka idea aaya: ek hi chain par bharosa mat karo, balki temperature badha ke (yaani thoda randomness allow kar ke) N alag-alag chains sample karo, aur jo final answer sabse zyada baar aaya, wahi maan lo — bilkul majority voting jaise. Intuition simple hai: sahi answer par bahut saare raaste milte hain, lekin har galat answer apni-apni alag galti se aata hai, toh galat answers bikhar jaate hain aur sahi answer vote jeet jaata hai.
Maths side se, self-consistency actually ka Monte-Carlo estimate hai — hum reasoning ko nuisance maan ke uspe sum (marginalize) kar rahe hain, aur sampling se uska mode nikaal rahe hain. Ek important baat: temperature zero mat rakhna, warna saari chains same aa jayengi aur voting bekaar. 0.5–0.7 theek rehta hai.
Tree-of-thought thoda advanced hai. Yahan reasoning ko ek tree ki tarah socho: har node ek partial thought hai. Model har node par kuch candidate next steps banata hai (generate), phir ek evaluator score karta hai ki yeh state achhi hai ya dead-end (evaluate), bekaar branches ko prune kar deta hai, aur zaroorat padne par backtrack karke doosra raasta try karta hai. Yeh puzzles jaise Game-of-24 ya planning problems mein bahut kaam aata hai jahan galat raaste chhodne padte hain — jo simple chain kabhi nahi kar sakti.
Yaad rakho trade-off: self-consistency sasta hai (bas times run) aur accuracy free mein badha deta hai; tree-of-thought mehenga hai (bahut zyada LLM calls) lekin sach mein mushkil search problems solve karta hai. Exam ke liye 80/20: SC = sample + majority vote (temp>0), ToT = tree + evaluate + prune + backtrack.