arXiv:2508.02611cs.SEcs.AI2025-08被引 5

用代码摘要压缩大型代码库,提升漏洞定位效率。

Meta-RAG on Large Codebases Using Code Summarization

  • 用代码摘要将代码库压缩79.8%,生成结构化自然语言表示
  • 在SWE-bench Lite上实现84.67%文件级和53.0%函数级定位准确率
  • 适合需要高效维护大型代码库的开发者与AI辅助工具研究者

大语言模型(LLM)系统在多个领域推动了人工智能的应用研究,软件开发是其中之一。现有工作已通过LLM代理自动化多项编码任务。然而,软件开发不仅限于代码实现,更涉及复杂的维护环节。本文提出一种多智能体系统,利用信息检索与大模型技术定位大型存量代码库中的缺陷。该系统引入新型检索增强生成方法——Meta-RAG,通过代码摘要将代码库平均压缩79.8%,生成紧凑、结构化的自然语言表示,并由一个LLM智能体判断修复漏洞所需的关键代码部分。在SWE-bench Lite数据集上的评估表明,Meta-RAG在文件级和函数级正确定位率分别达到84.67%和53.0%,达到当前最优性能。

原文摘要 · Abstract (English)

Large Language Model (LLM) systems have been at the forefront of applied Artificial Intelligence (AI) research in a multitude of domains. One such domain is software development, where researchers have pushed the automation of a number of code tasks through LLM agents. Software development is a complex ecosystem, that stretches far beyond code implementation and well into the realm of code maintenance. In this paper, we propose a multi-agent system to localize bugs in large pre-existing codebases using information retrieval and LLMs. Our system introduces a novel Retrieval Augmented Generation (RAG) approach, Meta-RAG, where we utilize summaries to condense codebases by an average of 79.8\%, into a compact, structured, natural language representation. We then use an LLM agent to determine which parts of the codebase are critical for bug resolution, i.e. bug localization. We demonstrate the usefulness of Meta-RAG through evaluation with the SWE-bench Lite dataset. Meta-RAG scores 84.67 % and 53.0 % for file-level and function-level correct localization rates, respectively, achieving state-of-the-art performance.

代码生成RAG智能运维

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