ProofOptimizer: Training Language Models to Simplify Proofs without Human Demonstrations

Alex Gu, Bartosz Piotrowski, Fabian Gloeckle, Kaiyu Yang, Aram H. Markosyan

Introduction

Recent breakthroughs in neural theorem proving have enabled AI models to solve International Mathematical Olympiad (IMO) level problems. However, these models suffer from a severe "bloat" problem. Because they are rewarded solely for correctness, they often produce convoluted, redundant scripts that span thousands of lines.

ProofOptimizer is the first language model trained to simplify these formal Lean proofs without relying on any human-annotated demonstrations. By combining expert iteration, reinforcement learning, and a symbolic linter, it can compress bloated, AI-generated proofs by up to 87%, making them readable for humans and more efficient for training future AI provers.

The Problem: "Write-Only" AI Proofs

While AI provers are reaching new heights in capability, their outputs are often "write-only"—nearly impossible for humans to comprehend. For instance, one AI-generated proof for an IMO problem was 16 times longer than its informal human counterpart.

Side-by-side comparison of a bloated AI-generated proof and its simplified version.

These excessively long proofs are slow to compile in formal systems like Lean and provide poor "synthetic data" for training the next generation of models. The primary bottleneck in solving this issue has been a lack of data: there is no large, pre-existing dataset of "messy proof vs. clean proof" pairs to train on.

Methods: Building ProofOptimizer

To overcome the data scarcity, the authors developed a system centered around a 7B-parameter language model (based on Qwen-2.5) trained through a self-improving loop. The methodology consists of four main pillars:

  1. Data Generation via Subtheorems: The authors broke down long proofs from a filtered version of the Goedel-Pset dataset into smaller "sub-theorems." Using a stronger model (Goedel-Prover-V2-32B), they generated proofs for these pieces, yielding 145,000 theorems for practice.
  2. Expert Iteration (ExpIt): The model attempts to simplify a proof. If Lean verifies that the shorter version is correct and at least 20% shorter, that pair is added to a new training set for supervised fine-tuning.
  3. Reinforcement Learning (RL): The team utilized the GRPO (Group Relative Policy Optimization) algorithm. The reward signal is purely mathematical and automated: Is the proof correct? And how much shorter is it than the original?
  4. Iterative Inference: At test time, the system uses a symbolic linter to remove obvious junk, then iteratively applies the LLM to the shortest version found so far, progressively "chipping away" at the proof's length over multiple rounds.

Key Results and Insights

ProofOptimizer achieved massive compression across standard benchmarks, substantially outperforming off-the-shelf "frontier" models like Gemini-2.5-Pro, even when those models were equipped with agentic tools.

  • miniF2F: Reduced average proof length by 87%.
  • PutnamBench: Reduced average proof length by 57%.
  • IMO 2025: Compressed massive proofs generated by the state-of-the-art Seed-Prover by 50% on average.
Scatter plot demonstrating the systematic reduction in proof length across datasets.

Why This Matters

  • Lean as the Ultimate Judge: Because Lean mechanically verifies correctness, human experts aren't needed to grade simplifications. This enables infinite, "self-play" style scaling of training data.
  • Simplified Proofs are Better Teachers: In a closed-loop experiment, fine-tuning a base model on shortened proofs led to a 2% higher success rate on new problems compared to training on the original long proofs. Clean data makes for better reasoning.
  • Shortness Correlates with Speed: While optimized for token count, the resulting proofs were significantly faster to execute in Lean. Notably, 28% of simplified proofs showed at least a 1.5x speedup in execution time.
  • The Diversity vs. Performance Trade-off: RL training boosted "single-shot" performance but caused "diversity collapse." For iterative shortening, the Expert Iteration (ExpIt) model was often superior because it maintained a wider variety of simplification strategies.

Limitations and Future Work

While highly effective on medium-length proofs, ProofOptimizer still struggles with the "hard tail" of extremely long proofs (thousands of tokens) due to context window limits and complex logic. Furthermore, the current model primarily simplifies tactics within a fixed proof structure. Future work could focus on "high-level" refactoring—identifying when an entire section of a proof can be replaced by a single powerful lemma.

Finally, while length and execution time are correlated, they aren't identical. Preliminary tests optimizing for "heartbeats" (a proxy for CPU effort) successfully eliminated "short but slow" proofs, suggesting that a dedicated "speed optimizer" is a promising avenue for future research.

Summary updated

BibTeX
@inproceedings{gu2026proofoptimizer,
  author = {Alex Gu and Bartosz Piotrowski and Fabian Gloeckle and Kaiyu Yang and Aram H. Markosyan},
  title = {{ProofOptimizer: Training Language Models to Simplify Proofs without Human Demonstrations}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=huptrb4JTa},
}
Figure