ToT (Yao et al., 2023) lets LLMs explore multiple reasoning paths simultaneously and use a value function to prune weak branches early. BFS keeps all nodes at a depth; DFS commits to one branch.
Pruning: nodes with score below threshold (here <0.4) are discarded. This avoids exploring dead-end reasoning paths and reduces token cost.
Tree-of-Thought (Yao et al., 2023) extends chain-of-thought by maintaining a tree of partial solutions and using an LLM-based value function to evaluate and prune branches. This allows systematic exploration of multiple reasoning paths, backtracking from dead ends, and beam search over thought sequences - enabling LLMs to solve complex planning and search problems that fail with linear CoT.
Interactive tree diagram with step-by-step BFS and DFS exploration of reasoning paths
Node scoring system showing why low-score branches get pruned before full expansion
Toggle between BFS (explores all nodes level by level) and DFS (commits to one path first)
Beam width slider controlling how many parallel paths are kept at each exploration step
Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.