ChatGPT-4: How to Use the Tree of Thought Process in Prompt Engineering 

Recently, I came across a research paper that introduced a new technique called the “Tree of Thought” process in AI. This process enhances problem-solving skills in Large Language Models (LLMs), such as OpenAI’s ChatGPT-4.

Intrigued by this concept, I decided to delve deeper into Prompt Engineering and how the Tree of Thoughts Method could be applied to everyday problem-solving scenarios.

Read more or watch the YouTube video(Recommended)


What is Prompt Engineering?

In the world of AI, Prompt Engineering focuses on designing structured prompts that help AI systems generate useful and targeted responses. These prompts lay the groundwork for obtaining a specific output or response from an AI model like ChatGPT.

Imagine you’re trying to find a hidden treasure with only a map and compass; In this case, Prompt Engineering is akin to marking checkpoints on your map that guide you to the treasure.

What is the Tree of Thought Prompting Method?

The “Tree of Thoughts” is an AI problem-solving method used in Prompt Engineering. It guides AI models like ChatGPT-4 to generate, evaluate, expand on, and decide among multiple solutions.

This process is similar to how humans solve problems by evaluating various potential solutions before deciding on the most promising one. And it is a great example of how AI research can be put into practice.

Comparing this method to navigating through a branching maze, where each junction leads to more choices and paths, exemplifies how AI models can use this approach to explore a multitude of possibilities before settling on an optimal solution.

Phase 1: Brainstorming

The first phase of the Tree of Thought process involves brainstorming diverse potential solutions to a given problem. In this stage, you can ask your AI model to generate three or more options while considering various factors.

Phase 2: Evaluation

The second phase is where the AI model objectively assesses each option’s potential success by evaluating their pros and cons, initial effort, implementation difficulty, potential challenges, and expected outcomes. The AI assigns a probability of success and a confidence level for each option based on these factors.


Phase 3: Expansion

The third phase involves delving deeper into each idea, refining it, and imagining its implications in real-world contexts. The AI model generates potential scenarios, strategies for implementation, necessary partnerships or resources, and possible ways to overcome obstacles.

Phase 4: Decision

During the final phase, the AI model ranks each solution based on the evaluations and scenarios generated. It provides justifications for its rankings and offers any final thoughts or considerations for each solution from the Prompt Engineering.

A Practical Example of Using Prompt Engineering and the ‘Tree of Thoughts’ Method

To better understand Prompt Engineering and the Tree of Thoughts method, I decided to use a practical example from my own life: asking for a pay raise from my boss.

Just like how a gardener tends to multiple plants in their garden before picking the ripest fruit, I started by generating multiple strategies using ChatGPT-4 with the Tree of Thoughts method.

Phase 1: Brainstorming Strategies

Firstly, I asked ChatGPT-4 to brainstorm three solutions for approaching my boss about a pay raise. The AI model suggested:

1. Presenting a well-researched case with industry salary benchmarks.

2. Demonstrating my contributions to the company’s growth and success.

3. Offering to take on additional responsibilities in exchange for a pay increase.


Phase 2: Evaluating Pros and Cons

Next, I asked ChatGPT-4 to evaluate the pros and cons of each strategy. The AI model systematically analyzed each option, providing valuable insights regarding implementation difficulties and potential challenges.

For instance, the first strategy required extensive research on industry benchmarks and gathering evidence to support my argument. The second relied on clear communication of my achievements and contributions to the company.

Lastly, the third strategy needed a willingness to take on more responsibilities and showcasing my versatility.

Phase 3: Expanding on Strategies

In the expansion phase, ChatGPT-4 went deeper into each strategy and created various scenarios that could unfold. For example, for the first strategy, the AI model outlined potential resources I could use to gather salary benchmark data, and suggested ways to communicate my research assertively. It also highlighted the importance of being prepared to negotiate and handle any possible counter arguments or concerns from my boss.

Similarly, for the second and third strategies, ChatGPT-4 provided ideas for showcasing my accomplishments and creating a proposal detailing additional responsibilities I could assume for a pay increase.

Phase 4: Deciding on the Best Approach

Finally, ChatGPT-4 ranked the strategies in order of promise. It recommended presenting a well-researched case with industry salary benchmarks as the most promising approach. With this result, I felt well-equipped to make my case for a pay increase.

Upon implementing this strategy in my real-life scenario, I found success in securing a pay raise. My boss appreciated the thorough research and well-laid-out argument, which ultimately led to a fruitful discussion.



My experience with Prompt Engineering and the Tree of Thoughts method using ChatGPT-4 was incredibly enlightening. The process helped me evaluate multiple approaches for a real-world problem and guided me towards an optimal solution.

I believe the “Tree of Thought” process in AI has vast potential for decision-making across various scenarios, and I’m excited to see how it evolves in the future.

By adapting this method for use in our daily lives, we can improve our problem-solving skills, aiding in better decision-making and ultimately leading to more successful outcomes.


1. What is Prompt Engineering

Prompt Engineering is a method in AI that focuses on designing structured prompts to generate useful and targeted responses from AI systems. It’s akin to marking checkpoints on a map to guide you to a treasure.

2. How does the Tree of Thoughts method work?

The Tree of Thoughts is a four-phase process: brainstorming, evaluation, expansion, and decision. It allows AI models to generate multiple potential solutions to a problem, evaluate and refine them, and ultimately select the best solution.

3. How effective is the Tree of Thoughts method with ChatGPT-4?

The Tree of Thoughts method effectively enhances the problem-solving capabilities of ChatGPT-4. It guides the AI to generate diverse solutions, evaluate them objectively, refine the ideas, and make a justified decision.

4.Where can I learn more about Prompt Engineering and the Tree of Thoughts method?

There are several resources online, such as can also watch our YouTube video on this topic for a more detailed explanation.

One comment

  1. I would love to get a look at the python code you wrote for this along with the ui you built to play with. Did you post this somewhere and I missed it? Thanks for your vids. Great job

Leave a Reply

Your email address will not be published. Required fields are marked *