## Definition **Tree of Thought** (ToT) is a reasoning strategy that turns problem-solving into an explicit search over a tree: at each step the model generates several candidate next "thoughts", evaluates them, and expands only the promising ones — pruning the rest. Where [[Chain-of-Thought]] commits to one linear path, ToT keeps several alive and chooses among them. ## The shape of the search ```text problem / | \ t1 t2 t3 generate candidate thoughts ✓ ✗ ✓ evaluate each (keep / prune) / \ / \ ... ... ... ... expand survivors ``` Three ingredients make a tree: 1. **Branching** — at a node, propose *k* alternative next steps. 2. **Evaluation** — score each branch (the model judges its own partial solutions, or a heuristic does). 3. **Pruning / selection** — drop weak branches; expand the best via breadth- or depth-first search. ## A combination of two ideas you already have ToT is best understood as **self-evaluation plus prompt chaining**. The chaining gives you the multi-step expansion (each thought conditions the next); the self-evaluation gives you the per-node scoring that decides which chains are worth continuing. Lanham presents it in *[[AI Agents in Action - Micheal Lanham]]* as exactly this composition — the agent reasons forward and grades itself as it goes, backtracking when a branch looks dead. It generalises [[Self-Consistency]], which only votes at the very end, by letting evaluation steer the search throughout. ## Powerful but expensive The strength of ToT — exploring alternatives instead of betting everything on one path — is also its cost. A single answer can require **dozens of LLM calls**: generation at every node and evaluation of every candidate, multiplied across the tree's depth and breadth. That makes it a heavy [[Test-Time Compute]] method, justified for genuinely hard problems (puzzles, planning, math) where a wrong first step dooms a linear chain, and wasteful for routine queries a single chain-of-thought would nail. ## Where it fits ToT is a natural engine for [[Agent Planning]]: searching the space of action sequences is precisely tree search, and per-node evaluation lets you reject infeasible plans before executing them. As a rule of thumb, escalate along the ladder — chain-of-thought for most tasks, self-consistency when you can afford a few extra samples, tree of thought when the problem rewards real search and you can pay for it. ## Related - [[Chain-of-Thought]] - [[Self-Consistency]] - [[Agent Planning]] - [[Test-Time Compute]] - [[AI Agents in Action - Micheal Lanham]]