Abstract
Large Language Models (LLMs) frequently encounter difficulties in multi-step mathematical reasoning, often failing during standard greedy decoding despite possessing the necessary latent knowledge. This paper presents a novel inference-time framework that significantly boosts reasoning accuracy without requiring additional fine-tuning of the base model. By integrating Monte Carlo Tree Search (MCTS) with a lightweight Energy-Based Model (EBM) trained via Noise Contrastive Estimation (NCE), the proposed method achieves substantial gains on benchmarks like GSM8k and AQUA-RAT.
Introduction
While LLMs have revolutionized natural language processing, their performance on complex mathematical tasks remains a bottleneck. Standard decoding strategies, such as greedy search, often lead models into logical dead-ends. Traditional remedies involve computationally intensive Reinforcement Learning from Human Feedback (RLHF) or massive data augmentation. This research explores a more efficient alternative: "unlocking" existing reasoning capabilities by improving how models search for and verify reasoning paths during inference.
Methodology
The proposed framework operates through a four-step pipeline designed to refine the model's output distribution and search strategy.
Residual Energy-Based Model (Residual-EBM)
The core idea is to reformulate the LLM's output probability ($P_{LM}$) by introducing a correction factor. The new distribution is defined such that the probability is proportional to $P_{LM} \cdot \exp(-E_\theta(x))$, where $E_\theta(x)$ is an energy function that learns to assign lower energy (higher reward) to logically sound reasoning steps.
Noise Contrastive Estimation (NCE)
To train the energy function efficiently, the authors employ Noise Contrastive Estimation. A DeBERTa-large model is trained as a binary classifier to distinguish between ground-truth solutions ("positive" data) and the LLM's own flawed outputs ("noise"). This approach avoids the computational burden of calculating the partition function while forcing the model to learn subtle logical distinctions.
MCTS Guided by Energy
During inference, the system employs MCTS to explore a tree where each node represents a complete sentence rather than a single token. This sentence-level granularity makes the search space manageable. The energy function provides the critical reward signal, allowing the search algorithm to balance exploration of new paths with exploitation of promising ones.
Experimental Evaluation
The framework was tested on the GSM8k (grade school math) and AQUA-RAT (algebra word problems) benchmarks. The energy function was trained on the respective training sets, while the large-scale LLMs (e.g., Llama2, RFT) remained frozen. This "No Train" approach ensures that the multi-billion parameter base models do not require expensive updates.
Results and Discussion
The results demonstrate that the MCTS-EBM approach consistently outperforms standard greedy decoding across various model sizes and architectures.
As shown in the table above, Llama2-7B saw a dramatic increase in pass@1 accuracy, jumping from 41.69% to 52.23% (+10.54%). Similar improvements were observed for RFT-7B (+6.48%) and RFT-13B (+6.08%). Notably, the method outperformed "Self-Consistency" majority voting (which requires 10 paths) while focusing on optimizing a single high-quality path through internal search.
Conclusion and Future Work
The "No Train Still Gain" approach proves that significant reasoning improvements can be achieved by focusing on inference-time search and verification. By keeping the primary LLM frozen and training only a small auxiliary verifier, the method offers a cost-effective path to higher performance. Future work will focus on reducing inference latency caused by MCTS roll-outs and improving the generalizability of the energy function across diverse task formats.
Summary updated