Tree of Thought vs. Chain of Thought Prompting
Chain of thought asks an LLM to reason in a straight line; tree of thought lets it explore, evaluate, and backtrack across multiple branches.
Tree of thought is a prompting strategy that has an LLM generate and evaluate multiple candidate reasoning paths — branching, comparing, and backtracking — instead of committing to a single linear chain of steps the way chain-of-thought prompting does. Where chain of thought produces one sequence of intermediate steps toward an answer, tree of thought explores several possible next steps at each point, scores them, and prunes the ones that look unpromising before continuing.
What chain of thought does and where it breaks down
Chain-of-thought prompting works by asking the model to “think step by step,” producing intermediate reasoning tokens before the final answer. This measurably improves performance on multi-step problems — arithmetic, logic puzzles, multi-hop questions — because it gives the model room to work through sub-problems instead of jumping straight to an answer from the prompt.
The limitation is that chain of thought is committed and linear. If the model takes a wrong turn at step two, everything built on top of that step inherits the error, and there’s no mechanism in the prompting strategy itself to notice and recover. For problems with a single, fairly direct reasoning path, this rarely matters. For problems where the right first move isn’t obvious — a puzzle with several plausible starting strategies, a proof with more than one viable approach, a planning task with genuine branching choices — a single linear chain has no way to compare alternatives or reconsider.
How tree of thought works
Tree of thought frames the reasoning process explicitly as a search over a tree of partial solutions. At a high level, it has four components:
- Thought decomposition — breaking the problem into intermediate steps small enough to evaluate individually, rather than one giant reasoning block.
- Thought generation — at each node, generating multiple candidate next steps (often by sampling the model several times with some randomness, or explicitly prompting it for distinct alternatives).
- State evaluation — having the model (or a separate scoring pass) judge which of the candidate next steps look promising, either with a numeric score or a coarse label like “sure / maybe / impossible.”
- Search strategy — a traversal algorithm, usually breadth-first or depth-first with pruning, that decides which branches to expand further and which to abandon, similar in spirit to beam search but operating over reasoning steps rather than tokens.
The practical effect is that the model can generate a promising-looking step, evaluate it, realize a few steps later that the branch isn’t working, and backtrack to try a different one — something a single linear chain-of-thought pass can’t do by construction.
A concrete shape
For a puzzle-style problem, a tree-of-thought prompt loop looks roughly like:
1. Generate 3 candidate first moves.
2. For each candidate, ask the model: "Is this move promising? sure/maybe/impossible."
3. Discard "impossible" branches. Keep top-scoring "sure" and "maybe" branches.
4. For each surviving branch, generate the next step and repeat.
5. Once a branch reaches a full solution, verify it end-to-end.
This is meaningfully more expensive than a single chain-of-thought pass — you’re running several generation and evaluation calls per level of the tree instead of one continuous generation. That cost is the central tradeoff: tree of thought trades tokens and latency for a higher chance of finding a correct path on problems where the first idea isn’t reliably the right one.
Chain of thought vs. tree of thought
| Chain of thought | Tree of thought | |
|---|---|---|
| Structure | Single linear sequence | Branching tree of candidate paths |
| Backtracking | None — errors propagate forward | Explicit — weak branches get pruned |
| Cost per query | One generation pass | Many generation + evaluation passes |
| Best suited for | Problems with a fairly direct solution path | Problems with genuine branching choices or search |
| Implementation | A prompt suffix (“think step by step”) | An explicit control loop around multiple model calls |
Where each one actually earns its cost
Chain of thought is the right default for most reasoning tasks: it’s cheap, it’s a one-line prompt addition, and it captures most of the benefit of “showing your work” for problems that don’t have meaningfully different starting strategies. Modern reasoning models effectively bake an internal, more sophisticated version of this into their own test-time compute budget, generating and revising internal reasoning before producing a visible answer.
Tree of thought earns its extra cost on problems that are structurally search problems — combinatorial puzzles, planning with multiple valid strategies, mathematical proofs where more than one approach is plausible. If a wrong early guess is expensive to recover from and there genuinely are multiple reasonable first moves, the ability to generate several, evaluate them, and prune is doing real work that a straight-line prompt can’t replicate. Because it multiplies model calls, it’s worth checking against a token cost calculator before deploying it at scale — an unoptimized tree search can burn through a token budget quickly on problems that didn’t need it.
The takeaway
Chain of thought gives a model room to reason step by step along one path; tree of thought gives it room to consider several paths, judge them, and back away from the ones that aren’t working. Default to chain of thought for straightforward multi-step reasoning, and reserve the added complexity and cost of tree of thought for problems where the branching itself — not just the depth of reasoning — is what makes the problem hard.
Tagged
Keep reading
Chisato · · 5 min read Grouped-Query Attention (GQA) Explained: MHA vs MQA vs GQA
Grouped-query attention shares key and value heads across groups of query heads, shrinking the KV cache with little quality loss. GQA vs MHA and MQA.
Chisato · · 5 min read Constrained Decoding: How LLMs Output Guaranteed JSON
Constrained decoding masks invalid tokens at each step so an LLM can only emit output matching a grammar, regex, or JSON Schema. How it works and its limits.
Chisato · · 5 min read GPT-6.1 Sol: Pricing, Benchmarks, Access vs Astra
OpenAI's GPT-6.1 Sol launched at DevDay at one-fifth of GPT-6 Astra's token price. The benchmarks, pricing tiers, safety rating, and who can use it.