Abstract
Mathematical reasoning remains a significant challenge for Large Language Models (LLMs) due to hallucinations. While formal proof assistants like Lean can verify steps, LLMs often lack a global sense of proof progress, leading to inefficient search. We introduce LeanProgress, a method to predict the number of remaining steps in a proof. By training on a balanced corpus of Lean proofs and incorporating proof history, our model achieves 75.8% prediction accuracy. Integrating this progress signal into a best-first search framework yields a 3.8% improvement in proof success on Mathlib4, particularly for complex, multi-step theorems.
The Challenge: "Tunnel Vision" in Neural Theorem Proving
Large Language Models have excelled at suggesting individual tactics in formal proof assistants. However, they often suffer from "tunnel vision"—they can propose locally correct steps without understanding the global trajectory of the proof. This lack of a progress indicator makes search algorithms like Best-First Search (BFS) inefficient, as they cannot distinguish between a state nearing a solution and one drifting into a dead end.
Methods: Training a "GPS" for Proofs
LeanProgress addresses this by training a model to act as a "distance-to-goal" predictor.
- The Predictor: The authors fine-tuned models like DeepSeek Coder 1.3B and Qwen 2.5 Coder to perform regression on the number of remaining steps. Given a proof state, the model predicts an integer representing the distance to completion.
- Proof History Utilization: Unlike previous approaches that only consider the current goal, LeanProgress includes the sequence of tactics already applied. This "history" provides directional context, helping the model understand the current strategy (e.g., an ongoing induction).
- Progress-Guided Search: This predictor is integrated into a BFS framework. The search algorithm prioritizes branches using a weighted score: $$C(s_i) = \alpha N(s_i) + (1-\alpha)P(s_i)$$ where $N(s_i)$ is the predicted remaining steps and $P(s_i)$ is the tactic log-probability. This balances local confidence with global progress.
Datasets and Balancing
The models were trained on proofs from Lean Workbook Plus and Mathlib4. To generate ground truth, the researchers used BFS to find the shortest paths for approximately 80,000 proof trajectories.
A significant challenge was the skewed distribution of proof lengths; most proofs in standard libraries are very short (1-2 steps). To prevent the model from biasedly predicting short distances, the authors employed a distribution balancing technique, upsampling longer proofs to ensure the model learns to recognize early and middle stages of complex problems.
Key Insights and Results
The inclusion of proof history proved critical. As shown in the performance data, history acts as the "velocity" of the proof, boosting accuracy significantly over using the state alone.
- Prediction Accuracy: LeanProgress achieved an overall accuracy of 75.8% with a Mean Absolute Error (MAE) of 3.15.
- Search Performance: Integration into the Reprover search framework increased the Mathlib4-test pass rate from 41.4% to 45.2% (a 3.8% absolute improvement).
- Practical Utility: The 1.3B parameter model is lightweight enough for real-time use in IDEs via the
predict_steps_with_suggestiontactic, providing human mathematicians with immediate feedback on their proof progress.
Conclusion
LeanProgress demonstrates that a global progress signal is a powerful heuristic for neural theorem proving. By combining local tactic probabilities with global distance estimates, search algorithms can navigate the vast space of mathematical formalization more effectively. Future work includes using this signal as a reward function for reinforcement learning to address the sparse reward problem in automated reasoning.
Summary updated