arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2510.01003cs.SEcs.CL
收藏

通过仓库记忆提升代码定位

Improving Code Localization with Repository Memory

The Ohio State University(俄亥俄州立大学);Microsoft(微软)

Boshi Wang, Weijian Xu, Yunsheng Li, Mei Gao, Yujia Xie, Huan Sun, Dongdong Chen

AI总结:

通过利用仓库提交历史增强语言代理的记忆,提升代码定位性能,更接近人类开发者经验。

摘要:

代码定位是仓库级软件工程任务中的基本挑战,例如bug修复。尽管现有方法为语言代理配备了全面的工具/接口来从仓库中获取信息,但它们忽略了记忆这一关键方面,通常每个实例都是从头开始处理,假设没有先前的仓库知识。相比之下,人类开发者自然会建立长期的仓库记忆,例如关键模块的功能和各种bug类型与其可能修复位置的关联。在本工作中,我们通过利用仓库的提交历史——一个丰富但未被充分利用的资源,来记录代码库的演变,为语言代理增强这种记忆。我们引入了工具,使代理能够从非参数化记忆中检索最近的历史提交和关联问题,以及通过提交模式识别出的活跃演变代码库部分的功能摘要。我们证明,增强这种记忆可以显著提高LocAgent,一种最先进的定位框架,在SWE-bench验证和更近期的SWE-bench-live基准测试中均取得成效。我们的研究致力于开发能够积累和利用过去经验进行长周期任务的代理,更接近于人类开发者的专业水平。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑