mlsanityData to 7 Oct 2026

Towards AI-Assisted Synthesis of Verified Dafny Methods

arXiv 2402.00247 ↗First posted 1 Feb 2024cs.SE cs.PLcited by 58

Not on the map. Why?

Abstract (arXiv)

Large language models show great promise in many domains, including programming. A promise is easy to make but hard to keep, and language models often fail to keep their promises, generating erroneous code. A promising avenue to keep models honest is to incorporate formal verification: generating programs' specifications as well as code so that the code can be proved correct with respect to the specifications. Unfortunately, existing large language models show a severe lack of proficiency in verified programming. In this paper, we demonstrate how to improve two pretrained models' proficiency in the Dafny verification-aware language. Using 178 problems from the MBPP dataset, we prompt two contemporary models (GPT-4 and PaLM-2) to synthesize Dafny methods. We use three different types of prompts: a direct Contextless prompt; a Signature prompt that includes a method signature and test cases, and a Chain of Thought (CoT) prompt that decomposes the problem into steps and includes retrieval augmentation generated example problems and solutions. Our results show that GPT-4 performs better than PaLM-2 on these tasks and that both models perform best with the retrieval augmentation generated CoT prompt. GPT-4 was able to generate verified, human-evaluated, Dafny methods for 58% of the problems, however, GPT-4 managed only 19% of the problems with the Contextless prompt, and even fewer (10%) for the Signature prompt. We are thus able to contribute 153 verified Dafny solutions to MBPP problems, 50 that we wrote manually, and 103 synthesized by GPT-4. Our results demonstrate that the benefits of formal program verification are now within reach of code generating large language models...

Key facts. Cited by 58 papers in the map (data through 7 Oct 2026). First posted on arXiv 1 Feb 2024.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 11; 2025: 26; 2026: 21.

58 papers.

Sort:

By area:

  1. 2024Formal Mathematical Reasoning: A New Frontier in AIcited by 80
  2. 2024DafnyBench: A Benchmark for Formal Software Verificationcited by 54
  3. 2024AutoVerus: Automated Proof Generation for Rust Codecited by 46
  4. 2024AlphaVerus: Bootstrapping Formally Verified Code Generation through Self-Improving Translation and Treefinementcited by 33
  5. 2024Automated Proof Generation for Rust Code via Self-Evolutioncited by 31
  6. 2025VERINA: Benchmarking Verifiable Code Generationcited by 30
  7. 2024Towards Neural Synthesis for SMT-Assisted Proof-Oriented Programmingcited by 19
  8. 2025Proving the Coding Interview: A Benchmark for Formally Verified Code Generationcited by 18
  9. 2025RL Is Neither a Panacea Nor a Mirage: Understanding Supervised vs. Reinforcement Learning Fine-Tuning for LLMscited by 17
  10. 2025Propose, Solve, Verify: Self-Play Through Formal Verificationcited by 11
  11. 2025VeruSAGE: A Study of Agent-Based Verification for Rust Systemscited by 11
  12. 2026AlgoVeri: An Aligned Benchmark for Verified Code Generation on Classical Algorithmscited by 11
38 more
  1. 2024Laurel: Unblocking Automated Verification with Large Language Modelscited by 10
  2. 2025OSVBench: Benchmarking LLMs on Specification Generation Tasks for Operating System Verificationcited by 8
  3. 2025VeriStruct: AI-assisted Automated Verification of Data-Structure Modules in Veruscited by 8
  4. 2025ProofWright: Towards Agentic Formal Verification of CUDAcited by 8
  5. 2026Intent Formalization: A Grand Challenge for Reliable Coding in the Age of AI Agentscited by 8
  6. 2024New Solutions on LLM Acceleration, Optimization, and Applicationcited by 7
  7. 2025VeriEquivBench: An Equivalence Score for Ground-Truth-Free Evaluation of Formally Verifiable Codecited by 7
  8. 2024Synthetic Programming Elicitation for Text-to-Code in Very Low-Resource Programming and Formal Languagescited by 6
  9. 2025Dafny as Verification-Aware Intermediate Language for Code Generationcited by 6
  10. 2025Local Success Does Not Compose: Benchmarking Large Language Models for Compositional Formal Verificationcited by 6
  11. 2025Agentic Verification of Software Systemscited by 5
  12. 2025The Hitchhiker's Guide to Program Analysis, Part II: Deep Thoughts by LLMscited by 4
  13. 2025Towards Repository-Level Program Verification with Large Language Modelscited by 4
  14. 2025RAG-Verus: Repository-Level Program Verification with LLMs using Retrieval Augmented Generationcited by 3
  15. 2025Can LLMs Enable Verification in Mainstream Programming?cited by 3
  16. 2025Inferring multiple helper Dafny assertions with LLMscited by 3
  17. 2026AutoReSpec: A Framework for Generating Specification using Large Language Modelscited by 3
  18. 2024Generative transformations and patterns in LLM-native approaches for software verification and falsificationcited by 2
  19. 2025FormalSpecCpp: A Dataset of C++ Formal Specifications created using LLMscited by 2
  20. 2026Doc2Spec: Synthesizing Formal Programming Specifications from Natural Language via Grammar Inductioncited by 2
  21. 2026Spec-Harness: Measuring and Improving Behavioral Adequacy of LLM-Synthesized Formal Specificationscited by 2
  22. 2024Assured Automatic Programming via Large Language Modelscited by 1
  23. 2025Towards Automated Formal Verification of Backend Systems with LLMscited by 1
  24. 2025Proof2Silicon: Prompt Repair for Verified Code and Hardware Generation via Reinforcement Learningcited by 1
  25. 2025LLM For Loop Invariant Generation and Fixing: How Far Are We?cited by 1
  26. 2025The 4/δ Bound: Designing Predictable LLM-Verifier Systems for Formal Method Guaranteecited by 1
  27. 2026Intent-aligned Formal Specification Synthesis via Traceable Refinementcited by 1
  28. 2026VeriContest: A Competitive-Programming Benchmark for Verifiable Code Generationcited by 1
  29. 2026AxDafny: Agentic Verified Code Generation in Dafnycited by 1
  30. 2026Formal Disco: Scalable Open-Ended Generation of Formally Verified Programscited by 1
  31. 2025From Scientific Texts to Verifiable Code: Automating the Process with Transformerscited by 0
  32. 2025Accessible Smart Contracts Verification: Synthesizing Formal Models with Tamed LLMscited by 0
  33. 2025Working Document -- Formalising Software Requirements with Large Language Modelscited by 0
  34. 2025AutoICE: Automatically Synthesizing Verifiable C Code via LLM-driven Evolutioncited by 0
  35. 2026Toward an Agentic Infused Software Ecosystemcited by 0
  36. 2026Can LLMs Reason Like Automated Theorem Provers for Rust Verification? VCoT-Bench: Evaluating via Verification Chain of Thoughtcited by 0
  37. 2026From Natural Language to Verified Code: Toward AI Assisted Problem-to-Code Generation with Dafny-Based Formal Verificationcited by 0
  38. 2026LiveFMBench: Unveiling the Power and Limits of Agentic Workflows in Specification Generationcited by 0

50 most cited of 58 All 58 (JSON)

Similar, not cited

Close in wording, no citation either way

  1. 2025Re:Form -- Reducing Human Annotations in Scalable Formal Software Verification with RL in LLMs: A Preliminary Study on Dafny
  2. 2025Asking LLMs to Verify First is Almost Free Lunch
  3. 2024VerMCTS: Synthesizing Multi-Step Programs using a Verifier, a Large Language Model, and Tree Search
  4. 2026Automating Formal Verification with Reinforcement Learning and Recursive Inference
  5. 2026Are you Synthesizing or Recalling? Evaluating LLMs on Algorithmic Code Retrieval
  6. 2026Evaluating Prompting and Execution-Based Methods for Deterministic Computation in LLMs
  7. 2026Adaptive Generate-Rank-Verify: Inference-Time Search with Costly Verification
  8. 2026A Frozen 12B Beats Frontier Models on Verified Work: 100% Accuracy, 0 Tokens, Bit-Exact, Forever