# Tree of Thoughts (ToT)

> The model tries a few next steps. It keeps the good ones and backs out of dead ends.

**Field:** Artificial Intelligence  
**Category:** Working with AI  
**Also known as:** Tree-of-Thought Prompting, Tree of Thought

## Think of it like

It is like a maze. You try a path, and you go back when it is a dead end.

## Definition

Tree of thoughts is a way to solve a hard problem in branches. The model writes a few possible next steps, not just one. Then it judges which steps look promising. It keeps the good branches and drops the weak ones. It can go back and try another branch when one fails. A program usually runs this loop around the model.

## Example

In the 2023 paper that named it, GPT-4 solved 4% of a number puzzle with chain of thought. With a tree of thoughts, it solved 74%.

## Why it matters

Some problems need a plan and a step back. One straight line of thought cannot undo a bad first move.

## Common mistake

Using it for easy tasks. It makes many more calls, so it is slow and dear for a simple question.

## Three principles

- **Branch.** Write several next steps.
- **Judge.** Score each one before going on.
- **Back up.** Leave a dead end and try another.

## Related terms

- [Chain-of-Thought Prompting](https://learn.benibix.com/term/ai/chain-of-thought-prompting)
- [Self-Consistency (Prompting)](https://learn.benibix.com/term/ai/self-consistency)
- [Prompt Chaining](https://learn.benibix.com/term/ai/prompt-chaining)
- [Reasoning Model](https://learn.benibix.com/term/ai/reasoning-model)
- [Test-Time Compute](https://learn.benibix.com/term/ai/test-time-compute)

## Taught in

- [Chain-of-Thought Prompting](https://learn.benibix.com/learn/ai-working-with-ai/chain-of-thought-prompting): Prompt Engineering, 7/16

![Three panels. Chain of thought: one line of steps from the question to one answer. Self-consistency: five lines from the question, landing on 8, 8, 6, 8 and 9, with a vote picking 8. Tree of thoughts: a question branching into three steps, two crossed out, the third branching again to reach the answer.](https://learn.benibix.com/diagrams/ai3-reasoning-paths.svg)

---

Source: https://learn.benibix.com/term/ai/tree-of-thoughts
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
