Tree-of-thought (ToT) prompting guides an LLM through multiple coherent intermediate reasoning paths instead of relying on one linear chain. It combines thought generation, evaluation, and systematic tree search for complex, exploratory, or strategic tasks. section 4.2.7
A ToT workflow progressively narrows candidate solutions:
- Generate coherent text units that represent possible intermediate decisions or reasoning steps. section 4.2.7
- Search the resulting tree with breadth-first search (BFS) or depth-first search (DFS), depending on whether level coverage or branch depth matters. section 4.2.7
- Evaluate each intermediate thought and discard impossible partial solutions, retaining candidates rated likely or sure. section 4.2.7
Game of 24
Given 4, 9, 10, and 13, ToT evaluates alternative equations while preserving viable branches. One successful path is 13 − 9 = 4, 10 − 4 = 6, and 4 × 6 = 24, yielding 4 × (10 − (13 − 9)) = 24. A GPT-4 implementation uses the tree-of-thoughts-llm package, the Game24Task task definition, generated candidates, value evaluation, and greedy selection. section 4.2.7
Figure 4.10 Illustration of how ToT can be used, where (a) corresponds to the thought generation and (b) to the evaluation of the thought. Image is taken from [4].
Use the diagram to inspect the separation between thought generation and thought evaluation, the two central stages of ToT. section 4.2.7





