TITLE: DeepSeek-Prover-V2: Advancing Formal Mathematical Reasoning via Reinforcement Learning for Subgoal Decomposition ARXIV: 2504.21801 AUTHORS: Z.Z. Ren , Zhihong Shao , Junxiao Song , Huajian Xin , Haocheng Wang , Wanjia Zhao , Liyue Zhang , Zhe Fu , Qihao Zhu , Dejian Yang , Z.F. Wu , Zhibin Gou , Shirong Ma , Hongxuan Tang , Yuxuan Liu , Wenjun Gao , Daya Guo , Chong Ruan DATE: [Submitted on 30 Apr 2025 ( v1 ), last revised 18 Jul 2025 (this version, v2)] === SECTION HEADINGS === ## Report GitHub Issue ## DeepSeek-Prover-V2: Advancing Formal Mathematical Reasoning via Reinforcement Learning for Subgoal Decomposition ## Abstract ## 1 Introduction ## 2 Method ## 2.1 Recursive Proof Search via Subgoal Decomposition ## Sketching Formal Proofs from Natural Language Reasoning. ## Recursive Resolution of Subgoals. ## Curriculum Learning for Subgoal-based Theorem Proving. ## 2.2 Unifying Informal Reasoning and Proof Formalization ## Cold Start by Synthetic Data. ## Reasoning-oriented Reinforcement Learning. ## 2.3 Training Details of DeepSeek-Prover-V2 ## Two-Stage Training. ## Expert Iteration. ## Supervised Fine-tuning. ## Reinforcement Learning. ## Distillation. ## 3 Experimental Results ## 3.1 Results on MiniF2F Benchmark ## Comparison with SoTA Models. ## Proving Challenging Problems through Subgoal-guided Curricula. ## CoT vs. non-CoT. ## 3.2 Results on Undergraduate-level Benchmarks ## Reward Hacking in Reinforcement Learning. ## 3.3 Results on Combinatorial Problems ## 3.4 Results on FormalMATH ## 3.5 ProverBench: Formalization of AIME and Textbook Problems ## AIME Formalization. ## Textbook Formalization. ## 4 Conclusion === BODY (head) === DeepSeek-Prover-V2: Advancing Formal Mathematical Reasoning via Reinforcement Learning for Subgoal Decomposition ## Report GitHub Issue × Title: Content selection saved. Describe the issue below: Description: Submit without GitHub Submit in GitHub arXiv is now an independent nonprofit! Learn more × Back to arXiv Why HTML? Report Issue Back to Abstract Download PDF Abstract 1 Introduction 2 Method 2.1 Recursive Proof Search via Subgoal Decomposition Sketching Formal Proofs from Natural Language Reasoning. Recursive Resolution of Subgoals. Curriculum Learning for Subgoal-based Theorem Proving. 2.2 Unifying Informal Reasoning and Proof Formalization Cold Start by Synthetic Data. Reasoning-oriented Reinforcement Learning. 2.3 Training Details of DeepSeek-Prover-V2 Two-Stage Training. Expert Iteration. Supervised Fine-tuning. Reinforcement Learning. Distillation. 3 Experimental Results 3.1 Results on MiniF2F Benchmark Comparison with SoTA Models. Proving Challenging Problems through Subgoal-guided Curricula. CoT vs. non-CoT. 3.2 Results on Undergraduate-level Benchmarks Reward Hacking in Reinforcement Learning. 3.3 Results on Combinatorial Problems 3.4 Results on FormalMATH 3.5 ProverBench: Formalization of AIME and Textbook Problems AIME Formalization. Textbook Formalization. 4 Conclusion References A Examples of Non-CoT and CoT Prompting for Proof Generation A.1 Non-CoT Generation of DeepSeek-Prover-V2 A.2 CoT Generation Strategy of DeepSeek-Prover-V2 B Examples of the Buggy Proofs Generated by DeepSeek-Prover-V2-7B on PutnamBench Triggering the User Interface Bug of apply? C An Example of Using exfalso to Prove a Vacuously True Statement D Revision to MiniF2F License: arXiv.org perpetual non-exclusive license arXiv:2504.21801v2 [cs.CL] 18 Jul 2025 \reportnumber 001 ## DeepSeek-Prover-V2: Advancing Formal Mathematical Reasoning via Reinforcement Learning for Subgoal Decomposition Z.Z. Ren*, Zhihong Shao*, Junxiao Song*, Huajian Xin † , Haocheng Wang † , Wanjia Zhao † , Liyue Zhang, Zhe Fu Qihao Zhu, Dejian Yang, Z.F. Wu, Zhibin Gou, Shirong Ma, Hongxuan Tang, Yuxuan Liu, Wenjun Gao Daya Guo, Chong Ruan DeepSeek-AI https://github.com/deepseek-ai/DeepSeek-Prover-V2 Corresponding author: Core contributors † Work done during internship at DeepSeek-AI. ## Abstract We introduce DeepSeek-Prover-V2, an open-source large language model designed for formal theorem proving in Lean 4, with initialization data collected through a recursive theorem proving pipeline powered by DeepSeek-V3. The cold-start training procedure begins by prompting DeepSeek-V3 to decompose complex problems into a series of subgoals. The proofs of resolved subgoals are synthesized into a chain-of-thought process, combined with DeepSeek-V3’s step-by-step reasoning, to create an initial cold start for reinforcement learning. This process enables us to integrate both informal and formal mathematical reasoning into a unified model. The resulting model, DeepSeek-Prover-V2-671B, achieves state-of-the-art performance in neural theorem proving, reaching 88.9 % 88.9\% pass ratio on the MiniF2F-test and solving 47 out of 658 problems from PutnamBench. In addition to standard benchmarks, we introduce ProverBench, a collection of 325 formalized problems, to enrich our evaluation, including 15 selected problems from the recent AIME competitions (years 24-25). Further evaluation on these 15 AIME problems shows that the model successfully solves 6 of them. In comparison, DeepSeek-V3 solves 8 of these problems using majority voting, highlighting that the gap between formal and informal mathematical reasoning in large language models is substantially narrowing. Figure 1: Benchmark performance of DeepSeek-Prover-V2. On the AIME benchmark, DeepSeek-V3 is evaluated using the standard find-answer task for natural-language reasoning, while prover models generate Lean code to construct formal proofs for a given correct answer. ## 1 Introduction The emergence of reasoning capabilities in large language models (LLMs) has revolutionized numerous areas of artificial intelligence, particularly in the domain of mathematical problem solving ( DeepSeek-AI, 2025 ) . These advancements are largely enabled by the paradigm of inference-time scaling, most notably through natural language chain-of-thought reasoning ( Jaech et al., 2024 ) . Rather than relying solely on a single forward pass to arrive at an answer, LLMs can reflect on intermediate reasoning steps, improving both accuracy and interpretability. Despite the success of natural language reasoning in solving competition-level mathematical problems, its application to formal theorem proving remains fundamentally challenging. LLMs perform natural language reasoning in an inherently informal manner, relying on heuristics, approximations, and data-driven guessing patterns that often lack the rigorous structure required by formal verification systems. In contrast, proof assistants such as Lean ( Moura and Ullrich, 2021 ) , Isabelle ( Paulson, 1994 ) , and Coq ( Barras et al., 1999 ) operate on strict logical foundations, where every proof step must be explicitly constructed and formally verified. These systems permit no ambiguity, implicit assumptions, or omission of details. Bridging the gap between informal, high-level reasoning and the syntactic rigor of formal verification systems remains a longstanding research challenge in neural theorem proving ( Yang et al., 2024 ) . To harness the strengths of informal mathematical reasoning in support of formal theorem proving, a classical approach is to hierarchically decompose formal proofs based on the guidance of natural-language proof sketches. Jiang et al. (2023) proposed a framework, called Draft, Sketch, and Prove (DSP), that leverages a large language model to generate proof sketches in natural language, which are subsequently translated into formal proof steps. This informal-to-formal theorem proving paradigm closely mirrors the concept of subgoals in hierarchical reinforcement learning ( Barto and Mahadevan, 2003 ; Nachum et al., 2018 ; Eppe et al., 2022 ) , where complex tasks are broken down into a hierarchy of simpler subtasks that can be solved independently to progressively achieve the overarching objective. In formal theorem proving, a subgoal is typically an intermediate proposition or lemma that contributes to the proof of a larger theorem ( Zhao et al., 2023 ; Zhao et al., 2024 ) . This hierarchical decomposition aligns with human problem-solving strategies and supports modularity, reusability, and more efficient proof search ( Wang et al., 2024b ; Zheng et al., 2024 ) . Recent studies have extended this paradigm by employing multi-tiered hierarchies for structured proof generation ( Wang et al., 2024a ) , and by leveraging reinforcement learning techniques to optimize the decomposition of complex theorems into manageable subgoals ( Dong et al., 2024 ) . In this paper, we develop a reasoning model for subgoal decomposition, leveraging a suite of synthetic cold-start data and large-scale reinforcement learning to enhance its performance. To construct the cold-start dataset, we develop a simple yet effective pipeline for recursive theorem proving, utilizing DeepSeek-V3 ( DeepSeek-AI, 2024 ) as a unified tool for both subgoal decomposition and formalization. We prompt DeepSeek-V3 to decompose theorems into high-level proof sketches while simultaneously formalizing these proof steps in Lean 4, resulting in a sequence of subgoals. Since the subgoal decomposition is powered by a large general-purpose model, we use a smaller 7B model to handle the proof search for each subgoal, thereby reducing the associated computational burden. Additionally, we introduce a curriculum learning framework that leverages the decomposed subgoals to generate conjectural theorems, progressively increasing the difficulty of training tasks to better guide the model’s learning process. Once the decomposed steps of a challenging problem are resolved, we pair the complete step-by-step formal proof with the corresponding chain-of-thought from DeepSeek-V3 to create cold-start reasoning data. Based on the cold start, a subsequent reinforcement learning stage is applied to further strengthen the connection between informal mathematical reasoning and formal proof construction. Our experiments show that reinforcement learning starting from the cold start of informal reasoning in task decomposition significantly enhances the model’s capabilities in formal theorem proving. The resulting DeepSeek-Prover-V2-671B model establishes a new state-of-the-art in neural theorem proving across multiple benchmarks. On MiniF2F-test, it achieves 82.4 % 82.4\% accuracy with Pass@32, improving to 88.9 % 88.9\% with Pass@8192. The model shows strong generalization capabilities to college-level theorem proving, solving 37.1 % 37.1\% of ProofNet-test problems with Pass@1024 and tackling 47 out of 658 challenging PutnamBench problems. Additionally, we contribute ProverBench, a benchmark dataset containing 325 formalized problems to advance neural theorem proving research, including 15 from the prestigious AIME competitions (years 24-25). DeepSeek-Prover-V2-671B successfully solves 6 of these 15 challenging AIME problems, further demonstrating its sophisticated mathematical reasoning capabilities. ## 2 Method Figure 2: Overview of the cold-start data collection process employed by DeepSeek-Prover-V2. We first prompt DeepSeek-V3 to generate a natural-language proof sketch while simultaneously formalizing it into a Lean statement with sorry placeholders for omitted proof details. A 7B prover model then recursively solves the decomposed subgoals. By combining these subgoal proofs, we construct a complete formal proof for the original complex problem. This composed proof is appended to DeepSeek-V3’s original chain-of-thought, creating high-quality cold-start training data for formal mathematical reasoning. ## 2.1 Recursive Proof Search via Subgoal Decomposition Decomposing the proof of a complex theorem into a sequence of smaller lemmas that serve as stepping stones is an effective strategy commonly employed by human mathematicians. Several previous studies have explored this hierarchical strategy in the context of neural theorem proving, aiming to enhance proof search efficiency by leveraging the informal reasoning capabilities of modern LLMs ( Jiang et al., 2023 ; Zhao et al., 2023 ; Wang et al., 2024a ; Dong et al., 2024 ) . In this paper, we develop a simple yet effective pipeline that utilizes DeepSeek-V3 ( DeepSeek-AI, 2024 ) as a unified tool for subgoal decomposition in formal theorem proving. ## Sketching Formal Proofs from Natural Language Reasoning. Recent advances in large language models have led to significant breakthroughs in informal reasoning capabilities. To bridge the gap between formal and informal reasoning, we leverage cutting-edge general-purpose LLMs, recognized for their strong mathematical reasoning and instruction-following abilities, to construct the foundational framework of our theorem-proving system. Our findings indicate that off-the-shelf models, such as DeepSeek-V3 ( DeepSeek-AI, 2024 ) , are capable of decomposing proof steps and expressing them in formal languages. To prove a given formal theorem statement, we prompt DeepSeek-V3 to first analyze the mathematical problem in natural language, then decompose the proof into smaller steps, translating each step into a corresponding Lean formal statement. Since general-purpose models are known to struggle with producing complete Lean proofs, we instruct DeepSeek-V3 to generate only a high-level proof sketch with the details omitted. The resulting chain of thought culminates in a Lean theorem composed of a sequence of have statements, each concluded with a sorry placeholder indicating a subgoal to be solved. This approach mirrors the human style of proof construction, in which a complex theorem is incrementally reduced to a sequence of more manageable lemmas. Figure 3: An illustrative example of how we translate decomposed subgoals into a series of lemma statements. We first (a) replace the original goal state and then (b) incorporate preceding subgoals as premises. Statement type (b) is used for recursive solving of complex problems, while both types (a) and (b) are incorporated into the curriculum learning process. ## Recursive Resolution of Subgoals. Leveraging the subgoals generated by DeepSeek-V3, we adopt a recursive solving strategy to systematically resolve each intermediate proof step. We extract subgoal expressions from have statements to substitute them for the original goals in the given problems (see Figure 3 (a)), and then incorporate the preceding subgoals as premises (see Figure 3 (b)). This construction enables subsequent subgoals to be resolved using the intermediate results of earlier steps, thereby promoting a more localized dependency structure and facilitating the development of simpler lemmas. To reduce the computational overhead of extensive proof search, we employ a smaller 7B prover model specifically optimized for processing the decomposed lemmas. Upon the successful resolution of all decomposed steps, a complete proof of the original theorem can be automatically derived. ## Curriculum Learning for Subgoal-based Theorem Proving. The training of prover models requires large formal-language problem sets, typically derived by formalizing existing natural-language mathematical corpora ( Xin et al., 2024a ; Ying et al., 2024 ; Lin et al., 2025 ) . Although formalization of human-authored texts provides high-quality and diverse formal content, the resulting training signals for prover models are often sparse, as a large proportion of computational attempts do not yield successful proofs and therefore offer no positive reward signals. To generate denser training signals, Dong and Ma (2025) proposed a self-play approach that enriches training problem sets by generating tractable conjectures closely related to the original theorem statements, thereby enabling more efficient use of training compute. In this paper, we implement a straightforward approach that leverages subgoals to expand the scope of formal statements used for model training. We generate two types of subgoal theorems, one incorporating preceding subgoals as premises and one without, corresponding to Figure 3 (b) and Figure 3 (a), respectively. Both types are integrated into the expert iteration stage ( Polu and Sutskever, 2020 ) , establishing a curriculum that progressively guides the prover model toward systematically addressing a curated subset of challenging problems. This procedure builds on the same underlying principle as AlphaProof’s test-time reinforcement learning ( DeepMind, 2024 ) , wherein variations of a target problem are generated to enhance the model’s capability in solving challenging IMO-level problems. ## 2.2 Unifying Informal Reasoning and Proof Formalization The algorithmic framework discussed above operates in two stages, leveraging two complementary models: DeepSeek-V3 for lemma decomposition and a 7B prover model to complete the corresponding formal proof details. This pipeline provides a natural and scalable mechanism for synthesizing formal reasoning data by combining high-level reasoning from language models with precise formal verification. In this manner, we unify the capabilities of informal mathematical reasoning and proof formalization within a single model. ## Cold Start by Synthetic Data. We curate a subset of challenging problems that remain unsolved by the 7B prover model in an end-to-end manner, but for which all decomposed subgoals have been successfully resolved. By composing the proofs of all subgoals, we construct a complete formal proof for the original problem. This proof is then appended to DeepSeek-V3’s chain-of-thought, which outlines the corresponding lemma decomposition, thereby producing a cohesive synthesis of informal reasoning and subsequent formalization. It enables the collection of hundreds of high-quality synthetic cold-start data, which serve as the foundation for training DeepSeek-Prover-V2. This cold-start dataset generation strategy differs from that of Kimina-Prover ( Wang et al., 2025 ) , a concurrent work on formal reasoning models. Specifically, we synthesize data by formalizing natural-language proofs directly into structured formal proof sketches. In contrast, Kimina-Prover adopts a reverse workflow: it begins by collecting complete formal proofs alongside their informal counterparts, then uses general-purpose reasoning models to retrosynthesize intermediate natural-language reasoning steps into coherent thinking blocks. ## Reasoning-oriented Reinforcement Learning. After fine-tuning the prover model on the synthetic cold-start data, we perform a reinforcement learning stage to further enhance its ability to bridge informal reasoning with formal proof construction. Following the standard training objective for reasoning models ( DeepSeek-AI, 2025 ) , we use binary correct-or-incorrect feedback as the primary form of reward supervision. During the training process, we observe that the structure of the generated proofs frequently diverges from the lemma decomposition provided by the chain-of-thought guidance. To address this issue, we incorporate a consistency reward in the early steps of training, which penalizes the structural misalignment, explicitly enforcing the inclusion of all decomposed have -structured lemmas in the final proof. In practice, enforcing this alignment enhances proof accuracy, especially on complex theorems that demand multi-step reasoning. ## 2.3 Training Details of DeepSeek-Prover-V2 ## Two-Stage Training. DeepSeek-Prover-V2 is developed through a two-stage training pipeline that establishes two complementary proof generation modes: 1. High-efficiency non-Chain-of-Thought (non-CoT) mode: This mode is optimized for the rapid generation of formal Lean proof codes, focusing on producing concise proofs without explicit intermediate reasoning steps. 2. High-precision Chain-of-Thought (CoT) mode: This mode systematically articulates intermediate reasoning steps, emphasizing transparency and logical progression, before constructing the final formal proofs. Consistent with DeepSeek-Prover-V1.5 ( Xin et al., 2024b ) , these two generation modes are governed by two distinct guiding prompts (see Appendix A for examples). In the first stage, we employ expert iteration within a curriculum learning framework to train a non-CoT prover model, meanwhile, synthesizing proofs for hard problems through subgoal-based recursive proving. The non-CoT generation mode is chosen to accelerate iterative training and data collection processes, as it offers significantly faster inference and validation cycles. Building on this foundation, the second stage leverages cold-start chain-of-thought (CoT) data synthesized by integrating DeepSeek-V3’s sophisticated mathematical reasoning patterns with our synthetic formal proofs. The CoT mode is enhanced through a further reinforcement learning stage, following the standard training pipeline commonly used for reasoning models. ## Expert Iteration. The training procedure for the non-CoT mode of DeepSeek-Prover-V2 follows the paradigm of expert iteration ( Polu and Sutskever, 2020 ) , a widely adopted framework for developing formal theorem provers. In each training iteration, the current best prover policy is used to generate proof attempts for those challenging problems that remain unsolved in prior iterations. Those successful attempts, verified by Lean proof assistant, are incorporated into the SFT dataset to train an improved model. This iterative loop ensures that the model not only learns from the initial demonstration datasets but also distills its own successful reasoning traces, progressively refining its ability to solve harder problems. The overall training procedure remains largely aligned with that of DeepSeek-Prover-V1 ( Xin et al., 2024a ) and DeepSeek-Prover-V1.5 ( Xin et al., 2024b ) , with only two modifications to the distribution of training problems. First, we incorporate additional problems derived from autoformalization and various open-source datasets ( Ying et al., 2024 ; Dong and Ma, 2025 ; Lin et al., 2025 ) , broadening the coverage of the training problem domains. Second, we augment the dataset with problems generated through subgoal decomposition, aiming at solving more challenging instances from the valid split of the MiniF2F benchmark ( Zheng et al., 2022 ) . ## Supervised Fine-tuning. We perform supervised fine-tuning on DeepSeek-V3-Base-671B ( DeepSeek-AI, 2024 ) using a constant learning rate of 5e-6 within a context window of 16,384 tokens. Our training corpus consists of two complementary sources: (1) non-CoT data collected through expert iteration, which produces Lean codes without intermediate reasoning steps; and (2) the cold-start CoT data described in Section 2.2 , which distills DeepSeek-V3’s advanced mathematical reasoning processes into structured proving pathways. The non-CoT components emphasize formal verification skills in the Lean theorem prover ecosystem, while the CoT examples explicitly model the cognitive process of transforming mathematical intuition into formal proof structures. ## Reinforcement Learning. We employ Group Relative Policy Optimization ( Shao et al., 2024 , GRPO;) as our reinforcement learning algorithm, which has demonstrated superior effectiveness and efficiency in reasoning tasks ( DeepSeek-AI, 2025 ) . Unlike PPO ( Schulman et al., 2017 ) , GRPO eliminates the need for a separate critic model by sampling a group of candidate proofs for each theorem prompt and optimizing the policy based on their relative rewards. Training utilizes binary rewards, where each generated Lean proof receives a reward of 1 if verified as correct and 0 otherwise. To ensure effective learning, we curate training prompts to include only problems that are sufficiently challenging yet solvable by the supervised fine-tuned model. During each iteration, we sample 256 distinct problems, generating 32 candidate proofs per theorem with a maximum sequence length of 32,768 tokens. ## Distillation. We extend the maximum context length of DeepSeek-Prover-V1.5-Base-7B ( Xin et al., 2024b ) from 4,096 to 32,768 tokens and fine-tune this extended-context model using rollout data collected during the reinforcement learning phase of DeepSeek-Prover-V2-671B. Alongside the CoT reasoning mode, we incorporate non-CoT proof data collected during expert iteration to enable a cost-efficient proving option that produces concise formal outputs with a small-size model. In addition, we perform the same reinforcement learning stage used in the training of the 671B model to boost the performance of DeepSeek-Prover-V2-7B. ## 3 Experimental Results In this section, we present a systematic evaluation of DeepSeek-Prover-V2 across diverse benchmark datasets of formal theorem proving, covering both high school competition problems and undergraduate-level mathematics. All experimental results of DeepSeek-Prover-V2 are conducted with Lean 4.9.0-rc2, using the same testing environment as DeepSeek-Prover-V1.5 ( Xin et al., 2024b ) . Without further specification, baseline evaluation results are sourced from their respective original papers. ## 3.1 Results on MiniF2F Benchmark MiniF2F ( Zheng et al., 2022 ) consists of 488 formalized problem statements sourced from a diverse range of mathematical materials, including the AIME, AMC, and IMO competitions, along with selected problems from the MATH dataset ( Hendrycks et al., 2021 ) . The benchmark includes Olympiad-level problems covering core areas of elementary mathematics, including algebra, number theory, and induction. These problems are divided into two equally sized subsets, denoted by miniF2F-valid and miniF2F-test, each containing 244 problems with an identical distribution across subject areas. We reserve the miniF2F-test set exclusively for evaluating model performance, while the miniF2F-valid problems are incorporated into curriculum learning with subgoal decomposition. We adopt the revised version of miniF2F released by Wang et al. (2025) , and further introduce two additional revisions to miniF2F-valid and one revision to miniF2F-test (see Appendix D ). Method Model size Sample budget miniF2F-test Tree Search Methods Hypertree Proof Search ( Lample et al., 2022 ) 600M 64 × 5000 64\times 5000 41.0 % 41.0\% InternLM2.5-StepProver + BFS + CG ( Wu et al., 2024 ) 7B 256 × 32 × 600 256\times 32\times 600 65.9 % 65.9\% HunyuanProver v16 + BFS + DC ( Li et al., 2024 ) 7B 600 × 8 × 400 600\times 8\times 400 68.4 % 68.4\% BFS-Prover ( Xin et al., 2025 ) 7B 2048 × 2 × 600 2048\times 2\times 600 70.83 % ± 0.89 % 70.83\%\pm 0.89\% Whole-proof Generation Methods Leanabell-Prover-GD-RL ( Zhang et al., 2025 ) 7B 128 128 61.1 % 61.1\% Goedel-Prover-SFT ( Lin et al., 2025 ) 7B 25600 25600 64.7 % 64.7\% STP ( Dong and Ma, 2025 ) 7B 25600 25600 67.6 % 67.6\% Kimina-Prover-Preview-Distill ( Wang et al., 2025 ) 7B 1 52.5 % 52.5\% 32 32 63.1 % 63.1\% 1024 1024 70.8 % 70.8\% Kimina-Prover-Preview ( Wang et al., 2025 ) 72B 1 52.94 % 52.94\% 32 32 68.85 % 68.85\% 1024 1024 77.87 % 77.87\% 8192 8192 80.74 % 80.74\% DeepSeek-Prover-V2 (non-CoT) 7B 1 1 55.5 % ± 1.4 % 55.5\%\pm 1.4\% 32 32 68.0 % ± 0.5 % 68.0\%\pm 0.5\% 1024 1024 73.2 % ± 0.5 % 73.2\%\pm 0.5\% 8192 8192 75.0 % 75.0\% 671B 1 1 59.5 % ± 1.4 % 59.5\%\pm 1.4\% 32 32 73.8 % ± 0.4 % 73.8\%\pm 0.4\% 1024 1024 76.7 % ± 0.2 % 76.7\%\pm 0.2\% 8192 8192 78.3 % 78.3\% DeepSeek-Prover-V2 (CoT) 7B 1 1 58.6 % ± 1.1 % 58.6\%\pm 1.1\% 32 32 75.6 % ± 0.5 % 75.6\%\pm 0.5\% 1024 1024 79.9 % ± 0.3 % 79.9\%\pm 0.3\% 8192 8192 82.0 % 82.0\% 671B 1 1 61.9 % ± 1.6 % 61.9\%\pm 1.6\% 32 32 82.4 % ± 0.6 % 82.4\%\pm 0.6\% 1024 1024 86.6 % ± 0.3 % 86.6\%\pm 0.3\% 8192 8192 88.9 % \mathbf{88.9\%} Table 1: Comparison with state-of-the-art models on the miniF2F-test dataset. The notation μ ± σ \mu\pm\sigma denotes the average accuracy μ \mu and the standard deviation σ \sigma . The tags CoT and non-CoT refer to two generation modes of a unified model, each guided by a different prompt. Problem Category miniF2F-valid miniF2F-test curriculum (+Pass@8192) Pass@8192 Olympiad IMO 10 / 20 = 50.0 % 10/20=50.0\% 10 / 20 = 50.0 % 10/20=50.0\% AIME 10 ​ ( + 2 ) / 15 = 80.0 % 10(+2)/15=80.0\% 14 / 15 = 93.3 % 14/15=93.3\% AMC 39 / 45 = 86.7 % 39/45=86.7\% 35 / 45 = 77.8 % 35/45=77.8\% MATH Algebra 69 / 70 = 98.6 % 69/70=98.6\% 70 / 70 = 100.0 % 70/70=100.0\% Number Theory 58 / 60 = 96.7 % 58/60=96.7\% 58 / 60 = 96.7 % 58/60=96.7\% Custom Algebra 17 / 18 = 94.4 % 17/18=94.4\% 15 / 18 = 83.3 % 15/18=83.3\% Number Theory 8 / 8 = 100.0 % 8/8=100.0\% 7 / 8 = 87.5 % 7/8=87.5\% Induction 8 / 8 = 100.0 % 8/8=100.0\% 8 / 8 = 100.0 % 8/8=100.0\% Overall Pass Rate 𝟐𝟏𝟗 ​ ( + 𝟐 ) / 𝟐𝟒𝟒 = 90.6 % \mathbf{219(+2)/244=90.6\%} 𝟐𝟏𝟕 / 𝟐𝟒𝟒 = 88.9 % \mathbf{217/244=88.9\%} Table 2: Problems solved by DeepSeek-Prover-V2-671B on the miniF2F benchmark. Results on miniF2F-valid are collected throughout the curriculum learning process, and DeepSeek-Prover-V2-671B is further invoked with Pass@8192 on the remaining problems. ## Comparison with SoTA Models. Table 1 summarizes a comparison of state-of-the-art formal theorem-proving modeling evaluated on the miniF2F-test dataset. The experimental results demonstrate that DeepSeek-Prover-V2-671B establishes a new state-of-the-art performance on the miniF2F-test benchmark, achieving an unprecedented 82.4 % 82.4\% accuracy with only 32 samples when leveraging the CoT generation strategy. Notably, the more parameter-efficient DeepSeek-Prover-V2-7B also exhibits competitive performance, surpassing all existing open-source theorem provers in the literature. The comparative analysis further reveals a compelling scaling pattern: as the sample budget increases from 1 to 8192, the performance gap between the 7B and 671B variants widens considerably, with the larger model demonstrating superior sample efficiency and a steeper improvement trajectory. ## Proving Challenging Problems through Subgoal-guided Curricula. Table 2 presents a detailed breakdown of the problems solved by DeepSeek-Prover-V2 on the miniF2F benchmark, where it achieves strong overall performance with a 90.6 % 90.6\% pass rate on the validation set and 88.9 % 88.9\% on the test set. Remarkably, our subgoal-guided curriculum learning framework, which integrates the general-purpose model DeepSeek-V3 with a lightweight specialized 7B prover, achieves a 89.8 % 89.8\% success rate on miniF2F-valid, nearly matching the performance of DeepSeek-Prover-V2-671B. These findings highlight the potential of state-of-the-art general-purpose LLMs to extend beyond natural language understanding and effectively support complex formal reasoning tasks. Through strategic subgoal decomposition, the model is able to break down challenging problems into a sequence of tractable steps, serving as an effective bridge between informal reasoning and formal proof construction. # output tokens non-CoT CoT 7B 442.6 4488.5 671B 761.8 6751.9 Table 3: Average number of tokens generated by DeepSeek-Prover-V2 on miniF2F-test. ## CoT vs. non-CoT. The experimental results in Table 1 demonstrate a substantial performance advantage of the CoT reasoning mode over the non-CoT mode in formal mathematical reasoning. This reinforces the effectiveness of CoT prompting, which encourages decomposition of complex problems into intermediate steps, and further confirms that inference-time scaling holds in the domain of formal theorem proving. Complementing these findings, Table 3 provides statistics on the number of tokens generated by DeepSeek-Prover-V2 under different reasoning modes. As expected, the CoT mode produces significantly longer outputs, reflecting its sophisticated reasoning process. Interestingly, within the non-CoT setting, the 671B model generates longer outputs on average compared to the 7B model. A closer examination reveals that, although explicit reasoning is not prompted in the non-CoT mode, the larger model often inserts brief natural language comments within the proof code that resemble implicit reasoning steps (see Appendix A ). This suggests that high-capacity models may internalize and externalize intermediate reasoning implicitly, even in the absence of explicit CoT prompting ## 3.2 Results on Undergraduate-level Benchmarks ProofNet ( Azerbayev et al., 2023 ) consists of 371 problems in Lean 3, drawn from a range of popular undergraduate pure mathematics textbooks, covering topics such as real and complex analysis, linear algebra, abstract algebra, and topology. We use the Lean 4 translation of ProofNet made available by Xin et al. (2024b) , which is further divided into two splits: ProofNet-valid and ProofNet-test, containing 185 and 186 problems, respectively. The test split of ProofNet is reserved exclusively for model evaluation, as variants of the ProofNet-valid problems are included in the public synthetic dataset provided by Dong and Ma (2025) , which is used in our supervised fine-tuning. The results, shown in Table 4 , indicate a substantial improvement in the pass rate of DeepSeek-Prover-V2 when using CoT reasoning compared to the non-CoT setting. Notably, despite the training data being predominantly drawn from high-school level mathematics, the model exhibits strong generalization to more advanced, college-level mathematical problems, underscoring its robust formal reasoning capabilities. PutnamBench ( Tsoukalas et al., 2024 ) is a continuously updated benchmark featuring competition mathematics problems from the William Lowell Putnam Mathematical Competition , spanning the years 1962 to 2023. The Putnam Competition is a highly prestigious annual mathematics competition for undergraduate students across the United States and Canada, encompassing a variety of college-level domains such as analysis, linear algebra, abstract algebra, combinatorics, probability, and set theory. We evaluate our model on the latest release of PutnamBench, which contains 658 problems formalized in Lean 4. We exclude problems that are incompatible with Lean 4.9.0 and evaluate the model on the remaining set of 649 problems. Our initial run solved 49 problems using a sample budget of 1024 per problem. After submitting the proofs to the benchmark maintainers, we excluded two problems due to misformulated statements. The final result stands at 47 problems successfully solved (as shown in Table 4 ), which significantly outperforms its non-CoT counterpart. These results further highlight the effectiveness of the CoT reasoning approach in handling challenging, college-level mathematical problems. Method Model size Sample budget ProofNet-test PutnamBench Goedel-Prover-SFT ( Lin et al., 2025 ) 7B 32 32 15.6 % 15.6\% 6 / 644 6/644 512 512 - 7 / 644 7/644 STP ( Dong and Ma, 2025 ) 7B 128 128 19.5 % ± 0.7 % 19.5\%\pm 0.7\% 7 / 644 7/644 3200 3200 23.9 % ± 0.6 % 23.9\%\pm 0.6\% 8 / 644 8/644 25600 25600 26.9 % 26.9\% - DeepSeek-Prover-V2 (non-CoT) 7B 32 32 21.6 % ± 0.2 % 21.6\%\pm 0.2\% 8 / 658 8/658 128 128 23.1 % ± 0.6 % 23.1\%\pm 0.6\% 9 / 658 9/658 1024 1024 24.7 % 24.7\% 10 / 658 10/658 671B 32 32 23.8 % ± 0.2 % 23.8\%\pm 0.2\% 9 / 658 9/658 128 128 27.2 % ± 0.5 % 27.2\%\pm 0.5\% 11 / 658 11/658 1024 1024 31.2 % 31.2\% 15 / 658 15/658 DeepSeek-Prover-V2 (CoT) 7B 32 32 23.0 % ± 0.4 % 23.0\%\pm 0.4\% 9 / 658 9/658 128 128 25.4 % ± 0.7 % 25.4\%\pm 0.7\% 10 / 658 10/658 1024 1024 29.6 % 29.6\% 11 / 658 11/658 671B 32 32 30.5 % ± 0.7 % 30.5\%\pm 0.7\% 22 / 658 22/658 128 128 33.6 % ± 0.3 % 33.6\%\pm 0.3\% 33 / 658 33/658 1024 1024 37.1 % \mathbf{37.1\%} 𝟒𝟕 / 𝟔𝟓𝟖 \mathbf{47/658} Table 4: The experimental results on ProofNet-test and PutnamBench. The scores for Goedel-Prover-SFT and STP on PutnamBench are sourced from their original papers, which conducted evaluations on an earlier version of PutnamBench comprising 644 problems. ## Reward Hacking in Reinforcement Learning. Our initial report claimed an unexpected finding that DeepSeek-Prover-V2-7B successfully solved 13 problems on PutnamBench that remained unsolved by its larger 671B counterpart. We acknowledge the Lean community for their assistance in identifying the cause of this unexpected result, which was traced to a user interface bug in Lean 4.9.0. Specifically, the apply? tactic fails to emit sorry declarations under certain corner cases. Upon closer examination of the model’s outputs, we identified a distinctive pattern in its reasoning approach: the 7B model frequently employs Cardinal.toNat and Cardinal.natCast_inj to exploit this user-interface bug (see examples in Appendix B ), which are noticeably absent in the outputs generated by the 671B version. ## 3.3 Results on Combinatorial Problems CombiBench Pass@16 Kimina-Prover-Preview ( Wang et al., 2025 ) 7 / 100 7/100 DeepSeek-Prover-V2-7B non-CoT 6 / 100 6/100 CoT 7 / 100 7/100 DeepSeek-Prover-V2-671B non-CoT 8 / 100 8/100 CoT 𝟏𝟎 / 𝟏𝟎𝟎 \mathbf{10/100} Table 5: Evaluation results on CombiBench under the with-solution setting. CombiBench ( Liu et al., 2025 ) is a comprehensive benchmark comprising 100 combinatorial competition problems formalized in Lean 4, each paired with its corresponding natural-language statement. We evaluate DeepSeek-Prover-V2 in the with-solution setting of this benchmark, where the correct answer is embedded in the Lean statement, allowing the evaluation to focus solely on proof generation. After filtering out problems incompatible with Lean 4.9.0 and those containing multiple sorry placeholders, we evaluate on 77 problems from the benchmark. Our initial run reported 12 successfully solved problems. After collaborating with the benchmark maintainers and identifying two misformulated problem statements, the final result stands at 10 solved problems. These results indicate that, while the prover model is primarily trained in number theory and algebra, it demonstrates promising generalization to combinatorial problems, despite their persistent difficulty. An interesting finding is that the chain-of-thought reasoning of DeepSeek-Prover-V2-671B can effectively identify misformulations and adapt its proof strategy accordingly. We include an example in the Appendix C where the model detects a contradiction within a misformulated statement and derives False to close the target goal through exfalso . ## 3.4 Results on FormalMATH FormalMATH All Lite Pass@32 Pass@32 Pass@3200 Goedel-Prover-SFT ( Lin et al., 2025 ) 13.53 % 13.53\% 46.70 % 46.70\% 49.41 % 49.41\% STP ( Dong and Ma, 2025 ) 13.87 % 13.87\% 48.59 % 48.59\% 53.17 % 53.17\% Kimina-Prover-Preview-Distill-7B 16.46 % 16.46\% 48.94 % 48.94\% - DeepSeek-Prover-V2-7B 22.41 % 22.41\% 51.76 % 51.76\% 55.06 % 55.06\% DeepSeek-Prover-V2-671B 28.31 % \mathbf{28.31\%} 56.00 % \mathbf{56.00\%} 61.88 % \mathbf{61.88\%} Table 6: Evaluation results on FormalMATH-All/Lite. The performance of DeepSeek-Prover-V2 is evaluated with the CoT generation mode. FormalMATH ( Yu et al., 2025 ) is a large-scale formal theorem proving benchmark with 5560 problems, ranging from high school Olympiad questions to undergraduate-level theorems, and covering a wide range of domains such as algebra, applied mathematics, calculus, number theory, and discrete mathematics. FormalMATH-Lite is a manageable subset of 425 problems (comprising 359 high school-level and 66 undergraduate-level problems) carefully selected from the full corpus, addressing the impracticality of evaluating on the full dataset while still enabling systematic assessment of test-time scaling across various mathematical domain. Table 6 presents the comparative performance analysis of various theorem provers on both FormalMATH-All and FormalMATH-Lite benchmarks. DeepSeek-Prover-V2-671B demonstrates superior performance across all evaluation metrics, successfully solving 28.31 % 28.31\% of problems in the full dataset and 56.00 % 56.00\% of problems in the Lite subset with 32 samples. When computational budgets are expanded to accommodate 3200 samples, performance on the Lite subset demonstrates a marked improvement to 61.88 % 61.88\% . The 7B parameter variant of DeepSeek-Prover-V2 also exhibits notable effectiveness, outperforming previous baselines including Goedel-Prover-SFT ( Lin et al., 2025 ) , STP ( Dong and Ma, 2025 ) , and Kimina-Prover-Preview-Distill-7B ( Wang et al., 2025 ) . ## 3.5 ProverBench: Formalization of AIME and Textbook Problems To enhance existing benchmarks and advance research in formal theorem proving, we introduce a benchmark dataset comprising 325 problems. Of these, 15 are formalized from number theory and algebra questions featured in the recent AIME competitions (AIME 24 and 25), offering authentic high-school competition-level challenges. The remaining 310 problems are drawn from curated textbook examples and educational tutorials, contributing a diverse and pedagogically grounded collection of formalized mathematical problems. This benchmark is designed to enable more comprehensive evaluation across both high-school competition problems and undergraduate-level mathematics. Method Model size Sample budget ProverBench All AIME 24&25 STP ( Dong and Ma, 2025 ) 7B 32 32 27.5 % ± 0.7 % 27.5\%\pm 0.7\% 0 / 15 0/15 128 128 31.4 % ± 1.1 % 31.4\%\pm 1.1\% 1 / 15 1/15 512 512 36.3 % 36.3\% 1 / 15 1/15 DeepSeek-Prover-V2 (non-CoT) 7B 32 32 47.7 % ± 0.6 % 47.7\%\pm 0.6\% 1 / 15 1/15 128 128 48.8 % ± 0.2 % 48.8\%\pm 0.2\% 1 / 15 1/15 512 512 49.5 % 49.5\% 1 / 15 1/15 671B 32 32 49.5 % ± 0.5 % 49.5\%\pm 0.5\% 1 / 15 1/15 128 128 51.5 % ± 0.3 % 51.5\%\pm 0.3\% 2 / 15 2/15 512 512 52.3 % 52.3\% 2 / 15 2/15 DeepSeek-Prover-V2 (CoT) 7B 32 32 49.0 % ± 0.3 % 49.0\%\pm 0.3\% 1 / 15 1/15 128 128 50.8 % ± 0.5 % 50.8\%\pm 0.5\% 1 / 15 1/15 512 512 51.7 % 51.7\% 1 / 15 1/15 671B 32 32 52.9 % ± 0.9 % 52.9\%\pm 0.9\% 4 / 15 4/15 128 128 56.5 % ± 0.5 % 56.5\%\pm 0.5\% 5 / 15 5/15 512 512 59.1 % \mathbf{59.1\%} 𝟔 / 𝟏𝟓 \mathbf{6/15} Table 7: The experimental results on ProverBench. The All category represents the complete evaluation set consisting of 325 problems, while AIME 24&25 denotes a subset of 15 problems formalized from recent AIME competitions. The results for STP ( Dong and Ma, 2025 ) are evaluated using the open-source model weights. Contest Problems AIME 24I P2 , P7 , P13 AIME 24II P4 , P7, P13 , P14 AIME 25I P1 , P8 , P9, P11 AIME 25II P2 , P4 , P13, P15 Table 8: Selection of AIME 24&25 problems for formalization. Problems with underlined bolded indices have been solved by DeepSeek-Prover-V2. Problems solved by DeepSeek-V3-0324 using Maj@16 are highlighted with a gray background. ## AIME Formalization. The American Invitational Mathematics Examination (AIME) is an annual mathematics competition designed to challenge and recognize talented high school students who demonstrate exceptional proficiency in mathematics. The problems from AIME 24&25 have become a standard benchmark for evaluating the reasoning capabilities of large language models. In order to bridge the evaluation of model performance across formal and informal mathematical reasoning, we curate and formalize a subset of problems from AIME 24&25. To ensure cleaner formalizations, we filter out geometry, combinatorics, and counting problems whose representations in Lean are potentially cumbersome. This results in 15 selected problems, covering competition-level topics in elementary number theory and algebra. We evaluate DeepSeek-V3-0324 on the selected set of problems using the standard find-answer task for natural-language mathematical reasoning. With majority voting over 16 sampled responses, the model successfully solves 8 out of 15 problems. In comparison, DeepSeek-Prover-V2-671B, operating under the formal proof generation setting with given correct answers, is able to construct valid formal proofs for 6 of 15 problems. This comparison highlights that the performance gap between informal mathematical reasoning and formal theorem proving is substantially narrowing, indicating growing alignment between linguistic understanding and formal logical rigor in advanced language models. Area Count AIME 24&25 15 Number Theory 40 Elementary Algebra 30 Linear Algebra 50 Abstract Algebra 40 Calculus 90 Real Analysis 30 Complex Analysis 10 Functional Analysis 10 Probability 10 Total 325 Table 9: Distribution of mathematical areas represented in ProverBench. ## Textbook Formalization. In addition to AIME 24&25, we augment our benchmark with problems carefully selected from textbooks used in high school competitions and undergraduate-level courses to strengthen coverage in specific mathematical domains. This curation process ensures comprehensive representation across difficulty levels and topic areas. As a result, we formalize 310 problems that encompass a broad spectrum, ranging from elementary mathematics at the competition level to advanced topics typically encountered in undergraduate studies. This comprehensive benchmark covers number theory, elementary algebra, linear algebra, abstract algebra, calculus, real analysis, complex analysis, functional analysis, and probability. The deliberate inclusion of this diverse array of mathematical fields allows for a thorough assessment of model capabilities across varying levels of abstraction and reasoning styles. Number theory and algebra problems test a model’s facility with discrete structures and equations, while analysis-oriented problems evaluate understanding of limits, continuity, and calculus. The abstract algebra and functional analysis components challenge models to reason about abstract structures and spaces, requiring sophisticated formal reasoning capabilities. The evaluation results are presented in Table 7 . As shown, DeepSeek-Prover-V2-671B with CoT reasoning consistently outperforms all baselines, reinforcing the trends observed in other benchmark evaluations. ## 4 Conclusion In this work, we propose a comprehensive pipeline for synthesizing cold-start reasoning data to advance formal theorem proving. Our data construction process is grounded in a recursive theorem-proving framework, wherein DeepSeek-V3 serves as a unified model for both subgoal decomposition and lemma formalization within the Lean 4 proof assistant. Our approach combines high-level proof sketches with formal steps, creating a sequence of manageable subgoals that can be efficiently solved using a smaller 7B model, significantly reducing computational requirements. The curriculum learning framework we developed uses these decomposed subgoals to generate increasingly difficult training tasks, creating a more effective learning progression. By pairing complete formal proofs with DeepSeek-V3’s chain-of-thought reasoning, we established valuable cold-start reasoning data that bridges informal mathematical thinking with formal proof structures. The subsequent reinforcement learning stage substantially enhanced this connection, leading to significant improvements in formal theorem proving capabilities. The resulting model, DeepSeek-Prover-V2-671B, consistently outperforms all baselines across a range of benchmarks, spanning both high-school competition problems and undergraduate-level mathematics. Our future work will focus on scaling this paradigm to an AlphaProof-like system with the ultimate aim of tackling IMO-level mathematical problems that represent the frontier of automated theorem proving challenges. === BODY (tail) ===