Tree Of Thought: Definition and Examples
Tree of Thought (ToT) is an advanced prompting technique that allows a language model to explore multiple reasoning paths in parallel, in a tree-like structure, before selecting the most relevant solution.
Full definition
Tree of Thought (ToT) is a prompting method inspired by human problem-solving processes. Unlike classic Chain of Thought, which follows a linear step-by-step reasoning, ToT allows the model to simultaneously explore multiple lines of thought, evaluate them, and backtrack if a branch proves unproductive.
Specifically, the model generates multiple intermediate 'thoughts' at each reasoning step, forming a tree of possibilities. Each node represents a partial state of reasoning, and the model can evaluate the promise of each branch before deciding which to pursue. This exploration and self-evaluation mechanism mirrors the human ability to consider different approaches to a complex problem.
This technique was formalized in 2023 by researchers at Princeton and Google DeepMind (Yao et al.) in their paper "Tree of Thoughts: Deliberate Problem Solving with Large Language Models." Their work demonstrated significant improvements on tasks requiring planning, strategic search, and decision-making, such as the 24 game, creative writing, and logic puzzles.
ToT can be implemented in two main ways: through carefully crafted prompts that explicitly ask the model to explore multiple branches, or via an external framework that orchestrates model calls using search algorithms like BFS (breadth-first search) or DFS (depth-first search). This flexibility makes it a powerful tool for tasks where a direct answer would be insufficient.
Etymology
The term "Tree of Thought" is a direct extension of "Chain of Thought" introduced by Wei et al. in 2022. The analogy moves from a chain (linear structure) to a tree (branched structure), reflecting the shift from sequential reasoning to multi-branch exploratory reasoning. The concept is also inspired by search trees used in computer science (decision trees, minimax algorithms) and cognitive science.
Concrete examples
Solving a complex math problem requiring multiple approaches exploration
I want to solve this problem: [PROBLEM]. Generate 3 different approaches to solve it. For each approach, develop the reasoning over 2-3 steps. Then evaluate each approach (promising, uncertain, or impossible) and continue only the most promising one until the final solution.
Strategic business decision-making with multiple options to evaluate
Our startup must choose between 3 growth strategies: [A, B, C]. For each strategy, explore the consequences at 6 months and 18 months considering risks and opportunities. Evaluate each branch on cost, feasibility, and impact criteria. Recommend the best option, justifying why the others were discarded.
Creative writing where multiple narrative directions are possible
I am working on a short story whose beginning is: [EXCERPT]. Propose 3 different narrative directions for the rest. For each, develop a continuation paragraph. Evaluate which creates the most dramatic tension and coherence with the beginning, then develop that direction in 500 words.
Practical usage
To apply Tree of Thought in your prompts, explicitly ask the model to generate multiple reasoning paths before converging on an answer. Structure your prompt in three phases: exploration (generate N approaches), evaluation (rate each approach by specific criteria), and selection (deepen the best branch). This technique is particularly effective for logic problems, strategic planning, and creative tasks where the first intuition is not always the best.
Related concepts
FAQ
What is the difference between Chain of Thought and Tree of Thought?
Can Tree of Thought be used with any language model?
Does Tree of Thought consume more tokens than a standard prompt?
See also
How to use this prompt
- Copy the prompt with the button above.
- Paste it into ChatGPT, Claude or your favorite AI assistant.
- Replace the bracketed variables with your details, then refine the result.
About Prompt Guide
Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.
More definitions
Trustworthy AI: Definition and Examples
Trustworthy AI refers to artificial intelligence designed to be reliable, ethical, transparent, and respectful of fundamental rights.
Vector Database: Definition and Examples
A vector database is a specialized database for storing, indexing, and searching numerical vectors (embeddings), enabling...
Video Understanding: Definition and Examples
Ability of an AI model to analyze, interpret, and extract relevant information from video content, combining visual, temporal, and often audio understanding.
Vision RAG: Definition and Examples
Vision RAG is an extension of Retrieval-Augmented Generation that integrates visual documents (images, charts, scanned PDFs) into the search process.
World Model: Definition and Examples
A world model is an internal representation that an AI system builds of the external world, allowing it to simulate, predict, and reason about the consequences of its actions without having to execute them in reality.
Zero-Shot Prompting: Definition and Examples
Zero-shot prompting gives the AI an instruction without any examples. Discover when and how to use this technique.
Get new prompts every week
Join our newsletter.