Reliable Evaluation and Benchmarks for Statement Autoformalization

Auguste Poiroux, Gail Garfinkel Weiss, Viktor Kunčak, Antoine Bosselut · DOI

TL;DR

This paper tackles the "evaluation crisis" in statement autoformalization—the task of translating natural language mathematics into formal code (like Lean 4). The authors introduce BEq+, a highly accurate symbolic metric for checking mathematical equivalence, and two new benchmarks, ProofNet# and RLM25, which reveal that while LLMs are improving at undergraduate math, they still struggle with research-level concepts unless provided with specific local context.

What Problem Does This Paper Address?

Autoformalization is a critical bridge for using AI to verify mathematical proofs. However, measuring progress is currently a mess. Standard NLP metrics like BLEU correlate poorly with mathematical correctness, and manual human evaluation is too slow to scale. Furthermore, existing benchmarks like ProofNet are riddled with "porting" errors (over 30% in some cases), and they focus almost exclusively on self-contained undergraduate problems.

This leaves researchers in the dark: Is a model actually getting better at math, or is it just getting better at mimicking the style of a noisy dataset? This paper provides the tools—metrics and clean data—to answer that question.

Methods

The authors propose a multi-pronged approach to stabilize evaluation:

  1. BEq+ (Symbolic Metric): Unlike previous metrics that used a second "prover" LLM to check equivalence (which is expensive and non-deterministic), BEq+ is a deterministic, symbolic metric. it uses a suite of Lean 4 tactics (like tauto, simp_all_arith!, and apply_rules) to try and prove that a candidate statement and a reference statement imply each other. It runs efficiently on a CPU and correlates much more strongly with human judgment than previous methods.
  2. Scaling Test-Time Compute: The authors investigate how performance scales when a model generates multiple candidates ($n=50$ to $n=1000$). They use Type-Check Filtering (discarding code that doesn't compile) followed by selection heuristics like Self-BLEU or Majority Voting to pick the best output.
  3. Context-Aware Prompting: For research-level math, they show that providing "in-file" context (definitions and theorems appearing earlier in the same project) is essential for the model to understand local notation and specialized structures.

Datasets

  • ProofNetVerif: A new dataset of 3,752 formal-informal pairs with human-annotated binary labels for semantic equivalence. This is used to "benchmark the benchmarks"—testing how well metrics like BEq+ actually work.
  • ProofNet#: A "meticulously corrected" version of the popular ProofNet benchmark. The authors fixed errors in 118 entries (31.8% of the total), providing a much more reliable ground truth for undergraduate math.
  • RLM25: A novel benchmark consisting of 619 pairs from six real-world, research-level Lean formalization projects (e.g., the Prime Number Theorem project). This is the first benchmark of its kind to focus on modern, professional-grade mathematics.

Key Insights and Ideas

  • The "Compilability" Signal: Simply filtering out candidates that don't type-check in Lean is a massive performance booster. Even without a fancy selection heuristic, picking a random candidate that compiles is significantly better than greedy decoding.
  • Sampling is King: Performance scales remarkably well with the number of samples. GPT-4o's accuracy on ProofNet# jumps from 31.0% (single generation) to 45.1% when allowed to generate 50 samples and use a selection heuristic.
  • Research Math is "Context-Hungry": On the RLM25 benchmark, models performed abysmally (near 0%) when given only the natural language statement. However, when provided with the surrounding "in-file" context, performance shot up to over 20-30%. This suggests that for professional math, the challenge isn't just translation, but understanding the local mathematical "environment."
  • Symbolic > LLM-based Evaluation: BEq+ achieves a 0.872 Kendall correlation with human judgment, proving that we don't need a 20B parameter model to evaluate autoformalization; well-crafted symbolic rules are more reliable and cheaper.

Key Results

  • Metric Accuracy: BEq+ achieved 98.0% precision on the ProofNetVerif dataset, meaning if it says two statements are equivalent, they almost certainly are.
  • Model Performance: On the corrected ProofNet# test set, GPT-4o leads with 45.1% accuracy (using sampling), followed by Llemma-34B at 28.3%.
  • Research Level: On RLM25, Llemma-34B actually outperformed GPT-4o in some configurations when provided with full file context, reaching 33.4% accuracy compared to GPT-4o's 31.6%.

Limitations and Future Work

The authors acknowledge that BEq+ still struggles with very long, complex statements where the search space for a symbolic proof becomes too large (recall drops from 62.5% on short statements to 29.6% on long ones).

Future work points toward "proof autoformalization"—not just translating the statement of a theorem, but the entire proof. They also suggest that better retrieval-augmented generation (RAG) techniques will be necessary to provide models with the right context from massive libraries like mathlib4 without overwhelming the context window.

Summary updated

BibTeX
@misc{poiroux2024reliable,
  author = {Auguste Poiroux and Gail Garfinkel Weiss and Viktor Kunčak and Antoine Bosselut},
  title = {{Reliable Evaluation and Benchmarks for Statement Autoformalization}},
  year = {2024},
  eprint = {2406.07222},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.07222},
}
Figure