Skip to content
BENIBIX Learn

Tree of Thoughts (ToT)

AI🛠️ Working with AIPrompt Writing Techniques

Also known as Tree-of-Thought Prompting, Tree of Thought

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

Think of it like

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

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.

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.
Tree of thoughts branches, cuts the weak branches, and backs up from dead ends.

Common mistake

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

Key takeaways

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

Learn it properly