Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 1.24 KB

File metadata and controls

35 lines (29 loc) · 1.24 KB
title status authors based_on category source tags
Tree-of-Thought Reasoning
established
Nikola Balic (@nibzard)
Yao et al. (2023)
Orchestration & Control
branching
deliberate-reasoning
search

Problem

Linear chain-of-thought reasoning can get stuck on complex problems, missing alternative approaches or failing to backtrack.

Solution

Explore a search tree of intermediate "thoughts" instead of a single chain. The agent expands multiple possible steps and evaluates partial solutions before committing to a path.

queue = [root_problem]
while queue:
    thought = queue.pop()
    for step in expand(thought):
        score = evaluate(step)
        queue.push((score, step))
select_best(queue)

How to use it

Apply when tasks benefit from exploring many potential strategies—puzzles, code generation, or planning. Use heuristics or a value function to prune unpromising branches.

Trade-offs

  • Pros: Covers more possibilities; improves reliability on hard tasks.
  • Cons: Higher compute cost; needs a good scoring method to guide the search.

References