DafnyBench: A Benchmark for Formal Software Verification

Chloe Loughridge, Qinyi Sun, Seth Ahrenbach, Federico Cassano, Chuyue Sun +5 more
6/12/2024
cs.SEcs.AIcs.LG

No official code found. Best implementation: sun-wendy/DafnyBench (67 stars, Apache-2.0, last commit 2024-12-12).

Abstract

We introduce DafnyBench, the largest benchmark of its kind for training and evaluating machine learning systems for formal software verification. We test the ability of LLMs such as GPT-4 and Claude 3 to auto-generate enough hints for the Dafny formal verification engine to successfully verify over 750 programs with about 53,000 lines of code. The best model and prompting scheme achieved 68% success rate, and we quantify how this rate improves when retrying with error message feedback and how it deteriorates with the amount of required code and hints. We hope that DafnyBench will enable rapid improvements from this baseline as LLMs and verification techniques grow in quality.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

DafnyBench: A Benchmark for Formal Software Verification

6713Dafny, ShellMay 29, 20241 years agoApache-2.0
benchmarkdafnyformal-verificationlanguage-modelprogram-verification

Cite this paper

@article{loughridge2024dafnybench,
  title  = {DafnyBench: A Benchmark for Formal Software Verification},
  author = {Chloe Loughridge and Qinyi Sun and Seth Ahrenbach and Federico Cassano and Chuyue Sun and Ying Sheng and Anish Mudide and Md Rakib Hossain Misu and Nada Amin and Max Tegmark},
  year   = {2024},
  eprint = {2406.08467},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.08467v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.08467.svg)](https://codeofpaper.com/paper/2406.08467)

Discussion