Baldur:使用大语言模型的全证明生成和修复
Baldur: Whole-Proof Generation and Repair with Large Language Models
摘要:
形式化地验证软件属性是一项非常可取但劳动密集型的任务。最近的工作已经开发了使用诸如Coq和Isabelle/HOL的证明助手来自动化形式化验证的方法,例如,通过训练一个模型来一次预测一个证明步骤,并使用该模型来搜索可能的证明空间。本文介绍了一种自动化形式化验证的新方法:我们使用大语言模型,在自然语言文本和代码上进行训练,并在证明上进行微调,以一次生成定理的整个证明,而不是一次一步。我们将此证明生成模型与微调的修复模型相结合,以修复生成的证明,进一步提高证明能力。作为其主要贡献,本文首次证明:(1)使用Transformers的整体证明发电是可能的,并且与基于搜索的技术一样有效,而不需要昂贵的搜索。(2)为学习的模型提供额外的上下文,例如先前失败的证明尝试和随后的错误消息,导致证明修复并进一步改进自动证明生成。(3)我们建立了一个新的国家的艺术全自动证明合成。我们具体化我们的方法在一个原型,Baldur,并评估它的基准6,336伊莎贝尔/HOL定理及其证明。除了从经验上展示整体证明生成,修复和添加上下文的有效性外,我们还展示了Baldur通过自动生成额外8.7%定理的证明来改进最先进的工具Thor。Baldur和Thor可以全自动地证明65.7%的定理。本文为使用大语言模型自动化形式化验证的新研究铺平了道路。
英文摘要:
Formally verifying software properties is a highly desirable but labor-intensive task. Recent work has developed methods to automate formal verification using proof assistants, such as Coq and Isabelle/HOL, e.g., by training a model to predict one proof step at a time, and using that model to search through the space of possible proofs. This paper introduces a new method to automate formal verification: We use large language models, trained on natural language text and code and fine-tuned on proofs, to generate whole proofs for theorems at once, rather than one step at a time. We combine this proof generation model with a fine-tuned repair model to repair generated proofs, further increasing proving power. As its main contributions, this paper demonstrates for the first time that: (1) Whole-proof generation using transformers is possible and is as effective as search-based techniques without requiring costly search. (2) Giving the learned model additional context, such as a prior failed proof attempt and the ensuing error message, results in proof repair and further improves automated proof generation. (3) We establish a new state of the art for fully automated proof synthesis. We reify our method in a prototype, Baldur, and evaluate it on a benchmark of 6,336 Isabelle/HOL theorems and their proofs. In addition to empirically showing the effectiveness of whole-proof generation, repair, and added context, we show that Baldur improves on the state-of-the-art tool, Thor, by automatically generating proofs for an additional 8.7% of the theorems. Together, Baldur and Thor can prove 65.7% of the theorems fully automatically. This paper paves the way for new research into using large language models for automating formal verification.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。