[论文解读] DeepSeek-Prover: Advancing Theorem Proving in LLMs through Large-Scale Synthetic Data
该论文提出 DeepSeek-Prover,一种迭代式框架,从高中和本科数学竞赛题中生成 800 万条合成 Lean 4 证明。通过结合自动形式化、假设拒绝以及对 DeepSeekMath 7B 模型的迭代微调,该方法在 miniF2F 上以 64 个样本实现 46.3% 的完整证明生成准确率,超越 GPT-4(23.0%)和先前的 SOTA 方法(41.0%),并在 GPT-4 完全失败的 148 个 FIMO 问题中成功证明了 5 个。
Proof assistants like Lean have revolutionized mathematical proof verification, ensuring high accuracy and reliability. Although large language models (LLMs) show promise in mathematical reasoning, their advancement in formal theorem proving is hindered by a lack of training data. To address this issue, we introduce an approach to generate extensive Lean 4 proof data derived from high-school and undergraduate-level mathematical competition problems. This approach involves translating natural language problems into formal statements, filtering out low-quality statements, and generating proofs to create synthetic data. After fine-tuning the DeepSeekMath 7B model on this synthetic dataset, which comprises 8 million formal statements with proofs, our model achieved whole-proof generation accuracies of 46.3% with 64 samples and 52% cumulatively on the Lean 4 miniF2F test, surpassing the baseline GPT-4 at 23.0% with 64 samples and a tree search reinforcement learning method at 41.0%. Additionally, our model successfully proved 5 out of 148 problems in the Lean 4 Formalized International Mathematical Olympiad (FIMO) benchmark, while GPT-4 failed to prove any. These results demonstrate the potential of leveraging large-scale synthetic data to enhance theorem-proving capabilities in LLMs. Both the synthetic dataset and the model will be made available to facilitate further research in this promising field.
研究动机与目标
- 为训练大语言模型在自动化定理证明(ATP)中的高质量形式化证明数据稀缺问题提供解决方案。
- 提升从非形式化数学问题生成的合成形式化证明数据的可扩展性和质量。
- 通过迭代式合成数据生成与微调,提升大语言模型在形式化定理证明中的表现。
- 使大语言模型在标准化 ATP 基准测试(如 miniF2F 和 FIMO)上超越现有模型(如 GPT-4)。
- 发布大规模合成数据集与微调后的模型,以加速形式化数学推理领域的研究。
提出的方法
- 使用零样本提示(zero-shot LLM prompt)将非形式化的高中与本科数学竞赛题自动转化为形式化的 Lean 4 陈述。
- 通过质量评分模型过滤低质量陈述,并利用假设拒绝策略排除不一致的假设。
- 使用大语言模型生成形式化陈述的证明,并通过 Lean 4 验证器验证其正确性。
- 在高质量、已验证的定理-证明对上迭代微调大语言模型,以在多轮循环中持续提升证明质量。
- 通过并行证明一个命题及其否定来加速证明生成,在任一成功时提前终止。
- 在生成的 800 万条合成形式化陈述-证明对上微调 DeepSeekMath 7B 模型,以用于 ATP 任务。

实验结果
研究问题
- RQ1从非形式化数学问题大规模生成的合成证明数据,能否显著提升大语言模型在形式化定理证明中的表现?
- RQ2一种重用已验证证明的迭代训练框架,是否能逐步提升证明生成的质量?
- RQ3合成数据生成能否在标准化 ATP 基准测试上超越现有 SOTA 方法(如 GPT-4 和强化学习基线)?
- RQ4当在合成形式化数据上进行训练时,大语言模型在复杂、竞赛级问题上的泛化能力如何?
- RQ5模型在自动形式化过程中能否识别并拒绝逻辑上不一致的形式化?
主要发现
- 在 miniF2F 测试集上,使用 64 个样本时,DeepSeek-Prover 模型实现了 46.3% 的完整证明生成准确率,超越 GPT-4 的 23.0% 和先前强化学习方法的 41.0%。
- 使用 100 个样本时,该模型在 FIMO 基准测试中解决了 148 个问题中的 4 个,而 GPT-4 一个也未解决。
- 使用 4096 个样本时,该模型在 FIMO 基准测试中解决了 5 个问题,展现出在复杂奥林匹克级别问题上的强大可扩展性与能力。
- 消融实验表明,模型在 miniF2F 上的表现随每轮迭代逐步提升,证实了迭代训练循环的有效性。
- 在案例研究中,模型成功识别并拒绝了一个不一致的形式化,展示了在检测错误假设方面的稳健性。
- 公开发布了包含 800 万条形式化陈述与证明的合成数据集,以及微调后的 DeepSeekMath 7B 模型,以支持未来在形式化定理证明领域的研究。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。