paper-with-me

홈 › Papers

CodeSpecBench: Benchmarking LLMs for Executable Behavioral Specification Generation

2026-04-14 · Zaoyu Chen, Jianbo Dai, Boyu Zhu, Jingdong Wang, Huiming Wang, Xin Xu, Haoyang Yuan, Zhijiang Guo, Xiao-Ming Wu 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.

📄 PDF Abstract BibTeX arXiv:2604.12268

Code (0)

등록된 구현이 없습니다.

Tasks

Code Generation

Similar Papers 제목 키워드 기반

Teaching Code LLMs to Reason with Intermediate Formal Specifications

2026-07-05 · Minh Le-Anh, Cuong Chi Le, Tien N. Nguyen arxiv

Unlike natural-language specifications, executable formal specifications provide machine-checkable constraints for verifying, debugging, and repairing code. However, writing such specifications is labor-intensive, and ex…

Program Repair

Ambiguity Detection and Elimination in Automated Executable Process Modeling

2026-04-13 · Ion Matei, Praveen Kumar Menaka Sekar, Maksym Zhenirovskyy, Hon Yung Wong 외 arxiv

Automated generation of executable Business Process Model and Notation (BPMN) models from natural-language specifications is increasingly enabled by large language models. However, ambiguous or underspecified text can yi…

EEG Benchmarking Needs a Task Specification Layer: NeuroDoc for Rulebook-Guided, Executable Benchmark Construction

2026-06-22 · Chengxuan Qin, Zhige Chen, Shu Peng, Rui Yang 외 arxiv

Electroencephalography (EEG) foundation models increasingly rely on multi-dataset training and evaluation, yet public EEG datasets still lack a shared task specification layer that can turn heterogeneous recordings into …

On the Behavioural Formalization of the Cognitive Middleware AWDRAT

2014-12-07 · Muhammad Taimoor Khan, Dimitrios Serpanos, Howard Shrobe

We present our ongoing work and initial results towards the (behavioral) correctness analysis of the cognitive middleware AWDRAT. Since, the (provable) behavioral correctness of a software system is a fundamental pre-req…

HardSecBench: Benchmarking the Security Awareness of LLMs for Hardware Code Generation

2026-01-20 · Qirui Chen, Jingxian Shuai, Shuangwu Chen, Shenghao Ye 외 arxiv

Large language models (LLMs) are increasingly used for hardware and firmware code generation, but existing studies primarily evaluate functional correctness while largely overlooking security. However, LLM-generated code…

Code Generation