When to reach for it
- The problem has multiple plausible solution paths.
- Early decisions have high cascading effects.
- The search space can be meaningfully evaluated by the LLM.
/pattern/tree-of-thoughts/
The agent explores multiple reasoning paths simultaneously like a tree diagram and selects promising paths to pursue while discarding dead ends.
When to reach for it
When it backfires
The tradeoff
Enables a much broader and deeper exploration of the solution space, but leads to exponentially increasing computational and token overhead.
Each thought spawns a few children; promising branches expand, dead ends stop.
Naively expanding every node multiplies LLM calls exponentially without obvious payoff.
Fix · Cap branching factor and depth; prune by score after each layer.
The pruner is itself non-deterministic; on tight budgets it can discard the best branch.
Fix · Anchor pruning to a verifiable signal (executable check, oracle, regex) when possible.
Search patterns, frameworks, and pages.