一句话:WiseSpec 通过自动构建、评估并迭代精化结构化需求,提升 LLM 在仓库级代码生成中的正确率。
论文关注仓库级代码生成任务:由任务需求自动生成源代码。随着大语言模型(LLM)的快速发展,该方向取得了显著进展,但面对复杂软件工程任务时,任务描述常常不完整、有歧义或缺少关键上下文信息,导致生成的代码不正确。已有工作主要通过更精巧的工具、技能和工作流来增强编码智能体,却普遍忽视了任务需求本身的质量。受软件需求工程启发,作者提出 WiseSpec——一个需求驱动的智能体框架。它自动构建结构化、信息丰富的需求,借助基于执行的评估来度量需求质量,并迭代精化需求以更好地引导代码生成。实验表明,WiseSpec 一致优于所有基线,在 %Resolved 指标上平均提升 13.17%。
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.