Introduction
Researchers from OpenAI have introduced GPT-f, an automated theorem prover and proof assistant that leverages Transformer-based language models to navigate the formal mathematics search space. By framing proof generation as a conditional language modeling task, GPT-f achieved a new state-of-the-art on the Metamath library and became the first deep learning system to contribute original proofs accepted by a formal mathematics community.
The Challenge of Automated Theorem Proving
Automated Theorem Proving (ATP) has traditionally been viewed as a search problem. Given a mathematical statement, a system must find a sequence of logical steps (tactics) to reach a proof. However, traditional ATPs face two significant hurdles:
- Combinatorial Explosion: The number of possible steps grows exponentially as the library of known theorems expands.
- Exogenous Terms: Many proofs require "original" mathematical terms (e.g., specific intermediate values or "witnesses") that are not present in the initial problem statement.
While human mathematicians use intuition to narrow the search space and propose useful intermediate terms, machines have historically relied on brute-force search or rigid heuristics. GPT-f explores whether generative language models can provide this "mathematical intuition."
Methodology: Proof as Language Generation
The core of GPT-f is a decoder-only Transformer architecture, similar to GPT-2 and GPT-3. The system is trained on several objectives:
- Proofstep Objective: The model generates a
PROOFSTEP(a theorem and its variable substitutions) conditioned on a current mathematicalGOAL. - Proof Search: Rather than a single greedy prediction, GPT-f maintains a proof tree. It uses the model's log-probabilities to prioritize goal expansion via a "best-first" search strategy.
- Learned Value Function: To guide the search, the model is trained on an "outcome objective," predicting whether a goal is provable by appending a "P" (proven) or "N" (not proven) token. The probability of the "P" token serves as a value function.
- Iterative Self-Improvement: Using "Expert Iteration," the system attempts to prove theorems and incorporates successful new proofs back into its training set for subsequent versions.
Data and Pre-training
The primary environment for GPT-f is Metamath (set.mm), a low-level formal language with approximately 38,000 proofs. To enhance the model's reasoning capabilities, the researchers utilized a 35GB pre-training mix called WebMath.
Pre-training on mathematical data (arXiv) proved more effective than generic web text, suggesting that the model learns transferable "reasoning features." Additionally, synthetic datasets were used to help the model master technical lemmas in arithmetic and ring algebra.
Key Results
GPT-f demonstrated significant improvements over previous benchmarks:
- State-of-the-Art Performance: The model closed 56.22% of proofs in a held-out Metamath test set, more than doubling the previous state-of-the-art (MetaGen-IL at 21.16%).
- Human-Accepted Proofs: GPT-f contributed 23 shortened proofs to the official Metamath library. These were accepted because they were more concise and symmetric than existing human-written versions.
- Zero-Shot Capabilities: The model successfully proved undergraduate-level competition problems (e.g., IMO 1972 B2) when acting as a proof assistant for a human.
Limitations and Future Directions
Despite its success, GPT-f faces several challenges. The search process is computationally expensive, requiring roughly 1,000 GPU hours per 1,000 theorems for the 700M parameter model. Iterative training can also lead to overfitting, where the model becomes "overly optimistic" and fails to explore new paths. Furthermore, while Metamath's simplicity is beneficial for neural networks, it lacks the high-level tactics found in systems like Lean or Coq, which represent a natural next step for this research.
Summary updated