Advanced Technique

Tree of Thoughts

Explore multiple reasoning paths simultaneously and select the best solution

What is Tree of Thoughts?

Tree of Thoughts (ToT) is an advanced prompting technique that encourages the AI to explore multiple reasoning paths at once, evaluating different approaches before settling on a final answer. Instead of linear thinking, it structures the problem as a tree where each branch represents a different possibility.

This is particularly powerful for complex problems where trial-and-error or exploring alternatives leads to better outcomes than immediately committing to one approach.

When to Use It

Best For:

  • • Strategic planning
  • • Complex puzzles
  • • Creative writing
  • • Multi-criteria decisions

Not Ideal For:

  • • Simple factual questions
  • • Quick tasks
  • • When one solution suffices
  • • Limited context scenarios

Examples

Example 1: Decision Making
Prompt
I need to decide on a tech stack for a startup. Consider three approaches: 1. React + Node.js (proven, large ecosystem) 2. Next.js + Serverless (fast to market) 3. Flutter + Firebase (mobile-first) For each option, evaluate: development speed, hiring pool, scalability, and maintenance burden. Then recommend the best choice with reasoning.
Output
Option 1: React + Node.js
• Dev Speed: 7/10 (mature tooling)
• Hiring: 9/10 (largest pool)
• Scalability: 8/10

Option 2: Next.js + Serverless
• Dev Speed: 9/10 (fastest)
• Hiring: 6/10
• Scalability: 7/10

Recommendation: Option 2 - Best for speed-to-market...
Example 2: Creative Problem Solving
Prompt
Solve this: A farmer needs to cross a river with a wolf, goat, and cabbage. The boat can only hold the farmer plus one item. If left alone, the wolf eats the goat, or the goat eats the cabbage. Explore three different solution paths and identify the correct sequence.
Output
Path 1: Direct attempts - Wolf+Goat or Goat+Cabbage left alone = fail

Path 2: Multiple trips - Farmer must shuttle back and forth

Path 3: Strategic ordering (correct):
1. Take goat across
2. Return alone
3. Take wolf across, bring goat back
4. Take cabbage across
5. Return alone
6. Take goat across

Best Practices

  • 01
    Define evaluation criteria

    Tell the model how to compare and judge different paths

  • 02
    Limit branch count

    3-5 branches is usually optimal; too many becomes unwieldy

  • 03
    Require explicit comparison

    Ask for side-by-side evaluation, not just descriptions

  • 04
    Have the model "debate" paths

    Let it argue for and against each approach before deciding

ToT vs Chain-of-Thought

While Chain-of-Thought explores one reasoning path sequentially, Tree of Thoughts explores multiple paths in parallel. CoT is like following a single thread; ToT is like a branching decision tree. Use ToT for complex problems where multiple solutions exist and the best isn't obvious.