ChatPaper.aiChatPaper

代码图模型(CGM):一种图集成的大型语言模型,用于仓库级软件工程任务

Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering Tasks

May 22, 2025
作者: Hongyuan Tao, Ying Zhang, Zhenhao Tang, Hongen Peng, Xukun Zhu, Bingchang Liu, Yingguang Yang, Ziyin Zhang, Zhaogui Xu, Haipeng Zhang, Linchao Zhu, Rui Wang, Hang Yu, Jianguo Li, Peng Di
cs.AI

摘要

近期,大型语言模型(LLMs)在函数级代码生成方面展现出潜力,然而,在仓库级软件工程任务上仍面临挑战。当前解决方案主要依赖专有的LLM代理,这带来了不可预测性并限制了可访问性,同时引发了数据隐私和模型定制方面的担忧。本文探讨了开源LLMs是否能在无需代理方法的情况下有效处理仓库级任务。我们通过让LLMs理解代码库中函数和文件的语义信息及结构依赖,证明了这一可能性。为此,我们引入了代码图模型(CGMs),它将仓库代码图结构整合到LLM的注意力机制中,并通过专用适配器将节点属性映射到LLM的输入空间。结合无代理图RAG框架,我们的方法在SWE-bench Lite基准测试中,使用开源模型Qwen2.5-72B实现了43.00%的解决率。这一表现在开源权重模型中排名第一,在开源系统方法中位列第二,总体排名第八,较之前最佳开源模型方法提升了12.33%。
English
Recent advances in Large Language Models (LLMs) have shown promise in function-level code generation, yet repository-level software engineering tasks remain challenging. Current solutions predominantly rely on proprietary LLM agents, which introduce unpredictability and limit accessibility, raising concerns about data privacy and model customization. This paper investigates whether open-source LLMs can effectively address repository-level tasks without requiring agent-based approaches. We demonstrate this is possible by enabling LLMs to comprehend functions and files within codebases through their semantic information and structural dependencies. To this end, we introduce Code Graph Models (CGMs), which integrate repository code graph structures into the LLM's attention mechanism and map node attributes to the LLM's input space using a specialized adapter. When combined with an agentless graph RAG framework, our approach achieves a 43.00% resolution rate on the SWE-bench Lite benchmark using the open-source Qwen2.5-72B model. This performance ranks first among open weight models, second among methods with open-source systems, and eighth overall, surpassing the previous best open-source model-based method by 12.33%.

Summary

AI-Generated Summary

PDF192May 28, 2025