Automated Formalization via Conceptual Retrieval-Augmented LLMs
Wangyue Lu, Lun Du, Sirui Li, Ke Weng, Haozhe Sun, Hengyu Liu, Minghe Yu, Tiancheng Zhang, Ge Yu
Abstract
Interactive theorem provers (ITPs) require manual formalization, which is labor-intensive and demands expert knowledge. While automated formalization offers a potential solution, it faces two major challenges: model hallucination (e.g., undefined predicates, symbol misuse, and version incompatibility) and the semantic gap caused by ambiguous or missing premises in natural language descriptions. To address these issues, we propose CRAMF, a Concept-driven Retrieval-Augmented Mathematical Formalization framework. CRAMF enhances LLM-based autoformalization by retrieving formal definitions of core mathematical concepts, providing contextual grounding during code generation. However, applying retrieval-augmented generation (RAG) in this setting is non-trivial due to the lack of structured knowledge bases, the polymorphic nature of mathematical concepts, and the high precision required in formal retrieval. We introduce a framework for automatically constructing a concept-definition knowledge base from Mathlib4, the standard mathematical library for the Lean 4 theorem prover, indexing over 26,000 formal definitions and 1,000+ core mathematical concepts. To address conceptual polymorphism, we propose contextual query augmentation with domain- and application-level signals. In addition, we design a dual-channel hybrid retrieval strategy with reranking to ensure accurate and relevant definition retrieval. Experiments on miniF2F, ProofNet, and our newly proposed AdvancedMath benchmark show that CRAMF can be seamlessly integrated into LLM-based autoformalizers, yielding consistent improvements in translation accuracy—achieving up to 62.1% and an average of 29.9% relative improvement.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
4 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Autoformalize Mathematical Statements by Symbolic Equivalence and Semantic Consistency cites miniF2F: a cross-system benchmark for formal Olympiad-level mathematics
- SAIR-Comb : A Structure-Aware Iterative Refinement Framework for Combinatorics Autoformalization cites Goedel-Prover-V2: Scaling Formal Theorem Proving with Scaffolded Data Synthesis and Self-Correction
- Decompose, Structure, and Repair: A Neuro-Symbolic Framework for Autoformalization via Operator Trees cites DRIFT: Decompose, Retrieve, Illustrate, then Formalize Theorems
- Decompose, Structure, and Repair: A Neuro-Symbolic Framework for Autoformalization via Operator Trees cites Goedel-Prover-V2: Scaling Formal Theorem Proving with Scaffolded Data Synthesis and Self-Correction
- Decompose, Structure, and Repair: A Neuro-Symbolic Framework for Autoformalization via Operator Trees cites Aria: an Agent for Retrieval and Iterative Auto-Formalization via Dependency Graph
- DRIFT: Decompose, Retrieve, Illustrate, then Formalize Theorems cites Precise Zero-Shot Dense Retrieval without Relevance Labels
- DRIFT: Decompose, Retrieve, Illustrate, then Formalize Theorems cites miniF2F: a cross-system benchmark for formal Olympiad-level mathematics
- DRIFT: Decompose, Retrieve, Illustrate, then Formalize Theorems cites Goedel-Prover-V2: Scaling Formal Theorem Proving with Scaffolded Data Synthesis and Self-Correction
- Goedel-Prover-V2: Scaling Formal Theorem Proving with Scaffolded Data Synthesis and Self-Correction cites miniF2F: a cross-system benchmark for formal Olympiad-level mathematics
- Aria: an Agent for Retrieval and Iterative Auto-Formalization via Dependency Graph cites Goedel-Prover-V2: Scaling Formal Theorem Proving with Scaffolded Data Synthesis and Self-Correction
Cited by top-tier papers4
- Aria: an Agent for Retrieval and Iterative Auto-Formalization via Dependency GraphHanyu Wang, Ruohan Xie, Yutong Wang, Guoxiong Gao et al.ICLR 2026 · 21 citations
- DRIFT: Decompose, Retrieve, Illustrate, then Formalize TheoremsMeiru Zhang, Philipp Borchert, Milan Gritta, Gerasimos LampourasICLR 2026 · 8 citations
- Decompose, Structure, and Repair: A Neuro-Symbolic Framework for Autoformalization via Operator TreesXiaoyang Liu, Zineng Dong, Yifan Bai, Yantao Li et al.ICML 2026 · 1 citation
- SAIR-Comb : A Structure-Aware Iterative Refinement Framework for Combinatorics AutoformalizationWeijie Jiang, Gaolei He, Beibei Xiong, Jianlin Wang et al.ACL 2026
Builds on9
- miniF2F: a cross-system benchmark for formal Olympiad-level mathematicsKunhao Zheng, Jesse Michael Han, Stanislas PoluICLR 2022 · 342 citations
- Precise Zero-Shot Dense Retrieval without Relevance LabelsLuyu Gao, Xueguang Ma, Jimmy Lin, Jamie CallanACL 2023 · 211 citations
- Query Rewriting in Retrieval-Augmented Large Language ModelsXinbei Ma, Yeyun Gong, Pengcheng He, Hai Zhao et al.EMNLP 2023 · 191 citations
- Goedel-Prover-V2: Scaling Formal Theorem Proving with Scaffolded Data Synthesis and Self-CorrectionYong Lin, Shange Tang, Bohan Lyu, Ziran Yang et al.ICLR 2026 · 160 citations
- Autoformalize Mathematical Statements by Symbolic Equivalence and Semantic ConsistencyZenan Li, Yifan Wu, Zhaoyu Li, Xinming Wei et al.NeurIPS 2024 · 48 citations
Related papers
- ProofBridge: Auto-Formalization of Natural Language Proofs in Lean via Joint EmbeddingsPrithwish Jana, Kaan Kale, Ahmet Ege Tanriverdi, Cruise Song et al.ICLR 2026 · 19 citations
- Improving Autoformalization Using Direct Dependency RetrievalShaoqi Wang, Lu Yu, Siwei Lou, Feng Yan et al.ACL 2026 · 2 citations
- Hilbert: Recursively Building Formal Proofs with Informal ReasoningSumanth Varambally, Thomas Voice, Yanchao Sun, Zhifeng Chen et al.ICLR 2026 · 62 citations
- Lean Finder: Semantic Search for Mathlib That Understands User IntentsJialin Lu, Kye Emond, Kaiyu Yang, Swarat Chaudhuri et al.ICLR 2026 · 10 citations
- Herald: A Natural Language Annotated Lean 4 DatasetGuoxiong Gao, Yutong Wang, Jiedong Jiang, Qi Gao et al.ICLR 2025
