How can AI generate code that is both correct and formally verified according to specifications?
Category: LLM Memory, Reasoning and Alignment › Generative Model Generalization and Evaluation · 6 papers · No consensus
6 papers; abstracts only, so this reports what papers claim.
Bottom line
No claim is backed by three or more verified papers. The papers report that jointly planning or synthesizing implementation and proof outperforms decoupled pipelines, that agentic joint synthesis can complete distributed-systems verification tasks where SOTA agents mostly fail, and that verified annotations help users understand generated code. The central tension is the scope of the guarantee: verification gives correctness beyond testing only relative to the generated specification, which may mismatch the original intent, and papers differ on whether full machine-checkable proofs or best-effort bounded verification is the useful standard. Missing are training on proof data, evaluation beyond a small curated repository-scale set, and end-to-end measurement of developer productivity.
Convergence
No claim is backed by three or more papers.
Contested
Does passing formal verification mean the generated code is actually correct? (scope difference)
- A: Machine-checkable proofs against validated specifications give correctness guarantees beyond testing. (p139699, p150230)
- B: Verification only guarantees correctness relative to the generated specification, which can mismatch the original intent. (p139424)
- Why: p139699 pairs problems with expert-validated specifications, while p139424 evaluates model-generated specifications where intent mismatches arise.
How strong must the verification guarantee be for verified code generation to be useful? (scope difference)
- A: The goal is full machine-checkable proofs in verification-aware languages. (p138973)
- B: Best-effort, compositional bounded verification of assertions alongside code is already efficient and helpful. (p155764)
- Why: p155764 targets C programs with a portfolio of bounded model checkers, while p138973 uses deductive verifiers such as Dafny, Verus, and Coq.
Isolated claims (1 to 2 papers)
- Jointly planning or synthesizing implementation and proof outperforms decoupled generate-then-prove pipelines.
- p150553 P$^{3}$: Joint Program-and-Proof Planning\ for Verified Cod [method/behavioural; not stated]: shared program-and-proof planning raises solve rates 4.6-11.2 points and cuts cost up to roughly 40%
- Verified annotations attached to generated code measurably help humans understand it.
- p155764 Viverra: Text-to-Code with Guarantees [method/behavioural; not stated]: verified assertions improved user performance on code-comprehension tasks in a study with 400+ participants
- Frontier models solve ordinary code generation far more often than end-to-end verified synthesis, with proof generation the weakest stage.
- p139699 VeriContest: A Competitive-Programming Benchmark for Verifia [method/behavioural; not stated] [partial]: strongest model reaches 92.18% on code generation but 13.95% on proofs and 5.29% end-to-end
- An agentic system that jointly and incrementally synthesizes implementation and proof can complete distributed-systems verification tasks where SOTA coding agents mostly fail.
- p150230 Inductive Deductive Synthesis: Enabling AI to Generate Forma [method/behavioural; Claude Code, Codex agents]: SOTA coding agents solve 2/7 key-value-store specifications; IDS reaches 7/7 in about 6.8 hours each
- Current frontier models solve only a small fraction of end-to-end verified program synthesis tasks. [demoted: only 2 paper(s) verified]
- p139699 VeriContest: A Competitive-Programming Benchmark for Verifia [method/behavioural; not stated]: strongest model reaches just 5.29% end-to-end across 946 competitive-programming problems
- p139424 VerifyThisBench: Joint Evaluation of Code, Specifications, a [behavioural/method; six SOTA models]: six SOTA models collectively produce just 36 human-verified correct solutions across 1,078 tasks
- p138973 Verify0: Can AI Agents Build Formally Verified Software Repo [behavioural/method; not stated] [partial]: strongest agent fully solves only 18 of 35 multi-module repository instances
Gaps
- No paper trains or fine-tunes models on proof data; all reported results come from prompting or agentic pipelines over existing models.
- Repository-scale evaluation covers only 35 curated instances, so nothing tests verified synthesis on large or legacy industrial codebases.
- Only one small user study (18 tasks) links verified output to human benefit; no paper measures developer productivity end to end.
Off topic or tangential
Verification report
- revision: 5 findings sent back to the generator; the revised answer was checked again
- bottom line: 4 sentences written, 0 dropped and 0 narrowed where both judges agreed, 0 kept although the judges split, 0 not checked
- 14 paper-to-statement attributions checked by two judges; agreement: 14 both agree
- changes: 1 demoted, 2 partial
- judge A (command-a-plus-05-2026): planted wrong statements caught 10 of 10; positive controls passed 10 of 10; bottom-line overstatements caught 1 of 1
- judge B (deepseek/deepseek-v4-pro-0813): planted wrong statements caught 10 of 10; positive controls passed 10 of 10; bottom-line overstatements caught 1 of 1
Removed, changed or disputed by verification
- demoted: Current frontier models solve only a small fraction of end-to-end verified program synthesis tasks.
The 6 papers that ask this question
- VeriContest: A Competitive-Programming Benchmark for Verifiable Code Generation
- VerifyThisBench: Joint Evaluation of Code, Specifications, and Proof
- Verify0: Can AI Agents Build Formally Verified Software Repositories?
- P3: Joint Program-and-Proof Planning for Verified Code Generation
- Inductive Deductive Synthesis: Enabling AI to Generate Formally Verified Systems
- Viverra: Text-to-Code with Guarantees
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction