liveBook · Manning

Tree-of-thought

As explained in AI Agents and Applications

Tree of thought is a reasoning technique that lets a language model explore, evaluate, refine, and backtrack across multiple reasoning paths.

Tree of Thought (ToT) is a reasoning technique that organizes language-model problem solving into multiple coherent paths. The model can explore alternatives, evaluate them, refine promising options, and backtrack instead of committing token by token. section 2.5.6

ToT is useful when a task requires deliberate planning rather than a single direct answer:

  • Explore multiple reasoning paths before choosing an approach. section 2.5.6
  • Evaluate and refine intermediate options as the solution develops. section 2.5.6
  • Backtrack when an earlier choice leads to a poor result. section 2.5.6
  • Apply the approach to strategic tasks such as Game of 24, creative writing, and mini crosswords. section 2.5.6

Game of 24

ToT helped GPT-4 solve 74% of Game of 24 problems, compared with 4% using Chain of Thought, illustrating the potential value of exploring and revisiting alternatives. section 2.5.6

Table 2.2 In-context learning prompts
In-context learning technique
Explanation
Zero-shot learning
No example is provided in the prompt.
One-shot learning
One example is provided in the prompt.
Two-shot learning
Two examples are provided in the prompt.
Few-shot learning
A number of examples are provided in the prompt.
Chain of Thought (CoT)
A number of examples are provided in the prompt, and for each example, all the logical steps to achieve an objective are clearly explained.

Compare ToT with Chain of Thought: the prompt reference defines CoT through examples whose logical steps are explicitly explained. section 2.5.6

How AI Agents and Applications covers it

How deep it goes
Defines exploration, evaluation, refinement, and backtracking but does not specify an implementation procedure.
Examples
Uses Game of 24, creative writing, and mini crosswords as application examples.
What it assumes
Contrasts with Chain of Thought and assumes familiarity with language-model prompting and in-context learning.
What you can do after
Evaluate when multiple reasoning paths and backtracking may improve a language-model solution.
How it connects
Connects to Chain of Thought, in-context learning, planning, backtracking, and strategic decision-making.

Also explained in

Compare how 6 books explain Tree-of-thought →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents and Applications. The section links point to the parts of the book it draws on.