Intermediate · Generative AI
Tree of Thoughts (ToT)
Visual diagram · (in preparation) · Math · (in preparation) · Worked example · 3 difficulty levels.
TL;DR. A prompting strategy that explores multiple reasoning branches as a search tree, evaluating intermediate thoughts and backtracking when needed.
Technical Definition
A prompting strategy that explores multiple reasoning branches as a search tree, evaluating intermediate thoughts and backtracking when needed.
How it works
ToT (Yao et al., 2023) generalizes Chain-of-Thought by representing the solution as a tree where each node is a partial 'thought'. The model proposes several next thoughts at each step, scores them, and uses BFS or DFS to explore. ToT substantially outperforms CoT on tasks needing planning or look-ahead, such as Game of 24 and creative writing, at the cost of more LLM calls.
Related Concepts
- Prompt Engineering — The art of crafting effective input instructions to guide LLM behavior without changing model weights.
- Chain-of-Thought (CoT) Prompting — Asking models to show step-by-step reasoning before giving a final answer, improving accuracy on complex tasks.
- Reasoning — An AI system's ability to draw logical, multi-step conclusions from given information.
- Self-Consistency — A decoding strategy that samples multiple chain-of-thought reasoning paths and returns the majority-voted answer for improved accuracy.