jongkwan.dev
Development · Essay №042

Tree of Thought (ToT)

A reasoning technique that explores several paths at once instead of one, then picks the best solution

Jongkwan Lee2026년 2월 2일5 min read
Contents

Multi-path reasoning that branches out like a tree

Concept

Unlike Chain of Thought, which follows a single path, Tree of Thought (ToT) explores several possible paths at once and selects the most promising one.

Structure

The diagram below shows the flow: the problem branches into several approaches, failed branches are discarded, and only the promising branch is explored more deeply.

CoT vs ToT

CoTToT
Single pathMultiple paths
Stops on failureBacktracks on failure
FastSlow (search cost)

How it works

  1. Generate several possible next steps
  2. Evaluate how promising each step is
  3. Keep exploring the promising paths
  4. Discard dead ends
  5. Repeat until success

Example: the Game of 24

Given the numbers 3, 3, 8, 8, make 24.

  • Method 1: 3+3+8+8=223+3+8+8 = 22 -- failure
  • Method 2: 3×8=243 \times 8 = 24 -- the remaining 3 and 8 cannot be handled -- failure
  • Method 3: 8/(38/3)=248/(3-8/3) = 24 -- success

The diagram below expands the three methods into a tree, showing two paths hitting dead ends and being discarded while one reaches 24.

Performance gain

The original ToT paper (Yao et al. 2023, arXiv:2305.10601) measured the following success rates on the Game of 24 with GPT-4.

  • CoT: 4%
  • ToT: 74% (roughly an 18x improvement)

Search strategies

ToT can use several search strategies.

  • Expands every candidate equally, level by level.
  • Example: Level 1 = A, B, C -> Level 2 = A1, A2, B1, B2, C1, C2
  • Advantage: hard to miss a solution, and short paths are easy to find.
  • Digs one path to the end, then backtracks on failure.
  • Example: A -> A1 -> A1-1 (failure) then A -> A2 -> A2-1 (success)
  • Advantage: uses less memory and validates a promising path quickly.

Prioritizes candidates by their promise score.

CandidateScoreSearch order
A0.91
B0.72
C0.33

Evaluating promise

Ways to evaluate how promising a node is:

Value prompting

  • Example question: "What is the probability of solving the problem from this state?"
  • Output format: score each candidate state on a 1-10 scale

Vote prompting

  • Example question: "Which of the following states is the most promising?"
  • Candidates: A: state 1, B: state 2, C: state 3
  • Decide the next path by majority or weighted vote

When to use ToT

SituationRecommended technique
Simple reasoningCoT
Problems with clear stepsCoT
Problems with several viable approachesToT
Problems that require searchToT
Problems where another approach must be tried on failureToT

Cost-performance trade-off

TechniqueAPI call costProblem-solving performance
CoTLowModerate
ToTHighHigh (strong on complex problems)

ToT requires more API calls, but on complex problems that cost is worth paying.

Limitations

  1. Compute cost: exploring several paths raises cost
  2. Evaluation accuracy: the promise estimate can be wrong
  3. Search space: a search space that is too large becomes inefficient

An extension: LATS

LATS (Language Agent Tree Search), an extension of ToT, adds the following:

  • ReAct (external tool use)
  • Reflexion (learning from failure)
  • Monte Carlo Tree Search (more efficient search)
  • Chain of Thought (CoT): single-path reasoning
  • LATS: ToT + ReAct + Reflexion combined
  • Monte Carlo Tree Search: a search algorithm used in game AI

Summary

Instead of following one path, ToT generates several candidate paths, evaluates how promising each node is, and backtracks away from hopeless branches. On problems that require search, such as the Game of 24, the success rate rises sharply over CoT, but candidate generation and evaluation add API calls and therefore cost. So simple reasoning with clear steps belongs to CoT, and problems where several approaches must be tried and another route found on failure belong to ToT. When the search space is too large or the promise estimate is inaccurate, efficiency drops. The strategy (BFS/DFS/best-first) and the evaluation method therefore have to be matched to the problem.