Papers
Topics
Authors
Recent
Search
2000 character limit reached

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

Published 17 Jun 2026 in cs.LG | (2606.19315v1)

Abstract: Enhancing the formal math reasoning capabilities of LLMs has become a key focus in both mathematical and computer science communities in recent years. While significant progress has been made in using state-of-the-art Auto-Regressive (AR) LLMs for formal theorem proving, these models suffer from inherent limitations. Their next-token prediction generation methods may yield suboptimal performance due to the challenges of long-range coherence and the compounding of errors over long sequences. Recent advancements in diffusion LLMs (dLLMs), which generate text through iterative denoising of a multi-token block, offer a promising alternative. However, the application of dLLMs to formal mathematics, where maintaining long-range coherence is critical, remains largely understudied. To address the challenges above, we propose Diffusion-Proof, to the best of our knowledge, the first framework to train and apply dLLMs for formal theorem proving. Our frameworks contain training and inference methods for two models. The first one is dLLM-Prover-7B, which performs whole-proof writing with long-range coherent tactic usage. The second one is dLLM-Corrector-7B, which is a novel large block diffusion-based correction model. It leverages the in-filling capabilities of dLLMs to perform local proof correction using bi-directional information. Extensive experiments demonstrate that Diffusion-Proof relatively significantly outperforms the AR LLM baseline trained under the same dataset. Diffusion-Proof achieves an absolute improvement of 1.61% on ProofNet-Test and 6.14% on MiniF2F-Test benchmarks compare to the baseline. Notably, Diffusion-Proof successfully resolves one IMO problem that more advanced thinking model DeepSeek-Prover-V2-7B could not solve, showcasing the unique advantage of dLLMs in formal theorem proving.

Summary

  • The paper introduces a dual-model diffusion LLM framework designed to overcome AR limitations in formal theorem proving.
  • It leverages block-diffusion generation and in-filling correction to maintain long-range tactic consistency and repair local errors.
  • Empirical evaluations on benchmarks like MiniF2F-Test and ProofNet-Test demonstrate significant improvements over AR baselines.

Diffusion-Proof: A Diffusion LLM Framework for Robust Formal Theorem Proving

Motivation and Limitations of AR LLMs in Formal Theorem Proving

Recent developments in LLM-based formal theorem proving have largely relied on auto-regressive (AR) models for sequential token generation in formal environments such as Lean4. Despite progress in scaling and reinforcement learning with verifier feedback, AR models exhibit fundamental deficiencies for this task: lack of long-range proof coherence, compounding errors over lengthy sequences, and incapacity for efficient in-filling correction. These limitations yield degraded performance on benchmarks involving complex proofs and impede the models' ability to perform localized proof repair and bi-directionally-aware tactic planning.

The Diffusion-Proof Framework

To address the architectural and inference constraints of the AR paradigm, this work proposes Diffusion-Proof, the first comprehensive diffusion LLM framework (dLLM-based) for formal theorem proving. The framework consists of two 7B-parameter models: dLLM-Prover-7B for whole-proof generation and dLLM-Corrector-7B for local block-level in-filling correction. The synergistic design leverages the iterative denoising generation mechanics of diffusion models for improved long-range tactic consistency, error correction flexibility, and bidirectional information access. Figure 1

Figure 1: Overview of Diffusion-Proof: block-diffusion-based proof writing with the ability to apply large-block corrections when verification fails but structural correctness is preserved.

Training Protocols and Data Structuring

Diffusion-Proof is fine-tuned atop Fast-dLLM-V2-7B using a 5.5M Lean proof corpus, which, after rule-based cleaning and structure normalization, yields 300K SFT records, balanced between natural language (NL) and formal language (FL). The SFT data is used for dLLM-Prover-7B. Subgoal-decomposed proofs, essential for block-filling tasks, are extracted to construct the corrector dataset. For dLLM-Corrector-7B, large-block correction training with block size up to 512 tokens enables context-rich in-filling of subgoal spans—operation that is infeasible with AR models.

Inference Pipeline: Whole-Proof Generation and Block Correction

Proof synthesis begins with dLLM-Prover-7B, which performs block-based, bidirectional long-range generation for full proof scripts. On Lean4 verification failure, provided the proof skeleton/subgoal structure is correct, Diffusion-Proof invokes the corrector. The faulty subgoal region is replaced with a block-masked token sequence; dLLM-Corrector-7B generates corrected variants conditioned on both prefix and suffix, producing creative, executable local fixes via multi-block bidirectional context. A high generation temperature and aggressive mask-denoise schedule bolster correction robustness.

Experimental Results: Benchmark and Ablation Analyses

Evaluation on MiniF2F-Test (244 tasks, Olympiad and undergraduate-level mathematics) and ProofNet-Test (186 tasks, advanced undergraduate mathematics) is performed using the pass@32 metric. The main baseline is Qwen-2.5-Lean-SFT-7B, an AR model matched for data, parameter count, and lack of RL or Long CoT reasoning.

Diffusion-Proof achieves 50.00% on MiniF2F-Test and 7.53% on ProofNet-Test, yielding absolute gains of 6.14% and 1.61% respectively over the AR baseline. Performance breakdown by problem category (IMO, AMC, Algebra, Number Theory) features improvements consistent with long-range reasoning leverage. Notably, the framework solves problems (e.g., one IMO case) that cannot be proved by DeepSeek-Prover-V2-7B, a more advanced AR model with RL and Long CoT support.

Ablation removes the corrector: dLLM-Prover-7B (without in-filling) still outperforms AR by 4.51% on MiniF2F, confirming architectural advantages independent of local correction.

Validation Loss Analysis

To empirically probe the mechanistic improvements, validation cross-entropy losses (with causal mask emulation for diffusion models) are compared across all models. Both SFT AR and SFT dLLM exhibit highly correlated distributions, as do their respective base models (Pearson 0.98+). However, the dLLM fine-tuned variant achieves lower loss on the proof dataset drawn from MiniF2F, indicating superior modeling of proof dependencies. This suggests that iterative block diffusion enables superior gradient flow and generalization over long proof text. Figure 2

Figure 2: Comparative validation loss for dLLM and AR models, base and SFT variants, illustrating dLLM's generalization advantage.

Full distribution plots and correlation exploration further validate these findings. Figure 3

Figure 3: Extended analysis of validation loss distributions and inter-model correlations for dLLM and AR LLMs.

Block-Based Correction: Case Studies and Qualitative Insights

The corrector module contributes critical improvements, particularly on the subset of tasks with decomposable subgoal error. Case studies demonstrate that the corrector can globally revise a subgoal by generating all internal tactic steps in one large block. This not only rectifies local logical errors but also improves global proof coherence by leveraging suffix context—a competence unreachable by sequential AR correction. On certain problems, Diffusion-Proof successfully proves theorems where even stronger AR models with advanced long-context reasoning (DeepSeek-Prover-V2-7B) fail, attributable to AR's persistent exposure bias and lack of bidirectional context for tactic selection.

Position in the Ecosystem and Theoretical Implications

Control experiments restrict modifications to the generation paradigm, confirming that the observed improvements derive from core dLLM features (iterative denoising, bi-directionality, in-filling flexibility). Comparison to broader SFT and RL-based theorem provers shows Diffusion-Proof matching or exceeding SFT AR methods trained with larger data, and providing a viable alternative to early-stage RL approaches. However, when RLVR and Long CoT protocols are incorporated, AR models still surpass on aggregated SOTA metrics, indicating future work should combine dLLM with those advances.

Conclusions

Diffusion-Proof establishes a technically sound foundation for integrating block diffusion LLMs into formal automated theorem proving pipelines. Empirical results show non-trivial advances over AR LLMs—both in proof synthesis and block-local correction—and highlight unique capabilities essential for tackling proofs with long-range tactics and complex error localization. The architectural decoupling of global generation and local correction via block-diffusion and bi-directional context provides an interpretable mechanism for enhancing both reliability and flexibility of proof repair.

Future Work and Implications

As dLLM scaling laws and RL synergy are explored, it is likely that block-diffusion architectures will play a central role in formal reasoning agents capable of sustaining reliable long-range planning, local proof repair, and rapid iterative development. Diffusion-Proof’s dual-model pipeline offers a framework for further research into data-efficient, context-rich, and verification-aware theorem provers, as well as for investigation into the underlying theoretical properties that drive dLLM’s empirical advantages in mathematical reasoning.

References: "Diffusion-Proof: Recipe for Formal Theorem Proving Beyond Auto-Regressive Generation" (2606.19315)

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 22 likes about this paper.