K-文化的一切——从回归到 K-美妆,发送到您的邮箱订阅邮件

METAL MEDIA

Compiler-Guided Adaptive Proof Search with Cross-Model Synergy on Context-Dependent Theorem Proving

arXiv:2608.180842026-08-20

不丢弃AI证明失败的尝试,而是重复利用它们,提升真实Lean项目定理证明的成功率

在真实的Lean 4项目中证明定理很难,因为证明往往依赖项目特有的上下文。这篇论文构建了一个搜索框架,利用编译器的报错反馈修复失败的证明,同时精细控制何时继续探索新方案、何时改进当前方案。在miniCTX-v2的七个真实Lean 4项目上,相比pass@k基线方法,平均通过率提高12.8个百分点,同时LLM调用次数减少21.9%。

METAL MEDIA 解读图

不丢弃AI证明失败的尝试,而是重复利用它们,提升真实Lean项目定理证明的成功率

  1. 01用两个互补的模型生成候选证明:一个通用型推理大模型(generalist)和一个Lean专用证明模型(specialist),再由一个LLM裁判判断哪个候选更有希望作为起点
  2. 02被选中的证明会根据编译器报错反馈不断被修改,但每次修改只有在裁判判定确实比当前最佳版本更好时才会被采纳,否则保留原版本
  3. 03当修复连续多轮都没有进展(触发停滞计数)时,系统会从两个模型重新采样全新的候选证明并重新开始
  4. 04在miniCTX-v2七个项目上,在pass@32的预算内,该方法将平均通过率提高12.8个百分点,LLM调用减少21.9%,成本也更低(1.96美元 对比 GPT-5-mini pass@32的2.43美元)
  5. 05分析发现,即使在成功的证明轨迹中,约一半(50.4%)的修改提案会被裁判拒绝,而39.5%的成功证明来自之前保留下来的状态而非最新提案,说明保留好的中间状态和生成新提案同样重要
这是 METAL MEDIA 制作的解读图,并非论文作者提供的原图。

他们做了什么

  1. 用两个互补的模型生成候选证明:一个通用型推理大模型(generalist)和一个Lean专用证明模型(specialist),再由一个LLM裁判判断哪个候选更有希望作为起点
  2. 被选中的证明会根据编译器报错反馈不断被修改,但每次修改只有在裁判判定确实比当前最佳版本更好时才会被采纳,否则保留原版本
  3. 当修复连续多轮都没有进展(触发停滞计数)时,系统会从两个模型重新采样全新的候选证明并重新开始
  4. 在miniCTX-v2七个项目上,在pass@32的预算内,该方法将平均通过率提高12.8个百分点,LLM调用减少21.9%,成本也更低(1.96美元 对比 GPT-5-mini pass@32的2.43美元)
  5. 分析发现,即使在成功的证明轨迹中,约一半(50.4%)的修改提案会被裁判拒绝,而39.5%的成功证明来自之前保留下来的状态而非最新提案,说明保留好的中间状态和生成新提案同样重要
Table 1: Pass rate (%) on miniCTX-v2 across seven projects with Gemini-2.5-flash as the Generalist. Results of full proof generation are pass@16. Our method additionally reports average LLM calls per theorem (gray).
MethodPass rate (%) per projectAvg.
CarlesonConNFFLTFoundationHepLeanMathlibSeymour
Gemini-2.5-Flash44.0028.0035.2952.0038.0040.0072.0044.18
DeepSeek-Prover-V242.0030.0047.0654.0042.0042.0070.0046.72
Ours48.0034.0050.0060.0054.0046.0078.0052.86
avg calls14.8616.4615.0312.2814.9216.128.9814.09
Table 2: Fraction of theorems proved by each component.
ComponentFraction (%)Subtotal (%)
AutoSolve28.3628.36
Init (Generalist)30.34
Init (Specialist)9.4439.78
Resample (Generalist)0.49
Resample (Specialist)1.011.50
Refine (Generalist)18.91
Refine (Specialist)11.4630.37
Table 3: Effect of stagnation threshold N on mathlib-valid.
K/12K/6K/4K/3K/2
Pass Rate (%)48.0056.0060.0054.0060.00
LLM Calls30.2427.1224.4227.6027.76
Table 4: Intra-WP std (same wrong proof, multiple runs) vs. inter-WP std (different wrong proofs) for theorems in the Mathlib valid split.
Intra-WP stdInter-WP std
T11.865.59
T20.802.58
T37.028.66
T40.000.00
T50.080.49
T65.426.54
T71.220.49
T84.064.85
T91.241.00
Avg2.413.36
Table 5: Model selection rate in pairwise comparisons. Each comparison occurs when both GPT5-mini and DeepSeek-prover-v2 produce a candidate proof and the judge selects the better starting point.
Project#ComparisonsGPT5-mini (%)DeepSeek-prover-v2 (%)
ConNF7354.845.2
FLT3278.121.9
HepLean4571.128.9
Foundation4755.344.7
Carleson4953.146.9
Seymour2352.247.8
Mathlib12255.744.3
Total39158.641.4
Table 6: Detailed breakdown of theorems proved by each component on miniCTX-v2 test.
ComponentNumber of theorems proved per projectAvg.
CarlesonConNFFLTFoundationHepLeanMathlibSeymour
AutoSolve07112041058.14
Init (Generalist)16205103258.71
Init (Specialist)41314332.71
Resample (Generalist)00001000.14
Resample (Specialist)00001010.29
Refine (Generalist)55437865.43
Refine (Specialist)27115343.29
Total2722193032274428.71

为什么重要

真实项目规模的定理证明因高度依赖局部上下文而十分困难,这项研究表明,更聪明地重复利用失败的尝试——而不只是训练更强的模型——就能同时提升准确率和效率。这种探索与利用平衡的搜索策略,也可能推广到其他能获得编译器或执行反馈的AI任务,比如代码自动修复或智能体式问题求解。

本文术语

  • Lean 4 · 一种可由计算机检查数学证明是否正确的编程语言兼证明辅助工具
  • pass@k · 一种评估方式,只要k次尝试中有一次验证成功就算通过
  • 编译器反馈 · Lean编译器给出的报错信息,指出证明在哪一行、为什么失败
  • 成对比较裁判(pairwise comparison) · 被要求比较两个候选证明、判断哪个更有可能成功的LLM
  • 停滞阈值(N) · 连续多少次修改被拒绝后,系统会重新开始探索并采样全新候选证明

无法转载的图表

  • Figure 1: Overview of our framework. Exploration (left) generates two diverse candidates via a generalist and a specialist. Exploitation (right) maintains a single current-best proof s∗ and drives it toward verification: each repair produces a proposal, and an LLM judge decides whether to accept it. When refinement stagnates for N consecutive rounds, the system re-enters exploration and draws fresh candidates from both models. The Verification & Feedback layer (bottom) provides structured error feedback, tactic suggestions and verification signals.
  • Figure 2: Empirical refinement results of one theorem with different initial attempts. One theorem, 10 wrong proofs (WP) as starting points (rows), each iteratively refined 5 times (columns) with a 32-iteration budget. Cells show iterations to success; × marks failure. Theorem: Set_EAnnulus_oc_subset_co in carleson. More examples can be found in Figure 8 and Figure 9 in Appendix B.
  • Figure 3: Pass rate (%) vs. LLM calls across seven Lean 4 projects from miniCTX-v2. Gray dashed line is pass@32.
  • Figure 4: LLM cost breakdown under 32 average LLM calls. Specialist DeepSeek-Prover-V2-7B is self-hosted; its cost is estimated at the generalist’s per-token price (higher than the specialist) for a conservative comparison.
  • Figure 5: Pass rate (%) vs. LLM calls on RLMEval-FLT3 with informal proof guidance. Text labels show average calls from the generalist, specialist, and pairwise comparison (Cmp).
  • Figure 6: Ablation study results.
  • (b) Effect of pairwise comparison on call allocation and cost.
  • Figure 7: Pairwise comparison behavior on solved refinement trajectories. (a) Keep-current rate during successful refinement. (b) Final verification from preserved proof states.
  • Figure 8: Refinement heatmap for _isBigO_deriv_ofReal_cpow_const_atTop in the mathlib.
  • Figure 9: Refinement heatmap for eLpNorm_toReal_le in the Carleson.
  • Figure 10: LLM calls breakdown under 32 average LLM calls on miniCTX-v2 test.
  • Figure 11: Pass rate (%) vs. LLM calls on HepLean with GPT5.4-mini as the Generalist and Goedel-Prover-V2-8B as the Specialist.
  • Figure 12: Global refinement keep current rate on solved theorems (294 total steps).
在原文中查看图表 →

论文原文摘要(英文)

Theorem proving in real-world Lean 4 projects is challenging because proofs often depend on project-specific context. While iterative refinement can use compiler errors to repair failed proofs, reusing failed attempts requires careful search control: some proofs provide better starting points than others, and later revisions may degrade a partially correct proof. We propose a compiler-guided proof search framework that balances exploration and exploitation. It explores diverse starting points through dual-model generation and stagnation-triggered resampling, while exploiting promising proof states through current-best refinement guided by compiler-grounded pairwise comparison. Experiments on seven real-world Lean 4 projects from miniCTX-v2 show that our method achieves a better effectiveness--efficiency tradeoff than pass@k baselines. Within the pass@32 budget, our method improves average pass rate by 12.8 percentage points while reducing LLM calls by 21.9%.

作者 · Zhuo Liu, Ding Yu, Hangfeng He

在 arXiv 阅读

最新论文

全部论文 →

METAL MEDIA 最新报道