Autoformalization in the Wild: Assessing LLMs on Real-World Mathematical Definitions

Lan Zhang, Marco Valentino, Andre Freitas
2/17/2025
cs.CLcs.FL

No official code found. Best implementation: lanzhang128/definition_autoformalization (8 stars, last commit 2025-11-12).

Abstract

Thanks to their linguistic capabilities, LLMs offer an opportunity to bridge the gap between informal mathematics and formal languages through autoformalization. However, it is still unclear how well LLMs generalize to sophisticated and naturally occurring mathematical statements. To address this gap, we investigate the task of autoformalizing real-world mathematical definitions: a critical component of mathematical discourse. Specifically, we introduce two novel resources for autoformalization, collecting definitions from Wikipedia (Def_Wiki) and arXiv papers (Def_ArXiv). We then systematically evaluate a range of LLMs, analyzing their ability to formalize definitions into Isabelle/HOL. Furthermore, we investigate strategies to enhance LLMs' performance including refinement through external feedback from Proof Assistants, and formal definition grounding, where we augment LLMs' formalizations through relevant contextual elements from formal mathematical libraries. Our findings reveal that definitions present a greater challenge compared to existing benchmarks, such as miniF2F. In particular, we found that LLMs still struggle with self-correction, and aligning with relevant mathematical libraries. At the same time, structured refinement methods and definition grounding strategies yield notable improvements of up to 16% on self-correction capabilities and 43% on the reduction of undefined errors, highlighting promising directions for enhancing LLM-based autoformalization in real-world scenarios.

View on arXivView PDF

Code Implementations(1)

80PythonOct 3, 202411 months ago

Similar Papers

Cite this paper

@article{zhang2025autoformalization,
  title  = {Autoformalization in the Wild: Assessing LLMs on Real-World Mathematical Definitions},
  author = {Lan Zhang and Marco Valentino and Andre Freitas},
  year   = {2025},
  eprint = {2502.12065},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.12065v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.12065.svg)](https://codeofpaper.com/paper/2502.12065)

Discussion