mlsanityData to 7 Oct 2026

Verus-SpecGym: An Agentic Environment for Evaluating Specification Autoformalization

arXiv 2605.26457 ↗First posted 26 May 2026cs.SE cs.AI cs.CLcited by 2

On the map: LLM agents and tool use → Software engineering coding agents

Abstract (arXiv)

AI coding agents are increasingly used to write real-world software, but ensuring that their outputs are correct remains a fundamental challenge. Formal verification offers a promising path: an agent generates code together with a machine-checked proof, guaranteeing that the code satisfies a formal specification. However, there is no guarantee that the formal spec itself matches the user's intent. In this work, we study specification autoformalization: whether LLM agents can translate informal programming problems into faithful formal specifications. We introduce Verus-SpecBench, a benchmark of 581 spec-writing tasks derived from Codeforces problems targeting Verus, a verifier for Rust, and Verus-SpecGym, an agentic environment in which models interact with Verus, bash, & the filesystem to develop these specs. The central challenge is evaluation: expert-written reference specs are expensive to write, & LLM judges can miss subtle mistakes. We address this by (a) extending Verus's exec_spec mechanism so that generated specs can be executed as Rust code, & (b) testing them against official Codeforces tests & adversarial cases extracted from Codeforces "hacks", which are edge cases written by competitors to break incorrect solutions. On Verus-SpecBench, the strongest model, Gemini 3.1 Pro, solves 77.8% of tasks, other frontier models solve 51.1--57.8% & OSS models reach only 21.5--25.5%. Our analysis of failure modes shows that model-generated specs can omit important input assumptions, accept incorrect outputs, & reject valid ones. We also find that LLM-as-a-judge evaluation misses 26% of the failures our evaluator catches. Overall, our results suggest that spec autoformalization is within reach for frontier agents but remains brittle even on problems where they can already generate correct code. The code, data, & logs can be found at https://github.com/formal-verif-is-cool/verus-spec-gym

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 15 of its 35 references that are in the map. First posted on arXiv 26 May 2026.

Builds on

15 of 35 references.

Closest ancestors · 4

Same direction, newest first

  1. 2026GLM-5: from Vibe Coding to Agentic Engineering17 Feb
  2. 2025VeruSAGE: A Study of Agent-Based Verification for Rust Systems20 Dec
  3. 2025Agentic Specification Generator for Move Programs29 Sep
  4. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering6 May

Other references · 11

  1. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
  2. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
  3. 2026Kimi K2.5: Visual Agentic Intelligencecited by 449
  4. 2023Clover: Closed-Loop Verifiable Code Generationcited by 62
  5. 2026Numina-Lean-Agent: An Open and General Agentic Reasoning System for Formal Mathematicscited by 43
  6. 2024AlphaVerus: Bootstrapping Formally Verified Code Generation through Self-Improving Translation and Treefinementcited by 33
  7. 2025VERINA: Benchmarking Verifiable Code Generationcited by 30
  8. 2025Propose, Solve, Verify: Self-Play Through Formal Verificationcited by 11
  9. 2026AlgoVeri: An Aligned Benchmark for Verified Code Generation on Classical Algorithmscited by 11
  10. 2025VerifyThisBench: Generating Code, Specifications, and Proofs All at Oncecited by 9
  11. 2026Spec-Harness: Measuring and Improving Behavioral Adequacy of LLM-Synthesized Formal Specificationscited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 2.

2 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Automating Formal Verification with Agent-Guided Tree Search
  2. 2026Grounding AI Agents in Contracts: An Empirical Evaluation of Spec-Driven Test Generation
  3. 2026Agentic Separation Logic Specification Synthesis
  4. 2026LiveFMBench: Unveiling the Power and Limits of Agentic Workflows in Specification Generation
  5. 2026Beyond Type-checking: Towards Holistic Evaluation of Formal Specification Generation
  6. 2026Inductive Deductive Synthesis: Enabling AI to Generate Formally Verified Systems
  7. 2026SpecFirst: Behavioral Specification Elicitation as a First-Class Step in Agent-Based Program Synthesis from Scratch
  8. 2026Intent Formalization: A Grand Challenge for Reliable Coding in the Age of AI Agents