arXiv:2410.14684cs.SEcs.AI2024-10ICLR被引 117

用仓库级代码图提升AI编程效率,解决上下文理解难题

RepoGraph: Enhancing AI Software Engineering with Repository-level Code Graph

  • 构建仓库级代码图,实现全局代码结构导航
  • 在SWE-bench上使多个开源框架性能显著提升
  • 适合需要理解大型代码库的AI软件工程开发者

大型语言模型在代码生成方面表现优异,但在现代AI软件工程任务中仍面临挑战。与传统函数级或文件级编码不同,AI软件工程不仅需要基础编码能力,还需掌握代码仓库的管理与交互。现有方法普遍忽视了仓库级代码理解的重要性,而这一能力对准确把握上下文、制定有效解决方案至关重要。为此,我们提出RepoGraph——一个可插拔模块,用于管理现代AI软件工程解决方案中的仓库级结构。RepoGraph提供所需的引导作用,成为AI软件工程师的仓库级导航工具。我们在SWE-bench上将RepoGraph集成到两类共四种方法中进行评估,结果显示其显著提升了所有系统的性能,创下开源框架新纪录。进一步分析表明,RepoGraph在另一仓库级编码基准CrossCodeEval上也展现出良好的可扩展性与灵活性。代码已公开于https://github.com/ozyyshr/RepoGraph。

原文摘要 · Abstract (English)

Large Language Models (LLMs) excel in code generation yet struggle with modern AI software engineering tasks. Unlike traditional function-level or file-level coding tasks, AI software engineering requires not only basic coding proficiency but also advanced skills in managing and interacting with code repositories. However, existing methods often overlook the need for repository-level code understanding, which is crucial for accurately grasping the broader context and developing effective solutions. On this basis, we present RepoGraph, a plug-in module that manages a repository-level structure for modern AI software engineering solutions. RepoGraph offers the desired guidance and serves as a repository-wide navigation for AI software engineers. We evaluate RepoGraph on the SWE-bench by plugging it into four different methods of two lines of approaches, where RepoGraph substantially boosts the performance of all systems, leading to a new state-of-the-art among open-source frameworks. Our analyses also demonstrate the extensibility and flexibility of RepoGraph by testing on another repo-level coding benchmark, CrossCodeEval. Our code is available at https://github.com/ozyyshr/RepoGraph.

代码生成仓库理解LLM应用

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