Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Heuristic:Iamhankai Forest of Thought Tree Iteration Scaling

From Leeroopedia
Knowledge Sources
Domains Optimization, LLMs, Tree_Search
Last Updated 2026-02-14 03:30 GMT

Overview

Progressive iteration depth strategy where early trees use fewer MCTS iterations (`min(t+1, max_iter)`) to implement a "quick thinking then slow thinking" approach across the forest.

Description

In the MCTS-based Forest-of-Thought, each tree in the forest receives a different number of MCTS iterations. The first tree (t=0) gets `min(1, max_iter)` = 1 iteration (essentially a single-pass "quick thinking" response), the second tree gets `min(2, max_iter)`, and so on, up to the configured `max_iter` cap. This creates a spectrum from fast/shallow to slow/deep reasoning across the forest.

Combined with the input diversity shuffling (different input orderings for t > 0) and the early stop majority vote, this strategy ensures that easy problems are solved quickly (first tree often suffices) while hard problems get progressively deeper exploration.

Usage

This heuristic is automatically applied in the MCTS mode of the Forest-of-Thought orchestrator. The first tree (t=0) acts as an initial "quick check" — the code comments explicitly label it as "quick thinking = IO" (input-output, no chain-of-thought). Subsequent trees engage "slow thinking input diversity" with progressively deeper search.

For the CoT and ToT base modes, a similar quick-then-slow pattern exists via the input diversity mechanism, but without the progressive iteration cap.

The Insight (Rule of Thumb)

  • Action: Set each tree's iteration count to `max_iter = min(t+1, self.max_iter)` where `t` is the tree index (0-based).
  • Value: Tree 0 → 1 iteration, Tree 1 → 2 iterations, ..., Tree N → min(N+1, max_iter) iterations.
  • Trade-off: Reduces total compute compared to giving every tree `max_iter` iterations. Easy problems are solved in 1-2 trees with minimal compute; hard problems still get full exploration depth. Risk: if the first tree gives a confidently wrong answer, the early stop heuristic may terminate prematurely.
  • Synergy: Works with the early stop majority vote — if the quick first tree gets the right answer and the second (slightly deeper) tree agrees, the forest stops immediately.

Reasoning

Test-time compute scaling is most valuable when applied adaptively. Simple problems do not benefit from deep MCTS search — a single chain-of-thought pass often suffices. Complex problems benefit from many iterations of refinement and exploration. By starting shallow and going deeper, the forest automatically allocates compute proportional to problem difficulty. The first tree's answer also serves as a baseline for the majority vote, enabling faster early stopping on easy problems.

The code comments in the MCTS run loop explicitly document this design intent:

  • Tree 0: `# quick thinking = IO` (line 366)
  • Trees 1+: `# slow thinking input diversity` (line 359)

Code Evidence

Progressive iteration from `run_with_mcf_stop_noearly.py:L367`:

max_iter = min(t+1, self.max_iter)

Quick vs slow thinking comments from `run_with_mcf_stop_noearly.py:L359-366`:

for t in range(self.tree_nums):
    if t > 0:  # slow thinking input diversity
        cases_list = np.array(self.learning_cases)[:,0].tolist()
        query_case = get_similarity_question(query, cases_list)
        # ... prepend few-shot example ...
    else:  # quick thinking = IO
        pass
    max_iter = min(t+1, self.max_iter)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment