Tree of Thoughts Prompting: When to Use It
Learn how Tree of Thoughts branches, evaluates and prunes, how it differs from chain-of-thought, and when extra model calls earn their place.
Published

Tree of thoughts prompting earns its extra model calls when you can judge partial solutions before finishing them. A small search can turn a 1-call baseline into 21 calls under the illustrative budget below; start with a reasoning-model baseline and add branches only for failures that search can fix.
Sources verified on 24 October 2026. Benchmark results below come only from Shunyu Yao and colleagues' original 2023 paper. The worked branches and model-call budgets are explanatory calculations, not reported production results.
Tree of Thoughts Prompting: How the Search Works
Tree of Thoughts (ToT) gives your application a way to compare unfinished solutions and choose which ones deserve more work. A large language model, or LLM, proposes next steps; an evaluator judges the resulting states; a search procedure decides what to keep, expand or abandon. Yao et al. introduced this framework in May 2023. Original paper, method.
Think of planning a route through a building. At a junction, you can inspect several corridors before committing. A blocked corridor should stop consuming effort. A plausible corridor stays available while you investigate another. The benefit comes from changing course while the decision is still cheap.
A thought is a useful unit of intermediate work. It might be an equation, a proposed crossword word or a writing plan. A state records the original problem plus the partial solution so far. The unit should be large enough to evaluate, but small enough that trying alternatives is useful.
The loop has three visible operations:
- Branch: propose distinct next steps from the current state.
- Evaluate: check each resulting state against constraints and its prospects of reaching a valid answer.
- Prune: stop expanding rejected states and spend the remaining budget on stronger candidates.
The paper combines these operations with breadth-first search, which keeps promising candidates across a level, and depth-first search, which follows a branch and can backtrack when it fails. You choose the search procedure for the task. Neither requires training a new model. Framework and search algorithms.
For a builder, the essential change is control over intermediate alternatives. Asking a model to sound thoughtful does not give your application that control.
Tree of Thought vs Chain of Thought
The difference is where you compare alternatives: within an unfinished solution, or after whole answers have been produced.
This is the distinction in Yao et al.'s background and method. Standard self-consistency samples complete chains and chooses the most frequent answer. It needs a meaningful way to recognize equivalent answers; voting on unconstrained prose is less straightforward than voting on a numeric result.
Chain-of-thought prompting can help express intermediate work. Self-consistency adds diversity across completed attempts. ToT adds a controller that can stop a weak route before paying to finish it. That controller also introduces a new failure: pruning a route that would have succeeded.
Two nearby techniques solve different problems. Few-shot prompting supplies examples of the behavior or output format you want, so it can help a generator or evaluator follow its contract. Prompt chaining connects stages, such as extracting facts and then drafting a reply. A fixed sequence of stages becomes a search only when it maintains alternatives and decides which to explore.
Use the simplest structure that addresses the failure. Inconsistent formatting calls for clearer examples or validation. Missing evidence calls for retrieval. Neither automatically calls for a tree.
A Worked Example: Branch, Evaluate and Prune
A correct intermediate equation can still lead to a dead end. That is the distinction an evaluator must recognize.
Take the paper's Game of 24 example: use 4, 9, 10 and 13, each exactly once, with basic arithmetic to make 24. The walkthrough below is constructed to show the mechanics; it is not a captured model transcript. Its viable and impossible states were checked by enumerating the remaining arithmetic combinations. Paper's example input.
Branch from the starting state
Candidate A computes
4 + 9 = 13, leaving10, 13, 13.Candidate B computes
13 - 9 = 4, leaving4, 4, 10.Both calculations are legal. The repeated numbers represent different remaining values; the state must preserve that multiplicity.
Evaluate the resulting states
Candidate A cannot reach 24 using the remaining values once each with addition, subtraction, multiplication or division. Prune it.
Candidate B has a valid continuation: subtract one remaining 4 from 10, then multiply by the other 4. Keep it.
This example uses an exact arithmetic check to make the judgment inspectable. The paper's search used model-based value estimates, which can be wrong.
Expand the surviving branch
From
4, 4, 10, consider4 + 4 = 8, leaving8, 10, or10 - 4 = 6, leaving4, 6.The first state cannot reach 24 with its remaining operation. The second can:
4 × 6 = 24. Keep that continuation and verify the completed expression.Check the final answer
(13 - 9) × (10 - 4) = 24uses every original number once and evaluates to the target. The search ends because the result passes the task's check.

For this tiny puzzle, an exhaustive solver can do the whole job; adding an LLM would be unnecessary engineering. The example teaches the loop. In an application, the useful split is often a model proposing plausible plans and code checking constraints the model should not guess.
What the Tree of Thoughts Paper Reported
The original results show that deliberate search helped on the authors' chosen tasks. They do not establish the improvement you should expect on a current production workload.
For Game of 24, the authors evaluated GPT-4 on 100 relatively hard games. Their experiments ran in May 2023. Table 2 reports these success rates:
Source: Yao et al., Table 2 and Game of 24 setup.
Breadth is the number of states retained, not the number of model calls. Generating candidates and evaluating them add work. In the Game of 24 configuration, the authors sampled each candidate's value three times. Experimental setup.
The paper also studied Creative Writing and Mini Crosswords. Those are different tasks with different evaluation methods. The practical conclusion is narrower than “ToT makes models better”: search can help when a promising intermediate direction matters and can be evaluated. A builder still needs workload-specific evidence before adding the controller.
How Many Model Calls Does Branching Add?
Count generation, evaluation and finalization separately. The evaluator can consume more calls than the candidate generator.
Here is an illustrative bounded search, independent of the paper's configuration. A call means one model request issued by your application. Assume one proposal call generates all children for a parent, while each child gets its own evaluation call. Stop after the chosen depth, with no retries or early exit, then use one final call to produce the response.
Set three children per expanded parent, retain two states after each level, and expand for three levels. The numbers of expanded parents are 1, 2 and 2. Therefore:
- Generation:
1 + 2 + 2 = 5calls. - Evaluation:
3 × (1 + 2 + 2) = 15calls. - Final response:
1call. - Total:
5 + 15 + 1 = 21calls, or 21× a 1-call baseline.
Repeat each candidate evaluation three times and the same tree becomes 5 + 45 + 1 = 51 calls. Group all candidate evaluations at each level into a single request and it becomes 5 + 3 + 1 = 9 calls. Grouping changes the evaluator's context and judgment conditions; it is an implementation option, not a promise of equal quality.
For comparison, self-consistency with five separately requested samples uses five model calls when the final vote is deterministic code. An additional model judge would add calls and change that comparison.
The general accounting rule is C = Σ nₜ(g + kv) + f. Here, nₜ is the number of parents expanded at level t, g is generation requests per parent, k is children per parent, v is evaluation requests per child, and f is finalization requests. This form assumes separate child evaluations; account for grouped evaluations directly when you batch them.
Tree of Thoughts LLM Design: Control the Search
Keep the search state and stopping rules in application code. Let the model propose and assess bounded artifacts you can inspect.
The wall this architecture hits is evaluator quality. If your evaluator cannot distinguish a viable partial solution from a persuasive dead end, expanding more branches only gives it more opportunities to choose badly.
Define an inspectable state
For a constrained scheduling feature, a state could contain assigned jobs, remaining jobs, occupied slots and unmet constraints. Define the next thought as a proposed assignment. Store the state, candidate identifier, parent identifier and evidence separately.
Choose an artifact that can be checked at the current stage. A vague paragraph about having a good strategy is difficult to prune reliably.
Give generation and evaluation different jobs
A generator instruction can be: “Propose distinct next assignments from this state. Return the assignment and updated state for each candidate. Preserve the listed constraints.”
An evaluator instruction can be: “Check each candidate against the constraints. Return its identifier, any violated constraint and whether continuation is feasible, uncertain or ruled out. Cite the state fields supporting the judgment.”
Use deterministic checks first for rules such as overlapping slots or missing required fields. If you need model judgment, validate it against known cases using an LLM-as-a-judge evaluation process.
Make pruning and the budget explicit
Reject states that violate a hard constraint. Rank the remaining candidates, retain a bounded frontier and remove duplicate states. Keep uncertain candidates available when the budget permits; an evaluator's low confidence is not proof that a branch is impossible.
Enforce request, depth, token and elapsed-time limits in the controller. Include evaluation and retries in those limits. Record what was discarded and why so you can inspect cases where pruning removed the successful route.
Verify before accepting or acting
Use a terminal check, such as all scheduling constraints satisfied or the relevant software tests passing. If no candidate qualifies before the budget ends, return an unresolved result or route it for review.
Keep branch exploration in a sandbox or as proposed actions. A speculative scheduling branch should not send invitations. A coding branch should not deploy changes while the controller is still comparing candidates.

Measure the evaluator as well as the final answer. A wrong rejection can permanently remove the useful branch. A wrong acceptance can spend the rest of the budget expanding a dead end. Those failures need different fixes.
When a Reasoning Model Makes ToT Unnecessary
External ToT is unnecessary when a reasoning model already meets your quality and latency requirements, and your application does not need to control intermediate alternatives.
A reasoning model performs internal work before answering. Anthropic's current prompting guidance recommends giving its thinking models general goals rather than prescribing every reasoning step. That supports starting with a clear task, constraints and acceptance criteria. It does not establish that a named model implements Yao et al.'s ToT algorithm internally. Anthropic prompting guidance.
For a builder adding a small code transformation, first try a suitable reasoning model and run the result through the relevant tests. If the baseline meets the release criterion, an external tree adds state management, evaluation and failure handling without an established benefit.
Keep external search on the table when your application has something extra to contribute: a simulator, a constraint checker, isolated test environments or a requirement to preserve distinct candidate plans. A stronger model can still serve as the generator inside that search. Model reasoning and application-controlled search are separate design choices.
The decision is empirical: keep the tree only if it improves verified outcomes enough to justify its measured resource use. A longer answer or more elaborate trace is not the success criterion.
What's Overhyped About Tree of Thoughts
A prompt that asks imaginary experts to debate does not, by itself, provide a controlled tree search. It may produce alternatives, but a production ToT implementation needs explicit state, evaluation, branch selection and a stopping policy. If these live only inside a single completion, you cannot assume the search you described was executed as intended.
The other overstatement is that more branches guarantee a better answer. Branches can repeat the same idea. A judge can share the generator's mistaken assumption. An early prune can discard the only useful continuation. Confidence language does not replace a task check.
Finally, the paper's strongest Game of 24 result is not evidence that every business workflow needs ToT. A document extractor with a schema mismatch may need better examples and validation. A support assistant missing a policy may need the right source. Searching more paths through the same missing information does not supply the missing fact.
Use search for alternative decisions that you can evaluate. Fix missing context and broken contracts directly.
What to Change in Your Build This Week
Act now if your failed cases contain recoverable early choices and you have a credible way to score the intermediate states. Examples include candidate code changes checked in isolated environments or plans tested against explicit scheduling constraints. Start with a narrow route for those cases and a fixed search budget.
Wait if you cannot yet say why one partial solution is better than another. Build a set of acceptable and unacceptable states, check the evaluator's decisions, and improve that judgment before widening the tree.
You are largely unaffected if the workflow is straightforward extraction, classification or a fixed sequence that already meets its acceptance criteria. Keep its simpler structure.
The Monday move is concrete: take failures from your current chain-of-thought workflow and compare a reasoning-model baseline with a bounded ToT variant on the same held-out tasks. Keep the final verifier unchanged. Record accepted outcomes, model calls, tokens, latency and cases where pruning removed a successful path. Adopt the search only for the task slice where those results support it.
Tree of Thoughts Questions
Is reasoning the same as Chain-of-Thought?
Reasoning is the broader capability of working through a problem. Chain-of-thought is a prompting approach that uses intermediate steps. A model can perform internal reasoning without printing those steps in its answer.
What is a tree in AI?
A tree represents states and possible next actions. A node is a state, and its children are alternatives reached by taking another step. In ToT, those states represent partial solutions.
What is the tree of reasoning?
In this context, it means organizing alternative partial solutions as branches, evaluating them and choosing which to continue. Yao et al.'s specific framework is called Tree of Thoughts.
What is tree of thought prompting?
It uses a language model to propose and evaluate intermediate alternatives, combined with a search procedure that selects which states to expand. The practical benefit is being able to reconsider a decision before completing the whole answer.
What are the three C's of prompting?
Yao et al.'s ToT algorithm does not define a three-C rule. That mnemonic is not its specification; the paper describes thought decomposition, generation, state evaluation and search.
What are the key differences between a chain of thought and a tree of thought?
Standard CoT produces one continuous reasoning path. ToT explicitly considers alternative partial paths and evaluates them during search. Self-consistency differs again: it samples complete paths and aggregates the final answers.
Can you give me an example of chain of thought prompting?
A worked arithmetic demonstration could show 13 - 9 = 4, then 10 - 4 = 6, then 4 × 6 = 24. Providing such intermediate steps as an example illustrates CoT. Comparing alternative steps and deciding which branch survives adds the ToT search mechanism.
What is Chain-of-Thought in simple terms?
It connects a question to its answer through intermediate steps, such as calculations or deductions. Those steps can make the task easier to follow, but they can still contain mistakes.
How does Chain-of-Thought actually work?
In the standard prompting setup, a model generates a sequence of intermediate steps conditioned on the problem and earlier generated text, then produces an answer. That sequence alone supplies no independent check of correctness and no application-managed search frontier.
Subscribe to the newsletter for practical guides to building dependable AI workflows.
- Published
- Category
- Build
- Language







