Introduction
The field of automated theorem proving (ATP) has long faced a significant hurdle: the "formalization gap." While Large Language Models (LLMs) have demonstrated remarkable mathematical reasoning in natural language, most formal verifiers like Lean 4 require precise, machine-readable code. Translating a word problem into this formal syntax—a process known as autoformalization—is often as cognitively demanding as solving the problem itself. Errors in this translation can lead to unprovable statements or, more insidiously, "trivially" provable ones that accidentally assume the conclusion.
Mathesis introduces a comprehensive end-to-end pipeline designed to bridge this gap. By integrating reinforcement learning with a novel evaluation framework, Mathesis enables the direct transition from natural language mathematical statements to machine-verified formal proofs.
The Challenge of Autoformalization
Existing "formal-to-formal" provers rely on human experts to provide the initial formal statement. When AI models attempt this translation, they frequently encounter semantic pitfalls. A common failure mode is the "Circular Proof Trap," where the model erroneously includes the theorem's goal within its assumptions. This results in a logically valid but mathematically vacuous proof. Furthermore, traditional evaluation metrics are often binary (pass/fail based on compilation), providing a sparse reward signal that hinders effective model training.
The Mathesis Pipeline
To address these challenges, the researchers developed a multi-stage architecture that optimizes the entire path from natural language (NL) to formal language (FL) and finally to a verified proof.
1. Mathesis-Autoformalizer
The core of the translation layer is the Mathesis-Autoformalizer. Unlike models trained solely on static datasets, this component utilizes Group Relative Policy Optimization (GRPO). This online reinforcement learning technique allows the model to learn from a composite reward function that evaluates both syntactic validity (compilation in Lean) and semantic alignment with the original English text.
2. Hierarchical Preference Optimization (HPO)
A key innovation in Mathesis is the use of Hierarchical Preference Optimization. This technique creates a feedback loop between the autoformalizer and the downstream prover. The autoformalizer is refined based on whether its generated formal statements actually lead to successful, verified proofs. This "prover-in-the-loop" approach ensures that the formalizations are not just syntactically correct but are also "provable" by the subsequent AI agent.
3. LeanScorer: Fuzzy Logic Evaluation
To provide a more nuanced training signal, the authors introduced LeanScorer. Instead of a simple binary check, LeanScorer deconstructs mathematical problems into individual premises and conclusions. It then employs the Sugeno Fuzzy Integral to aggregate these components into a continuous score. This allows the system to distinguish between perfect translations, minor notation inconsistencies, and fundamental logical errors, facilitating smoother gradient updates during RL training.
Datasets and Benchmarks
The effectiveness of Mathesis was evaluated on two primary benchmarks:
- Gaokao-Formal: A new, high-quality dataset consisting of 488 problems from China’s National College Entrance Exam. This benchmark is particularly challenging as it includes complex geometry and combinatorics problems that require deep multi-step reasoning.
- MiniF2F: A standard industry benchmark for formal theorem proving, used to compare Mathesis against existing state-of-the-art systems.
Key Results and Impact
Mathesis demonstrates significant improvements over previous methods across multiple dimensions. The Mathesis-Autoformalizer alone achieved a 22% higher pass rate than the previous leading model, Kimina, on the Gaokao-Formal benchmark.
As shown in the experimental results, the integration of Hierarchical Preference Optimization (Mathesis-HPO) consistently boosts the performance of various prover backends. The full system achieved a record-breaking 18.0% accuracy on Gaokao-Formal and 64.3% on MiniF2F (pass@32).
Beyond academic benchmarks, the system has seen real-world application through integration into the Huawei Celia AI assistant. In this deployment, Mathesis improved the accuracy of solving complex mathematical sub-questions from 65.3% to 84.2%, demonstrating the practical utility of robust autoformalization.
Conclusion
Mathesis represents a major step toward autonomous mathematical reasoning. By treating autoformalization as a reinforcement learning task and linking it directly to prover success, the system overcomes the primary bottlenecks of formal theorem proving. Future work will focus on unifying the formalization and proving stages into a single model and enhancing the human-readability of the generated Lean code.
Summary updated