Awesome Testing

Models · reviewed · reviewed Oct 16, 2026 · 3 min

How do tree search and Tree of Thoughts guide an LLM?

A search controller stores partial solutions, asks a model for possible continuations, evaluates candidates and chooses which branches to expand or prune. Tree of Thoughts applies this pattern to language-sized steps. Search needs a budget and a final check; a promising branch can still be wrong.

Keep alternatives outside one continuation

Suppose a coding assistant must repair a failing checkout test while preserving payment behaviour. It could generate one patch, or keep several partial repair plans and inspect them before committing further work.

In a search tree, a node represents a partial solution and an edge represents a possible next step. The frontier contains candidates still available for exploration. A controller expands some nodes, evaluates their children, and stops when it has sufficient evidence or exhausts its budget.

Tree of Thoughts, introduced by Yao and colleagues in 2023, uses coherent text steps as the search units. A step might be an equation or a short plan. The method separates step generation, evaluation and search control; it is more than asking a model to print the phrase “think in a tree.”

Follow a repair that looks promising too early

The following is an authored example, not a recorded agent run. Assume the checkout requirement explicitly forbids adding another payment retry:

flowchart TD
  R[Checkout failure] --> A[Add retry]
  R --> B[Inspect mapping]
  A --> C[Passes; charge risk]
  B --> D[Repair and verify]

A judge looking only at the failing test might prefer A. Keeping B allows further investigation, but only an evaluator or final check that sees the payment contract can distinguish a passing test from an acceptable repair.

With a beam width of one, the controller retains only one candidate per stage. Pruning B removes its future from that search unless the system explicitly regenerates or revisits it. A larger beam keeps more alternatives and consumes more evaluation and storage. Neither width guarantees that a useful proposal will be generated or retained.

Who makes each choice?

The model proposes continuations. An evaluator scores or checks states. A search controller decides which candidates remain, which are expanded next, and when work stops. The evaluator may be a model, deterministic rules, executable checks, or a combination.

Breadth-first exploration advances across a level; depth-first exploration follows a branch before returning to alternatives. The original Tree of Thoughts study used bounded breadth-first and depth-first procedures. Its task-specific results are evidence about those experiments, not proof that every current reasoning model uses the same machinery.

Inference policyWhat the system retainsHow it chooses an answer
One generated traceOne continuing token sequenceReturn its resulting answer
Multiple complete samplesSeparate finished candidatesVote or rank final answers
Tree search over stepsSeveral partial solutions and search stateEvaluate, expand and prune before final selection

A learned decision tree is another object entirely: it stores fitted feature tests for prediction. A search tree stores alternatives for this request. Neither is the Transformer's attention pattern.

Better search needs a useful measurement

Process-supervision research studies judging intermediate steps rather than only final answers. Such feedback can guide search toward viable solutions, but a learned verifier can misjudge the important constraint. Searching harder against a weak score can repeatedly select the same kind of error.

The test-time compute study by Snell and colleagues compares ways to allocate proposal and verification work. Useful policies vary with task difficulty and proposer capability. Budget the complete search, including discarded candidates and checks, rather than measuring only the selected answer's length.

A practical stop rule can return an unresolved result when no checked candidate qualifies. Missing evidence does not become available merely because there are more branches. Finally, backtracking a plan is not a transaction rollback: exploring a real tool action can already change external state. Keep hypothetical alternatives separate from execution and reconcile effects before trying another branch.

Sources and further reading

  1. 01
    Tree of Thoughts: Deliberate Problem Solving with Large Language ModelsYao et al. · research · published May 17, 2023 · source checked Oct 16, 2026

    Primary separation of thought-sized proposals, state evaluation and bounded breadth/depth exploration; reported gains belong to the studied tasks.

  2. 02
    Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model ParametersSnell et al. · research · published Aug 6, 2024 · source checked Oct 16, 2026

    Primary study of proposer/verifier policies, revision, search, and task-dependent allocation of inference work; its results are not universal reasoning-budget guarantees.

  3. 03
    Let's Verify Step by StepLightman et al. · research · published May 31, 2023 · source checked Oct 16, 2026

    Primary comparison of outcome and process supervision for learned math verifiers, with explicit limits on transfer beyond the studied domain.