Notes

Tree-of-Thought Prompting

Chain-of-thought asks a model to think out loud in a single line, straight through to the answer. Tree-of-thought prompting lets it think in branches instead — proposing several candidate next steps, judging them, and abandoning the ones that lead nowhere.

How the search runs

Introduced by Yao and colleagues in 2023, the method treats partial reasoning as a search tree built from three repeated moves:

  • Thought generation — ask the model for several distinct next steps from the current state
  • Evaluation — have the model rate each state (sure, maybe, impossible) or vote across the candidates
  • Search — expand the promising states breadth-first or depth-first, backtracking when a branch dies

The scaffolding lives in your application code, not in the prompt: it is many ordinary model calls arranged by a search loop.

Where it pays, and what it costs

It helps on problems where an early wrong commitment is fatal and partial progress can be checked. The original paper's Game of 24 task moved from 4% with chain-of-thought to 74% with tree-of-thought; constrained writing and crossword tasks improve similarly. The price is steep — dozens to hundreds of calls per question, with latency to match — so it fits offline or high-value work rather than an interactive assistant.

When to reach for something simpler

If candidate states cannot be scored partway through, the evaluation step is guesswork and the tree buys little. Self-consistency — sample several complete chains and take the majority answer — captures much of the benefit at a fraction of the complexity, and reasoning models trained to search inside their own output close more of the gap again.

Tree-of-thought prompting generates several candidate reasoning steps at each stage, has the model score them, and searches the resulting tree — expanding promising branches, backtracking from dead ends — instead of following one chain of thought. It raises accuracy sharply on problems where an early wrong commitment cannot be recovered, such as puzzles and constrained planning, at the cost of dozens of model calls per question. The search logic lives in application code, not in the prompt.

Imagine finding your way through a maze. You could walk forward confidently and hope for the best, or you could try a few turns, look ahead, and back up when a path clearly dead-ends. Most AI reasoning works the first way: one line of thought, start to finish. Tree-of-thought prompting makes it work the second way. The system suggests several possible next steps, rates how promising each one looks, follows the best, and abandons the rest. On puzzles where a single early wrong move ruins everything, this is far more reliable. The catch is effort — a hundred small steps instead of one, which takes time and costs more.