Exploring reasoning paths
In Chapter 3, we discussed CoT prompting. But with CoT prompting, the LLM creates a reasoning path within a single turn. What if we combine the decomposition pattern and the adaptation pattern by splitting this reasoning into pieces?
Tree of Thoughts
Researchers from Google DeepMind and Princeton University introduced the ToT technique in December 2023. They generalize the CoT pattern and use thoughts as intermediate steps in the exploration process toward the global solution.
Let’s return to the plan-and-solve agent we built in the previous chapter. Let’s use the non-deterministic nature of LLMs to improve it. We can generate multiple candidates for the next action in the plan on every step (we might need to increase the temperature of the underlying LLM). That would help the agent to be more adaptive since the next plan generated will take into account the outputs of the previous step.
Now we can build a tree of various options...