mlsanityData to 14 Oct 2026

CodeSpecBench: Benchmarking LLMs for Executable Behavioral Specification Generation

arXiv 2604.12268 ↗First posted 14 Apr 2026cs.SE cs.CLcited by 4

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) can generate code from natural language, but the extent to which they capture intended program behavior remains unclear. Executable behavioral specifications, defined via preconditions and postconditions, provide a concrete means to assess such understanding. However, existing work on specification generation is constrained in evaluation methodology, task settings, and specification expressiveness. We introduce CodeSpecBench, a benchmark for executable behavioral specification generation under an execution-based evaluation protocol. CodeSpecBench supports both function-level and repository-level tasks and encodes specifications as executable Python functions. Constructed from diverse real-world codebases, it enables a realistic assessment of both correctness (accepting valid behaviors) and completeness (rejecting invalid behaviors). Evaluating 15 state-of-the-art LLMs on CodeSpecBench, we observe a sharp performance degradation on repository-level tasks, where the best model attains only a 20.2% pass rate. We further find that specification generation is substantially more challenging than code generation, indicating that strong coding performance does not necessarily reflect deep understanding of intended program semantics. Our data and code are available at https://github.com/SparksofAGI/CodeSpecBench.

Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 28 of its 36 references that are in the map. First posted on arXiv 14 Apr 2026.

Builds on

28 of 36 references.

References · 28

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  2. 2021Program Synthesis with Large Language Modelscited by 3,637
  3. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  4. 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 2,004
  5. 2025DeepSeek-V3.2: Pushing the Frontier of Open Large Language Modelscited by 815
  6. 2024A Survey on Large Language Models for Code Generationcited by 658
  7. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
  8. 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 353
  9. 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 183
  10. 2024Large Language Model-Based Agents for Software Engineering: A Surveycited by 178
  11. 2024SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agentscited by 133
  12. 2025LeetCodeDataset: A Temporal Dataset for Robust Evaluation and Efficient Training of Code LLMscited by 70
16 more
  1. 2024Enchanting Program Specification Synthesis by Large Language Models using Static Analysis and Program Verificationcited by 58
  2. 2023Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?cited by 57
  3. 2024DafnyBench: A Benchmark for Formal Software Verificationcited by 57
  4. 2024SpecGen: Automated Generation of Formal Program Specifications via Large Language Modelscited by 53
  5. 2025UTBoost: Rigorous Evaluation of Coding Agents on SWE-Benchcited by 45
  6. 2024EvoCodeBench: An Evolving Code Generation Benchmark with Domain-Specific Evaluationscited by 34
  7. 2025VERINA: Benchmarking Verifiable Code Generationcited by 34
  8. 2025CLEVER: A Curated Benchmark for Formally Verified Code Generationcited by 29
  9. 2025EffiBench-X: A Multi-Language Benchmark for Measuring Efficiency of LLM-Generated Codecited by 27
  10. 2024MHPP: Exploring the Capabilities and Limitations of Language Models Beyond Basic Code Generationcited by 26
  11. 2025Otter: Generating Tests from Issues to Validate SWE Patchescited by 25
  12. 2025A Study of LLMs' Preferences for Libraries and Programming Languagescited by 20
  13. 2024Evaluating LLM-driven User-Intent Formalization for Verification-Aware Languagescited by 16
  14. 2025Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inferencecited by 16
  15. 2024An Empirical Evaluation of Pre-trained Large Language Models for Repairing Declarative Formal Specificationscited by 5
  16. 2025Can LLMs Enable Verification in Mainstream Programming?cited by 3

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 4.

4 papers.