Tree of thoughts (ToT)
Tree of thoughts is a prompting method in which a language model generates several possible next steps, judges them, and searches through the branches, backtracking when a path looks hopeless.
Chain-of-thought prompting has a model reason in one straight line. If an early step is wrong, everything after it inherits the mistake. Tree of thoughts, published in May 2023 by Shunyu Yao and colleagues, turns that line into a branching search. At each point the model proposes several candidate next steps, called thoughts, evaluates how promising each one is, and a search procedure decides which branches to explore further and when to go back.
The method has four parts: how to break the problem into thought-sized steps, how to generate candidates, how to evaluate them, and which search to use. The authors' official code uses breadth-first search for some tasks, keeping the best few branches at each level, and depth-first search for crosswords, following one branch deep and backtracking on failure. The evaluation is done by the model itself, either by scoring each state or by having options vote.
The headline result came from the Game of 24, a puzzle in which four numbers must be combined with basic arithmetic to make 24. GPT-4 with chain-of-thought prompting solved 4 per cent of the test puzzles. With tree of thoughts it solved 74 per cent. A similar idea appeared the same month in a paper by Jieyi Long, which used a controller, a checker and a memory module to let a model backtrack while solving Sudoku.
The cost is many more model calls. Every candidate thought must be generated and evaluated, so a tree search can use far more tokens and time than a single answer. That makes it best suited to problems where a wrong path is easy to detect and exploration pays off, such as puzzles, planning and some coding tasks, rather than everyday questions.
Tree of thoughts belongs to a wider shift towards spending more computation when a model answers rather than only when it is trained. Reasoning models trained with reinforcement learning, such as DeepSeek-R1 in 2025, show behaviours like self-reflection and verification inside a single long chain of reasoning, which overlaps with what tree of thoughts does from the outside.
It is a method where a language model explores several possible reasoning steps at each stage, rates how promising they are, and uses a search algorithm to pursue the best branches and abandon dead ends. It was introduced in a May 2023 paper by Shunyu Yao and colleagues. Chain of thought follows one line of reasoning from start to finish. Tree of thoughts generates several alternatives at each step, evaluates them and can backtrack, so one early mistake does not doom the whole answer. It is more powerful on search-heavy problems but much more expensive to run. On the Game of 24 puzzle in the original paper, GPT-4 solved 74 per cent of problems with tree of thoughts compared with 4 per cent using chain-of-thought prompting. Gains are largest on tasks that need exploration and where bad paths can be recognised early. Usually yes. Because it involves generating, scoring and searching over many candidate steps, it is normally run by a program that makes repeated calls to the model. The original authors released an official implementation, and several agent frameworks include similar search patterns.Common questions
What is tree of thoughts prompting?
How is tree of thoughts different from chain of thought?
How well does tree of thoughts work?
Do I need special software to use tree of thoughts?
Search for "tree of thoughts", "ToT prompting", "LLM tree search" or "test-time search reasoning" to find the original work and later variations. The most reliable sources are the original papers on arXiv and the authors' official code repository, along with later papers that compare search-based prompting with reasoning models on the same benchmarks. Check whether reported gains account for the extra model calls a tree search needs.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.