Summary of AIPROVER: Agentic Auto-Formalization of Mathematical Research via Certificate-Driven Evolving Harness
Summary (Overview)
- AIPROVER is a novel agentic framework that jointly post-trains a 119B open-weight language model (Leanstral-1.5) and evolves its agentic tool-calling harness via HarnessEvolve, a certificate-driven evolutionary search algorithm, for research-level proof auto-formalization.
- The framework introduces SAM (Semantic Alignment Model) fine-tuning, which uses contrastive learning to align natural language (NL) and formal language (FL) representations in the LLM, treating an NL theorem-proof pair and its Lean counterpart as the same mathematical object.
- LoCoBench is introduced as a new benchmark: 58.9k instances (18.8k labeled NL–Lean pairs, 40.1k unlabeled NL–Mizar pairs) with a 771-instance validation split containing theorem–proof pairs with no public Lean formalization.
- AIPROVER improves pass@4 semantic correctness from 15.7% to 36.7% over its base model, outperforming all other open-weight systems and Aristotle (18.4%). As a skill for Claude Code and Codex, it lifts their semantic correctness from 41.9% and 34.1% to 79.8% and 62.4%, respectively.
- The system is cost-efficient: 24% cheaper than Numina-Lean-Agent while achieving higher accuracy, establishing a new accuracy–cost Pareto frontier for research-level AFPS.
Introduction and Theoretical Foundation
Background and Motivation
The paper addresses proof auto-formalization: translating natural-language (NL) theorems and proofs into formal language (FL) counterparts (e.g., Lean) for mechanical verification. While recent breakthroughs (Navier–Stokes conjecture, Fermat's Last Theorem formalization) demonstrate progress, five critical limitations plague existing systems:
- Cost: Frontier model formalization can take 11 days and 6 billion output tokens
- Human-in-the-loop dependence: Mathematicians must supply target statements and stay involved
- Jagged intelligence: Frontier models excel at familiar tasks but falter on unfamiliar ones
- Semantic drift: Compilation success doesn't guarantee the formalization preserves the theorem's meaning
- Lack of accessibility: Headline results rely on non-public models, preventing cross-checking
Theoretical Foundation
The problem is formally defined as: Given an NL passage (theorem + proof), learn a map to an equivalent FL pair in Lean satisfying four properties:
- (a) Type-correctness: Lean's kernel accepts
- (b) Completeness: No placeholders (sorry, admit) are used
- (c) Semantic correctness: states exactly theorem under the same definitions
- (d) Proof faithfulness: follows the proof strategy of
Properties (a) and (b) are mechanically certified by Lean; (c) and (d) are undecidable (Church, 1936; Turing, 1937) and require a judge.
Key insight: The authors hypothesize that an LLM that internalizes the NL–FL equivalence (rather than relying on external retrieval encoders, critics, or scorers) will formalize more accurately. Additionally, they argue that an agent's performance depends as much on its harness as on the model, motivating joint model–harness co-evolution.
Methodology
1. Semantic Alignment Model (SAM) Fine-Tuning
SAM is a decoder-only LLM fine-tuned to represent and as the same mathematical object. Two views are created:
- NL view: — the hidden state at the [PRED] token when running on
- FL view: — the final hidden state when running on alone
The training objective combines cross-entropy loss on the FL tokens with a contrastive InfoNCE loss:
where is the cosine similarity of unit-normalized projected views, scaled by temperature . The full objective is with .
2. Reward Design (Reward Ladder)
A four-check reward ladder evaluates candidates, with each check presupposing the preceding one:
| Outcome | TC | CP | SC | Reward (r) |
|---|---|---|---|---|
| No answer | - | - | - | 0 |
| Ill-typed | × | - | - | 0.05 |
| Incomplete proof | √ | × | ||
| Complete proof | √ | √ | ||
| Solved | √ | √ | √ |
The four checks are: Type-correctness (TC) — Lean accepts the file; Completeness (CP) — no sorry/axiom bypass; Semantic correctness (SC) — logical equivalence via extended BEq testing both directions ( and ); Length fidelity (LF) — with characters of slack.
3. HarnessEvolve: Certificate-Driven Evolutionary Search
HarnessEvolve evolves harness control flow while the model stays frozen. It maintains a search memory tree where:
- Each node stores a harness, its fitness, per-instance rewards/certificates, and verdict
- All evaluated harnesses are retained (accepted or rejected), enabling the mutator to learn from both successes and failures (inspired by conflict-driven clause learning in SAT solvers)
- Parent selection uses UCB1/UCT-style exploration: where
- A frontier coding agent mutates the parent harness using read, write, search, and bash tools
- Fitness is computed as
4. Agentic RLSF (Reinforcement Learning via Symbolic Feedback)
RLSF post-trains the model inside the frozen harness using GRPO (Group-Relative Policy Optimization):
- episodes per training instance yield rewards from the verifier
- Advantage for rollout : (group mean baseline, no standard deviation normalization)
- The fine-grained reward ladder is essential: under binary verification rewards, groups where all rollouts fail or succeed yield for all and no gradient
5. LoCoBench Benchmark Construction
LoCoBench comprises 58.9k instances from four sources:
| Domain | Mathlib+CSLib (NL+Lean) | MML (NL only) | Val (MML/textbook) | Total |
|---|---|---|---|---|
| Algebraic Structures | 10,151 | 18,081 | 200 | 28,432 |
| Foundations, Logic & Complexity | 5,911 | 7,628 | 471 | 14,010 |
| Number Theory | 2,695 | 13,676 | 100 | 16,471 |
| Total | 18,757 | 39,385 | 771 | 58,913 |
Validation instances are out-of-distribution: Mizar theorems with the longest proofs from papers disjoint from training, plus 71 bounded-arithmetic textbook theorems. NL content is generated via informalization (FL-to-NL) using coding agents with CriticLeanGPT feedback loops.
Empirical Validation / Results
Main Results on LoCoBench-Val (Pass@4, %)
| System | TC | TC+SC (w/ or w/o sorry) | TC+SC (full proofs) |
|---|---|---|---|
| Leanstral-1.5 (no tools) | 18.4 | 3.5 | 3.0 |
| Leanstral-1.5 (w/ tools) | 27.4 | 12.6 | 12.6 |
| Aristotle | 43.2 | 18.5 | 18.4 |
| OpenGauss (w/ Leanstral-1.5) | 57.3 | 22.2 | 21.5 |
| GPT-5.6-Sol | 63.7 | 25.2 | 25.2 |
| Codex (w/ GPT-5.6-Sol) | 97.0 | 34.6 | 34.1 |
| Claude Code (w/ Claude-Opus-5) | 92.2 | 41.9 | 41.9 |
| AIPROVER-Baseline (w/ Seed Harness) | 57.6 | 19.8 | 15.7 |
| AIPROVER-Baseline (w/ HarnessEvolve) | 84.4 | 28.7 | 22.6 |
| AIPROVER (SAM + Interleaved RL/HarnessEvolve) | 94.8 | 39.0 | 36.7 |
| AIPROVER + Codex | 98.7 | 62.4 | 62.4 |
| AIPROVER + Claude Code | 100.0 | 79.8 | 79.8 |
Key Findings
- Open-weight models without Lean-tailored harnesses stay below 3.9% TC+SC; AIPROVER raises this nearly tenfold to 36.7%
- AIPROVER outperforms frontier LLMs: GPT-5.6-Sol (25.2%), Aristotle (18.4%), Codex (34.1%); only Claude Code alone (41.9%) is higher
- As a skill for coding agents: AIPROVER adds +28.3% to Codex and +37.9% to Claude Code, vs. +10.4%/+30.6% for Numina-Lean-Agent and +7.8%/+12.4% for OpenGauss
Ablation Insights
- Seed harness: Wrapping the base model raises TC from 27.4% to 57.6%
- HarnessEvolve alone: Lifts TC to 84.4% but full proofs only to 22.6% (harness fixes compilation, not semantics)
- SAM: Raises matched NL–FL cosine similarity from 0.11 to 0.75; RLSF mostly preserves it (0.64)
- Interleaved RLSF + HarnessEvolve: Full proofs reach 36.7%
Cost Analysis
| Configuration | Accuracy (TC+SC full) | Cost/attempt |
|---|---|---|
| AIPROVER standalone | 36.7% | $0.32 |
| AIPROVER + Claude Code | 79.8% | $1.55 |
| Numina-Lean-Agent + Claude Code | 72.5% | $2.03 |
| AIPROVER + Codex | 62.4% | $0.85 |
| Numina-Lean-Agent + Codex | 44.5% | $1.08 |
AIPROVER forms the accuracy–cost Pareto frontier: higher accuracy at 14–24% lower cost than alternatives.
Theoretical and Practical Implications
Theoretical Contributions
- Semantic alignment as a training signal: AIPROVER is the first to make semantic alignment a training objective rather than a post-hoc filter, building NL–FL equivalence directly into the model via contrastive learning
- Certificate-driven co-evolution: The framework demonstrates that harness and model can be mutually optimized, with verifier certificates guiding both evolutionary search and reinforcement learning
- Fine-grained reward design: The reward ladder shows that graded rewards (distinguishing ill-typed, incomplete, and complete proofs) are essential for effective RL in formal mathematics, where binary rewards yield no gradient signal
Practical Implications
- Accessibility: AIPROVER makes research-level formalization accessible with open-weight models on local GPUs, removing the dependency on costly frontier APIs
- Human-in-the-loop reduction: The system runs unattended, addressing the human-dependence limitation of prior approaches
- Skill integration: AIPROVER can be deployed as a Lean-specialist sub-agent within frontier coding agents, improving both accuracy and cost-efficiency of existing systems
- Benchmark contribution: LoCoBench provides the first large-scale research-level benchmark with Mizar-to-Lean transfer, enabling standardized evaluation of AFPS systems
Conclusion
AIPROVER demonstrates that an open-weight LLM can achieve research-level proof auto-formalization through three synergistic innovations: (1) SAM fine-tuning that aligns NL and FL representations in the model, (2) a fine-grained verifier reward ladder that provides learning signal from partial successes, and (3) HarnessEvolve, which adapts the harness control flow to the evolving model while learning from both accepted and rejected designs.
The framework establishes a new state-of-the-art for open-weight AFPS systems (36.7% vs. 21.5% for the best prior open-weight system) and pushes the accuracy–cost frontier when integrated with frontier coding agents. Key future directions include: extending to additional proof assistants (Isabelle/HOL, Rocq), developing reliable proof-faithfulness checks (currently not scored due to lack of reliable judges), and scaling the co-evolution framework to even larger models and more diverse mathematical domains.
Related papers
- From Expert-Guided Proof Search to Automated Open-Problem Solving
Bolzano, an open-source multi-agent proof-search system, autonomously solved 214 open problems from 3,800 arXiv and STOC papers, including four author-confirmed results.
- AgentGarten: Code Worlds for Evolving Agents
AgentGarten separates world state from neural-rendered appearance, enabling agents to learn emergent tool use in 4-10 rounds versus millions of reinforcement learning episodes.
- Learning Meta-Skills for Agent Harness Design in Test-Time AI4AI
Learning reusable meta-skills for environment design improves AI test-time performance by 8.95 points over no-skill construction, enabling fixed-weight self-improvement.