Back

Takeaways: Tree of Thoughts: Deliberate Problem Solving with Large Language Models

Strategy

Tree of Thoughts architecture (Tree of Thoughts)

Instead of a single, linear path to an answer, the model branches its reasoning into a web of different variants (a tree). It generates several possible next steps from one point, creating alternative scenarios for solving the problem. Explanation or prompt"Propose 3 different concepts for solving this algorithmic problem. For each of these concepts, then add 2 further steps showing how it could be developed, and then choose the one with the greatest potential."

Tree of Thoughts: Deliberate Problem Solving with Large Language Models
Summary1/9

Strategy

Built-in self-evaluation of states (Self-Evaluation)

A key mechanism in which the artificial intelligence itself checks, at every step, whether its assumptions so far make sense. It rates the generated "thoughts" as promising, doubtful or wrong before spending resources on continuing them. Explanation or prompt"Analyze the paragraph of text you just generated and rate on a scale of 1 to 10 how well it fulfills the main logical assumptions of my prompt. If it received a score lower than 7, ignore it completely."

Tree of Thoughts: Deliberate Problem Solving with Large Language Models
Summary2/9

Strategy

Graph search and backtracking (Search Algorithms & Backtracking)

A technique of applying search algorithms known from computer science (breadth-first or depth-first). When the model runs into a contradiction or decides a branch is wrong, it stops that line of thought and "backtracks" to an earlier correct decision point to explore a different branch.

"Start solving this puzzle step by step. If at any stage your reasoning leads to a contradiction with the rules of the puzzle, write 'ERROR', go back to the previous stage and propose a different way of calculating."

Tree of Thoughts: Deliberate Problem Solving with Large Language Models
Summary3/9

Good practice

Defining the right scale of a "Thought"

A reasoning step for the model should be big enough to be substantively meaningful for evaluating the final solution, but small enough that many precise variants of it can be generated.

When generating code, the "thought" and the evaluation point should be coming up with an idea for a single class in the architecture, rather than asking to evaluate every generated line separately.

Tree of Thoughts: Deliberate Problem Solving with Large Language Models
Summary4/9

Good practice

Varying the voting methods (Flexible Evaluation Methods)

The choice of self-evaluation method should depend on the task. For analytical tasks (math, programming) it is better to flatly reject contradictions; for creative ones, continuous evaluation (e.g. assigning points/stars to individual ideas).

"Create 4 variants of a book title, then give them points from 0 to 5 for emotional resonance. Pass only the variant with the highest score on to the next step."

Tree of Thoughts: Deliberate Problem Solving with Large Language Models
Summary5/9

Good practice

Strategic lookahead (Lookahead)

When a problem is complex, it is worth asking the model, before it makes a final decision about the path, to briefly simulate where a given path would ultimately lead it and what obstacles may arise.

"Before you start writing the full script with this particular storyline, list the 2 biggest plot holes that may appear if we use this solution."

Tree of Thoughts: Deliberate Problem Solving with Large Language Models
Summary6/9

Avoid

A linear approach to tasks with difficult planning (Left-to-Right Limits)

Avoid forcing the model to solve games and complicated multi-step problems with traditional methods that generate the result straight ahead with no option to correct, so that a single mistake cascades and ruins everything else.

"Solve this hard Sudoku puzzle step by step from the left side of the grid downward and don't change the digits you've already set."

Tree of Thoughts: Deliberate Problem Solving with Large Language Models
Summary7/9

Avoid

Blindly pushing on into hallucinations with no pauses for evaluation

What we avoid is relying on a continuous stream of generation in which we give the artificial intelligence no clear checkpoint for reflection: "does what I just wrote make sense?".

"Write a non-stop 3,000 words of an intricate geopolitical plan and give me the finished text right away." (Instead of asking it to come up with 3 theses, verify them, and only then develop them.)

Tree of Thoughts: Deliberate Problem Solving with Large Language Models
Summary8/9

Avoid

Overusing ToT on trivial tasks

The Tree of Thoughts framework uses a very large number of tokens and significantly lengthens the time needed to generate an answer. You shouldn't use complex branching instructions for trivial informational requests.

"Design a three-level tree of thoughts, with 3 branches at each level, and rate each branch on a 10-point scale to determine what the formula for the area of a square is."

Tree of Thoughts: Deliberate Problem Solving with Large Language Models
Summary9/9