TL;DR
This paper introduces FORML4, a new large-scale dataset and a Process-Driven Autoformalization (PDA) framework to improve the conversion of natural language math into the formal language Lean 4. By leveraging compiler feedback on both statements and proofs, their method significantly boosts autoformalization accuracy, especially for the rapidly evolving Lean 4 ecosystem.
What Problem Does This Paper Address?
The core challenge addressed is autoformalization: automatically translating mathematical statements and proofs written in natural language into formal languages that computers can verify. While this has the potential to bridge the gap between human mathematical knowledge and automated reasoning, existing approaches face several hurdles. Firstly, they are often limited to formal languages with vast existing corpora, making it difficult to adapt to rapidly evolving languages like Lean 4. Secondly, many methods struggle to keep pace with the complexity and nuances of formal proofs, often focusing solely on statements. This paper aims to tackle these limitations by creating a comprehensive dataset and a novel framework specifically for Lean 4, emphasizing the role of proof structure and compiler feedback.
Methods
The paper introduces two main innovations:
- FORML4 Dataset: This is a large-scale dataset designed for evaluating autoformalization capabilities in Lean 4. It goes beyond existing datasets by including not only natural language statements but also their corresponding formal statements and, crucially, their proofs. This comprehensive approach allows for a more thorough evaluation of LLMs' ability to handle the entire formalization process.
- Process-Driven Autoformalization (PDA) Framework: This framework leverages the Lean 4 compiler's feedback to iteratively improve autoformalization. It involves:
- Training an autoformalization model on the FORML4 dataset.
- Using the Lean 4 compiler to process the model's output (statements and proofs) and generate precise, step-level feedback.
- Training a Process-Supervised Verifier (PSV) that learns from this detailed compiler feedback, rather than just a binary success/failure signal.
- Fine-tuning the autoformalization model based on the PSV's evaluations, creating a feedback loop for continuous improvement. This process-driven approach allows the model to learn from the nuances of proof construction.
Datasets
- FORML4: The primary contribution is this newly constructed dataset. It contains formal statements and proofs from Mathlib 4, which are then "informalized" into natural language. It includes:
- A large training set (14,250 examples).
- Random and Basic test sets (around 970 examples each) for evaluating performance on theorems with varying complexity and reliance on prior knowledge.
- A Real test set (around 967 examples) derived from natural language math questions and answers, aiming for real-world scenario evaluation.
- Existing Datasets: The paper compares FORML4 with datasets like MMA, Lean Workbook, ProofNet, Minif2f, and FIMO, highlighting FORML4's unique inclusion of proofs and its focus on Lean 4.
Key Insights and Ideas
- Proofs are Crucial: Including proofs in the dataset and evaluation process is vital. They provide essential context for generating higher-quality statements and enable more granular feedback from the compiler, going beyond simple syntax checking.
- Compiler Feedback is Powerful: Leveraging the precise, step-level feedback from the Lean 4 compiler (rather than just a binary success/fail) significantly enhances autoformalization. This "process-driven" approach allows models to learn from the how of proof construction, not just the what.
- Iterative Improvement Works: The proposed PDA framework, with its iterative cycle of autoformalization, compilation, verification, and fine-tuning, leads to substantial gains in accuracy.
- Lean 4's Evolution is a Challenge: The rapid development of Lean 4 presents a unique challenge for autoformalization, underscoring the need for datasets and methods that can adapt to such dynamic environments.
Key Results
- The PDA framework, particularly when using the Process-Supervised Verifier (PSV), significantly improves autoformalization performance on FORML4 compared to baseline models and existing LLMs.
- Models fine-tuned on FORML4 (even a baseline Mistral-7B) show dramatic improvements over general-purpose LLMs, demonstrating the dataset's effectiveness.
- The RFT+VEA model (combining rejective sampling fine-tuning with verifier enhancement) achieved the best performance, highlighting the synergistic benefits of different techniques.
- Human evaluations confirm that the enhanced autoformalizer achieves better results, and that proof validity is a strong indicator of autoformalization success.
- The paper reports specific performance metrics (e.g., greedy scores, pass@k) in tables, showing improvements in the percentage of successfully compiled outputs. For instance, GPT-40 achieved a Greedy score of 5.85% on the Real Test, while fine-tuned models like RFT+VEA reached 35.67% on the same test set.
Limitations and Future Work
- Incompatibility of Topics: Human evaluators noted that certain theorem statements are difficult to informalize due to their specific topics or settings, leading to challenges in achieving strict semantic alignment.
- Subjectivity in Constraints: Specifying condition constraints in natural language can be subjective, impacting the accuracy of informalization.
- Computational Cost: While the PDA framework is more efficient than some prior methods, iterative refinement and compiler feedback can still be computationally intensive.
- Future Work: The authors plan to extend their benchmark and methods to other formal languages like Isabelle, HOL Light, and Coq. They also aim to explore more sophisticated ways to combine enhancement methods and reduce the time complexity of their approach.
Summary updated