MathForm: Scaling Mathematical Autoformalization with Knowledge Retrieval and Verification-Guided Refinement

Lushi Pu, Weiming Zhang, Xinheng Xie, Zixuan Fu, Bingxiang He, Hengyu Zhao, Hongya Lyu, Xin Li, Jie Zhou, Yudong WangarXiv 2026

TL;DR

MathForm introduces a novel framework for mathematical autoformalization that combines external library knowledge retrieval with verification-guided iterative refinement. By constructing the 367K-sample FormalVerse dataset and training an 8B model via supervised fine-tuning and reinforcement learning, the authors outperform specialized models more than four times its size.

What Problem Does This Paper Address?

Autoformalization—the process of translating natural language mathematics into machine-verifiable code (such as Lean 4)—is a crucial bottleneck for scaling automated theorem proving systems. Currently, models struggle with this task because they rely entirely on their internal parametric memory to navigate the massive, complex, and evolving type hierarchies of formal libraries like Lean's Mathlib.

Furthermore, standard data generation pipelines rely on a simple "Best-of-N" filtering strategy, which caps data difficulty at the model's single-pass generation capability. This often results in formal statements that compile successfully but subtly alter or drop key mathematical assumptions, rendering them useless for downstream proof assistants.

Methods

The authors propose MathForm, a closed-loop data construction and training framework that replaces one-shot translation with an iterative, grounded process:

  1. Knowledge Retrieval: A Retrieval Planner analyzes the natural language statement and queries Mathlib via LeanExplore to fetch relevant definitions and existing formalizations, grounding the generation process.
  2. Verification-Guided Iterative Refinement: Instead of discarding failed single-pass attempts, candidates undergo a multi-round loop. They face a format check, a syntax check (Lean compiler diagnostics), and a semantic consistency check (using QwQ-32B as a judge). Failures trigger corrective feedback and re-retrieval for up to three rounds.
  3. Trajectory Reconstruction: The messy multi-round histories are retrospectively synthesized into clean, structured Chain-of-Thought (CoT) formalization trajectories.
  4. Training Recipe: They fine-tune a Qwen3-8B model using Supervised Fine-Tuning (SFT) on these clean trajectories, followed by Reinforcement Learning (RL) using the DAPO algorithm with a joint compilation and semantic consistency reward.
Figure 2: Overview of the MATHFORM data construction and training pipeline. The system combines Mathlib knowledge retrieval, compilation and semantic verification, and iterative refinement to generate reliable formal data, followed by trajectory reconstruction and training of MATHFORM-8B.

Datasets

  • FormalVerse: A newly constructed large-scale Lean 4 dataset containing approximately 367K verified examples. Its sources include Lean-Workbook (32.8%), NuminaMath (26.0%), DeepMath (11.4%), and other diverse mathematical corpora.
  • Evaluation Benchmarks: The model was evaluated across six diverse benchmarks: FormalMATH-Lite, DeepSeek-ProverBench, CombiBench, and the highly abstract FATE series (FATE-M, FATE-H, FATE-X), which cover advanced abstract algebra and algebraic geometry.
Figure 3: Distribution of natural-language problem sources in FORMALVERSE.

Key Insights and Ideas

  • The Power of Iteration: Multi-round refinement recovered an additional 31% of verified data that single-pass generation completely missed, effectively raising the ceiling of data difficulty the pipeline could handle.
  • Syntax $\neq$ Semantics: A statement can compile successfully while still being mathematically incorrect (e.g., swapping quantifiers or dropping preconditions). Incorporating an LLM semantic consistency judge is critical for high-fidelity data.
  • Pipeline Compression: Training an 8B model on these multi-round trajectories effectively "compresses" the complex retrieval-and-refinement pipeline's capabilities into the model's single-pass generation, realizing a form of data-model co-evolution.
Figure 4: Numbers of natural-language-to-formal-language pairs accepted in successive refinement rounds. Later rounds contribute an additional 31.0% of all retained pairs.

Key Results

  • MathForm-8B achieved a macro-average Pass@8 rate of 88.06% under Syntax Check (SC) and 72.37% under Consistency Check (CC) across six benchmarks.
  • It consistently outperformed specialized 32B models like ReForm-32B (68.41% CC) and Goedel-Formalizer-V2-32B (63.74% CC).
  • On highly abstract benchmarks like FATE-H and FATE-X, MathForm-8B achieved CC pass rates of 63% and 37%, outperforming the strongest specialized baselines by 10 to 12 percentage points.
Figure 1: Macro-average Pass@8 (%) across six benchmarks among specialized autoformalizers. MATHFORM- 8B achieves the strongest overall performance within this category despite its smaller model size.

Limitations and Future Work

While MathForm-8B dominates specialized autoformalizers, frontier general-purpose models (like Qwen3.7-Plus or DeepSeek-V4-Pro) still hold an edge in semantic fidelity (higher CC scores), indicating a capability-efficiency trade-off. Additionally, the authors plan to explore larger-scale test-time scaling methods to further boost performance on highly complex mathematical problems.

Summary updated

BibTeX
@misc{pu2026mathform,
  author = {Lushi Pu and Weiming Zhang and Xinheng Xie and Zixuan Fu and Bingxiang He and Hengyu Zhao and Hongya Lyu and Xin Li and Jie Zhou and Yudong Wang},
  title = {{MathForm: Scaling Mathematical Autoformalization with Knowledge Retrieval and Verification-Guided Refinement}},
  year = {2026},
  eprint = {2608.14221},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.14221},
}
Figure