# Tree of Thoughts

Tree of Thoughts is a reasoning framework for large language models that explores multiple thought branches in a tree structure, improving problem-solving over linear chain-of-thought prompting.

Tree of Thoughts (ToT) is a prompting and reasoning framework designed to enhance the problem-solving capabilities of large language models (LLMs). It extends the concept of chain-of-thought prompting by allowing a model to explore multiple distinct reasoning paths simultaneously. Instead of generating a single, linear sequence of thoughts, ToT maintains a tree of intermediate thoughts, systematically evaluates these branches, and uses search algorithms to navigate towards a coherent solution. This approach is particularly effective for complex tasks requiring planning, exploration, and strategic lookahead, where a single train of thought may prematurely lock in on a suboptimal strategy.

## Core Principles

The framework operates on the principle that for many challenging problems, the reasoning is not a simple path but a complex landscape of possible steps. ToT structures this as a search problem over a tree, where each node represents an intermediate thought or partial solution. The key components involve generating candidate thoughts from a given state, evaluating their promise, and searching through the space of these incomplete ideas. Unlike sampling multiple independent completions and then aggregating, ToT interleaves this generation with explicit evaluation and search, informing the next step with an assessment of what has been produced so far.

The methodology is influenced in part by classical problem-solving and planning techniques. It reframes the generation process for an LLM as a search problem akin to solving a puzzle, using heuristics to guide the exploration, a direct conceptual descendent of ideas like Depth-First Search or Best-First Search popularized in earlier eras of [artificial-intelligence](https://www.wikiprompt.org/wiki/artificial-intelligence).

## Method and Components

A typical ToT process involves several concrete stages. First is the definition of a **state** which is a partial solution, or ample context composed of prior thought steps. The system then must define a **thought generator**, which uses the model to create one or more candidate next steps. For many tasks, a single proposal (the e.g., generating a next line of a poem) is sufficient, while for others, a “propose” prompt generates several distinct potential next steps.

Next is the **state evaluator**. Each generated candidate thought is scored. The evaluation can be the same heuristic (e.g., a rule subtype) or by sampling: the LLM itself independently rates the probability that this step leads to success. This evaluation produces a qualitative value.

The final step is the **search algorithm**. The most common algorithms are Breath-First Search (BFS) where the most promising `b` states are retained at each level, and Depth-First Search (DFS) which explores one branch to its conclusion before backtracking. This explicit search and look-ahead capabilities enable the model to recover from a dead-end a crucial skill for tasks like creative writing where several open options exist.

The implementation uses a standard transformer architecture. It capitalizes on the [attention mechanisms](https://www.wikiprompt.org/wiki/transformer) that enable the LLM to parse and compare its own generated alternatives in the context window.

## Applications and Performance

The framework has shown step-change improvements on tasks that involve exploration, like the 24-point game, and on human evaluator judged tasks like creative story writing. In mathematics and logic puzzles, ToT has been shown to significantly increase the solve rate of typical [large-language-models](https://www.wikiprompt.org/wiki/large-language-model) models against direct prompting. The combination of search and limited exploration compare other inference methods (like majority voting) that typically on average over samples. The tree-structured search successfully combines the breadth of parallel sampling with the depth of chain-of-thought.

## Connection to AI Research

Tree of Thoughts is part of a broader research trend to build more deliberate and planning-capable autonomous agents. Rather than just token-by-token generation, it frames reasoning as planning. These higher-level control and search loops are typically part of [machine-learning](https://www.wikiprompt.org/wiki/machine-learning) methodology, though it leverages [deep-learning](https://www.wikiprompt.org/wiki/deep-learning) networks. Researchers expect improvements in foundation models to interlock with this structured control, and have extended the idea to wider agentic loops, where a model can use external tools or memory.

The research builds heavily on early advances in LLM prompting techniques, which first showed that with the right approach, one can explicit training to elicit reasoning capability. As such, its lineage draws from work at [google-deepmind](https://www.wikiprompt.org/wiki/google-deepmind) and [openai](https://www.wikiprompt.org/wiki/openai) in the study of prompting and emergent reasoning.

## Evaluation and Limitations

While ToT demonstrates ability, at a cost with more token usage and latency. The system for deciding thoughts and states is task-specific and not automatically inferred, requiring careful engineering of superficial steps and a plan. The improvements are less consistent on simple tasks, where the complexity is not necessary. The degree of its i is subject to ongoing assessment but confirms the importance of adding a computational of search to the output.

The internal state evaluations with task are specific but can be cast to the models own probabilistic scoring in a resource and improvement. Model using it can generate a module.

---
Source: https://www.wikiprompt.org/wiki/tree-of-thoughts
License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
Last updated: 2026-09-07T21:29:49.212179+00:00
