arXiv:2610.26464cs.SEOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.26464

VerusEval: Evaluating LLM-Generated Verus Specifications Beyond Verifier Acceptance

Ding Wang, Chao Jiang, Dugang Liu, Zhiwu Xu, Cheng Wen, Zhong Ming, Yuwei Liu, Xinyi Wan, Lin Huang

DING WANG, Shenzhen University, China

CHAO JIANG, Shenzhen University, China

DUGANG LIU ⊗^{\otimes}, 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.

References (25)