arXiv:2611.05590cs.AINov 2026

Manuscript Offprint

arXiv:2611.05590

Verified but Vacuous: Three Failure Surfaces of LLM-Driven Verified Code Generation

Aditya Vempaty, Himaneesh Sompalle, Manan Tayal, Mowafak Allaham, Prasenjit Dey, Ashish Jagmohan, Ravi Kokku

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

What should “verified” mean when evaluating LLM-generated code? Many existing pipelines report a single verification number (for example, dafny verify accepted N% of samples). We argue this collapses three distinct properties measured in a conditional audit sequence: verifier acceptance (Surface A), syntactic specification binding (Surface B: does the proof obligation bind to the spec?), and semantic specification fidelity (Surface C: does the spec capture the informal requirement?). We contribute this three-surface decomposition plus the ensures-binding gate, a syntactic Surface-B instance for Dafny pipelines that emit distinguishable specification and implementation artifacts (static AST walk, <10 ms per component). Two empirical demonstrations show the surfaces separate. First (A≠BA \neq B), via Li@Opus (a same-model reproduction of Li et al. (2025)'s Dafny-as-intermediate-representation (IR) pipeline under Claude Opus 4.7) on three Python benchmarks of simple coding tasks (LeetCode-style): it reaches 99.1% verifier acceptance on HumanEval while only 1.9% carry a certificate binding to a spec-defined predicate or function. This gap is roughly fortyfold (36 to 52×) that holds across HumanEval, LeetCodeDataset, and LiveCodeBench v6 in a narrow 1.9% to 2.7% band. This gap is observed even as the fraction of verified samples that carry any ensures clause climbs from 5.3% on HumanEval to 10.61% on LiveCodeBench v6 (10.9% on the test-evaluated subset). Postcondition prevalence more than doubles with benchmark difficulty but binding-to-a-spec-predicate rate does not follow. Second (B≠CB \neq C), via VCG on two Rust benchmarks: we use VCG (which is our own in-house Dafny-as-intermediate pipeline) on Rust because the Rust target lets us enforce fully-verifiable output (every component ships as a Dafny certificate, ensures-binding gate passing by construction). Even inside that construction, 11.48% (MBPP-Rust) and 14.82% (VeriContest LC slice) of structurally-verified samples still fail hidden tests. On the LC slice of VeriContest, VCG's reported End2End rate is 7.79% (535/6870). The cited external rates are 5.51% (GPT-5.5) and 1.88% (single-shot Opus 4.7). These give descriptive differences of 2.3 percentage points and 4.14×, respectively; task-budget, repair and harness differences prevent a matched-performance claim. Therefore, any pipeline shipping certificates should report at least one of Surface B (e.g. the ensures-binding gate) or Surface C (e.g. Post2Exe) alongside Surface A; where feasible, both, since Surface B alone leaves the semantic blind spot we demonstrate on VCG, and Surface C alone leaves the syntactic blind spot we demonstrate on Li@Opus. Many existing evaluations report neither.

1 INTRODUCTION

What should “verified” mean when evaluating LLM-generated code? Large language models can generate code that passes tests most of the time. Frontier models solve 70–95% of HumanEval-style problems (Chen et al., 2021) and 60–90% of LeetCode-style benchmarks (newfacade, 2024; Jain et al., 2024). Passing a test suite tells us that no tested input triggered a bug; it does not tell us that the implementation satisfies the requirements on inputs the tests did not visit. For code shipped into production (payment processors, medical dose calculators, security-sensitive parsers), that distinction is crucial.

Formal verification systems (Dafny (Leino, 2010), Lean (de Moura & Ullrich, 2021), F* (Swamy et al., 2016), Verus (Lattuada et al., 2024)) can machine-check that an implementation satisfies its formal specification. Recent work has explored LLMs as authors of specs (Ma et al., 2024), impls (Misu et al., 2024), proof tactics (Yang et al., 2023), and complete verified programs (Xie et al., 2026; Li et al., 2025), with promising but basic-level empirical evidence. Existing evaluations of such pipelines typically report a single verification number alongside pass@k:dafny verify accepted N% of the samples, or verus returned zero on N% of them. This paper argues that a single verification number collapses three properties that are distinct and empirically separable. We measure them on conditional populations; their semantic properties are not logically nested.

We came to this decomposition while building VCG, an in-house Dafny-as-intermediate pipeline for LLM-driven verified code generation. VCG's pre-launch audit surfaced a class ofdafny verify-accepted components whose ensures clauses did not reference any spec-defined predicate/function. This violated VCG's intended external-specification convention. Reference absence alone does not establish semantic vacuity: meaningful inline postconditions can fail this gate, and a named tautology can pass it. Dafny still establishes the obligations generated by the actual program and assumptions; the gate measures a separate structural property. We added a static ensures-binding integrity check to VCG's verify-repair loop to reject such components. That check turned out to be the simplest instance of a distinct evaluation surface we had been conflating withdafny verify acceptance.

Applying the same static check to a same-model reproduction of Li et al. (2025)'s Dafny-as-intermediate pipeline (under Claude Opus 4.7) makes the case concretely:dafny verify accepts 99.1% of samples on HumanEval, but only 1.9% carry a certificate that structurally binds its proof obligation to a spec-defined predicate/function. Fully 94.7% ship no ensures clause at all; another 3.4% contain an ensures clause that does not bind to a spec-defined predicate/function. This is not a defect of Li et al.'s pipeline: their few-shot prompt (Figure 6 of Li et al. 2025, reproduced verbatim in our few-shot) is a bodyless method {::testEntry} with no postcondition, plus a Main() full of expect statements. Dafny assumes those expectations (not proves them) and checks them at runtime; on this input shape, verifier acceptance establishes the remaining static proof obligations (well-formedness, termination, local method-body proof) under those fixture assumptions, but does not prove the fixture expectations themselves or a general functional postcondition. The mismatch is a defect of the metric we use to summarize the pipeline, not of the pipeline itself.

Contributions. This paper isolates and develops the methodology contribution that motivated our own pipeline design:

  1. A decomposition of verification quality into three conditionally measured, empirically separable failure surfaces (§2): Surface A (verifier acceptance), Surface B (syntactic specification binding), and Surface C (semantic specification fidelity). We contribute the ensures-binding gate (§3) as a syntactic instance of Surface B for Dafny pipelines that emit distinguishable specification and implementation artifacts: a static AST walk that runs in <10 ms per Dafny component.

  2. A three-level analytical decomposition of Surface B, and an empirical A→BA \to B gap of roughly fortyfold on Li@Opus (§5). To avoid overclaiming what one syntactic gate establishes, we report certificate quality at three observable levels: Level 1 = verifier accepted (Surface A); Level 2 = Impl.dfy contains at least one ensures clause (architecture-agnostic postcondition presence, which does not require the clause to reference any spec-defined symbol); Level 3 = at least one ensures clause binds to a spec-defined predicate/function (our gate; a Surface-B instance for pipelines that separate spec and impl artifacts). On a same-model reproduction of Li et al.'s Dafny-as-IR pipeline applied to three Python benchmarks of simple coding tasks (HumanEval, LeetCodeDataset, LiveCodeBench v6; LeetCode-style), Level 1 stays at 92–99% while Level 3 stays in a narrow 1.9–2.7% band which has a roughly fortyfold (36–52×) gap. The intermediate Level 2 climbs from 5.3% on HumanEval to 10.61% on LCB v6 (1,032/9,731; 10.9% on the 9,448 test-evaluated subset): the pipeline writes more postconditions on harder problems, but they do not get bound to spec-defined symbols. Level 2 measures postcondition presence without requiring an external symbol, whereas Level 3 measures the external-specification convention. The reported pattern does not show that inline postconditions are semantically weaker, or isolate prompt convention from task difficulty. A controlled comparison is needed to distinguish those explanations.

  3. Semantic-fidelity finding: Surface B → Surface C also leaks (§6). Even inside VCG, which passes our external-spec-binding Surface-B criterion on 100% of shipped verified components by construction (other conceivable Surface B instances may still fail on this population), 11.48% (MBPP-Rust; Rust) and 14.82% (VeriContest LC; Rust) of structurally-verified samples still fail hidden tests. Under the standard trusted-toolchain and correct-oracle assumptions, this is an operational proxy for requirement fidelity, not a unique diagnosis of specification failure.

The sharper claim is that verification quality must be decomposed, and that many existing evaluations report only its weakest surface (AxDafny (Breen et al., 2026) and VeriContest's Post2Exe check (Xie et al., 2026, §4.1) are notable exceptions; Table 6 in Appendix D). §9 closes with the concrete methodological ask that follows: any pipeline shipping certificates should report at least one of Surface B or Surface C alongside its verifier-acceptance rate.

Figure 1 (Appendix A) visualises the cascade: Li@Opus's collapse at A→BA \to B vs. VCG's collapse at B→CB \to C, with bar widths proportional to the fraction of attempted samples surviving each surface.