# MathlibPR: Pull Request Merge-Readiness Benchmark for Formal Mathematical Libraries

*Zixuan Xie, Xinyu Liu, Shangtong Zhang*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/139534) · [OpenReview](https://openreview.net/forum?id=KN8c4YcO15) · [alphaXiv](https://www.alphaxiv.org/abs/2605.07147) · [Open on the map](../papers.html#p139534)

Category: [LLM Agents, Evals & Benchmarks](../pcat/17.md) › [Mathematical Reasoning Benchmarks](../pgroup/377.md) · Type: benchmark or dataset · Keywords: benchmark, code review, formal mathematics, LLM evaluation, pull request, Mathlib

Areas: [Evaluation & Benchmarks](../areas/evaluation.md) › Language Model and Agent Benchmarks › Formal Mathematics Benchmarks

## Summary
MathlibPR is a benchmark built from Mathlib4 pull request histories that evaluates LLM models and agents on distinguishing merge-ready PRs, revealing their current limitations.

## Explained to a 5-year-old
People work together to make a big math library that helps solve math problems. When someone suggests a new piece of math code, they make a pull request that needs to be checked. Checking if the code is good and follows the rules is hard for humans, so they need help. The paper creates a game-like test called MathlibPR that uses real math code changes to see if AI can tell which ones are ready. The AI tries but still finds it difficult to decide which changes are good, so more help is needed.

## Explained to a 5-year-old, longer
A math library is like a big toolbox of math rules and formulas that many people share. When someone thinks of a new math rule, they write code for it and send it as a pull request. The pull request must be checked to see if it follows the library’s style and works correctly. Humans usually do this checking, but it can take a lot of time. The paper makes a test called MathlibPR that uses real pull requests from a math library to see how well AI can do this checking. The test labels each pull request as ready to merge or not ready. Many AI models and AI agents try the test, but they often get it wrong. This shows that AI still needs improvement to help with reviewing math code. The test also gives a way to train better AI helpers that can suggest fixes and decide if a pull request is good. By using real history, the test reflects the real challenges of maintaining a large math library.

## For a technical reader
The paper creates a benchmark from actual Mathlib pull requests to evaluate how well language models can assess PR readiness. It defines a staged evaluation protocol that tests both standalone models and agent systems. Results show that current models struggle to differentiate merge-ready PRs from those that merely pass builds. The benchmark provides a supervised signal from PR merge outcomes, enabling future development of reviewer assistants and reward models for guiding LLM contributions.

## Problem
The review process for contributions to large formal mathematical libraries is a bottleneck, requiring human reviewers to assess whether proposed changes follow conventions and are ready for integration. It is unclear whether large language models can assist in this review task.

## Method
The approach constructs a benchmark from historical Mathlib pull requests, annotates PRs as merge-ready or not, and evaluates both LLM models and LLM agents using a staged protocol that tests their ability to classify PRs. It includes a supervised signal derived from the PR merge outcomes to train or assess the models.

## Results
The approach shows that both LLM models and LLM agents have difficulty distinguishing merge-ready PRs from build-passing PRs that were later revised or never merged.

## Contributions
The paper introduces a benchmark built from real Mathlib4 pull request histories and a staged evaluation protocol for assessing LLM performance on PR review tasks. It also provides a supervised signal derived from PR merge outcomes to guide future reviewer assistants and reward models.

## Practical relevance
It enables the development of automated reviewer assistants and reward models that can evaluate and guide LLMs to produce high-quality contributions to formal mathematical libraries.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/139534)
