{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/arxiv-2605-26457","title":"Verus-SpecGym: An Agentic Environment for Evaluating Specification Autoformalization","arxiv_id":"2605.26457","date":"2026-05-26","proceeding":null,"authors":["Anmol Agarwal","Natalie Neamtu","Pranjal Aggarwal","Seungone Kim","Jannis Limperg","Cedric Flamant","Kanna Shimizu","Bryan Parno","Sean Welleck"],"abstract":"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","url_abs":"https://arxiv.org/abs/2605.26457","url_pdf":"https://arxiv.org/pdf/2605.26457","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2605.26457","atlas_url":null,"mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.26457"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/formal-verif-is-cool/verus-spec-gym","reach":null}],"summary":{"ran":11,"unverified":4},"by_repo_kind":{"found_in_text":{"samples":15,"ran":11,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"8720a5baa2bda6e9","entry":"build_task_block","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"verus_spec_gym_specific_scripts/01_add_task_string.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/verus_spec_gym_specific_scripts/01_add_task_string.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8720a5baa2bda6e9"}},{"code_sha256_prefix":"de19ee7afd87e58d","entry":"compare_numeric","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"adapters/dabstep/scorer.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/adapters/dabstep/scorer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"de19ee7afd87e58d"}},{"code_sha256_prefix":"ba5ee1d9b4540911","entry":"compute_skill_digest","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"src/harbor/skills.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/src/harbor/skills.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ba5ee1d9b4540911"}},{"code_sha256_prefix":"5b8eb1533af10264","entry":"extract_numeric","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"adapters/dabstep/scorer.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/adapters/dabstep/scorer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5b8eb1533af10264"}},{"code_sha256_prefix":"a62495edc6f98b22","entry":"is_numeric_with_commas","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"adapters/dabstep/scorer.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/adapters/dabstep/scorer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a62495edc6f98b22"}},{"code_sha256_prefix":"6a1371fda6847d50","entry":"is_valid_zip","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"verus_spec_gym_specific_scripts/00_download_tasks_from_drive.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/verus_spec_gym_specific_scripts/00_download_tasks_from_drive.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6a1371fda6847d50"}},{"code_sha256_prefix":"59952f68078d5908","entry":"load_directory_tasks","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"adapters/reasoning-gym/check_reasoning_gym_registry.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/adapters/reasoning-gym/check_reasoning_gym_registry.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"59952f68078d5908"}},{"code_sha256_prefix":"7a34caea0b6d9960","entry":"load_json_file","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"verus_spec_gym_specific_scripts/02_calculate_results.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/verus_spec_gym_specific_scripts/02_calculate_results.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7a34caea0b6d9960"}},{"code_sha256_prefix":"5222d192fa6fe184","entry":"load_json_from_zip","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"verus_spec_gym_specific_scripts/02_calculate_results.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/verus_spec_gym_specific_scripts/02_calculate_results.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5222d192fa6fe184"}},{"code_sha256_prefix":"35fe44cdfc2044d1","entry":"problem_id_to_task_name","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"verus_spec_gym_specific_scripts/00_download_tasks_from_drive.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/verus_spec_gym_specific_scripts/00_download_tasks_from_drive.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"35fe44cdfc2044d1"}},{"code_sha256_prefix":"aaaec19d21c1ca6e","entry":"replace_or_insert_task_block","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"verus_spec_gym_specific_scripts/01_add_task_string.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/verus_spec_gym_specific_scripts/01_add_task_string.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"aaaec19d21c1ca6e"}},{"code_sha256_prefix":"f9cbe74f88c6ad8f","entry":"compare_tasks","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"adapters/reasoning-gym/check_reasoning_gym_registry.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/adapters/reasoning-gym/check_reasoning_gym_registry.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f9cbe74f88c6ad8f"}},{"code_sha256_prefix":"9c8945aa7526c377","entry":"find_zip","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"verus_spec_gym_specific_scripts/00_download_tasks_from_drive.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/verus_spec_gym_specific_scripts/00_download_tasks_from_drive.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9c8945aa7526c377"}},{"code_sha256_prefix":"ef9a34ebf9f1a20a","entry":"load_registry_tasks","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"adapters/reasoning-gym/check_reasoning_gym_registry.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/adapters/reasoning-gym/check_reasoning_gym_registry.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ef9a34ebf9f1a20a"}},{"code_sha256_prefix":"9be3a5228f1ec1e0","entry":"resolve_skills","repo":"formal-verif-is-cool/verus-spec-gym","repo_kind":"found_in_text","path":"src/harbor/skills.py","file_url":"https://github.com/formal-verif-is-cool/verus-spec-gym/blob/HEAD/src/harbor/skills.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9be3a5228f1ec1e0"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_2026.jsonl"},"syntology_extracted_results":{"kind":"leaderboard_placements","source":"Syntology's leaderboard-shaped extractor over the paper's own arXiv-HTML tables: a model pointed at a cell, the number was read from that cell and checked against the board's metric, dataset, split and scale, and an independent check accepted the entry; not reviewed by the paper's authors or the archive's editors","extractor_model":"global.anthropic.claude-sonnet-4-5-20250929-v1:0","verifier_model":null,"prompt_sha":"fa63d4bb9d755694","coverage":{"sentence":"Syntology has checked 6,885 of the 9,623 papers on this site that are newer than the archive; results from the others appear after they are checked.","papers_newer_than_archive":9623,"papers_checked":6885},"entries":[],"not_placed":{"boards":0,"rejected_by_independent_check":0,"refused_by_a_rule":0,"check_did_not_answer":0,"proposed_without_a_cell":0,"declined_by_site":0}}}