liveBook · Manning

Tree-of-thought

As explained in Building Reliable AI Systems

A prompting method in which a language model explores and evaluates multiple reasoning paths before selecting a solution.

Tree-of-thought (ToT) prompting is useful when a decision has several plausible paths and a single chain of reasoning may overlook one. Instead of committing to the first answer, the model generates candidate approaches, evaluates their merits and drawbacks, and selects a response using stated criteria. section 2.7.7

A practical prompt can ask the model to:

  • Generate multiple possible solutions or actions. section 2.7.7
  • Evaluate each branch against the relevant circumstances, including its advantages and drawbacks. section 2.7.7
  • Select the best-supported branch using predefined criteria, then produce the final response. section 2.7.7

Damaged-TV return

For a customer asking about a damaged TV bought last month, candidate paths include a return under a 30-day policy, a warranty claim for repair or replacement, and an exception process. The appropriate answer depends on the purchase timing, warranty, and applicable policy; listing paths alone does not establish eligibility. section 2.7.7

The same pattern can support an agent weighing shipping partners, warehouse consolidation, and bulk-shipping discounts to reduce European shipping costs. Unlike ReAct’s iterative reason–act–observe cycle, ToT explores alternatives before choosing among them. Branch evaluation makes the choice explicit, but the quality of the result still depends on the criteria used. section 6.2.5 section 2.7.7

How Building Reliable AI Systems covers it

How deep it goes
Explains branch generation, evaluation, and selection, but does not specify an implementation or detailed selection criteria.
Examples
Uses a damaged-TV return and European shipping-cost decisions to illustrate competing paths.
What you can do after
Practice/perform branch generation, evaluation, and selection for customer-service or agent decisions.
How it connects
Contrasts multiple-path exploration with chain-of-thought prompting and ReAct’s iterative reason–act–observe process.

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 Building Reliable AI Systems. The section links point to the parts of the book it draws on.