How it works
Tree of thoughts is a reasoning technique in which the model generates multiple solution alternatives, organizes them as nodes in a tree and evaluates partially completed paths. Instead of a single chain of thought, the model explores branches in parallel and backtracks when a path does not work. At each step, the model evaluates whether the branch is on track or needs to backtrack, and expands the promising ones. In the end, the solution that survived among the branches is chosen. The technique combines generation, evaluation and search in a more symbolic decision logic, common in systems that need step by step planning. Each branch is evaluated by a special prompt that asks whether the step is solving the problem, whether it is possible to continue or whether it is worth backtracking. The model can explore more than one branch simultaneously, with cost proportional to the number of branches kept alive.
Practical example
To solve a puzzle with several steps, the model generates three possible actions at each step, evaluates those that allow continuing to close the puzzle, discards the incompatible ones and follows another branch. This way, there is a greater chance of finding the solution than following a single reasoning path. Branches that lead to contradictions are discarded immediately, and the model returns to the previous node to explore a different alternative, like someone who makes a mistake in a script step and tries another path to the destination. Unlike a linear script, the model can deviate from a path that is not leading to any result, which increases the chance of getting the solution right.
What it's for
Tree of thoughts helps with tasks that require planning, such as case judgment, software development and problem solving with multiple conditions. The tree allows reviewing paths and avoiding naive decisions made linearly. The method is especially useful when an initial decision can lead to a dead end, and the model needs to evaluate consequences before proceeding with an option. The use of the tree is common in automated planning systems and in agents that must consult several strategies before acting.
Difference between X and Y
Unlike chain of thought, which follows a single path, tree of thoughts keeps several alternatives active. The difference with self consistency is in the explicit tree structure and node evaluations, not just the majority of answers.