Paper deep dive
WiseSpec: Requirements-Driven Agents for Code Generation
Zhao Tian
Intelligence
Status: succeeded | Model: Gemma-4-26B-A4B | Prompt: intel-v1 | Confidence: 95%
Last extracted: 9/2/2026, 5:35:13 AM
Summary
The paper introduces WiseSpec, a requirements-driven agent framework for repository-level code generation that addresses the limitations of ambiguous or incomplete task descriptions. WiseSpec constructs structured requirements using a domain-specific language (DSL), assesses their quality via execution-based evaluation, and iteratively refines them to improve code generation accuracy. Experimental results on SWE-bench benchmarks show WiseSpec outperforms state-of-the-art baselines like Agentless, Trae-agent, and Claude Code.
Entities (13)
Relation Signals (11)
Zhao Tian → affiliatedwith → Tianjin University
confidence 100% · Zhao Tian School of Computer Software, Tianjin University
WiseSpec → evaluatedon → SWE-bench Verified
confidence 95% · The evaluation is conducted on three widely used repository-level code generation benchmarks: SWE-bench-Verified
WiseSpec → evaluatedon → SWE-bench Pro
confidence 95% · The evaluation is conducted on three widely used repository-level code generation benchmarks: SWE-bench-Pro
WiseSpec → evaluatedon → SWE-bench Lite
confidence 95% · The evaluation is conducted on three widely used repository-level code generation benchmarks: SWE-bench-Lite
WiseSpec → outperforms → Agentless
confidence 95% · WiseSpec consistently outperforms all baselines, achieving an average improvement of 13.17% in %Resolved.
WiseSpec → outperforms → Trae-agent
confidence 95% · WiseSpec consistently outperforms all baselines, achieving an average improvement of 13.17% in %Resolved.
WiseSpec → outperforms → Claude Code
confidence 95% · WiseSpec consistently outperforms all baselines, achieving an average improvement of 13.17% in %Resolved.
Zhao Tian → advisedby → Junjie Chen
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Code generation aims to automatically generate source code from task requirements and has attracted significant attention with the rapid advancement of large language models (LLMs). Despite remarkable progress, LLMs often struggle to generate correct code for complex software engineering tasks because task descriptions are frequently incomplete, ambiguous, or lack critical contextual information. Existing approaches primarily improve the capabilities of coding agents through more sophisticated tools, skills, and workflows, while largely overlooking the quality of the task requirements themselves. To address this limitation, we draw inspiration from software requirements engineering and propose WiseSpec, a novel requirements-driven agent framework for repository-level code generation. WiseSpec automatically constructs structured and information-rich requirements, assesses their quality through execution-based evaluation, and iteratively refines them to better guide code generation. Experimental results show that WiseSpec consistently outperforms all baselines, achieving an average improvement of 13.17% in %Resolved.
Tags
Links
- Source: https://arxiv.org/abs/2609.00568v1
- Canonical: https://arxiv.org/abs/2609.00568v1
Trouble viewing inline? Open PDF directly →
Full Text
14,941 characters extracted from source content.
Expand or collapse full text
WiseSpec: Requirements-Driven Agents for Code Generation Zhao Tian School of Computer Software, Tianjin University Tianjin, China tianzhao@tju.edu.cn Abstract Code generation aims to automatically generate source code from task requirements and has attracted significant attention with the rapid advancement of large language models (LLMs). Despite re- markable progress, LLMs often struggle to generate correct code for complex software engineering tasks because task descriptions are frequently incomplete, ambiguous, or lack critical contextual information. Existing approaches primarily improve the capabili- ties of coding agents through more sophisticated tools, skills, and workflows, while largely overlooking the quality of the task re- quirements themselves. To address this limitation, we draw inspi- ration from software requirements engineering and propose Wis- eSpec, a novel requirements-driven agent framework for repository- level code generation. WiseSpec automatically constructs structured and information-rich requirements, assesses their quality through execution-based evaluation, and iteratively refines them to better guide code generation. Experimental results show that WiseSpec consistently outperforms all baselines, achieving an average im- provement of 13.17% in %Resolved. CCS Concepts • Software and its engineering→ Automatic programming. Keywords Code Generation, Agent, Requirements Engineering ACM Reference Format: Zhao Tian. 2026. WiseSpec: Requirements-Driven Agents for Code Genera- tion. In Proceedings of the 41st IEEE/ACM International Conference on Auto- mated Software Engineering (ASE ’26), October 12–16, 2026, Munich, Germany. ACM, New York, NY, USA, 3 pages. https://doi.org/10.1145/3832783.3844573 1 Introduction Code generation aims to automatically generate source code from programming requirements, offering substantial potential to im- prove developer productivity and software quality [2,9]. Recent advances in Large Language Model (LLM)-based coding agents have achieved remarkable progress by enhancing the capabilities of LLMs through sophisticated tools, skills, and workflows [4,16]. De- spite these advances, complex software engineering tasks remain challenging. Existing approaches primarily focus on improving how LLMs solve programming tasks, while largely overlooking This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License. ASE ’26, Munich, Germany © 2026 Copyright held by the owner/author(s). ACM ISBN 979-8-4007-2882-2/2026/10 https://doi.org/10.1145/3832783.3844573 Initial Task Description Target Codebase Requirement Generation Requirement Quality Assessment Requirement Refinement Loop Engineering Context Collection Requirement DSL Code & Test Generation Code & Test Execution Requirement Diagnosis Alignment Rules Refined Requirement Correct Code InputWiseSpec AgentOutput Figure 1: The overview of WiseSpec what they are asked to solve, namely the quality of task require- ments themselves [7]. Most methods directly consume the original problem description as input, implicitly assuming that it faithfully specifies the intended program behavior. In practice, however, task descriptions are frequently ambiguous, incomplete, or missing crit- ical contextual information, making them an unreliable representa- tion of the underlying requirements [12,13]. Consequently, even powerful LLMs struggle to accurately infer user intent and pro- duce correct implementations, highlighting the need for explicit requirement understanding and alignment before code generation. To address these challenges, we propose WiseSpec, a novel requirements-driven agent that enhances the code generation per- formance of LLMs. First, WiseSpec collects relevant contextual in- formation to construct structured, information-rich requirements using a predefined domain-specific language (DSL). Second, it re- formulates requirement quality assessment as an execution-based code evaluation problem, enabling the computation of a quantita- tive requirement quality score. Third, WiseSpec iteratively refines and aligns the generated requirements according to refinement and alignment rules, ultimately producing higher-quality require- ments for better code generation. Experiment results demonstrate that WiseSpec significantly outperforms all three state-of-the-art baselines across two LLMs and three benchmarks. 2 Approach Figure 1 illustrates the overview of WiseSpec, consisting of three components: Requirement Generation, Requirement Quality As- sessment, and Requirement Refinement. 2.1 Requirement Generation To accurately retrieve the contextual information required for code generation, WiseSpec simulates the program comprehension pro- cess by iteratively collecting and analyzing relevant code snippets from the target codebase. Starting from the given task descrip- tion, it progressively expands the retrieval scope along program dependencies, using previously collected code snippets to guide subsequent retrieval and exploration. To transform the collected arXiv:2609.00568v1 [cs.SE] 1 Sep 2026 ASE ’26, October 12–16, 2026, Munich, GermanyZhao Tian yet fragmented information into structured programming require- ments, WiseSpec employs a predefined requirement DSL. The re- quirement DSL consists of nine primary requirement attributes and seventeen corresponding sub-attributes, covering both high-level architectural information and fine-grained implementation details. Based on requirement DSL, WiseSpec systematically organizes the retrieved contextual information into a structured and information- rich requirement representation, providing a solid foundation for subsequent code generation. 2.2 Requirement Quality Assessment Assessing the quality of requirement specifications is a fundamental step in requirements engineering, as ambiguous, incomplete, or incorrect requirements can propagate errors to downstream im- plementations [5]. However, because requirements are typically expressed in structured natural language without formal semantics, their quality is difficult to evaluate directly and quantitatively [10]. To address this challenge, WiseSpec reformulates requirement qual- ity assessment as an execution-based code evaluation problem. Specifically, it first generates executable code and tests from the synthesized requirements and evaluates the generated code through test execution. Since code is expected to faithfully implement the in- tended requirements, its execution correctness serves as an effective proxy for requirement quality. WiseSpec adopts a strict acceptance criterion, i.e., the generated code is accepted only if it passes all generated tests. Otherwise, the corresponding requirements are considered potentially deficient and are forwarded to the subse- quent requirement refinement and alignment stage. 2.3 Requirement Refinement This component iteratively improves low-quality requirements to better guide LLMs toward generating correct code. To diagnose re- quirement deficiencies, WiseSpec categorizes them into three mutu- ally exclusive and collectively exhaustive types: Conflict, Omission, and Ambiguity. Based on the identified deficiency type, WiseSpec applies a set of predefined requirement alignment rules to generate actionable refinement feedback. Guided by this refinement feedback, the requirements are iteratively refined and re-assessed. During the refinement process, WiseSpec adopts a greedy optimization strategy that retains the candidate requirement with the highest quality score at each iteration, as it is more likely to provide accurate and complete guidance for code generation. Furthermore, refine- ment feedback that fails to improve requirement quality is recorded as counterexamples, enabling WiseSpec to adjust its refinement strategy in subsequent iterations. Through this loop engineering, WiseSpec progressively improves the requirement quality, leading to more reliable code generation. 3 Experiments and Results I.Process: To comprehensively evaluate WiseSpec, we compare it against three state-of-the-art coding agents: Agentless [14], Trae- agent [4], and Claude Code [1]. The evaluation is conducted on three widely used repository-level code generation benchmarks: SWE-bench-Lite [6], SWE-bench-Verified [11], and SWE-bench- Pro [3]. We randomly sample 100 instances from each benchmark to control the computational cost. We use two advanced LLMs, Table 1: Comparison in %Applied (↑) and %Resolved (↑). Technique SWE-Lite SWE-Verified SWE-Pro %App.%Res.%App.%Res.%App.%Res. DeepSeek Agentless55%24%61%35%62%6% Trae-agent64%28%61%35%43%11% Claude Code72%36%77%46%84%24% WiseSpec 100%39%93%51%100%35% Qwen Agentless47%14%35%22%59%5% Trae-agent55%17%63%24%49%5% Claude Code89%26%80%33%77%20% WiseSpec 100%28%98%37%99%26% DeepSeek-V3.2 [8] and Qwen-Plus-2025-12-01 [15], as the underly- ing models. We evaluate all approaches using two metrics: %Applied, which measures the syntactic correctness of generated code by de- termining whether it can be successfully applied to the codebase, and %Resolved, which measures functional correctness by assessing whether the generated code passes all gold tests. I.Results: Table 1 presents the effectiveness comparison of all approaches. Across all six experimental settings (3 benchmarks ×2 LLMs), WiseSpec consistently achieves the best performance, outperforming all representative coding agents. Specifically, Wis- eSpec improves %Resolved by 2%∼29% and %Applied by 11%∼63% over the baselines across different settings. To further evaluate its generalizability to more capable LLMs, we conduct an additional experiment using the state-of-the-art Claude-Opus-4.8 on SWE- bench-Pro. While Claude Code achieves a %Resolved score of 53%, WiseSpec further increases the score to 56%, demonstrating that it generalizes well to stronger foundation models. Overall, these results show that the proposed requirements-driven paradigm ef- fectively improves repository-level code generation. Furthermore, a Wilcoxon signed-rank test (훼=0.05) yields푝<2.5×10 −4 , con- firming that the improvements of WiseSpec over all baselines are statistically significant for both %Resolved and %Applied. 4 Conclusion In this paper, we identify the quality of task requirements as a funda- mental bottleneck in repository-level code generation and propose a requirements-driven paradigm to address this challenge. Based on this insight, we present WiseSpec, a novel requirements-driven agent that automatically constructs structured and information- rich requirements, assesses their quality through execution-based evaluation, and iteratively refines them to improve code correct- ness. Experiment results demonstrate that WiseSpec consistently outperforms all baselines across multiple evaluation metrics, high- lighting the effectiveness of requirements engineering in improving LLM-based code generation. Acknowledgments Zhao Tian is advised by Professor. Junjie Chen. This work is supported by National Natural Science Foundation of China (Grant No. 62322208). WiseSpec: Requirements-Driven Agents for Code GenerationASE ’26, October 12–16, 2026, Munich, Germany References [1]Anthropic. 2026. Claude Code: AI-powered coding assistant for developers. https://w.anthropic.com/claude-code. Accessed: 2026-07-12. [2]Norman Becker, Tural Mammadov, and Andreas Zeller. 2026. Can LLMs Really Reason about Code? Studying How Well LLMs Understand the Relation between Input, Code, and Output. In Proceedings of the 3rd ACM International Conference on AI-Powered Software. 21–30. [3]Xiang Deng, Jeff Da, Edwin Pan, Yannis Yiming He, Charles Ide, Kanak Garg, Niklas Lauffer, Andrew Park, Nitin Pasari, Chetan Rane, et al.2025. Swe-bench pro: Can ai agents solve long-horizon software engineering tasks? arXiv preprint arXiv:2509.16941 (2025). [4] Pengfei Gao, Zhao Tian, Xiangxin Meng, Xinchen Wang, Ruida Hu, Yuanan Xiao, Yizhou Liu, Zhao Zhang, Junjie Chen, Cuiyun Gao, et al.2025. Trae agent: An llm-based agent for software engineering with test-time scaling. arXiv preprint arXiv:2507.23370 (2025). [5]Hojae Han, Jaejin Kim, Jaeseok Yoo, Youngwon Lee, and Seung-won Hwang. 2024. Archcode: Incorporating software requirements in code generation with large language models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). 13520–13552. [6]Carlos E Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik Narasimhan. 2024. Swe-bench: Can language models resolve real-world github issues?. In International Conference on Learning Representations, Vol. 2024. 54107–54157. [7]Shiqi Kuang, Zhao Tian, Kaiwei Lin, Chaofan Tao, Shaowei Wang, Haoli Bai, Lifeng Shang, and Junjie Chen. 2026. REAgent: Requirement-Driven LLM Agents for Software Issue Resolution. arXiv preprint arXiv:2604.06861 (2026). [8] Aixin Liu, Aoxue Mei, Bangcai Lin, Bing Xue, Bingxuan Wang, Bingzheng Xu, Bochao Wu, Bowei Zhang, Chaofan Lin, Chen Dong, et al.2025. Deepseek- v3. 2: Pushing the frontier of open large language models. arXiv preprint arXiv:2512.02556 (2025). [9]Antonio Mastropaolo, Luca Pascarella, Emanuela Guglielmi, Matteo Ciniselli, Simone Scalabrino, Rocco Oliveto, and Gabriele Bavota. 2023. On the robustness of code generation techniques: An empirical study on github copilot. In 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE). IEEE, 2149–2160. [10] Lloyd Montgomery, Davide Fucci, Abir Bouraffa, Lisa Scholz, and Walid Maalej. 2022. Empirical research on requirements quality: a systematic mapping study. Requirements Engineering 27, 2 (2022), 183–209. [11]OpenAI. 2024. Introducing SWE-bench Verified. https://openai.com/index/ introducing-swe-bench-verified/. Accessed: 2026-07-12. [12]Zhao Tian and Junjie Chen. 2025. Aligning Requirement for Large Language Model’s Code Generation. arXiv preprint arXiv:2509.01313 (2025). [13]Zhao Tian, Junjie Chen, and Xiangyu Zhang. 2025. Fixing Large Language Models’ Specification Misunderstanding for Better Code Generation. In 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE). IEEE Computer Society, 645–645. [14] Chunqiu Steven Xia, Yinlin Deng, Soren Dunn, and Lingming Zhang. 2025. De- mystifying llm-based software engineering agents. Proceedings of the ACM on Software Engineering 2, FSE (2025), 801–824. [15]An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, et al.2025. Qwen3 technical report. arXiv preprint arXiv:2505.09388 (2025). [16]John Yang, Carlos Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. 2024. Swe-agent: Agent-computer interfaces enable automated software engineering. Advances in Neural Information Processing Systems 37 (2024), 50528–50652. Received 2026-07-12; accepted 2026-08-25