Tree-of-thought prompting: when to explore multiple solution paths
Tree-of-thought prompting (ToT) structures a model to generate and evaluate several candidate paths from an intermediate state instead of continuing a single solution in one direction. It can help when a problem requires search or planning, but it is not a general prompt that improves accuracy every time. Repeatedly generating, evaluating, and exploring candidates adds cost and latency, and the model’s self-evaluation can be wrong.
Tree-of-thought prompting (ToT) structures a model to generate and evaluate several candidate paths from an intermediate state instead of continuing a single solution in one direction. It can help when a problem requires search or planning, but it is not a general prompt that improves accuracy every time. Repeatedly generating, evaluating, and exploring candidates adds cost and latency, and the model’s self-evaluation can be wrong.
How is it different from chain of thought?
Chain-of-thought (CoT) generates one line of explanation from the input, through intermediate steps, to an answer. ToT manages several branches as a tree. Each node represents the input and a partial solution so far; each branch is a candidate next step. After evaluating candidates, the system can extend promising branches, discard weak ones, or return to an earlier state.
In 2023, Yao et al. introduced ToT as a framework for language-model inference and problem solving. An implementation makes four design choices: how to divide the intermediate process into thought steps, how to generate candidates from each state, how to evaluate the promise of each state, and which search algorithm to use. The size of a thought should fit the task. It might be one equation in a number puzzle, one word in a crossword, or a short outline in a writing task.
How does the search proceed?
**Define states and steps.** Decide what counts as one partial answer and how many steps may be needed to finish.
**Generate next candidates.** Produce several possible next thoughts from the current state. When the task has tight constraints, propose candidates one at a time to reduce duplication.
**Evaluate candidates.** Use explicit rules or a model evaluator to select states that move toward the goal. Choose criteria relevant to the task, such as correctness, constraint compliance, or progress.
**Search and backtrack.** Breadth-first search keeps several promising candidates at each step. Depth-first search follows one promising path first and returns when it gets stuck. Stop when a solution is verified or a step limit is reached.
**Verify the final answer.** Do not rely only on the model’s evaluation score; check the result against the actual rules or an independent verifier.
For example, suppose the goal in the Game of 24 is to use 4, 9, 10, 13 exactly once each with arithmetic operations to make 24. Instead of producing one answer immediately, split the first calculation into candidates, then continue promising ones based on the remaining numbers and target. One successful path shown in the paper is 13 − 9 = 4, then 10 − 4 = 6, then 4 × 6 = 24. The evaluator should check whether each step uses allowed numbers and moves toward a valid solution. At the end, verify arithmetically that the equation equals 24 and uses each input number once.
What do the research results mean?
The paper evaluated GPT-4 on three tasks requiring planning or search: Game of 24, creative writing, and 5×5 mini crosswords. On 100 difficult Game-of-24 puzzles, the reported success rates were 7.3% for standard input-output prompting, 4.0% for CoT, and 74% for ToT. In the same experiment, GPT-3.5 with ToT achieved 19%. These figures apply to the paper’s models, prompts, and task setup; they do not mean the same difference will occur for every reasoning task or current model.
The appendix also reports cases where ToT was only slightly better than CoT on general math and commonsense questions. Gains were modest when CoT already performed well or when missing external knowledge, rather than reasoning, was the bottleneck. ToT requires more computation because it generates and evaluates multiple candidates. The paper reports about 5,500 completion tokens for one Game-of-24 problem with ToT, comparable to roughly 100 CoT trials at 6,700 tokens. Evaluate whether the performance benefit justifies the extra cost for your task.
When should you choose ToT, and when should you keep it simple?
| Situation | Useful starting point | Why and what to watch |
|---|---|---|
| A clear request whose answer can be checked at once | Direct answer or CoT | A separate search tree may add little. |
| A puzzle or planning task where an early choice strongly limits later ones | A bounded ToT experiment | Comparing alternatives and revisiting a blocked branch may help. |
| A task where rules can quickly eliminate candidates | Combine ToT with rule checks | This can reduce evaluator errors and prune impossible paths early. |
| A task where fact-checking or current information is central | Source search, tools, and verification | More candidate thoughts cannot replace missing external evidence. |
Before applying ToT, limit the number of candidates, search depth, number of states retained, and stopping conditions. If evaluation is unstable, do not use the model’s self-evaluation as the sole judge; combine it with a calculator, rule checker, tests, or human review. Compare direct prompting, CoT, and ToT on the same input set and model settings. Track error types, call and token costs, and latency as well as success rate. Keep the simpler method if ToT’s benefit is not demonstrated.
Limitations to keep in mind
ToT is not a single prompt that can be reproduced by saying “think longer.” It combines candidate generation, evaluation, a search policy, and stopping conditions.
Candidate generation and self-evaluation can be wrong. For math, code, and rule-based tasks, prioritize deterministic external checks.
Too many branches increase cost; a poor evaluator can prune a promising path too early. Tune branching and evaluation rules on a small representative set first.
The paper’s high success rate comes from controlled research tasks. Real workflows have different data, goals, and failure costs, so evaluate them separately.
References
[Yao et al., Tree of Thoughts: Deliberate Problem Solving with Large Language Models (NeurIPS 2023)](https://arxiv.org/abs/2305.10601) — describes the framework’s four design elements, experiments on Game of 24, creative writing, and mini crosswords, and the added computation. Read 2026-11-22.
[NeurIPS 2023 paper](https://proceedings.neurips.cc/paper_files/paper/2023/file/271db9922b8d1f4dd7aaef84ed5ac703-Paper-Conference.pdf) — full paper and appendix with additional tasks and cost results. Read 2026-11-22.