ToTRL: Unlock LLM Tree-of-Thoughts Reasoning Potential through Puzzles Solving

Haoyuan Wu, Xueyi Chen, Rui Ming, Jilong Gao, Shoubo Hu, Zhuolun He, Bei Yu · Submission to ICLR 2026 · Withdrawn

TL;DR

Reinforcement learning has successfully elicited long chain-of-thought (CoT) reasoning in modern LLMs, but this reasoning remains strictly linear, redundant, and prone to trial-and-error wandering. ToTRL (Tree-of-Thoughts Reinforcement Learning) trains LLMs to autonomously perform parallel tree-based reasoning, branch exploration, and pruning within their own internal thinking traces. By training on constraint-heavy puzzle games with rule-based rewards, the resulting model—ToTQwen3-8B—matches or exceeds explicit search algorithms while cutting token costs on complex reasoning tasks.

What Problem Does This Paper Address?

Current reasoning models (such as OpenAI's o1 and DeepSeek-R1) generate long chains of thought to tackle challenging problems. However, standard CoT is fundamentally linear: it commits to a single path and reasons locally from step to step. When solving tasks with interdependent constraints and multiple solutions, this linear structure leads to excessive introspection, repetitive backtracking, and verbose token generation without a global view of the search space.

The Tree-of-Thoughts (ToT) paradigm addresses this conceptually by treating problem-solving as tree search (proposing branches, evaluating states, and pruning dead ends). Historically, ToT has required cumbersome external scaffolding—such as dedicated Python search algorithms (BFS, DFS, or MCTS) and multi-agent prompting. This paper asks: Can an LLM internalize tree-search reasoning natively through reinforcement learning, eliminating the need for external search wrappers?

Methods

ToTRL introduces an on-policy reinforcement learning framework designed to guide models from sequential CoT into native tree-based exploration:

  1. Two-Stage Training Strategy: Reasoning models are heavily habituated to standard CoT. To break this bias:
  2. Stage 1 (No-Thinking Mode): The model leaves native <think> blocks empty and is forced to structure its reasoning explicitly within custom <tot> tags.
  3. Stage 2 (Thinking Mode): Once proficient with branch structures, the model moves its tree exploration back into its native <think> process and uses <tot> for structured synthesis.
  4. Strict Hierarchical Reward Modeling:
  5. Format Validation ($F(o)$): Evaluates syntactic and structural tag compliance. Format violations immediately receive a penalty ($r_p = -1$).
  6. Exact Set-Equivalence Correctness ($A(o|q)$): For multi-solution puzzles, the extracted answer set must match the complete ground truth set exactly ($r_s = 1$). Partial answers receive full penalties to prevent the policy from collapsing into incomplete shortcuts.
  7. KL Divergence Removal: The authors set $\beta = 0$ in the surrogate PPO objective, removing the reference-model KL penalty to maximize the model's freedom to explore novel search behaviors.
Linear CoT:   Step 1 ──► Step 2 ──► Dead End? (Rambling check) ──► Step 3 (Entangled)

ToTRL (ToT):  Root ──┬──► Case A (Valid)   ──► Subcase A1 ──► [Solution 1]
                     ├──► Case B (Invalid) ──► [Pruned immediately]
                     └──► Case C (Valid)   ──► Subcase C1 ──► [Solution 2]

Datasets

  • Training: 1,440 self-generated logic puzzles (720 $6\times6$ Sudoku puzzles and 720 Alphametic equation puzzles featuring 1–4 unique solutions), divided into 1,080 samples for Stage 1 and 360 for Stage 2.
  • In-Distribution Evaluation: 50 $6\times6$ Sudoku and 200 Alphametic puzzles.
  • Out-of-Distribution (OOD) Logic:
  • $5\times5$ Crosswords (50 puzzles from Yao et al., 2023)
  • $9\times9$ Sudoku (50 puzzles from Kaggle)
  • Knights & Knaves (K&K) Logic Puzzles (140 puzzles from Xie et al., 2024)
  • Self-generated Poker 24 Game (160 puzzles) and Make 24 (160 puzzles)
  • OOD Mathematics & Real-World: AIME 2024, AIME 2025, AMC 2023, along with BFCL v3 (tool use), Arena Hard, Creative Writing v3, and LiveCodeBench v5.

Key Insights and Ideas

  • Puzzles as Search Engines: Games like Sudoku and Alphametic equations naturally force tree construction because every candidate placement cascades constraints across rows, columns, or carry-overs. Contradictions immediately trigger pruning.
  • Prompting Alone Fails: Simply prompting baseline reasoning models to use ToT often degrades performance (e.g., dropping Qwen3-8B on $9\times9$ Sudoku from 0.180 to 0.080). Internalizing tree exploration requires explicit RL guidance.
  • Strict Rewards Prevent Degeneracy: Ablations show that giving partial credit causes the model to settle on finding only a subset of answers. All-or-nothing rewards compel the model to explore all valid branches.
  • Test-Time Efficiency: Because ToTQwen3-8B actively prunes unviable paths rather than rambling linearly, it achieves higher accuracy with smaller token budgets during test-time scaling.

Key Results

Trained on top of Qwen3-8B, ToTQwen3-8B demonstrates marked improvements across logic and math benchmarks:

Benchmark DeepSeek-R1-Distill-7B GLM-4-Z1-9B Qwen3-8B (Thinking) ToTQwen3-8B (Ours)
$6\times6$ Sudoku (In-Dist) 0.000 0.200 0.660 0.800
Alphametic (Avg. In-Dist) 0.028 0.253 0.930 0.973
$5\times5$ Crossword (OOD) 0.000 0.062 0.378 0.508
$9\times9$ Sudoku (OOD) 0.000 0.000 0.180 0.260
K&K Puzzles (OOD) 0.007 0.893 0.950 0.986
Poker 24 (Avg. OOD) 0.021 0.410 0.468 0.603
AIME 2025 (Math OOD) 0.367 0.600 0.533 0.633
AMC 2023 (Math OOD) 0.925 0.950 0.900 0.950

Furthermore, on the Poker 24 benchmark, ToTRL achieved 0.603, performing on par with external algorithmic search systems like original ToT (0.631) and TS-LLM (0.582)—while requiring only a single, standard inference call.

Limitations and Future Work

  • Residual CoT Redundancy: Because the underlying base model was pretrained on sequential CoT, ToTQwen3-8B occasionally exhibits residual repetition within branches.
  • Lack of Hard Pruning Guarantees: Unlike external BFS or MCTS algorithms with programmatic state verification, the LLM’s internal pruning remains probabilistic.
  • Domain Transfer Gaps: While reasoning generalized well to math and agentic tool use (BFCL v3 improved from 0.767 to 0.783), coding performance on LiveCodeBench saw no statistically significant improvement.
  • Future Directions: Expanding ToTRL beyond synthetic logic puzzles into software engineering, interactive planning, and complex real-world decision-making scenarios.

Summary updated

BibTeX
@misc{wu2025totrl,
  author = {Haoyuan Wu and Xueyi Chen and Rui Ming and Jilong Gao and Shoubo Hu and Zhuolun He and Bei Yu},
  title = {{ToTRL: Unlock LLM Tree-of-Thoughts Reasoning Potential through Puzzles Solving}},
  year = {2025},
  eprint = {2505.12717},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.12717},
}
Figure