# Tree of thoughts (ToT)

> Canonical: https://skillalmanac.com/glossary/tree-of-thought | Last verified: 2026-11-25 | Index status: index-eligible

Tree of thoughts is a prompting framework in which a language model explores several candidate reasoning steps, judges them, and backtracks when needed. It generalises chain-of-thought prompting from a single line of reasoning to a branching search.

Also called: tree of thought, tree of thought prompting, tree of thoughts prompting, ToT prompting, tree-of-thought.

## In plain language

Tree of thoughts means letting an AI try several routes to an answer instead of committing to the first one. Picture solving a maze on paper: you walk down one corridor, notice it is a dead end, and go back to try another. The framework has the model write out a few possible next steps, rate how promising each looks, and keep going down the best ones. It helps on puzzles that need planning or looking ahead. Generating and scoring alternatives can add token usage and latency; charges depend on the model and service. IBM notes that the setup is complex to tune and can spend effort on low-value paths.

## Technical definition

Tree of Thoughts (Yao et al., arXiv 2305.10601) frames problem solving as search over a tree whose nodes are intermediate text thoughts. The abstract says the framework generalises chain-of-thought prompting, lets the model consider multiple reasoning paths, self-evaluate choices, and backtrack, and reports results on Game of 24, Creative Writing and Mini Crosswords. IBM breaks the method into four parts: thought decomposition, thought generation, state evaluation, and a search algorithm, either breadth-first or depth-first. Generating and evaluating branches can require additional inference work; batching, pruning and implementation determine call counts, token usage and latency.

## How it shows up when you use agents

An agent can propose several approaches, compare them and revisit an earlier choice after a test fails. This is an analogy for exploring alternatives, not enough to establish that it implements formal Tree of Thoughts search. Asking for three options alone does not provide a search controller or state-evaluation procedure. The formal framework sits one step beyond [chain of thought](/glossary/chain-of-thought), which follows a single line of reasoning. The related entry on [reasoning models](/glossary/reasoning-model) covers models that produce intermediate steps by themselves.

What breaks when it is misunderstood: people expect branching to help every task. IBM lists computational overhead, implementation complexity and search inefficiency as limits. For a simple edit, extra search may be unnecessary; test its value against the added inference work rather than assuming an improvement. The other mistake is trusting the self-evaluation: the model that scores a branch is the same kind of model that wrote it.

Next action: use branching for choices with real alternatives, such as a design decision or a refactor with several routes, and have the agent write the options and its reasons before it touches files. Judge the options yourself or with an explicit scoring step, as the [idea-scoring-matrix skill](/skills/skill-almanac/idea-scoring-matrix) does for brainstormed ideas. Compare the task-specific quality and resource use with a simpler approach before adopting a search framework.

## Common confusions

- **Tree of thoughts versus chain of thought.** Chain of thought writes one sequence of steps. Tree of thoughts generates alternatives at each step, evaluates them and can backtrack, and its abstract says it generalises chain-of-thought prompting. See [Chain of thought](/glossary/chain-of-thought).
- **Tree of thoughts versus a reasoning model.** Tree of thoughts is a prompting and search framework from a research paper. A reasoning model is a model built to produce intermediate steps by itself. See [Reasoning model](/glossary/reasoning-model).
- **Brainstorming versus tree search.** Listing options is only the generation part. Tree of thoughts also scores states and searches, breadth-first or depth-first, according to IBM.
- **Better answers versus higher cost.** The paper reports gains on specific tasks. Additional search can add inference work; the resource and monetary effects depend on implementation, model and service.

## Worked examples in this catalogue

### [idea-scoring-matrix](https://skillalmanac.com/skills/skill-almanac/idea-scoring-matrix)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Supplied ideas ranked with a weighted scoring matrix and sensitivity checks. This is an analogy for evaluating alternatives, not a formal ToT implementation.

Why it exercises the concept: Scoring alternatives helps explain one component. The skill does not generate intermediate thought states or control breadth-first or depth-first search.

## Related terms

- [Chain of thought](https://skillalmanac.com/glossary/chain-of-thought.md)
- [Reasoning model](https://skillalmanac.com/glossary/reasoning-model.md)
- [Prompt engineering](https://skillalmanac.com/glossary/prompt-engineering.md)
- [Large language model (LLM)](https://skillalmanac.com/glossary/large-language-model.md)
- [Token](https://skillalmanac.com/glossary/token.md)

## Sources

- [Tree of Thoughts: Deliberate Problem Solving with Large Language Models](https://arxiv.org/abs/2305.10601), arXiv (Yao et al.) (accessed 2026-11-24)
- [What is Tree Of Thoughts Prompting?](https://www.ibm.com/think/topics/tree-of-thoughts), IBM (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
