๐ง๐ฟ๐ฒ๐ฒ ๐ผ๐ณ ๐ง๐ต๐ผ๐๐ด๐ต๐๐: ๐ ๐ฎ๐ธ๐ฒ ๐๐๐ ๐ ๐๐ ๐ฝ๐น๐ผ๐ฟ๐ฒ
Chain-of-Thought makes a model think step by step. It follows one path. If the first step is wrong, the entire answer fails.
Tree of Thoughts fixes this. It turns reasoning into a search.
Instead of one line of reasoning, you treat each part of a solution as a node. You generate several next steps from that node.
Follow these steps:
- Generate: Ask the LLM for multiple different next steps.
- Score: Ask the LLM to rate each step from 1 to 10.
- Prune: Keep only the highest scoring paths. Throw the rest away.
The model evaluates itself. You do not need an external solver.
Repeating this cycle allows for real backtracking. If the best path hits a dead end, you move to the next best option. Chain-of-Thought cannot do this.
Tree of Thoughts works best for:
- Math problems
- Planning tasks
- Coding with tests
- Logic puzzles
It requires more LLM calls than standard methods. Do not use it for simple questions. Use it when your problem needs a search process.
See how it works on the Game of 24 puzzle: https://dev48v.infy.uk/prompt/day6-tree-of-thoughts.html
Full post: https://dev.to/dev48v/tree-of-thoughts-how-to-make-an-llm-explore-instead-of-guess-3kn1
Optional learning community: https://t.me/GyaanSetuAi