arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.14408cs.AIcs.CLcs.LG
收藏

FVEL:基于大语言模型的交互式形式验证环境(通过定理证明实现)

FVEL: Interactive Formal Verification Environment with Large Language Models via Theorem Proving

Shenzhen Campus of Sun Yat-sen University(中山大学深圳校区);City Univeristy of Hong Kong(香港城市大学);Sun Yat-sen University(中山大学);The University of Hong Kong(香港大学);Huawei Noah’s Ark Lab(华为诺亚方舟实验室);MBZUAI(Mohamed bin Zayed 人工智能大学);DarkMatter AI Research(DarkMatter AI 研究院)

Xiaohan Lin, Qingxing Cao, Yinya Huang, Haiming Wang, Jianqiao Lu, Zhengying Liu, Linqi Song, Xiaodan Liang

AI总结:

本研究提出结合大语言模型的交互式形式验证环境FVEL,将待验证代码转为Isabelle格式后通过神经自动定理证明验证,构建大规模FVELER数据集,实验证明微调后模型在SV-COMP基准上的问题解决率显著提升、证明错误率降低。

摘要:

随着不断发展的大语言模型(LLM)推动当前新兴的程序综合技术发展,形式验证(FV)的重要性日益凸显。然而,当前的形式验证主要依赖符号验证器或手工制定的规则,在大规模、灵活的验证场景中存在局限性。另一方面,用于自动定理证明的形式语言(如Isabelle)作为另一类严谨验证手段,拥有完善的规则与定理体系。本文提出FVEL——一款结合大语言模型的交互式形式验证环境。具体而言,FVEL将待验证的代码转换为Isabelle格式,再通过基于大语言模型的神经自动定理证明完成验证。这种联合范式既利用了Isabelle中严谨且丰富的系统化规则体系,也便于引入和调整前沿大语言模型。为实现这一目标,我们提取了大规模数据集FVELER3。FVELER数据集包含以Isabelle形式化的代码依赖与验证过程,总计涵盖758个理论、29125条引理和200646个证明步骤,具备深度依赖关系。我们在FVEL环境中对FVELER进行基准测试:先使用FVELER微调大语言模型,再在Code2Inv和SV-COMP基准上评估。结果显示,经FVELER微调的Llama3-8B搭配FVEL在SV-COMP上多解决17.39%的问题(从69个增至81个),Mistral-7B则多解决12%的问题(从75个增至84个),同时证明错误的比例有所降低。项目页面:https://fveler.github.io/。

英文摘要:

Formal verification (FV) has witnessed growing significance with current emerging program synthesis by the evolving large language models (LLMs). However, current formal verification mainly resorts to symbolic verifiers or hand-craft rules, resulting in limitations for extensive and flexible verification. On the other hand, formal languages for automated theorem proving, such as Isabelle, as another line of rigorous verification, are maintained with comprehensive rules and theorems. In this paper, we propose FVEL, an interactive Formal Verification Environment with LLMs. Specifically, FVEL transforms a given code to be verified into Isabelle, and then conducts verification via neural automated theorem proving with an LLM. The joined paradigm leverages the rigorous yet abundant formulated and organized rules in Isabelle and is also convenient for introducing and adjusting cutting-edge LLMs. To achieve this goal, we extract a large-scale FVELER3. The FVELER dataset includes code dependencies and verification processes that are formulated in Isabelle, containing 758 theories, 29,125 lemmas, and 200,646 proof steps in total with in-depth dependencies. We benchmark FVELER in the FVEL environment by first fine-tuning LLMs with FVELER and then evaluating them on Code2Inv and SV-COMP. The results show that FVEL with FVELER fine-tuned Llama3- 8B solves 17.39% (69 -> 81) more problems, and Mistral-7B 12% (75 -> 84) more problems in SV-COMP. And the proportion of proof errors is reduced. Project page: https://fveler.github.io/.

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

↑