arXiv:2510.01003cs.SEcs.CL2025-10被引 18

用提交历史给代码定位模型加记忆,提升找错位置的准确率

Improving Code Localization with Repository Memory

  • 基于提交历史构建非参数化记忆库,存储近期改动和模块功能摘要
  • 在SWE-bench-verified和SWE-bench-live上显著提升定位准确率
  • 适合做长期代码理解与维护任务的研究者或开发者参考

代码定位是仓库级软件工程任务(如修复漏洞)的核心挑战。现有方法虽赋予语言代理访问仓库信息的工具,却忽略了记忆机制——每次处理都从零开始,忽视了过往知识。而人类开发者会自然积累对关键模块功能及漏洞类型与修复位置关联的记忆。本文通过利用仓库的提交历史(一种丰富但未被充分使用的资源)来增强语言代理的记忆能力,引入工具使代理能检索包含近期历史提交、关联问题以及通过提交模式识别出的活跃代码部分功能摘要的非参数化记忆库。实验表明,该记忆增强可显著提升当前最先进的定位框架LocAgent在SWE-bench-verified和更近期的SWE-bench-live基准上的表现。本研究推动了具备长期经验积累能力的智能体发展,使其更贴近人类开发者的专业水平。

原文摘要 · Abstract (English)

Code localization is a fundamental challenge in repository-level software engineering tasks such as bug fixing. While existing methods equip language agents with comprehensive tools/interfaces to fetch information from the repository, they overlook the critical aspect of memory, where each instance is typically handled from scratch assuming no prior repository knowledge. In contrast, human developers naturally build long-term repository memory, such as the functionality of key modules and associations between various bug types and their likely fix locations. In this work, we augment language agents with such memory by leveraging a repository's commit history -- a rich yet underutilized resource that chronicles the codebase's evolution. We introduce tools that allow the agent to retrieve from a non-parametric memory encompassing recent historical commits and linked issues, as well as functionality summaries of actively evolving parts of the codebase identified via commit patterns. We demonstrate that augmenting such a memory can significantly improve LocAgent, a state-of-the-art localization framework, on both SWE-bench-verified and the more recent SWE-bench-live benchmarks. Our research contributes towards developing agents that can accumulate and leverage past experience for long-horizon tasks, more closely emulating the expertise of human developers.

代码定位记忆机制智能体提交历史

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。