Diffusion-Proof: Recipe for Formal Theorem Proving Beyond Auto-Regressive Generation

Ruida Wang, Rui Pan, Pengcheng Wang, Shizhe Diao, Tong ZhangarXiv 2026

TL;DR

Diffusion-Proof is the first framework to successfully train and apply diffusion large language models (dLLMs) to formal theorem proving, moving away from traditional left-to-right auto-regressive generation. By leveraging block-based diffusion and bi-directional context, it achieves significant performance gains on formal math benchmarks and successfully solves a complex International Mathematical Olympiad (IMO) problem that stumped advanced auto-regressive models.

What Problem Does This Paper Address?

Large Language Models (LLMs) have shown great promise in formal theorem proving—writing code in languages like Lean 4 that can be rigorously verified by a computer. However, almost all existing methods rely on Auto-Regressive (AR) models. AR models generate text strictly from left to right, predicting the next token based only on preceding tokens.

This introduces two major flaws in mathematical reasoning:

  1. Exponential error accumulation: A single early mistake cascades down the proof, rendering the rest of the steps useless.
  2. Lack of long-range coherence: AR models struggle to maintain a global plan or look ahead to satisfy future constraints.

Furthermore, AR models cannot naturally perform "in-filling" local corrections using both preceding and succeeding context when a proof step fails.

Methods

The authors introduce Diffusion-Proof, a framework built on block diffusion LLMs (specifically fine-tuning Fast-dLLM-V2-7B). Instead of token-by-token generation, block dLLMs iteratively denoise blocks of text, allowing the model to look both forward and backward within a block during generation.

The framework consists of two specialized 7B-parameter models working in tandem:

  • dLLM-Prover-7B: Trained using a curriculum sorted by proof complexity (length) to generate entire proofs from scratch using block diffusion.
  • dLLM-Corrector-7B: A novel model trained with an extended diffusion block size (from 32 to 512 tokens). If the prover's initial proof fails verification but the overall skeleton is correct, the corrector replaces the faulty subgoal with a mask (<|MASK|>) and uses bi-directional context to infill a local correction.

The framework's workflow is illustrated in Figure 1:

Diffusion-Proof Framework Overview

Datasets

  • Pre-training/SFT Data: The authors compiled a massive 5.5 million record dataset of Lean proofs from prior works, which they cleaned and filtered down to a high-quality mixture of 300k natural language/formal language records to train the prover.
  • Corrector Data: A subset of 128k records containing explicit subgoal decompositions (identified by Lean's have keyword) was used to train the corrector model.
  • Evaluation Benchmarks:
  • MiniF2F-Test: 244 high-school and undergraduate competition math problems formalized in Lean 4.
  • ProofNet-Test: 186 advanced undergraduate math theorems covering topics like real/complex analysis and topology.

Key Insights and Ideas

  • Bi-directional Awareness is Crucial for Math: Unlike natural language, formal math proofs heavily rely on future constraints matching past assumptions. The iterative denoising process of dLLMs naturally accommodates this by allowing the model to refine early steps based on what it plans to do later in the block.
  • The Power of Global Subgoal Trajectories: When correcting a proof, rewriting the entire top-level subgoal (top-level correction) yields better results than simply changing the exact line that failed (in-place correction). This gives the model the freedom to find an entirely new path rather than being trapped by previous bad choices.
  • Paradigm Over Probability: Validation loss analysis showed that the fine-tuned dLLM and AR models have nearly identical cross-entropy loss under a pure causal mask. Yet, the dLLM significantly outperforms the AR model in practice, proving that the architectural advantage lies squarely in the diffusion generation paradigm (iterative refinement) rather than better token-level probability modeling.

Key Results

  • Benchmark Performance: Under the standard pass@32 metric, Diffusion-Proof achieved 50.00% accuracy on MiniF2F-Test (a 6.14% absolute improvement over the Qwen-2.5-Lean-SFT-7B baseline) and 7.53% on ProofNet-Test (a 1.61% absolute improvement).
  • Outperforming Advanced Models: Diffusion-Proof successfully solved the challenging IMO problem imo_1962_p2. Notably, the much larger and more complex DeepSeek-Prover-V2-7B model failed to solve this problem even when equipped with Long Chain-of-Thought (CoT) reasoning, demonstrating the unique robustness of diffusion-based tactic planning.
  • Corrector Impact: The ablation study showed that the dLLM-Corrector alone contributed an extra 1.64% absolute improvement on MiniF2F by successfully fixing complex multi-case subgoals.

Limitations and Future Work

  • Compute and Scale Constraints: Due to limited computational resources, the models were capped at 7B parameters and trained on a relatively small SFT dataset compared to state-of-the-art industrial provers.
  • Lack of Long CoT: The current base dLLM architecture has limited Long Chain-of-Thought capabilities, preventing the authors from exploring how diffusion models handle extended internal deliberation.
  • Language Scope: The framework is currently restricted to Lean 4. Expanding to other formal verification languages like Isabelle or Coq requires building massive new proof corpora and specialized verification pipelines.
  • Future Directions: The authors point to integrating Reinforcement Learning with Verifiable Feedback (RLVR) and exploring the theoretical foundations of dLLMs in logical reasoning as key next steps.

Summary updated

BibTeX
@misc{wang2026diffusion,
  author = {Ruida Wang and Rui Pan and Pengcheng Wang and Shizhe Diao and Tong Zhang},
  title = {{Diffusion-Proof: Recipe for Formal Theorem Proving Beyond Auto-Regressive Generation}},
  year = {2026},
  eprint = {2606.19315},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.19315},
}
Figure