Introduction
Deep learning has revolutionized many domains, yet "neural theorem proving"—the application of AI to write formal mathematical proofs—faces a unique challenge: data starvation. Formalizing mathematics is an incredibly labor-intensive process, estimated to cost roughly 2.5 man-years per megabyte of code. Because available datasets of human-written proofs are small, large language models (LLMs) often overfit, memorizing specific human "tactics" (high-level commands) rather than learning the underlying logical structures.
To address this, the authors propose Proof Artifact Co-training (PACT), a methodology designed to extract significantly more training signal from existing mathematical libraries without requiring additional human labor.
Methodology: The Kernel as a Teacher
PACT shifts the focus from what humans write to what the computer sees. When a human writes a proof in an assistant like Lean, they use high-level tactics. Lean then elaborates these into "proof terms"—dense, low-level logic that the computer's kernel can verify. PACT extracts millions of self-supervised data points from these internal artifacts.
The model, a decoder-only Transformer, is co-trained on the primary goal of predicting human tactics alongside nine auxiliary tasks derived from internal artifacts. These tasks include:
- Next Lemma Prediction: Guessing the next mathematical tool to apply.
- Proof Term Prediction: Synthesizing the low-level logic for a specific goal.
- Skip-proof: Predicting missing sub-terms within a proof.
- Theorem Naming: Identifying a theorem based on its formal statement.
Experimental Setup and Datasets
The researchers developed LEANSTEP, a new dataset and machine learning environment for the Lean 3 prover. It includes approximately 128,000 human tactic steps and millions of PACT-derived examples (e.g., 9.3 million for premise classification). The models were initially pre-trained on WebMath, a large-scale dataset of mathematical text, before being fine-tuned or co-trained on mathlib, the primary library of formalized mathematics in Lean.
Key Results
The integration of PACT led to a substantial performance jump. The best PACT-enhanced model increased the theorem-proving success rate from a baseline of 32.2% to 48.4% on a held-out test set.
Beyond raw percentages, the study revealed several key insights:
- Co-training vs. Pre-training: Simultaneous training on auxiliary tasks (co-training) proved more effective than sequential training (pre-training). PACT acts as a powerful regularizer, preventing overfitting on scarce human data.
- Generalization: On "future-mathlib"—theorems added to the library after the training data was collected—the model maintained a 37% success rate, demonstrating an ability to handle novel concepts.
- Efficiency: Over one-third of the proofs found by the AI were more efficient than the original human versions. Consequently, 19 "nontrivial" proofs generated by the model were officially committed to the Lean mathematical library.
Discussion and Future Work
While PACT significantly improves model scaling and logic comprehension, limitations remain. The model is still bounded by the existing corpus of theorems; without a mechanism to automatically generate new, interesting theorem statements, learning may eventually saturate. Furthermore, while PACT aids imitation learning, future work could combine it with reinforcement learning (RL) or "expert iteration" to allow models to learn from their own successful searches. Finally, the computational cost of running these proofs in a search loop remains a challenge for real-time interactive deployment of larger models.
Summary updated