Tree of Thoughts: Deliberate Problem Solving with Large Language Models logo

Tree of Thoughts: Deliberate Problem Solving with Large Language Models

Free

Deliberate reasoning via tree search over thoughts

FreeFree tier
Inputs: textOutputs: text
Type
Open Source

About Tree of Thoughts: Deliberate Problem Solving with Large Language Models

Tree of Thoughts (ToT) is a framework that enhances large language model (LLM) reasoning by enabling deliberate exploration over multiple intermediate reasoning paths. Unlike standard chain-of-thought prompting, ToT treats reasoning as a search over a tree of thought units, where the LLM generates and evaluates candidate thoughts at each step, using breadth-first or depth-first search to arrive at better solutions. The approach is particularly effective for tasks requiring planning, exploration, and strategic lookahead, such as mathematical problem-solving, creative writing, and puzzle solving. The paper introduces this method and demonstrates its superiority over traditional prompting techniques on several benchmarks.

Key Features

Explores multiple reasoning paths in a tree structure
Uses breadth-first or depth-first search over thought sequences
Incorporates self-evaluation of intermediate states
Allows backtracking and exploration of alternative strategies
Integrates with any autoregressive language model

Pros & Cons

Pros
  • Significantly improves accuracy on complex reasoning tasks compared to chain-of-thought
  • Enables systematic exploration and backtracking for better solutions
  • Provides interpretability through explicit thought paths
  • Flexible – can be adapted with different search strategies and evaluation heuristics
Cons
  • Higher computational cost due to multiple LLM calls per problem
  • Requires careful design of thought decomposition and scoring functions
  • Performance depends on the quality of the LLM’s self-evaluation
  • May not scale well to very deep search trees without pruning

Best For

Mathematical reasoning and problem solvingCreative writing tasks (e.g., story generation)Puzzle solving (e.g., Game of 24, crosswords)Planning and decision-making with multiple steps

FAQ

What is Tree of Thoughts?
Tree of Thoughts (ToT) is a prompting framework that allows large language models to explore multiple reasoning paths simultaneously by treating intermediate steps as nodes in a tree and using search algorithms like BFS or DFS to find better solutions.