Tree of Thoughts (ToT): Exploring multiple solutions in parallel

Reading time: approx. 7 min

What you will learn

In this advanced lesson, you will be introduced to Tree of Thoughts (ToT), a generalization of Chain of Thought (CoT) prompting. ToT allows AI models to explore several different reasoning paths simultaneously, rather than just following a single linear thought chain. This method is particularly well suited for complex tasks that require extensive exploration, planning, or strategic problem solving.

The basics

While CoT is effective for problems that can be broken down into sequential steps, many real-world problems are more divergent. They may have multiple potential solutions or require exploration of different hypotheses. ToT handles this by:

  • Maintaining a "thought tree": Each "thought step" represents a coherent language sequence that functions as an intermediate step toward solving a problem
  • Branching: The model can explore different reasoning paths by branching from different "nodes" in the tree
  • Evaluation and selection: In a complete ToT implementation, AI can then evaluate the different branches and choose the most promising path

Imagine a "tree structure" where each branch represents a possible thought path or a subproblem being solved. This is powerful for tasks that require creativity, strategic planning, or where there are multiple "right" answers.

Practical examples

Example 1: Develop a multi-step plan for a school trip

You want AI to help plan a school trip that involves several logistical challenges and alternative solutions.

Prompt (inspired by ToT principle):

You are an experienced project manager for school trips. Plan a one-day trip for a grade 8 class. The goal is to visit both a museum and a nature area within the same municipality.

Generate at least three different scenarios for this trip, where each plan describes in detail:
1. Transportation options: How do we get there and between the places?
2. Schedule: An approximate timetable for the day, including buffer time
3. Possible challenges and solutions: What problems may arise and how do we handle them?
4. Pedagogical connection: How can this specific plan be linked to the curriculum?

Consider cost-effectiveness and sustainability in your suggestions.

Benefits: Instead of a single plan, AI is encouraged to explore multiple "thought paths" for transportation, scheduling, and problem solving, resulting in a broader range of well-considered alternatives.

Example 2: Brainstorm ideas for a creative project

A class is to create a "future city". You want different perspectives for the city's design.

Prompt (inspired by ToT principle):

You are an innovative urban planner. Brainstorm three distinct concepts for a "sustainable future city" for grade 7. For each concept, describe:
1. Overall vision: What is the unique idea for this city?
2. Key technologies: What technology drives the city?
3. Social aspects: How do people live, and how are societal challenges handled?
4. Environmental impact: How is the city's ecological footprint minimized?

Think broadly and dare to be futuristic in each concept.

Benefits: AI will present several unique and detailed visions for the future city, where each vision represents a "branch" in the thought tree. This stimulates creativity and gives students a rich foundation to work further with.

Implementation in the classroom

  1. Problem-based learning: For complex tasks, students can use ToT-inspired prompts to get AI to generate different strategies or solutions for a problem. They can then evaluate and choose the most appropriate.

  2. Argumentation analysis: Ask AI to generate arguments for and against a controversial position by asking it to explore multiple "lines" of argumentation. Students can then analyze strengths and weaknesses in each line.

  3. Research and hypothesis formation: Let students formulate a research question and then use ToT prompting to generate different hypotheses and potential methods to test them.

Next steps

You now have a solid understanding of advanced prompting techniques, from steering AI with examples to letting it explore complex thought structures. In the final lesson, we will gather all this knowledge and convert it into concrete, practical tasks.