← All papers
First page of ProofJudge: Tool-Grounded LLM Evaluation of Formal Proof Quality in Mathlib

ProofJudge: Tool-Grounded LLM Evaluation of Formal Proof Quality in Mathlib

Shane Caldwell

cs.LO Aug 20, 2026 · v1 cs.AI cs.CL
Introduces an agentic LLM-as-judge system scoring Lean 4 Mathlib proof quality beyond correctness, grounded by tool access to library state.
Formal proofs in Lean 4 that pass the kernel's type checker can nonetheless vary widely in quality. We introduce ProofJudge, an agentic LLM-as-judge system that scores formal proof quality along five dimensions beyond correctness: library leverage, automation fit, structural clarity, statement quality, and Mathlib conventions. We evaluate ProofJudge on a novel dataset of 218 declarations drawn from distinct Mathlib PRs. The judge agent is grounded by tool access to the commit the PR is applied to, enabling it to query the library state when scoring. A judge is considered aligned with human preferences when it rates the version of the PR Mathlib accepted above the initial version that was sent back for revision. All six judge models evaluated recover the reviewers' preference well above chance, from 80.8% to 63.5%, and two open-weight judges reach roughly 70% at a tenth of the best judge's cost. We release the judge harness, evaluation dataset, and evaluation traces as open-source artifacts to support further research.

Formal proofs in Lean 4 that pass the type checker can vary widely in quality along dimensions valued by human mathematicians. As automated proof generation scales, evaluating these qualitative standards places a heavy burden on Mathlib reviewers.

ProofJudge is an agentic LLM-as-judge system that scores formal proof quality along five dimensions beyond correctness: library leverage, automation fit, structural clarity, statement quality, and Mathlib conventions. The judge is grounded via tool access (querying Mathlib through bash) to the commit a PR is applied to. Alignment with human reviewers is measured by whether the judge rates the accepted post-revision version above the rejected pre-revision version.

Evaluated on 218 declaration pairs from distinct Mathlib PRs, all six judge models recovered reviewer preferences above chance, from 80.8% (claude-sonnet-5) to 63.5% (deepseek-v4-flash). Two open-weight judges reached roughly 70% at a tenth of the best judge's cost. Judges were noisy, with verdicts flipping across replicates.

JudgeWeightsAlignment % (95% CI)USD/pair
claude-sonnet-5closed80.8 (73.6–88.2)1.392
gemini-3.7-flashclosed75.2 (69.3–81.2)0.186
muse-glimmer-30bopen70.2 (63.4–77.3)0.140
gpt-5.4-miniclosed68.7 (60.6–77.1)0.136
deepseek-v4-flashopen63.5 (56.0–71.6)0.029
Six judges on the 218-pair test split, three replicates each