Formal verification is the next frontier for ensuring the correctness of code generated by Large Language Models (LLMs). While methods that co-generate code and formal specifications in formal languages, like Dafny, can, in principle, prove alignment with user intent, progress is bottlenecked by specification quality evaluation. Current benchmarks rely on matching against ground-truth specifications, a manual and expertise-intensive process that has limited existing datasets to a few hundred simple problems and also suffers from a reliability issue. To address this, we introduce VeriEquivBench, a new benchmark with $2,389$ complex algorithmic problems that probe the limitations of current models in both code generation and formal reasoning. Our evaluation framework replaces ground-truth matching with a formally grounded metric, the equivalence score, and rigorously verifies the quality of generated specifications and code. Our results show that generating formally verifiable code remains a profound challenge for state-of-the-art LLMs. This underscores both the difficulty of the task and the need for benchmarks like VeriEquivBench to drive progress toward scalable and reliable coding agents.


翻译:形式化验证是确保大型语言模型(LLMs)生成代码正确性的下一个前沿方向。尽管通过协同生成代码与形式规范(如Dafny中的形式语言)的方法在原则上能够证明与用户意图的一致性,但其进展受限于规范质量评估的瓶颈。当前基准测试依赖与真值规范进行匹配——这一需专家手动完成且专业门槛极高的过程,导致现有数据集仅局限于数百个简单问题,同时存在可靠性缺陷。为此,我们提出VeriEquivBench——一个包含2389个复杂算法问题的新基准,可探查当前模型在代码生成与形式推理两方面的局限性。本评估框架采用基于形式化验证的等价性分数替代真值匹配,并严谨验证生成规范与代码的质量。结果表明,生成形式可验证代码对最先进的LLMs而言仍是巨大挑战。这既凸显了该任务的难度,也表明需要像VeriEquivBench这样的基准来驱动可扩展且可靠代码智能体研究的发展。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
评估大语言模型在科学发现中的作用
专知会员服务
19+阅读 · 2025年12月19日
天大最新《大型语言模型评估》全面综述,111页pdf
专知会员服务
88+阅读 · 2023年10月31日
智能合约的形式化验证方法研究综述
专知
16+阅读 · 2021年5月8日
浅谈最广泛应用的金融风控算法-评分卡
凡人机器学习
10+阅读 · 2020年8月3日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
10+阅读 · 2013年12月31日
国家自然科学基金
34+阅读 · 2012年12月31日
VIP会员
最新内容
综述 | 3D场景图:开放挑战与未来方向
专知会员服务
1+阅读 · 6月22日
21世纪的无人机战争
专知会员服务
2+阅读 · 6月22日
《量子技术的军事任务技术适配与利用》
专知会员服务
3+阅读 · 6月22日
美国从乌克兰无人机战争中学习经验
专知会员服务
7+阅读 · 6月21日
ICML 2026 | 面向视觉语言模型的语义鲁棒性认证
专知会员服务
5+阅读 · 6月21日
相关VIP内容
评估大语言模型在科学发现中的作用
专知会员服务
19+阅读 · 2025年12月19日
天大最新《大型语言模型评估》全面综述,111页pdf
专知会员服务
88+阅读 · 2023年10月31日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
10+阅读 · 2013年12月31日
国家自然科学基金
34+阅读 · 2012年12月31日
Top
微信扫码咨询专知VIP会员