← Latest papers
💬 NLP

APE-Bench: Evaluating Automated Proof Engineering for Formal Math Libraries

This paper introduces APE-Bench, the first systematic framework and benchmark for evaluating automated proof engineering in formal mathematics libraries by extracting real-world repository-scale tasks and providing a unified harness to validate both syntactic compilation and semantic correctness across diverse agent implementations.

Original authors: Huajian Xin, Luming Li, Xiaoran Jin, Jacques Fleuriot, Wenda Li

Published 2026-02-03
📖 5 min read🧠 Deep dive

Original authors: Huajian Xin, Luming Li, Xiaoran Jin, Jacques Fleuriot, Wenda Li

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to teach a robot how to be a master librarian for a massive, living library of mathematical proofs. This library, called Mathlib, contains millions of pages. It's not just a static book; it's constantly being rewritten, expanded, and fixed by human experts.

For a long time, researchers tested robots on their ability to solve single, isolated math puzzles (like "Prove that 2+2=4"). But in the real world, being a mathematician isn't just about solving one puzzle; it's about proof engineering. This means navigating the whole library, finding the right tools, fixing broken pages, and making sure your new additions fit perfectly with the millions of pages already there without breaking anything else.

This paper introduces a new way to test robots on these real-world skills. Here is the breakdown using simple analogies:

1. The Problem: The "Isolated Puzzle" vs. The "Living Library"

  • Old Way (miniF2F): Imagine testing a chef by giving them a single recipe card and asking them to cook one dish. If the dish tastes good, they pass. This doesn't tell you if they can manage a whole restaurant kitchen, order ingredients, or fix a broken oven.
  • The Reality: Real math work is like running that restaurant. You have to coordinate with other chefs, use specific tools, and ensure your new dish doesn't ruin the menu.
  • The Gap: Existing tests only checked if the robot could cook the single dish. They didn't check if the robot could handle the chaos of a real kitchen.

2. The Solution: APE-Bench (The "Living Library" Test)

The authors created APE-Bench, a new testing ground that mimics real-life library maintenance.

  • How it works: Instead of giving the robot a fake puzzle, the system looks at real history of the Mathlib library. It finds a moment where a human expert made a change (a "commit"), hides that change, and asks the robot: "Here is the library before the change. Here is a note saying what the human wanted to do. Can you make that change?"
  • The Twist: The robot isn't just graded on whether the code "runs" (syntax). It's graded on two things:
    1. Compilation: Did the code actually compile without errors? (Did the dish burn?)
    2. Semantic Check: Did the robot actually do what was asked? (Did they fix the right problem, or did they just randomly change lines?)

3. The Infrastructure: APE-Harness (The "Universal Kitchen")

To run these tests fairly, they built a system called APE-Harness. Think of this as a universal kitchen simulator.

  • The "Contract": Every test comes with a strict contract. It says: "You are in this specific version of the library. You can only touch these files. You must prove you did the job."
  • The "Scaffolds": The system is designed so you can plug in different robots (like Claude Code, Codex, or their own APE-Agent) into the same kitchen. Because the kitchen rules (the contract) are the same for everyone, you can fairly compare who is actually the better chef, rather than just seeing who got lucky with the instructions.
  • The "Time Travel" Trick: The library has 67 different versions (like 67 different editions of a book). Storing all of them would take up a massive amount of space. The authors built a clever "deduplication" system. If a page is the same in Version 1 and Version 67, the system only stores it once and just points to it. This saved them 85% of the storage space and 98% of the money needed to process the data.

4. The Results: Who Passed the Test?

They tested three top-tier AI models (GPT-5.2, Gemini 3 Pro, and Gemini 3 Flash) on this new, harder test.

  • The Difficulty: The new test was much harder than the old "single puzzle" tests.
    • On the old tests, the robots got 80–90% correct.
    • On the new "Library Maintenance" test, the best robot only got 47% correct.
  • The Winner: Gemini 3 Flash was the most efficient. It solved the most problems for the least amount of money. The other models tried harder (more conversation turns) but ran out of their "budget" before finishing.
  • The Lesson: The robots are great at solving isolated math problems, but they still struggle with the messy, complex task of managing a huge, evolving codebase.

5. Why This Matters

The paper claims this is the first time we have a systematic, automated way to test if AI can do "software engineering for proofs."

  • It moves the goalposts from "Can the AI solve a math problem?" to "Can the AI work as a professional mathematician in a team environment?"
  • It provides a fair playing field where different AI systems can be compared using the exact same rules and tools.

In short: The authors built a realistic simulation of a giant, messy math library and a set of rules to test if AI can fix it. They found that while AI is getting better, it still has a long way to go before it can reliably manage complex, real-world mathematical projects on its own.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →