mlsanityData to 7 Oct 2026

Self-Spec Verifiable Code Generation

arXiv 2609.39568 ↗First posted 30 Sep 2026cs.SE cs.AIcited by 0

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) may generate unreliable code on corner cases missed by testing, while formal verification can provide machine-checkable guarantees. Recently, researchers have proposed several benchmarks to evaluate the capabilities of LLMs in generating formally verifiable code, where LLMs need to formulate formal specifications, generate the corresponding code, and verify its correctness. However, existing benchmarks have two key limitations: (I) They primarily evaluate specification and code generation stage-wise, with code generation typically conditioned on an oracle specification. This setup overlooks whether strong stage-wise performance translates into end-to-end success. (II)They mainly focus on a single proof-oriented language and mathematically structured tasks, offering limited coverage of tasks common in software development. In this paper, we introduce VeriCodeBench, a benchmark for self-spec verifiable code generation, where the LLM relies solely on its own generated specification and code throughout the entire process. VeriCodeBench contains 400 language-native problems across C, Java, Rust, and Python, covering practical concerns in software development. We evaluate specification coverage, code validity, and joint problem-level success. We further introduce CodeNova to enhance the capabilities of LLMs in self-spec verifiable code generation. CodeNova makes requirements explicit through constraint-guided specification and uses verifier feedback to guide targeted implementation repairs. Experimental results reveal that self-generated specifications remain a major bottleneck, while providing more sophisticated specifications may not necessarily lead to higher verification success rates. CodeNova substantially improves performance across all evaluation metrics, enabling Claude Sonnet 5 to achieve the strongest results under the self-spec protocol.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 24 of its 32 references that are in the map. First posted on arXiv 30 Sep 2026.

Builds on

24 of 32 references.

References · 24

  1. 2023LeanDojo: Theorem Proving with Retrieval-Augmented Language Modelscited by 414
  2. 2021MiniF2F: a cross-system benchmark for formal Olympiad-level mathematicscited by 380
  3. 2023ProofNet: Autoformalizing and Formally Proving Undergraduate-Level Mathematicscited by 180
  4. 2025A Survey on Code Generation with LLM-based Agentscited by 104
  5. 2024Planning In Natural Language Improves LLM Search For Code Generationcited by 79
  6. 2024Code-Aware Prompting: A study of Coverage Guided Test Generation in Regression Setting using LLMcited by 63
  7. 2024Towards AI-Assisted Synthesis of Verified Dafny Methodscited by 58
  8. 2023nl2spec: Interactively Translating Unstructured Natural Language to Temporal Logics with Large Language Modelscited by 57
  9. 2024Enchanting Program Specification Synthesis by Large Language Models using Static Analysis and Program Verificationcited by 55
  10. 2024SpecGen: Automated Generation of Formal Program Specifications via Large Language Modelscited by 51
  11. 2023Verus: Verifying Rust Programs using Linear Ghost Types (extended version)cited by 50
  12. 2024PropertyGPT: LLM-driven Formal Verification of Smart Contracts through Retrieval-Augmented Property Generationcited by 36
12 more
  1. 2024AutoSafeCoder: A Multi-Agent Framework for Securing LLM Code Generation through Static Analysis and Fuzz Testingcited by 34
  2. 2024AlphaVerus: Bootstrapping Formally Verified Code Generation through Self-Improving Translation and Treefinementcited by 33
  3. 2025VERINA: Benchmarking Verifiable Code Generationcited by 30
  4. 2025CLEVER: A Curated Benchmark for Formally Verified Code Generationcited by 27
  5. 2025Proving the Coding Interview: A Benchmark for Formally Verified Code Generationcited by 18
  6. 2025Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inferencecited by 14
  7. 2025ClassInvGen: Class Invariant Synthesis using Large Language Modelscited by 11
  8. 2026AlgoVeri: An Aligned Benchmark for Verified Code Generation on Classical Algorithmscited by 11
  9. 2025Supporting Software Formal Verification with Large Language Models: An Experimental Studycited by 6
  10. 2026WybeCoder: Verified Imperative Code Generationcited by 4
  11. 2025Specification-Guided Repair of Arithmetic Errors in Dafny Programs using LLMscited by 2
  12. 2025MINIF2F-DAFNY: LLM-Guided Mathematical Theorem Proving via Auto-Active Verificationcited by 2

Built on by

Not cited yet.