Abstract
Large language models (LLMs) require high-quality, multi-step reasoning data to improve their problem-solving capabilities. However, standard data synthesis methods like rejection sampling are highly inefficient and struggle to solve complex problems. This paper introduces FastMCTS, a modified Monte Carlo Tree Search algorithm tailored for LLMs. By caching simulation steps and dynamically balancing exploration, FastMCTS generates over 30% more correct reasoning paths than rejection sampling and boosts downstream model performance by nearly 4% under the exact same compute budget.
Introduction
To teach LLMs how to reason, researchers typically synthesize training data using a stronger "teacher" model. The standard approach is rejection sampling: a model is given a math problem and asked to generate dozens of answers, keeping only those that reach the correct final answer.
However, rejection sampling has major flaws. It treats every attempt independently, meaning the model cannot learn from a promising intermediate step if it ultimately makes a mistake at the end. It is also highly inefficient for long reasoning chains and heavily biases the resulting dataset toward easy problems, as hard problems might yield zero correct paths even after 100 blind attempts. While Monte Carlo Tree Search (MCTS) is effective for complex state-space problems, applying vanilla MCTS to LLMs is computationally expensive due to the slow nature of autoregressive text generation and the wastefulness of discarding simulation rollouts. FastMCTS addresses these inefficiencies to make tree search a viable tool for LLM data synthesis.
Methodology
FastMCTS is a lightweight tree-search sampling strategy designed to maximize token utility and search efficiency. It introduces several key modifications to the standard MCTS framework:
- Reserve Simulation: In vanilla MCTS, the "simulation" phase generates a path to the end of the game to estimate a node's value and then discards it. FastMCTS saves every generated reasoning step from the simulation as a valid node in the search tree, preventing redundant generation.
- Adaptive Stay Policy: Instead of always traversing to leaf nodes, FastMCTS can "stay" at an intermediate node if a path is highly likely to succeed or fail, promoting diversity for easy problems while focusing compute on hard ones.
- Dynamic Exploration: The algorithm adjusts the Upper Confidence Bound (UCT) parameter based on a node's win rate, encouraging the exploitation of promising branches.
- Robust Verification: FastMCTS uses an LLM-as-a-judge to verify intermediate steps and final answers, filtering out logical errors and lucky guesses.
Experimental Setup
The authors curated two primary datasets for synthesis: EN Math Hard (46,000 problems) and CN High School Math Hard (50,000 problems). Evaluation was conducted across a wide range of benchmarks, including GSM8K, MATH-500, and AIME24 for English, and Gaokao Math for Chinese. Qwen2.5-72B-Instruct served as the teacher model for data generation, while Qwen2.5-7B was used as the student model for training.
Key Results
Sampling Efficiency
FastMCTS significantly outperforms both standard MCTS and rejection sampling in terms of token utility. As the number of generated tokens scales, FastMCTS generates over 30% more correct reasoning paths (verified tokens) compared to rejection sampling. This efficiency allows the system to find solutions for harder problems that rejection sampling fails to solve within a reasonable budget.
Downstream Performance
Models trained on FastMCTS-synthesized data consistently outperformed those trained on rejection-sampled data. Using the same token generation budget, the FastMCTS-trained 7B model showed an average improvement of 3.9% across all English benchmarks. Furthermore, the tree structure of FastMCTS naturally provides step-level preference data. By applying Branch-DPO (Direct Preference Optimization) using these "free" labels, the authors further boosted the 7B model's average performance on English math benchmarks from 55.6% to 56.6%.
Conclusion and Future Work
FastMCTS demonstrates that tree-structured search can be economically viable for LLM data synthesis by maximizing token utility through simulation caching. While currently focused on the math domain, the strategy offers a scalable way to generate high-quality reasoning trajectories and preference data simultaneously. Future work will explore the application of FastMCTS to coding and general reasoning tasks, as well as investigating the impact of prefix repetition in tree-structured training data.
Summary updated