Current repository agents encounter a reasoning disconnect due to fragmented representations, as existing methods rely on isolated API documentation or dependency graphs that lack semantic depth. We consider repository comprehension and generation to be inverse processes within a unified cycle: generation expands intent into implementation, while comprehension compresses implementation back into intent. To address this, we propose RPG-Encoder, a framework that generalizes the Repository Planning Graph (RPG) from a static generative blueprint into a unified, high-fidelity representation. RPG-Encoder closes the reasoning loop through three mechanisms: (1) Encoding raw code into the RPG that combines lifted semantic features with code dependencies; (2) Evolving the topology incrementally to decouple maintenance costs from repository scale, reducing overhead by 95.7%; and (3) Operating as a unified interface for structure-aware navigation. In evaluations, RPG-Encoder establishes state-of-the-art localization performance on SWE-bench Verified with 93.7% Acc@5 and exceeds the best baseline by over 10% in localization accuracy on SWE-bench Live Lite. These results highlight our superior fine-grained precision in complex codebases. Furthermore, it achieves 98.5% reconstruction coverage on RepoCraft, confirming RPG's high-fidelity capacity to mirror the original codebase and closing the loop between intent and implementation.


翻译:当前代码库智能体因表示形式碎片化而面临推理脱节问题,现有方法依赖于孤立的API文档或缺乏语义深度的依赖图。我们认为代码库理解与生成是统一循环中的两个互逆过程:生成将意图扩展为具体实现,而理解则将实现压缩回意图。为此,我们提出RPG-Encoder框架,将Repository Planning Graph(RPG)从静态生成蓝图推广为统一的高保真表示。RPG-Encoder通过三种机制实现推理闭环:(1)将原始代码编码为融合语义特征与代码依赖的RPG;(2)通过增量式拓扑演化,使维护成本与代码库规模解耦,实现95.7%的开销降低;(3)作为统一接口支持结构感知导航。在评估中,RPG-Encoder在SWE-bench Verified上以93.7%的Acc@5指标达到最先进的定位性能,并在SWE-bench Live Lite的定位准确率上超越最佳基线超过10%。这些结果凸显了我们在复杂代码库中卓越的细粒度精度。此外,该方法在RepoCraft上实现98.5%的重建覆盖率,证实了RPG镜像原始代码库的高保真能力,从而完成了意图与实现之间的闭环。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
AI生成代码缺陷综述
专知会员服务
16+阅读 · 2025年12月8日
通过强化学习增强代码生成中的代码大语言模型:综述
专知会员服务
29+阅读 · 2025年1月1日
【CVPR2024】OmniViD: 一个用于通用视频理解的生成框架
专知会员服务
25+阅读 · 2024年3月27日
《深度学习代码智能》综述、基准和工具集
专知会员服务
56+阅读 · 2024年1月2日
专知会员服务
16+阅读 · 2021年1月23日
【Code】GraphSAGE 源码解析
AINLP
31+阅读 · 2020年6月22日
手把手教你用Python实现“坦克大战”,附详细代码!
机器学习算法与Python学习
12+阅读 · 2019年6月8日
搜狗开源机器阅读理解工具箱
专知
19+阅读 · 2019年5月16日
【干货】深入理解自编码器(附代码实现)
TextInfoExp:自然语言处理相关实验(基于sougou数据集)
全球人工智能
12+阅读 · 2017年11月12日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
23+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关VIP内容
AI生成代码缺陷综述
专知会员服务
16+阅读 · 2025年12月8日
通过强化学习增强代码生成中的代码大语言模型:综述
专知会员服务
29+阅读 · 2025年1月1日
【CVPR2024】OmniViD: 一个用于通用视频理解的生成框架
专知会员服务
25+阅读 · 2024年3月27日
《深度学习代码智能》综述、基准和工具集
专知会员服务
56+阅读 · 2024年1月2日
专知会员服务
16+阅读 · 2021年1月23日
相关基金
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
23+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
8+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员