arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.05385cs.SE
收藏

DafnyPro:基于LLM的自动验证框架用于Dafny程序

DafnyPro: LLM-Assisted Automated Verification for Dafny Programs

UIUC(伊利诺伊大学厄巴纳-香槟分校);Amazon Web Services(亚马逊云科技)

Debangshu Banerjee, Olivier Bouissou, Stefan Zetzsche

AI总结:

DafnyPro通过增强LLM生成验证注释的能力,提升了Dafny程序的自动验证效率和准确性。

摘要:

我们介绍了DafnyPro,一个推理时框架,用于增强LLM在生成Dafny验证注释方面的性能。DafnyPro包含三个关键组件:一个差分检查器,用于防止修改基础程序逻辑;一个修剪器,用于移除不必要的不变式;以及一个提示增强系统,用于检索并应用预定义的、问题无关的证明策略。我们使用Claude Sonnet 3.5和3.7在四个基准测试中评估DafnyPro:Clover、MBPP-Dafny、HumanEval-Dafny和DafnyBench,在所有情况下均实现了稳定的性能提升。值得注意的是,在最具有挑战性的DafnyBench基准测试中,使用DafnyPro增强的Claude Sonnet 3.5实现了86%的正确证明,比基础模型提高了16个百分点。我们还对两个Qwen模型在由更大模型增强的DafnyPro训练数据上进行微调。我们的7B和14B模型在DafnyBench上分别实现了68%和70%的正确证明,表明较小的模型可以保持高验证准确性。

英文摘要:

We present DafnyPro, an inference-time framework that enhances LLMs for generating verification annotations in Dafny. DafnyPro comprises three key components: a diff-checker that prevents modifications to base program logic, a pruner that removes unnecessary invariants, and a hint-augmentation system that retrieves and applies predefined, problem-independent proof strategies. We evaluate DafnyPro using Claude Sonnet 3.5 and 3.7 on four benchmarks: Clover, MBPP-Dafny, HumanEval-Dafny, and DafnyBench, achieving consistent performance gains in all cases. Notably, on DafnyBench, the most challenging benchmark, Claude Sonnet 3.5 enhanced with DafnyPro achieves 86% correct proofs, a 16 pp improvement over the base model. We also fine-tune two Qwen models on training data derived from verification attempts by larger models enhanced with DafnyPro. Our 7B and 14B models achieve 68% and 70% correct proofs on DafnyBench, respectively, demonstrating that smaller models can maintain high verification accuracy.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑