LLM Learning Roadmap
✨ Awesome-Anything
🖼️ Digital Image Processing
🍃 LLM Components
🌱 LLM Pre-training
☘️ LLM Post-Training
🍀 LLM Popular Models
🪴 LLM Applications
🌿 LLM Optimization
🌾 LLM Compression
🌵 LLM Hands-on Practice
🌴 LLM Must-read Papers
🌳 LLM Q&A
🐝 VLM Image Encoders
📝 MISC.
🔗9.3.4 MCT Self-Refine
Researchers from Fudan University and Shanghai AI Lab proposed a Monte Carlo Tree Search (MCTS) combined with a self-refine optimization method, called MCT Self-refine (MCTSr). It aims to enhance the performance of LLMs in complex mathematical reasoning tasks (such as International Mathematical Olympiad problems), improving decision-making accuracy and reliability.
Research Background:
- Large language models face accuracy and reliability issues in strategy and logical reasoning, especially in mathematical reasoning tasks, where they are prone to generate hallucinations or erroneous outputs. These outputs may appear reasonable but incorrect, and finally harmful for the reasoning process.
- Self-refine method can alleviate these issues, but it tends to produce misleading or incorrect results when dealing with complex real-world mathematical problems.
MCTS and Self-refine Recall
MCTS, as a decision-making algorithm, is typically used in games and complex problem-solving environments. This paper proposes the MCTSr algorithm, which combines the exploration ability of MCTS with the Self-refine and Self-evaluation capabilities of LLMs to enhance the reasoning ability.

Recall: Monte Carlo Tree Search (MCTS)
MCTS is a heuristic search algorithm. It builds a search tree and uses simulation results to evaluate the value of actions. It mainly includes four stages: Selection, Expansion, Simulation, and Backpropagation.
- Selection: Starting from the root node, select child nodes based on a specific strategy (e.g., Upper Confidence Bound, UCT, explained later). Continue this process until reaching a leaf node.
- Expansion: If the leaf node is not a terminal state (i.e., without a clear win/loss outcome in a game), create one or more new child nodes. Each child node represents a possible action.
- Simulation: Starting from the expanded node, perform a random simulation (also called playout or rollout). Select actions randomly until the game reaches a terminal state (such as win, loss, or draw). The result (win or loss) is used to evaluate the value of the leaf node.
- Backpropagation: Pass the simulation result back from the child node to the root node, updating the statistics of all nodes along the path. Update the win/loss count and visit count for each node on the path based on the simulation result.
Recall: Upper Confidence Bound (UCT) applied in MCTS
For MCTS, the Selection stage is crucial. UCT selects the action that maximizes the following formula to balance exploration and exploitation:
- : the average reward (or value) of node . When the decision process has clear win/loss outcomes (e.g., in Go game), it can be expressed as:
where is the number of wins along the path through node , and is the total number of visits to node . These statistics are updated during the Backpropagation stage (since win/loss can be treated as 0–1 reward, this is also the average reward).
- : the total number of visits to the parent node of the current node.
- : a constant to balance exploration and exploitation.
Interpretation of the formula:
- The first term () is exploitation: The larger the node’s average value, the more the algorithm tends to exploit (choose) this node.
- The second term () is exploration: The smaller the node’s visit count, the larger this term becomes, encouraging exploration of less-visited nodes.

Self-refine
Given an input to an LLM, it first produces an initial output. Then, this output is fed back into the LLM itself, prompting it to generate its own revision suggestions or feedback. Next, based on the output and the feedback, the model generates a refined plan and a revised output.
This iterative process continues until either the maximum number of iterations is reached or no further improvements are made. Finally, the result is the output obtained after multiple rounds of refinement.
.png?table=block&id=28326e5a-7de0-808c-9732-f1669fcf2a83&t=28326e5a-7de0-808c-9732-f1669fcf2a83)
Example of Self-refine
.png?table=block&id=28326e5a-7de0-8060-9a03-ee7aa7cd992e&t=28326e5a-7de0-8060-9a03-ee7aa7cd992e)
Method of MCTSr
In this paper, the iterative process of refining a math problem is abstracted as a search tree structure, where nodes represent different versions of answers, and edges represent refinement attempts. Self-refine method is used to improve the answers, while the self-evaluation is used to sample the reward values of the answers.
- Some notations:
- Problem
- Answer node set
- Action set available at each node (each action represents a possible self-refinement)
- Reward sampling function (based on the quality and validity of refinements)
- Reward set sampled by node
- Terminal state function
- Value function of node ,
- UCT value
MCTSr Workflow:
- Initialization: Generate an initial answer or pseudo-response using the model (e.g., “I don’t know”), then build the root node to reduce model overfitting.
.png?table=block&id=28326e5a-7de0-8052-99b4-f176e5f07411&t=28326e5a-7de0-8052-99b4-f176e5f07411)
- Selection Stage: Use the UCT value to rank candidate answer nodes that have not yet been fully expanded. The greedy strategy is applied to select the highest-value node for exploration and optimization.
- Incomplete Expansion: Since an LLM can generate an unlimited number of refinements for any answer state, each node may have infinitely many expansion operations.
- The number of child nodes is limited by a predefined threshold.
- At least one child node’s Q-value must exceed the Q-value of its parent node.
- Self-Refine: The model uses multi-round dialogue–style refine prompts as guidance to optimize the answer.
.png?table=block&id=28326e5a-7de0-802b-a0d1-fc5dca2d0668&t=28326e5a-7de0-802b-a0d1-fc5dca2d0668)
- Self-Evaluation: The value function is obtained by performing multiple Self-reward samplings on the answer:
- : the set of sampled rewards for node .
- : the minimum reward in the set.
- : the average reward.
Where:
This balances the worst-case reward (minimum) and the average-case reward, ensuring robustness against poor outputs while also considering the overall performance.
.png?table=block&id=28326e5a-7de0-8033-af1d-ea1b541a17fc&t=28326e5a-7de0-8033-af1d-ea1b541a17fc)
- Backpropagation: Propagate the sampled reward values and Q-values of the leaf nodes backward to their parent and ancestor nodes. Update the parent node’s Q-value by considering the influence of its child nodes:
This refines the average by balancing the current node’s value with the best possible outcome from its child nodes.
- UCT Update: Each node’s UCT value is updated using the following formula:
- Termination Function: The search stops when certain conditions are met, including early stopping, search budget limits (e.g., number of rollouts), or advanced criteria based on LLM logits. Once the conditions are satisfied, the final answer is selected according to the Q-value.
Experiment
Using LLaMA3-8B as the base model combined with MCTSr, experiments were conducted on datasets such as GSM8K, GSM-Hard, MATH, AIME, Math Odyssey, and OlympiadBench.
- GSM Benchmark Test: On GSM8K and GSM-Hard, results show that as the number of MCTSr refinement iterations increases, the success rate improves significantly. Moreover, on GSM-Hard, no performance ceiling was observed even at higher iteration counts.
- MATH Benchmark Test: On the MATH dataset (five difficulty levels), 8-rollouts of MCTSr improved success rates across all levels, with an overall accuracy of 58.24%. This indicates the algorithm’s effectiveness and scalability for problems of varying difficulty.
- Olympiad-level Benchmark Test: On AIME, Math Odyssey, and OlympiadBench datasets, results showed significant improvements with more refinement iterations. For example, AIME accuracy increased from 2.26% to 11.79%, demonstrating the algorithm’s potential and adaptability in tackling Olympiad-level math problems.
Conclusion: Compared with advanced open-source large models, MCTSr can enhance the mathematical reasoning ability of smaller models to a comparable level.


Conclusion
Contributions:
- Developed and validated a reasoning algorithm that integrates LLMs with MCTS, demonstrating its effectiveness on Olympiad-level math problems.
- Experiments revealed that the synergistic potential of LLMs and MCTS shows performance improvements on complex reasoning tasks.
Limitations:
- Although the MCTSr algorithm shows advantages in mathematical tasks, the research is still in its early stages.
- As a general decision-making framework, its broader applicability (e.g., in black-box optimization problems or large language model–driven dialogue and strategy tasks) remains to be further explored.
Prev
CivitAI’s Payment Issue
Next
Awesome-AI-Tutorials
Loading...