Manuscript Offprint
arXiv:2610.26464VerusEval: Evaluating LLM-Generated Verus Specifications Beyond Verifier Acceptance
DING WANG, Shenzhen University, China
CHAO JIANG, Shenzhen University, China
DUGANG LIU , Shenzhen University, China
ZHIWU XU, Shenzhen University, China
CHENG WEN, Shenzhen University, China
ZHONG MING, Shenzhen University, China
YUWEI LIU, Ant Group, China
XINYI WAN, Ant Group, China
LIN HUANG, Ant Group, China
Large language models (LLMs) are increasingly used to generate Verus contracts for Rust programs together with the proofs that establish them. Yet verifier acceptance, the common measure of success, shows only that the implementation satisfies the generated contract, so it leaves open whether the contract captures the intended behavior. Assessing specification generation therefore requires an evaluation methodology, not a single metric. We present VerusEval, a framework that evaluates generated contracts along six dimensions, including Verus-native checks for semantic triviality, validated input–output (I/O) suites, and contract equivalence, and that relates them so that the strength and blind spots of each become measurable. Evaluating 13,716 artifacts from four workflows, five LLMs, and two prompting settings on 762 tasks, we find that acceptance overstates quality: only 42.3% of the accepted artifacts complete all three semantic checks without a flag, and across workflows and models, higher acceptance does not consistently come with more correct contracts. I/O evaluation rejects 23.6% of the accepted artifacts, yet only 63.2% of those that pass it are proved equivalent. Of the accepted artifacts flagged by contract comparison, 84.1% have a rejected completeness obligation, and the direction of a failure prioritizes inspection of the generated contract or the reference; it does not by itself establish which artifact is defective. Screening and review further identify 36 candidate defects among 61 selected reference contracts, and repairing one of them makes 10 of its 11 failing artifacts equivalent. Based on these findings, we derive four actionable lessons for evaluation, generation, and benchmark maintenance.
Additional Key Words and Phrases: formal specification, large language models, program verification, semantic refinement, empirical evaluation, Verus
1 Introduction
Formal verification establishes that a program satisfies a mathematical specification, providing guarantees about the behaviors covered by that specification. Its use in verified kernels and distributed systems demonstrates its value for building reliable software [8, 10, 16]. For Rust, Verus [17] supports deductive verification of executable code annotated with specifications and proof code, and it discharges the resulting proof obligations with an SMT solver. Developers express admissible inputs and output guarantees through function contracts [24], but writing suitable contracts and the proofs needed to establish them requires substantial expertise and effort [9]. Large language models
Authors' Contact Information: Ding Wang, Shenzhen University, College of Computer Science and Software Engineering, Shenzhen, China, lifetruthuuu@gmail.com; Chao Jiang, Shenzhen University, College of Computer Science and Software Engineering, Shenzhen, China, chaoccc22@gmail.com; Dugang Liu, Shenzhen University, College of Computer Science and Software Engineering, Shenzhen, China, dugang.ldg@gmail.com; Zhiwu Xu, Shenzhen University, College of Computer Science and Software Engineering, Shenzhen, China, xuzhiwu@szu.edu.cn; Cheng Wen, Shenzhen University, College of Computer Science and Software Engineering, Shenzhen, China, wencheng@xidian.edu.cn; Zhong Ming, Shenzhen University, College of Computer Science and Software Engineering, Shenzhen, China, mingz@szu.edu.cn; Yuwei Liu, Ant Group, Ant Research, Hangzhou, China, lyw458372@antgroup.com; Xinyi Wan, Ant Group, Ant Research, Hangzhou, China, wanxinyi.wxy@antgroup.com; Lin Huang, Ant Group, Ant Research, Hangzhou, China, linyu.hl@antgroup.com.
D. Wang, C. Jiang, D. Liu, Z. Xu, C. Wen, Z. Ming, Y. Liu, X. Wan, and L. Huang
(LLMs) can automate specification and proof development for Rust. AlphaVerus [2] generates code and contracts through translation and verifier feedback, while StarVerus [13] coordinates multiple agents to generate Verus specifications and proofs. Related workflows such as AutoVerus [38] and VeruSAGE [39] generate and repair proofs for supplied contracts. These advances make it increasingly feasible to produce verified Rust artifacts automatically.
Once the contract is generated rather than supplied, the bottleneck moves from generation to evaluation: verification checks the implementation against the contract, and nothing checks the contract against the intended behavior. A verified artifact is therefore only as strong as its contract, so a contract that omits a required constraint, excludes valid inputs, or is vacuous still passes verification. Acceptance consequently becomes an unreliable basis for comparison: a workflow that emits looser contracts can appear more successful without delivering stronger guarantees. Evaluating generated contracts thus requires evidence beyond acceptance, but the available kinds of evidence differ in strength. Concrete input–output (I/O) cases, which prior work uses for postconditions, Rocq specifications, and Verus specifications [1, 7, 40], can expose a wrong contract but cover only sampled behaviors. Logical comparison with a reference covers all inputs, but it is only as reliable as the reference, and a rejected proof attempt does not yield a counterexample. Text similarity and LLM judgements are cheap but cannot establish logical relations.
Recent evaluation frameworks each foreground one kind of evidence on their own artifacts and tasks. Verus-SpecGym [1], Coins [40], CodeSpecBench [6], and TLA -Bench [4] ground their evaluation in execution. Clover [31] checks consistency among code, docstrings, and annotations. A study [30] of postcondition formalization reports that generated tests expose solutions otherwise counted correct, and LiveFMBench [37] shows that prover gaming inflates measured accuracy. These studies establish that acceptance overstates contract quality but leave open three questions for an evaluation methodology. How strong is each kind of evidence, and where is it blind, when all are applied to the same artifacts? Can a difference from a reference become a diagnosis that indicates which contract to revise? Who audits the reference on which the other evidence depends?
We introduce VerusEval, a framework for systematically evaluating LLM-generated Verus specifications. It organizes these kinds of evidence into six dimensions with different roles. Text similarity and intent judgement give lightweight signals of how a contract is written and what it appears to intend. Verifier validity records how far an artifact progresses through verification, and semantic triviality detects vacuous contracts without a reference. Specification correctness uses proof obligations discharged by Verus itself to check whether a contract is sound (equivalent to or stronger than the reference) and complete (equivalent to or weaker). Behavior correctness checks the contract on a validated I/O suite. When a comparison with the reference fails, the rejected obligation shows the direction of the difference, which prioritizes inspection of the generated contract or the reference but does not by itself establish which artifact is defective. We apply VerusEval to 13,716 generated artifacts over 762 tasks, covering 18 configurations of four workflows, five models, and two prompting settings. The study includes StarVerus and adaptations of AlphaVerus, AutoVerus, and VeruSAGE for contract generation. Our contributions are:
• A specification evaluation framework. We define and implement six dimensions for evaluating generated Verus contracts. Four are diagnostic, and three of them adapt established checks: vacuity detection [3], the classical contract refinement order [19, 24], and finite-sample I/O testing [7, 26]. Our contribution is to instantiate them natively in Verus and to calibrate them on the same artifacts, so that the strength and blind spots of each become measurable. Encoding soundness and completeness as native proof obligations makes the direction of a deviation readable from the failed obligation.
• A systematic empirical study. We quantify how well verifier acceptance reflects contract quality and compare generation workflows, models, and prompting settings. Only 42.3% of accepted artifacts complete the triviality, I/O, and contract-comparison checks without a flag, and although acceptance is positively associated with quality at the artifact level, across workflows and models, higher acceptance does not consistently come with higher specification correctness.
• An analysis of evaluation evidence, failure modes, and reference quality. I/O evaluation rejects 23.6% of the accepted artifacts, yet only 63.2% of those that pass it are proved equivalent to their references. Of the accepted artifacts flagged by contract comparison, 84.1% have a rejected completeness obligation, that is, a failed proof attempt rather than a confirmed difference. Screening selects 61 of the 762 reference contracts, and review labels 36 of them as candidate defects. We demonstrate the resulting audit–repair procedure on one reference: restoring its missing guarantee makes 10 of its 11 failing artifacts equivalent. These results inform practical lessons for generation, evaluation, and benchmark maintenance.
2.1 Verus
Verus [17] is a deductive verifier for Rust: developers annotate functions with contracts and proof code, and an SMT solver discharges the resulting proof obligations automatically. Functions come in three modes: exec functions are compiled Rust, spec functions give pure mathematical definitions for contracts to use, and proof functions package reusable lemmas. An exec function's contract consists of a requires clause, which defines its admissible inputs, and an ensures clause, which states what the function guarantees on return. Contracts, together with the spec functions they call, form the specification of a program. The proof code instead serves as scaffolding: assertions, loop invariants, decreases clauses, ghost variables, and proof lemmas help the verifier discharge the proof obligations that the contract and implementation induce. A file reaches acceptance by clearing three successive stages: parsing, frontend checking (including name resolution, typing, and Verus mode rules), and proof. Verus accepts a file only when every function in it verifies. Acceptance certifies that the executable implementation satisfies the contract supplied in the same file, given the supplied proof code.
2.2 Satisfiability, Soundness, and Completeness
Let C denote a Verus function’s executable implementation, and let P and Q denote the precondition and postcondition expressed by its requires and ensures clauses, respectively.
The Hoare triple [11] holds if, for any input that satisfies the precondition and on which terminates, the resulting output satisfies the postcondition . However, verifier acceptance, which establishes that holds, is insufficient as a sole evaluation metric. For instance, if is unsatisfiable (i.e., always false) or is a tautology (i.e., always true), then any program trivially satisfies , rendering the verification result vacuous.
We say that a program C satisfies a specification if holds. Likewise, an input-output pair is accepted by if O satisfies Q whenever I satisfies P. In terms of program behavior, C satisfies if every correct input-output pair of C is accepted by .
This captures only one direction, referred to as completeness: it ensures that no correct behaviors of C are excluded from the specification. The complementary direction, referred to as soundness, requires that every input-output pair accepted by the specification must itself be a correct input-output pair of C. Intuitively, soundness guarantees that all behaviors characterized by the specification are indeed exhibited by the program.
D. Wang, C. Jiang, D. Liu, Z. Xu, C. Wen, Z. Ming, Y. Liu, X. Wan, and L. Huang
An ideal specification should be both sound and complete. If it is, then, by contraposition, every pair that C cannot produce is rejected by , and we call such pairs incorrect. Following prior work on evaluating postconditions [7, 26], we evaluate against sets of observed correct and sampled incorrect input–output pairs, checking whether it accepts the former and rejects the latter. These checks provide finite-sample evidence for soundness and completeness.
Such finite sets, however, may not fully represent the program’s complete behavioral space. In certain benchmarks, a reference specification is provided, which we assume faithfully captures the intended program semantics . Relative to this reference, a generated specification is sound (i.e., equivalent to or stronger than) if every input–output pair accepted by is accepted by . It is complete (i.e., equivalent to or weaker than) if every input–output pair accepted by is accepted by . It is equivalent to iff it is both sound and complete.
Figure 1 shows min_sublist, which returns a shortest list from a nonempty collection S. Its generated contract constrains the returned list to have the minimum length but omits . For , this contract permits , so it is unsound relative to the reference even though the artifact verifies.

Fig. 1. A contract can verify while omitting an output guarantee.
3 The VerusEval Framework
Because verifier acceptance alone cannot show whether a generated contract is vacuous or fails to capture the intended behavior (Section 2.2), VerusEval also evaluates what the contract requires and guarantees. Figure 2 outlines the evaluation. The unit of evaluation is a generated artifact: a Verus file containing the implementation of the task's target function, a generated specification, and proof code. VerusEval evaluates each artifact along six dimensions, some of which also draw on the task's reference contract or on a validated I/O suite.
A provided specification in practice is always more abstract than any implementation that satisfies it, and therefore admits a broader set of behaviors.

Fig. 2. Overview of VerusEval.
3.1 Evaluation Dimensions
• Text similarity measures how closely the generated contract resembles the reference contract in wording. It reflects how a contract is written rather than what it means, so logically equivalent contracts can still differ.
• Intent judgement uses an LLM to assess whether the generated contract is consistent with the implementation or the reference contract. Its explanations help locate potential problems.
• Verifier validity records how far the artifact progresses through verification (Section 2.1). Acceptance leaves open whether the contract captures the required behavior.
• Semantic triviality detects vacuous contracts [3]. A false precondition excludes every input, and a true postcondition constrains no output.
• Specification correctness assesses the soundness and completeness of the generated contract relative to the reference. It relates the generated precondition and postcondition to their reference counterparts by logical implication, so its conclusions are only as reliable as the reference.
• Behavior correctness checks whether the generated artifact admits the correct cases and rejects the incorrect cases of the validated I/O suite. Its cases are labeled using the reference implementation and contract, so it shares the reference dependence of specification correctness. The six dimensions play two roles. Text similarity and intent judgement are descriptive and never flag an artifact, since neither can establish a logical relation. The other four are diagnostic, and three of them flag artifacts through the triviality check, the I/O suite, and contract comparison.
3.2 Metric Definitions
Table 1 lists the metrics in each dimension. We describe them in the same order.
Text similarity. From each file, we extract the contract clauses and all spec function definitions, since contracts call these functions. The three metrics compare the normalized tokens of this text between the generated and reference files. BLEU [28, 29] and ROUGE-L [18] measure general textual overlap and treat all tokens alike. KeySpecMatch instead focuses on specification-specific features: clause kinds, selected Verus tokens such as quantifiers and logical operators, and identifiers. It reports the fraction of reference features that also occur in the generated contract.
Intent judgement. The two judgements follow the LLM-as-a-judge setting [43] and differ in what the judge sees. The spec-code judgement receives the full generated file, so the judge infers the
D. Wang, C. Jiang, D. Liu, Z. Xu, C. Wen, Z. Ming, Y. Liu, X. Wan, and L. Huang
Table 1. Core metrics.
| Dimension / metric | Comparison object / evidence | Dimension / metric | Comparison object / evidence |
|---|---|---|---|
| Text similarity | Reference contract text | Semantic triviality | |
| BLEU | False precondition | Generated precondition | |
| ROUGE-L | True postcondition | Generated postcondition | |
| KeySpecMatch | Specification correctness | Reference contract | |
| Intent judgement | Reference-relative soundness | ||
| LLM spec-code judgement | Implementation | Reference-relative completeness | |
| LLM spec-spec judgement | Reference contract | Reference equivalence | |
| Verifier validity | Behavior correctness | ||
| Syntactic validity | Parser diagnostics | Correct-I/O acceptance | Correct input-output pairs |
| Type validity | Frontend checks | Wrong-output rejection | Wrong-output pairs |
| Verifier acceptance | Proof outcomes | Invalid-input rejection | Invalid inputs |
intended behavior from the implementation. The spec-spec judgement receives the generated and reference contracts, together with their spec functions, and treats the reference as the intended behavior. Each judgement returns a score between 0 and 1, where 1 indicates full consistency and 0 indicates an unrelated, vacuous, or contradictory contract. The judge also explains its score by listing missing constraints, overly strong constraints, and vacuous clauses.
Verifier validity. The three metrics are binary and follow the verification stages in Section 2.1. Syntactic validity holds if the artifact parses. Type validity holds if the artifact also passes frontend checking. Verifier acceptance holds if Verus also discharges every proof obligation in the file.
Semantic triviality. Both triviality metrics are defined by proof obligations. We write each obligation as a Verus proof function and discharge it with Verus itself. This native encoding preserves spec functions, quantifiers, and the distinction between initial and final states. Each proof attempt has one of three outcomes: the obligation is proved when Verus discharges it, rejected when a completed attempt fails, and unresolved when the attempt does not complete, for example because of a timeout. Only a successful proof establishes the obligation. A rejected or unresolved attempt does not establish its negation. Each metric checks one obligation on the generated contract alone:
Here, denotes logical equivalence over all values of the relevant inputs and outputs. holds if the precondition is unsatisfiable, and holds if the postcondition is a tautology. does not assume , so a false precondition cannot make it hold. A proved obligation certifies the corresponding defect.
Specification correctness. We check the soundness and completeness of Section 2.2 directly by comparing the generated contract with the reference . Like and , each of the following four implications is encoded as a native Verus proof obligation:
The four implications instantiate the classical refinement order on contracts [19, 24]. When and hold, the generated contract is sound. When and hold, it is complete. When all four hold, it is equivalent to the reference. We name each obligation after the difference that its rejection suggests: a rejected , for example, points to a generated precondition that excludes inputs admitted by the reference. A rejected obligation is a failed proof attempt, not a confirmed semantic difference. Because and compare postconditions without precondition guards, their rejection can also arise outside the inputs admitted by one or both contracts. Thus, are sufficient but not necessary for the inclusions of Section 2.2, as and compare postconditions on all inputs rather than only on inputs satisfying the preconditions, making them stronger than needed. We keep the unconditional forms because they attribute a difference to a single clause and keep the comparison independent of the implementation. A domain-restricted alternative such as is more precise but entangles both clauses in one obligation, making the failing direction harder to read.
Figure 1 illustrates the corresponding reasoning for postconditions. The generated contract omits the clause , allowing the illustrated output to violate and refute . The preconditions coincide, and the reference postcondition implies the generated one, so , , and hold. The generated contract is therefore complete but unsound, with a strictly weaker postcondition.
Behavior correctness. Following the finite-sample evaluation in Section 2.2, we also check contracts against concrete cases. Here, I denotes the inputs of the target function, including the initial state of mutable parameters. O denotes its outputs, including the return value and the final state of mutable parameters. The validated I/O suite contains three kinds of cases. A correct pair combines an input admitted by the reference precondition with the output that the reference implementation produces for it. A wrong-output pair combines such an input with an output that the reference contract rejects. An invalid input either violates the reference precondition or makes the reference implementation panic. We write if the input I satisfies P, and if the output O satisfies Q. Let Panic(C, I) denote an observed panic when executing the implementation C on input I. The three kinds of cases are checked against the following conditions:
Both pair conditions require , so a contract cannot reject a wrong output merely by excluding a valid input. Correct-I/O acceptance, wrong-output rejection, and invalid-input rejection are the fractions of the corresponding cases for which Verus proves these conditions. An invalid input also counts as rejected if the implementation panics on it. We record the two separately, because a panic reflects the implementation rather than the contract.
4 Experimental Setup
4.1 Research Questions
RQ1 (Quality Proxy): How well does verifier acceptance reflect specification quality?
RQ2 (Configuration Effects): How do verifier acceptance and specification quality vary across generation workflows, models, and prompting settings?
RQ3 (Value and Limits of I/O): What does I/O evaluation add to verifier acceptance, and which contract differences does it miss?
RQ4 (Contract Differences): Which contract differences do the rejected obligations of verifier-accepted artifacts point to, and how can the direction of a failure guide improvements to generated and reference contracts?
D. Wang, C. Jiang, D. Liu, Z. Xu, C. Wen, Z. Ming, Y. Liu, X. Wan, and L. Huang
Table 2. Datasets and the RQs that use them.
| Dataset | Content | Size | RQs |
|---|---|---|---|
| Tasks | Reference implementation and contract of a target function | 762 | All |
| Labeled | Reference contracts selected by screening and then reviewed | 61 | 4 |
| I/O cases | Correct pairs, wrong-output pairs, and invalid inputs | 11,641 | 1-3 |
| Generated artifacts | 18 configurations: each model zero- and few-shot on all tasks | 13,716 | 2 |
| AlphaVerus | Llama | 1,524 | |
| AutoVerus | GPT-4o | 1,524 | |
| StarVerus | DeepSeek-Chat, DeepSeek-Reasoner, GPT-4o, Llama, Qwen-Coder | 7,620 | |
| VeruSAGE | DeepSeek-Chat, Qwen-Coder | 3,048 | |
| Accepted (eligible) | Accepted by Verus and containing a target function | 7,081 | 1, 3, 4 |
| Proof-failed | Type-valid but failing at proof, with a target function | 1,774 | 1 |
| Flagged | Accepted, with a rejected obligation among | 3,765 | 4 |
| Contract variants | One-side changes of 395 bases equivalent to their references | 943 | 3 |
4.2 Benchmark and Evaluation Datasets
Tasks and references. We use the 762 self-contained tasks of StarVerus [13] (Table 2), which originate from VeriCoding [5] (450), VerusBench [38] (144), MBPP-verified [25, 38] (77), a Dafny-to-Verus collection [2] (53), and HumanEval-Verus [32] (38). Each task specifies a target function and provides its reference implementation and reference contract , which Verus accepts.
Validated I/O suites. For each task, we build an I/O suite with the three kinds of cases of Section 3.2. An LLM (DeepSeek-V4-Flash) and heuristics for boundary inputs and output mutation propose candidate cases, similar to EvalPlus [21]. A candidate enters the suite only after its label is validated: Verus checks whether its input satisfies the reference precondition and whether the reference postcondition rejects a wrong output, and running the implementation supplies correct outputs and confirms panic-based invalid inputs. The suites thus rest on the same reference as specification correctness. The suites contain 11,641 cases: 4,716 correct pairs, 4,028 wrong-output pairs, and 2,897 invalid inputs. Construction targets at least five cases of each kind per task, with lower targets for some tasks, mostly for invalid inputs when a task has no precondition. Eighty-six tasks fall short for at least one kind. We evaluate every validated case, and only a kind without cases has no score.
Generated artifacts. We run four generation workflows, AlphaVerus [2], AutoVerus [38], StarVerus [13], and VeruSAGE [39]. StarVerus generates the contract together with the proof code, and we adapt the other three workflows to do the same. Table 2 lists the 18 configurations of workflow, model, and prompting setting, each run on all 762 tasks. Llama and Qwen-Coder denote Llama 4 Maverick and Qwen3-Coder-480B-A35B-Instruct. Of the 13,716 resulting artifacts, Verus accepts 7,134, and the others fail at parsing (1,814), frontend checking (2,990), or proof (1,778). Because the quality metrics evaluate the target function, we exclude 57 artifacts without an executable one (53 accepted and 4 proof-failed). The remaining 13,659 artifacts enter the quality metrics of RQ2, and their 7,081 accepted and 1,774 proof-failed members are the two groups that RQ1 compares.
Controlled contract variants. For RQ3, we construct contract variants that differ from the reference in a known direction. Each variant modifies a base, an accepted artifact that is proved equivalent to its reference and passes a suite with all three kinds of cases. Of the 7,081 accepted artifacts, 3,937 have such a suite, 2,293 of these pass every case, and 1,430 of those are proved equivalent. Sampling at most two per task yields 395 bases from 213 tasks.
A variant changes one side of the target contract and keeps the implementation and proof code. It strengthens the precondition or postcondition by adding a clause (Add) or tightening a comparison, such as to (Refine), or weakens it by deleting one of several clauses (Remove) or loosening a comparison, such as to (Relax). A candidate is kept only if Verus still accepts it and confirms the change. For an original predicate and a modified predicate , a stronger requires a proof of and a verified witness of , and a weaker requires the converse. A second witness shows that a stronger remains satisfiable and a weaker falsifiable. We keep the first of up to three passing candidates per base and operation. Because the base is equivalent to its reference, the variant differs from the reference in the confirmed direction.
Of the 3,552 candidates tried, we keep 943 variants over 204 tasks: 394 stronger and 62 weaker preconditions, and 72 stronger and 415 weaker postconditions. Weaker preconditions and stronger postconditions are rare because the unchanged implementation must then assume less or guarantee more, so most such candidates fail verification (729 of 845 and 691 of 948).
4.3 Evaluation Procedure
All evaluations use Verus release 0.2025.09.25.04e8687 with its bundled Rust 1.88.0 toolchain on x86-64 Linux, and each proof attempt has a timeout of 20 seconds. We retry unresolved attempts with larger time and resource limits and, where needed, with a simplified proof harness that keeps the checked expressions unchanged. Attempts that still do not complete remain unresolved. The two intent judgements use DeepSeek-V4-Flash as the judge model.
5 Experimental Results
For each RQ, we present the quantitative results and then summarize the answer in a finding.
5.1 RQ1: Verifier Acceptance as a Quality Proxy
Existing evaluations count every verifier-accepted artifact as a success. RQ1 examines how well this criterion reflects specification quality. We first compare accepted and proof-failed artifacts on the quality metrics and then screen the accepted artifacts with three semantic checks.
Association with quality metrics. We compare the 7,081 accepted and 1,774 proof-failed artifacts (Table 2). Proof-failed artifacts pass frontend checking but fail at proof, so unlike artifacts that fail earlier, they can be scored on the same metrics as accepted ones. Table 3 reports the mean of each metric in both groups and Kendall's [14, 15] between acceptance and the metric, with 95% confidence intervals from a bootstrap over tasks. All metrics are oriented so that higher is better, so a positive means that accepted artifacts tend to score higher.
Acceptance is positively associated with every quality metric except the false-precondition check, which almost no artifact fails. The association is strongest for specification correctness, with between 0.261 and 0.266. Among the artifacts with an equivalence score, 46.8% of the accepted and 14.5% of the proof-failed ones are proved equivalent to their references. The intent judgements and the two pair-based I/O metrics follow, whereas text similarity, invalid-input rejection, and the true-postcondition check show the weakest associations.
The I/O associations partly reflect unresolved cases rather than incorrect behavior. For 76 of the 1,774 proof-failed artifacts, Verus reports part of the contract as ill-formed, for example because it cannot infer a trigger for a quantifier. Most of their case checks therefore remain unresolved and count as not passed. Excluding these artifacts lowers to 0.158 for correct-I/O acceptance and 0.198 for wrong-output rejection, whereas for equivalence barely changes (0.257). The association with specification correctness is thus the most robust.
Acceptance therefore carries information about specification quality but does not certify it, since fewer than half of the accepted artifacts are proved equivalent to their reference contracts, so counting every accepted artifact as a success overstates quality.
D. Wang, C. Jiang, D. Liu, Z. Xu, C. Wen, Z. Ming, Y. Liu, X. Wan, and L. Huang
Table 3. Quality metrics of accepted and proof-failed artifacts. A dash marks an undefined interval.
| Dimension | Metric | Accepted | Proof-failed | with acceptance | |||
|---|---|---|---|---|---|---|---|
| n | Mean | n | Mean | Value | 95% CI | ||
| Text similarity | BLEU | 7,081 | 0.488 | 1,774 | 0.346 | 0.151 | [0.125, 0.178] |
| ROUGE-L | 7,081 | 0.655 | 1,774 | 0.519 | 0.174 | [0.149, 0.199] | |
| KeySpecMatch | 7,081 | 0.715 | 1,774 | 0.633 | 0.112 | [0.082, 0.141] | |
| Intent judgement | Spec-code judgement | 7,081 | 0.930 | 1,774 | 0.744 | 0.239 | [0.210, 0.271] |
| Spec-spec judgement | 7,081 | 0.778 | 1,774 | 0.588 | 0.196 | [0.165, 0.225] | |
| Semantic triviality | False precondition not proved | 7,081 | 0.999 | 1,774 | 1.000 | -0.012 | - |
| True postcondition not proved | 7,081 | 0.986 | 1,774 | 0.954 | 0.090 | [0.055, 0.124] | |
| Specification correctness | Soundness | 7,074 | 0.694 | 1,771 | 0.379 | 0.261 | [0.225, 0.293] |
| Completeness | 7,074 | 0.552 | 1,771 | 0.220 | 0.266 | [0.235, 0.299] | |
| Equivalence | 7,074 | 0.468 | 1,771 | 0.145 | 0.263 | [0.235, 0.291] | |
| Behavior correctness | Correct-I/O acceptance | 6,812 | 0.907 | 1,722 | 0.777 | 0.194 | [0.156, 0.235] |
| Wrong-output rejection | 6,592 | 0.958 | 1,660 | 0.810 | 0.239 | [0.201, 0.274] | |
| Invalid-input rejection | 4,224 | 0.767 | 1,171 | 0.678 | 0.094 | [0.048, 0.142] | |

Fig. 3. Screening flags of the 7,081 accepted artifacts, with counts of incomplete checks in parentheses.
Screening of accepted artifacts. A missing equivalence proof, however, does not show that an artifact is wrong. We therefore screen each accepted artifact with three checks, each of which flags the artifact when it finds evidence of a defect. Contract comparison flags an artifact when Verus rejects one of the implications , the I/O suite when the generated contract fails a case, and the triviality check when or is proved. An artifact passes a check when the check completes without a flag. Only 2,995 of the 7,081 accepted artifacts (42.3%) pass all three checks, and 3,790 (53.5%) are flagged by at least one. The remaining 296 are not flagged, but at least one of their checks is incomplete, mostly because some I/O cases remain unresolved. Even counting them as passing would raise the pass rate only to 46.5%.
Figure 3 shows that the three checks are far from equally informative. Contract comparison also flags 1,666 of the 1,672 I/O-flagged artifacts and 84 of the 104 triviality-flagged ones. Only 25 flagged artifacts lack a contract-comparison flag, and 22 of them are proved equivalent to their reference contracts. For 17 of these 22, the triviality obligation proved for the generated contract therefore also holds for the reference contract. The I/O suite thus rarely detects a problem that contract comparison misses.

Fig. 4. Workflows compared on a shared model under few-shot prompting.
The flags, however, differ in strength. A failed case usually provides a concrete counterexample, and a proved triviality obligation shows that the contract is vacuous. A rejected implication, by contrast, shows only that a proof attempt failed. Where the I/O suite and contract comparison flag the same artifact, the failed case usually supplies the counterexample that the rejected implication lacks. Overall, 44.7% of the flagged artifacts have a counterexample or a proved triviality obligation. The 2,083 artifacts (55.0%) flagged by contract comparison alone rest only on rejected implications.
Finding 1. Verifier acceptance is positively associated with specification quality, most robustly with specification correctness, but it overstates quality as a success criterion. Only 42.3% of the accepted artifacts pass all three semantic checks, and 53.5% are flagged by at least one. Of the flagged artifacts, 44.7% have a counterexample or a proved triviality obligation, whereas 55.0% rest only on rejected implications.
5.2 RQ2: Effects of Generation Configurations
RQ1 shows that acceptance is an imperfect proxy for the quality of individual artifacts. RQ2 asks whether a configuration with higher acceptance also produces better specifications. We vary one factor at a time. Workflows are compared on a shared model and models within StarVerus, both under few-shot prompting, and prompting settings are compared within each StarVerus model.
Figures 4 and 5(a) show configuration means. Unlike RQ1, which compares only artifacts that reach the proof stage, RQ2 averages each quality metric over all artifacts of a configuration that have a score, including those that fail parsing or frontend checking. Most I/O cases of such artifacts remain unresolved and count as not passed, so the I/O means also reflect how often a configuration produces type-valid artifacts. Since the scored artifacts differ between configurations, a difference in means may partly reflect which tasks are scored. For the differences we discuss, we therefore also compare the two configurations on the tasks that both have scored, with 95% bootstrap intervals over tasks. Figure 5(b) shows such paired changes from zero-shot to few-shot prompting.
Workflow differences. Across workflows, the acceptance gap does not predict the quality gap. In two of the four comparisons, the workflow with higher acceptance also leads on most metrics: StarVerus over AlphaVerus with Llama and over VeruSAGE with DeepSeek-Chat. In the other two, it does not. With GPT-4o, AutoVerus accepts more tasks than StarVerus (77.0% versus 73.4%) but scores lower on the spec-code judgement (78.1% versus 94.1%) and the true-postcondition check (87.4% versus 99.6%). With Qwen-Coder, StarVerus accepts 20.6 percentage points more tasks than VeruSAGE, yet the two differ by at most 0.5 points in soundness, completeness, and equivalence.
D. Wang, C. Jiang, D. Liu, Z. Xu, C. Wen, Z. Ming, Y. Liu, X. Wan, and L. Huang
(a) Few-shot means

(b) Few-shot minus zero-shot
Llama ▲ GPT-4o ■ DeepSeek-Chat ♦ DeepSeek-Reasoner × Qwen-Coder
Fig. 5. StarVerus models: (a) few-shot means and (b) paired zero- to few-shot changes with 95% intervals.
Model differences. Across models, acceptance rankings carry over to the pair-based I/O metrics but not to specification correctness. Within StarVerus, acceptance ranges from 64.6% for Llama to 88.6% for DeepSeek-Reasoner. Type validity follows the same ordering, and so, largely, do the two pair-based I/O metrics, which depend on it. Specification correctness does not. On the tasks scored for both models, DeepSeek-Reasoner accepts 24.0 points more tasks than Llama but shows no clear difference in soundness, completeness, or equivalence, with all intervals including zero. It is even 3.2–4.3 points lower than DeepSeek-Chat and Qwen-Coder in completeness and equivalence.
Prompting differences. Prompting, in contrast, moves acceptance and quality in the same direction. Few-shot prompting raises acceptance for all five StarVerus models by 17.3–38.2 points and improves most quality metrics, with larger gains in soundness than in completeness. Much of the I/O gain, however, reflects artifacts that become type-valid, so that their cases can be checked, rather than contracts that behave better. Few-shot prompting raises type validity most for Llama and GPT-4o (by 41.2 and 37.4 points), which are also the two models with the largest I/O gains. On tasks where both settings yield type-valid artifacts, the few-shot gain drops to at most 6.2 points for correct-I/O acceptance and 9.0 for wrong-output rejection.
Finding 2. Within the comparisons of this study, four workflow pairs and the model and prompting comparisons in StarVerus, acceptance is an unreliable basis for comparing configurations: higher acceptance does not consistently come with higher specification correctness. Few-shot prompting raises acceptance and most quality metrics, although much of its I/O gain reflects artifacts that become type-valid.
5.3 RQ3: Coverage and Limits of I/O Evaluation
RQ1 and RQ2 show that verifier acceptance must be complemented by semantic checks. Our validated I/O suites provide the finite-sample evidence of Section 2.2, and nearly all I/O-flagged artifacts are also flagged by contract comparison (Figure 3). RQ3 asks what this evidence adds to verifier acceptance and where it falls short of contract comparison. We measure two gaps on the accepted artifacts: the gap from acceptance to I/O passing shows the usefulness of I/O evaluation, and the gap from I/O passing to proved soundness, completeness, and equivalence shows its limitation. We then evaluate the controlled variants of Section 4.2, whose differences from the reference contract are known, to explain which differences the finite cases miss. Because
Table 4. Accepted artifacts (Acc.), % passing I/O, and % of those proved equivalent (Equiv.) by configuration.
| Workflow | Model | Zero-shot | Few-shot | ||||
|---|---|---|---|---|---|---|---|
| Acc. | I/O | Equiv. | Acc. | I/O | Equiv. | ||
| AlphaVerus | Llama | 42 | 33.3 | 57.1 | 224 | 74.1 | 70.5 |
| AutoVerus | GPT-4o | 197 | 55.3 | 67.0 | 587 | 69.0 | 65.4 |
| DeepSeek-Chat | 347 | 66.9 | 60.3 | 610 | 70.0 | 64.9 | |
| DeepSeek-Reasoner | 493 | 60.6 | 59.9 | 672 | 67.4 | 60.9 | |
| StarVerus | GPT-4o | 261 | 57.1 | 66.4 | 558 | 69.0 | 62.9 |
| Llama | 200 | 56.5 | 51.3 | 487 | 70.4 | 67.3 | |
| Qwen-Coder | 472 | 62.5 | 53.9 | 590 | 71.7 | 64.1 | |
| VeruSAGE | DeepSeek-Chat | 166 | 69.3 | 69.6 | 477 | 69.6 | 67.8 |
| Qwen-Coder | 250 | 62.0 | 51.0 | 448 | 74.6 | 66.2 | |
| All | 2,428 | 61.0 | 59.1 | 4,653 | 70.2 | 65.0 | |
Table 5. Detection of controlled variants by kind of case. Five variants yield only expression diagnostics.
| Change | Violates | Operation | Correct | Wrong | Invalid | Detected | Missed | |
|---|---|---|---|---|---|---|---|---|
| Stronger precondition | AddRefine | 163231 | 161230 | 128227 | 00 | 161230 | 21 | |
| Weaker precondition | RemoveRelax | 3527 | 00 | 00 | 2719 | 2719 | 88 | |
| Stronger postcondition | AddRefine | 693 | 00 | 00 | 00 | 00 | 693 | |
| Weaker postcondition | RemoveRelax | 224191 | 00 | 163171 | 00 | 163171 | 5818 | |
| Total | 943 | 391 | 689 | 46 | 771 | 167 |
the suites and contract comparison share the oracle , their agreement is not independent corroboration, so the variant experiment measures the suites themselves.
From acceptance to I/O passing and equivalence. We start from the 7,081 accepted artifacts in Figure 3. The I/O suite flags 1,672 of them (23.6%), which acceptance alone would count as successes, and 660 others have unresolved or no cases. The remaining 4,749 (67.1%) pass every available case. Among these, however, only 3,737 (78.7%) are proved sound, 3,373 (71.0%) complete, and 3,000 (63.2%) equivalent to their references. Table 4 shows that this gap persists in every configuration, with equivalence rates between 51.0% and 70.5% among I/O-passing artifacts.
Detection by direction. We run the 943 variants on the suites of their bases (Table 5). Each kind of case can witness only one direction of a variant's change: a case with input satisfying (a correct or wrong-output pair) witnesses a stronger precondition , an invalid input violating witnesses a weaker precondition , a correct output satisfying witnesses a stronger postcondition , and a wrong output outside witnesses a weaker postcondition .
In practice, the suites detect 771 of the 943 variants (81.8%), miss 167 that pass every case, and give only expression diagnostics for the other five. Correct pairs detect 391 of the 394 stronger preconditions, invalid inputs 46 of the 62 weaker preconditions, and wrong-output pairs 334 of the 415 weaker postconditions. Wrong-output pairs also detect 355 stronger preconditions, because their check requires the input to be admitted first. In the current suites, no case detects any of the 72 stronger postconditions.
D. Wang, C. Jiang, D. Liu, Z. Xu, C. Wen, Z. Ming, Y. Liu, X. Wan, and L. Huang
Soundness
Completeness
L1: Pre stronger 16.2%
L2: Post weaker 46.8%
L3: Pre weaker 51.1%
L4: Post stronger 54.0%
Flagged artifacts per combination (n = 3,765)

Fig. 6. Combinations of failed obligations in the 3,765 flagged artifacts.
Why changes escape the suite. A change escapes when no case in the suite is judged differently by the original and the changed contract. For 95 of the 167 misses, which change a precondition (19) or weaken a postcondition (76), the suite simply lacks such a case. In one task, for example, deleting the precondition clause N > 0 newly admits inputs with N = 0, but every invalid input in the suite also violates the remaining clause such as and is still rejected. The 72 stronger postconditions escape under this construction. A retained variant keeps the implementation and the precondition of its base and is still accepted by Verus, so the implementation satisfies the stronger postcondition wherever the reference admits the input. This explanation is conditional on the base implementation agreeing with the reference implementation on the reference domain that generated the positive pairs; we state it as an assumption about this retained suite, not as a general implementation-equivalence theorem.
Finding 3. I/O evaluation adds screening beyond acceptance but is weak evidence of equivalence. It rejects 23.6% of the accepted artifacts, yet only 63.2% of those that pass it are proved equivalent to their references, and every configuration shows this gap. On 943 controlled contract variants, the suites detect 81.8%, but detection depends on the direction of the change. Under the construction and the stated base/reference behavioral-agreement assumption, the 72 stronger postconditions are expected to escape; the suites detect 88.5% of the other 871 variants.
5.4 RQ4: Contract Differences and Improvement Directions
RQ1 and RQ3 leave contract comparison as the most discriminating check: it flags 3,765 of the 7,081 accepted artifacts, including nearly all that the I/O suite flags. Its flags, however, only identify rejected proof obligations, not confirmed differences. The percentages below therefore describe proof-obligation patterns and screening priorities, not a confirmed distribution of semantic defects. RQ4 asks which contract differences these rejections point to and how they can guide improvements to generated and reference contracts. We call a rejected obligation among a failure, with the direction given in Equations (3)–(6).
Failure directions. Figure 6 shows the failures of the 3,765 flagged artifacts, which cover 634 tasks. Most of them have a rejected completeness obligation: 84.1% have or rejected, compared with 57.5% that have a rejected soundness obligation through or . For preconditions, weaker-precondition failures ( , 51.1%) far outnumber stronger ones ( , 16.2%). Postcondition failures are common in both directions ( 54.0%, 46.8%). The most frequently rejected obligation is thus , the stronger-postcondition direction in which the I/O suites of RQ3 detect none of the variants.
Contract differences. The column shares count each obligation separately, whereas each row of Figure 6 shows which obligations fail together and which are proved. The proved obligations determine how the generated contract relates to its reference. If all rejected obligations of a row lie
(a) Selected reference contracts by signal

(b) Candidate defects by kind (n = 36)
Fig. 7. Screening of reference contracts: (a) candidates/selected per signal and (b) candidate defects by kind.
under Completeness, and are proved, so the generated contract is sound and thus (equivalent to or) stronger than the reference (Section 2.2). These rows cover 1,599 flagged artifacts (42.5%), about half of the 3,166 with a rejected completeness obligation. Conversely, the rows whose rejected obligations all lie under Soundness cover 599 artifacts (15.9%), whose generated contracts are complete and thus (equivalent to or) weaker than the reference. In another 571 artifacts (15.2%), the preconditions (521, rejecting only and ) or the postconditions (50, rejecting only and ) are proved equivalent. The difference thus lies in the other condition, which may be weaker in some respects and stronger in others, so both cases below can apply to it. The remaining 996 artifacts (26.5%) establish none of these relations.
Completeness proved, soundness unproved. For the 599 complete artifacts, a rejected suggests a precondition that excludes inputs the reference admits, and a rejected a postcondition that permits outputs the reference rejects. Both differences can be exposed by I/O cases (Table 5). A correct pair whose input the generated precondition excludes shows an input to admit, and a wrong output that the generated postcondition accepts shows an output to exclude. Such counterexamples indicate how to revise the generated contract, by relaxing its precondition or tightening its postcondition.
Soundness proved, completeness unproved. For the 1,599 sound artifacts, a rejected suggests a precondition that admits inputs the reference excludes, and a rejected a postcondition that guarantees more than the reference. A confirmed difference of either kind would make the contract stronger, and the accepted artifact proves that its implementation handles the extra inputs or provides the extra guarantees. Executing the implementation thus cannot yield a counterexample to a stronger postcondition, and although an invalid input may expose the extra inputs of a weaker precondition, the implementation is proved correct on them too. Such differences therefore prioritize reviewing the reference, while a stronger generated contract may also overconstrain the task: the reference may abstract the behavior on purpose, restrict inputs the task allows, or omit a guarantee that the task requires. We do not claim that the generated contract is correct, only that it is Verus-verified and equivalent to or stronger than the reference. A stronger contract from a single model is thus only a candidate, and recurrence across models signals which references warrant review, as implemented below.
Reviewing reference contracts. We screen the reference contracts with five signals, each of which selects a reference for review against its implementation. S0 applies the triviality obligations and to the reference itself, since any generated contract that is not itself vacuous fails completeness against a vacuous reference. S1 and S2 look for the same problems through accepted artifacts, selecting a task with a postcondition proved true ( ) that still implies the reference postcondition ( ) or with a precondition proved false ( ). S3 and S4 look for comparison patterns shared across models. S3 selects a task with at least six accepted artifacts, at least 80% of which, from at least three models, have proved and rejected, the pattern of the stronger guarantees above. S4 applies the same rule to preconditions ( proved, rejected).
D. Wang, C. Jiang, D. Liu, Z. Xu, C. Wen, Z. Ming, Y. Liu, X. Wan, and L. Huang

Fig. 8. One candidate reference defect per kind. Badges give counts, and dashed boxes mark omissions.
Reference review results. The signals select a non-random, purposive sample of 61 of the 762 references (8.0%, Figure 7a); the resulting 36/61 is a yield among screened references, not an estimate of benchmark-wide defect prevalence. Two independent judges assess whether each selected reference captures the observable behavior of its implementation, that is, its return value and the final state of the parameters it writes, and identify the candidate defects. They agree on 57 of the 61, and a domain expert then reviews every label to finalize it, including adjudication of all four disagreements. The five signals, their selection thresholds, the independent judgments, and expert adjudication define the screening sample; references outside it are not represented by this rate. The 36 candidate defects fall into four kinds (Figure 7b). A missing guarantee leaves part of the behavior unconstrained (20), a vacuous contract admits no input or constrains no output (6), an incorrect constraint misstates a condition, such as a value range (7), and an inexpressible property cannot be stated in a Verus contract (3). Figure 8 shows one candidate of each kind.
Repairing a reference contract. The first example in Figure 8 illustrates one repair selected from the screened references; its 10/11 result is a case study, not an estimate of repair success across the benchmark. All 11 accepted artifacts of min_array, from five models, fail only because they require the minimum to be an array element, a guarantee the reference omits and whose loss a comment attributes to translation from Dafny. Their shared guarantee thus suggests the repair. We add it to the reference with the loop invariants that prove it, and Verus accepts the repaired reference with the unchanged implementation. Against it, 10 of the 11 artifacts are proved equivalent, and the remaining one fails only because the postcondition comparison does not assume .
Finding 4. The direction of a comparison failure prioritizes inspection of the generated contract or the reference; it does not by itself establish which artifact is defective. Of the 3,765 flagged artifacts, 15.9% fail only soundness obligations, a pattern for inspecting weaker generated contracts and using I/O counterexamples to guide relaxed preconditions or tightened postconditions. Another 42.5% fail only completeness obligations, a pattern that prioritizes auditing the reference, while a stronger generated contract may still overconstrain the task. Reviewing the 61 screened references finds 36 candidate defects, and a guarantee shared by several models can repair a reference that omits it.
6 Actionable Lessons
Our findings yield four lessons for evaluation, generation, and benchmark maintenance.
Lesson 1: Report contract quality alongside acceptance. Acceptance alone overstates the quality of generated contracts (Finding 1) and misleads comparisons, because a workflow or model with higher acceptance does not necessarily produce more correct contracts (Finding 2). Evaluations should therefore report triviality, specification correctness, and behavior correctness together with acceptance, and compare configurations on the same tasks. Few-shot prompting raises both acceptance and quality for the StarVerus models, but much of its I/O gain comes from artifacts that become type-valid, so I/O gains should be reported together with type validity.
Lesson 2: Design I/O suites for the differences they must expose. An I/O suite reveals a contract change only if one of its cases is judged differently by the original and the changed contract (Finding 3). Our suites show two gaps. First, a weakened constraint goes unnoticed when every invalid input also violates another constraint that remains. Invalid inputs should therefore each violate a different input constraint, and wrong outputs a different output guarantee. Second, no case in the current suites detects the 72 stronger postconditions, which are expected to escape under the construction and the stated base/reference behavioral-agreement assumption (Section 5.3). Such a difference need not be a defect of the generated contract, and Lesson 4 handles it through the reference rather than the suite. Evaluations should also report the three kinds of cases separately, since a wrong-output case fails not only when the contract accepts the wrong output but also when a stronger precondition rejects the input. For invalid inputs, they should distinguish precondition rejection from runtime panic, which can conceal an omitted input constraint.
Lesson 3: Revise weaker generated contracts with I/O counterexamples. Weaker generated contracts may exclude inputs that the reference admits or permit outputs that it rejects, and the 15.9% pattern prioritizes inspecting this possibility (Finding 4). Verifier feedback does not reveal such differences, since the artifacts are accepted. I/O cases do, as the RQ3 variants show (Table 5). Each failing case shows what to change, an input to admit or an output to exclude. Generation workflows should therefore feed failing cases back to the generator and re-verify the revised contract. Such cases can come from task requirements or existing tests when no reference is available.
Lesson 4: Review the reference when stronger contracts recur across models. The 42.5% pattern prioritizes reviewing stronger generated contracts and the references against which they are compared (Finding 4). Their extra inputs or guarantees are met by the verified implementation, so a confirmed difference of this kind makes the reference a candidate for review rather than proving the generated contract wrong, although a stronger contract may also overconstrain the task. When the same difference recurs across models, the reference may omit a guarantee that the task requires, and screening can select it for review. For min_array, adding the guarantee that the generated contracts share repairs the reference and makes 10 of its 11 flagged artifacts equivalent (Section 5.4). Benchmark maintainers should therefore review such references before treating the generated contracts as wrong. A shared guarantee should be adopted only if the task requires it and the unchanged implementation verifies against the extended reference, and the I/O labels should be revalidated afterwards.
Summary. Together, the lessons suggest a staged evaluation. Acceptance serves as an entry check, and the triviality checks remove vacuous contracts. With a reference, the direction of a comparison failure prioritizes the next inspection: weaker generated contracts can be tested and revised with I/O counterexamples, while stronger ones that recur across models can trigger a review of the reference. Without a reference contract, I/O cases of all three kinds give partial evidence, and a stronger postcondition that the implementation satisfies passes every case.
7 Threats to Validity
Construct validity. Contract comparison and the I/O suites both depend on the reference, which can itself be defective. RQ4 screens the reference contracts for such defects and reviews a non-random sample of 61 selected ones; the 36/61 result is a screened-sample yield, references outside the selection are not reviewed, and the rate of undetected defects is unknown. A rejected obligation
D. Wang, C. Jiang, D. Liu, Z. Xu, C. Wen, Z. Ming, Y. Liu, X. Wan, and L. Huang
may also stem from the limits of proof automation rather than a real difference, so we treat it as a failed proof attempt rather than a confirmed difference.
Internal validity. Errors in extracting contracts or building proof harnesses could distort results. We encode every obligation natively in Verus, which avoids translation into another logic. The RQ3 variants come from a limited, retained set of edits; their detection rates are descriptive for these mutations and do not estimate detection of naturally occurring defects. The reference review of RQ4 compares contracts with implementations, not task requirements, so we report candidate defects rather than a confirmed defect rate. Each configuration generates one artifact per task, so configuration comparisons are based on one generation draw per task; the bootstrap over tasks captures task variation but not run-to-run variation.
External validity. Our 762 self-contained tasks may not represent repository-scale verification [20], although they come from five benchmarks. Not every model runs in every workflow, so we compare workflows only on shared models. All results use one Verus release (Section 4.3), and another release may decide some obligations differently.
8 Related Work
Proof Generation. LLMs support deductive verification by generating proof annotations and repairing failed proofs. AutoVerus [38] synthesizes and repairs Verus proof annotations using verifier feedback, while VeruSAGE [39] studies agentic proof completion for Rust systems. RagVerus [44] retrieves repository context for proof generation, and VerusSeek [42] applies retrieval to Rust proof synthesis. ExVerus [41] uses counterexample reasoning to guide Verus proof repair. With a supplied contract, verifier acceptance measures whether the generated proof code completes verification. Specification Generation. Specification generators infer the contracts that state the properties to be verified. SpecGen [23] combines conversational specification generation with mutation of candidate specifications to obtain verifiable contracts. AutoSpec [35] uses static analysis and program verification to decompose programs and iteratively validate generated specifications. Fun2Spec [33] synthesizes quantified contracts for C++ programs using automated validation and error feedback. For unsafe Rust, KaPilot [34] extracts safety requirements from documentation, refines Kani specifications through verification, and uses implication checks to select among candidates. For Verus, AlphaVerus [2] generates code and contracts through translation and refines candidates using verifier feedback. StarVerus [13] uses multiple agents to generate specifications and proofs. These approaches make the contract itself an output that verification alone cannot validate.
Specification Evaluation. Empirical studies examine how well generated specifications capture program behavior. Xie et al. [36] compare LLMs and traditional techniques for generating specifications from comments and documentation, studying few-shot prompting and generation failures. Endres et al. [7] evaluate generated postconditions by their correctness and ability to discriminate incorrect code. EvoSpex [26] learns postconditions from valid and invalid program states, and SpecSyn [22] uses program mutants to assess and refine specification strength. Recent evaluation frameworks use tests, proofs, and consistency checks to assess generated specifications. Verus-SpecGym [1] executes Verus specifications against official contest tests and adversarial cases. Coins [40] instantiates specifications on trusted test cases to produce Rocq proof obligations and highlights how verification difficulty can obscure specification quality. Clover [31] checks consistency among code, docstrings, and formal annotations. LiveFMBench [37] shows that prover gaming and ignored code context can inflate measured specification-generation accuracy.
Our controlled variants and reference screening draw on work on test adequacy and benchmark quality. Mutation analysis [12] seeds small faults to measure whether a test suite detects them, and EvalPlus [21] shows that insufficient tests overstate the correctness of generated code. Label errors in test sets can likewise change model rankings on machine learning benchmarks [27]. Our work complements these studies in a common Verus setting. It relates verifier acceptance, I/O cases, and logical comparison with the reference on the same artifacts and measures which contract differences each can reveal. It also uses the direction of a comparison failure to prioritize inspection of the generated contract or the reference, while treating the reference itself as a possible source of error and using differences shared across models to find and repair candidate defects.
9 Conclusion
We presented VerusEval, a framework that evaluates LLM-generated Verus contracts along six dimensions, and applied it to 13,716 artifacts on 762 tasks. Our study revealed that verifier acceptance overstates contract quality: only 42.3% of the accepted artifacts complete all three semantic checks without a flag, and across workflows and models, higher acceptance does not consistently come with more correct contracts. I/O evaluation rejected 23.6% of the accepted artifacts but was weak evidence of equivalence. Most accepted artifacts flagged by contract comparison have a rejected completeness obligation, and the direction of a failure helps prioritize inspection of the generated contract or the reference but does not by itself identify which artifact is defective. Screening and review identified 36 candidate defects among the benchmark reference contracts, and repairing one of them made 10 of its 11 failing artifacts equivalent. We derived four actionable lessons for evaluation, generation, and benchmark maintenance. These findings highlight the need to evaluate generated contracts not only by whether they verify but also by what they guarantee, and to treat benchmark references as subject to review.
References
[1] Anmol Agarwal, Natalie Neamtu, Pranjal Aggarwal, Seungone Kim, Jannis Limperg, Cedric Flamant, Kanna Shimizu, Bryan Parno, and Sean Welleck. 2026. Verus-SpecGym: An Agentic Environment for Evaluating Specification Autoformalization. arXiv:2605.26457 doi:10.48550/arXiv.2605.26457
[2] Pranjal Aggarwal, Bryan Parno, and Sean Welleck. 2025. AlphaVerus: Bootstrapping Formally Verified Code Generation through Self-Improving Translation and Treefinement. In Proceedings of the 42nd International Conference on Machine Learning (Proceedings of Machine Learning Research, Vol. 267). PMLR, Vancouver, Canada, 587–615. https://proceedings.mlr.press/v267/aggarwal25a.html
[3] Ilan Beer, Shoham Ben-David, Cindy Eisner, and Yoav Rodeh. 2001. Efficient Detection of Vacuity in Temporal Model Checking. Formal Methods in System Design 18, 2 (2001), 141–163. doi:10.1023/A:1008779610539
[4] Arslan Bisharat, Eric Spencer, Brian Ortiz, Khushboo Bhadauria, Mujtaba Nazari, Beatriz Santos, Anisa Ramos, TaiNing Wang, George K. Thiruvathukal, Konstantin Läufer, and Mohammed Abuhamad. 2026. TLA -Bench: An Execution-Grounded Benchmark and Dataset for Natural-Language to TLA Specification Generation. arXiv:2607.23425 doi:10.48550/arXiv.2607.23425
[5] Sergiu Bursuc, Theodore Ehrenborg, Shaowei Lin, Lacramioara Astefanoaei, Ionel Emilian Chiosa, Jure Kukovec, Alok Singh, Oliver Butterley, Adem Bizid, Quinn Dougherty, Miranda Zhao, Max Tan, and Max Tegmark. 2025. A benchmark for vericoding: formally verified program synthesis. arXiv:2509.22908 doi:10.48550/arXiv.2509.22908
[6] Zaoyu Chen, Jianbo Dai, Boyu Zhu, Jingdong Wang, Huiming Wang, Xin Xu, Haoyang Yuan, Zhijiang Guo, and Xiao-Ming Wu. 2026. CodeSpecBench: Benchmarking LLMs for Executable Behavioral Specification Generation. arXiv:2604.12268 [cs.SE] https://arxiv.org/abs/2604.12268
[7] Madeline Endres, Sarah Fakhoury, Saikat Chakraborty, and Shuvendu K. Lahiri. 2024. Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions? Proceedings of the ACM on Software Engineering 1, FSE (2024), 1889–1912. doi:10.1145/3660791
[8] Ronghui Gu, Zhong Shao, Hao Chen, Xiongnan Newman Wu, Jieung Kim, Vilhelm Sjöberg, and David Costanzo. 2016. CertiKOS: An Extensible Architecture for Building Certified Concurrent OS Kernels. In 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 16). USENIX Association, Savannah, GA, USA, 653–669. https://www.usenix.org/conference/osdi16/technical-sessions/presentation/gu
[9] Reiner Hähnle and Marieke Huisman. 2019. Deductive Software Verification: From Pen-and-Paper Proofs to Industrial Tools. In Computing and Software Science: State of the Art and Perspectives. Springer, Cham, Switzerland, 345–373. doi:10.1007/978-3-319-91908-9_18
D. Wang, C. Jiang, D. Liu, Z. Xu, C. Wen, Z. Ming, Y. Liu, X. Wan, and L. Huang
[10] Chris Hawblitzel, Jon Howell, Manos Kapritsos, Jacob R. Lorch, Bryan Parno, Michael L. Roberts, Srinath Setty, and Brian Zill. 2015. IronFleet: Proving Practical Distributed Systems Correct. In Proceedings of the 25th Symposium on Operating Systems Principles. ACM, New York, NY, USA, 1–17. doi:10.1145/2815400.2815428
[11] C. A. R. Hoare. 1969. An Axiomatic Basis for Computer Programming. Commun. ACM 12, 10 (1969), 576–580. doi:10.1145/363235.363259
[12] Yue Jia and Mark Harman. 2011. An Analysis and Survey of the Development of Mutation Testing. IEEE Transactions on Software Engineering 37, 5 (2011), 649–678. doi:10.1109/TSE.2010.62
[13] Chao Jiang, Ding Wang, Dugang Liu, Zhiwu Xu, Cheng Wen, Zhong Ming, Yuwei Liu, Xinyi Wan, and Lin Huang. 2026. StarVerus: LLM-Powered Multi-Agent Collaboration for Industrial Rust Code Verification Automation. In Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining V.2. ACM, New York, NY, USA, 7444–7455. doi:10.1145/3770855.3818485
[14] Maurice G. Kendall. 1938. A New Measure of Rank Correlation. Biometrika 30, 1–2 (1938), 81–93. doi:10.1093/biomet/30.1-2.81
[15] Maurice G. Kendall. 1945. The Treatment of Ties in Ranking Problems. Biometrika 33, 3 (1945), 239–251. doi:10.1093/biomet/33.3.239
[16] Gerwin Klein, Kevin Elphinstone, Gernot Heiser, June Andronick, David Cock, Philip Derrin, Dhammika Elkaduwe, Kai Engelhardt, Rafal Kolanski, Michael Norrish, Thomas Sewell, Harvey Tuch, and Simon Winwood. 2009. seL4: Formal Verification of an OS Kernel. In Proceedings of the ACM SIGOPS 22nd symposium on Operating systems principles. ACM, New York, NY, USA, 207–220. doi:10.1145/1629575.1629596
[17] Andrea Lattuada, Travis Hance, Chanhee Cho, Matthias Brun, Isitha Subasinghe, Yi Zhou, Jon Howell, Bryan Parno, and Chris Hawblitzel. 2023. Verus: Verifying Rust Programs using Linear Ghost Types. Proceedings of the ACM on Programming Languages 7, OOPSLA1 (2023), 286–315. doi:10.1145/3586037
[18] Chin-Yew Lin. 2004. ROUGE: A Package for Automatic Evaluation of Summaries. In Text Summarization Branches Out. Association for Computational Linguistics, Barcelona, Spain, 74–81. https://aclanthology.org/W04-1013/
[19] Barbara H. Liskov and Jeannette M. Wing. 1994. A Behavioral Notion of Subtyping. ACM Transactions on Programming Languages and Systems 16, 6 (1994), 1811–1841. doi:10.1145/197320.197383
[20] Dugang Liu, Ding Wang, Chao Jiang, Cheng Wen, Zhiwu Xu, Zhong Ming, Yuwei Liu, Xinyi Wan, and Lin Huang. 2026. Beyond Benchmarks: A Case Study of LLM-Generated Verus Specification Failures on Asterinas Vostd. In Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering. Association for Computing Machinery, New York, NY, USA. To appear. https://conf.researchr.org/track/ase-2026/ase-2026-industry-showcase
[21] Jiawei Liu, Chunqiu Steven Xia, Yuyao Wang, and Lingming Zhang. 2023. Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generation. In Advances in Neural Information Processing Systems, Vol. 36. Curran Associates, Inc., Red Hook, NY, USA, 21558–21572. doi:10.52202/075280-0943
[22] Lezhi Ma, Shangqing Liu, Yi Li, Qiong Wu, Han Wang, and Lei Bu. 2026. SpecSyn: LLM-based Synthesis and Refinement of Formal Specifications for Real-world Program Verification. arXiv:2604.21570 doi:10.48550/arXiv.2604.21570
[23] Lezhi Ma, Shangqing Liu, Yi Li, Xiaofei Xie, and Lei Bu. 2025. SpecGen: Automated Generation of Formal Program Specifications via Large Language Models. In 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE). IEEE, Piscataway, NJ, USA, 16–28. doi:10.1109/ICSE55347.2025.00129
[24] Bertrand Meyer. 1992. Applying “Design by Contract”. Computer 25, 10 (1992), 40–51. doi:10.1109/2.161279
[25] Md Rakib Hossain Misu, Cristina V. Lopes, Iris Ma, and James Noble. 2024. Towards AI-Assisted Synthesis of Verified Dafny Methods. Proceedings of the ACM on Software Engineering 1, FSE, Article 37 (2024), 24 pages. doi:10.1145/3643763
[26] Facundo Molina, Pablo Ponzio, Nazareno Aguirre, and Marcelo Frias. 2021. EvoSpex: An Evolutionary Algorithm for Learning Postconditions. In 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE). IEEE, Piscataway, NJ, USA, 1223–1235. doi:10.1109/ICSE43902.2021.00112
[27] Curtis G. Northcutt, Anish Athalye, and Jonas Mueller. 2021. Pervasive Label Errors in Test Sets Destabilize Machine Learning Benchmarks. In Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks, Vol. 1. Curran Associates, Inc., Red Hook, NY, USA, 13 pages. https://datasets-benchmarks-proceedings.neurips.cc/paper/2021/hash/f2217062e9a397a1dca429e7d70bc6ca-Abstract-round1.html
[28] Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. 2002. BLEU: A Method for Automatic Evaluation of Machine Translation. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics. Association for Computational Linguistics, Philadelphia, PA, USA, 311–318. doi:10.3115/1073083.1073135
[29] Matt Post. 2018. A Call for Clarity in Reporting BLEU Scores. In Proceedings of the Third Conference on Machine Translation: Research Papers. Association for Computational Linguistics, Brussels, Belgium, 186–191. doi:10.18653/v1/W18-6319
[30] I. S. W. B. Prasetya, Fitsum Kifetew, and Davide Prandi. 2026. Talk is Cheap, Logic is Hard: Benchmarking LLMs on Post-Condition Formalization. arXiv:2603.17193 [cs.SE] https://arxiv.org/abs/2603.17193
[31] Chuyue Sun, Ying Sheng, Oded Padon, and Clark Barrett. 2024. Clover: Closed-Loop Verifiable Code Generation. In AI Verification - First International Symposium, SAIV 2024, Proceedings. Springer, Cham, Switzerland, 134–155. doi:10.1007/978-3-031-65112-0_7
[32] The Human-Eval-Verus Contributors. 2024. Human-Eval-Verus: Translating the HumanEval Benchmark to Verus. https://github.com/secure-foundations/human-eval-verus. Open-source community effort; accessed 2026-07-31.
[33] Shubham Ugare, Tarun Suresh, Sasa Misailovic, and Julien Vanegue. 2026. Fun2spec: Code Contract Synthesis at Scale. In Proceedings of the 34th ACM International Conference on the Foundations of Software Engineering. ACM, New York, NY, USA, 914–925. doi:10.1145/3803437.3805262
[34] Minghua Wang, Yuxi Ling, Mingzhi Gao, Yuwei Liu, and Lin Huang. 2026. KaPilot: LLM-Assisted Generation of Kani Specifications for Unsafe Rust Verification. arXiv:2607.21957 doi:10.48550/arXiv.2607.21957
[35] Cheng Wen, Jialun Cao, Jie Su, Zhiwu Xu, Shengchao Qin, Mengda He, Haokun Li, Shing-Chi Cheung, and Cong Tian. 2024. Enchanting program specification synthesis by large language models using static analysis and program verification. In International Conference on Computer Aided Verification. Springer, Cham, Switzerland, 302–328. doi:10.1007/978-3-031-65630-9_16
[36] Danning Xie, Byungwoo Yoo, Nan Jiang, Mijung Kim, Lin Tan, Xiangyu Zhang, and Judy S. Lee. 2025. How Effective are Large Language Models in Generating Software Specifications?. In 2025 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER). IEEE, Piscataway, NJ, USA, 1–12. doi:10.1109/SANER64311.2025.00014
[37] Dong Xu, Jialun Cao, Guozhao Mo, Junjie Hu, Cheng Wen, Hongyu Lin, Xianpei Han, Shengchao Qin, Cong Tian, Shing-Chi Cheung, Le Sun, and Yaojie Lu. 2026. LiveFMBench: Unveiling the Power and Limits of Agentic Workflows in Specification Generation. arXiv:2605.01394 doi:10.48550/arXiv.2605.01394
[38] Chenyuan Yang, Xuheng Li, Md Rakib Hossain Misu, Jianan Yao, Weidong Cui, Yeyun Gong, Chris Hawblitzel, Shuvendu K. Lahiri, Jacob R. Lorch, Shuai Lu, Fan Yang, Ziqiao Zhou, and Shan Lu. 2025. AutoVerus: Automated Proof Generation for Rust Code. Proceedings of the ACM on Programming Languages 9, OOPSLA2 (2025), 3454–3482. doi:10.1145/3763174
[39] Chenyuan Yang, Natalie Neamtu, Chris Hawblitzel, Jacob R Lorch, and Shan Lu. 2025. VeruSAGE: A Study of Agent-Based Verification for Rust Systems. arXiv:2512.18436 doi:10.48550/arXiv.2512.18436
[40] Fanpeng Yang, Xing Li, Shuling Wang, Jie An, Zeyu Sun, Shenghua Feng, Wenhan Wang, Weiyi Wang, Naijun Zhan, and Fanjiang Xu. 2026. How Powerful are LLMs in Generating Formal Program Specifications? arXiv:2608.13077 doi:10.48550/arXiv.2608.13077
[41] Jun Yang, Yuechun Sun, Yi Wu, Rodrigo Caridad, Yongwei Yuan, Jianan Yao, Shan Lu, and Kexin Pei. 2026. ExVerus: Verus Proof Repair via Counterexample Reasoning. arXiv:2603.25810 doi:10.48550/arXiv.2603.25810
[42] Yuchen Zhang, Cheng Wen, Jialun Cao, Dugang Liu, Zhiwu Xu, Yuwei Liu, and Shengchao Qin. 2026. VerusSeek: Retrieval-Augmented LLM-Based Proof Synthesis for Rust Programs. In Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering. Association for Computing Machinery, New York, NY, USA. To appear. doi:10.1145/3832783.3834603
[43] Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Eric P. Xing, Hao Zhang, Joseph E. Gonzalez, and Ion Stoica. 2023. Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena. In Advances in Neural Information Processing Systems, Vol. 36. Curran Associates, Inc., Red Hook, NY, USA, 46595–46623. doi:10.52202/075280-2020
[44] Sicheng Zhong, Jiading Zhu, Yifang Tian, and Xujie Si. 2025. RAG-Verus: Repository-Level Program Verification with LLMs using Retrieval Augmented Generation. arXiv:2502.05344 doi:10.48550/arXiv.2502.05344