Tree of Thoughts

  • Reasoning
  • Research term
3 steps

Tree of Thoughts is a 2023 research method where an AI explores a problem by branching into several possible next steps, scoring each branch, following the promising ones, and backing out of dead ends.

The scoring comes from the model too. Shown a partial solution, it is asked whether the rest can still work out, with answers like sure, likely, or impossible. Branches judged impossible are dropped, which keeps the number of paths from growing out of reach.

Where you’ll meet it

You ask your assistant to seat sixty wedding guests at tables of eight. Couples sit together, two feuding cousins sit apart, and the grandparents need a table near the door. Every plan it writes breaks at least one rule, usually at the last few tables.

What to do

Ask a coding agent to build the search around the model. Its short program asks the model, in separate requests, for a few ways to seat the next table, keeps only the ones that leave every rule still possible, and goes back a table when none do.

Easy to mix up

In chain-of-thought, the model keeps track of its options inside one written line of reasoning. In Tree of Thoughts, a program around the model tracks the branches across many separate requests.

Check yourself

Which of these tasks gives a Tree of Thoughts search more to work with?

Go deeperIts tests were puzzles, and an outside program can steer the search

Yao and colleagues presented the method at NeurIPS 2023, a major machine-learning conference, and tested it on puzzles such as the Game of 24, where four numbers must be combined to make 24. With step-by-step prompting, their model solved 4 percent of the test puzzles; with the tree search, it solved 74 percent, though each puzzle took many more requests.

Reasoning models, which write out long reasoning before they answer, now try and abandon approaches within one reply. The outside search keeps some advantages. Because each branch is its own request, a program can set how many branches to keep, check them with ordinary code where a rule is exact, and log every path it dropped.

Practice Modern AI

Or take the learning quiz on a mix of every set