[论文解读] Alibaba LingmaAgent: Improving Automated Issue Resolution via Comprehensive Repository Exploration
RepoUnderstander 使用一个仓库知识图谱和蒙特卡洛树搜索来使基于LLM的代理能够理解整个软件仓库,相较于现有的RAG和代理基线,自动问题解决得到了改进。
This paper presents Alibaba LingmaAgent, a novel Automated Software Engineering method designed to comprehensively understand and utilize whole software repositories for issue resolution. Deployed in TONGYI Lingma, an IDE-based coding assistant developed by Alibaba Cloud, LingmaAgent addresses the limitations of existing LLM-based agents that primarily focus on local code information. Our approach introduces a top-down method to condense critical repository information into a knowledge graph, reducing complexity, and employs a Monte Carlo tree search based strategy enabling agents to explore and understand entire repositories. We guide agents to summarize, analyze, and plan using repository-level knowledge, allowing them to dynamically acquire information and generate patches for real-world GitHub issues. In extensive experiments, LingmaAgent demonstrated significant improvements, achieving an 18.5\% relative improvement on the SWE-bench Lite benchmark compared to SWE-agent. In production deployment and evaluation at Alibaba Cloud, LingmaAgent automatically resolved 16.9\% of in-house issues faced by development engineers, and solved 43.3\% of problems after manual intervention. Additionally, we have open-sourced a Python prototype of LingmaAgent for reference by other industrial developers https://github.com/RepoUnderstander/RepoUnderstander. In fact, LingmaAgent has been used as a developed reference by many subsequently agents.
研究动机与目标
- 论证理解整个代码库对自动化软件工程任务至关重要。
- 将仓库信息整合成结构化知识图谱,以降低输入复杂度。
- 开发基于蒙特卡洛树搜索的探索策略,以高效导航仓库图。
- 利用摘要与规划来利用仓库级知识进行故障定位和补丁生成。
提出的方法
- 通过自上而下的分层结构化文件、类和函数以及一个函数调用引用图来构建仓库知识图谱。
- 应用带相关性和引用扩展探索的蒙特卡洛树搜索,以识别与问题最相关的仓库区域。
- 使用受情境学习与思维链启发的基于奖励的评估,对叶节点进行打分以评估与问题的相关性。
- 总结仓库经验并通过API工具动态检索本地信息,以在求解过程中收集代码片段。
- 采用受ReAct启发的框架,为仓库查询和补丁生成生成推理路径与行动。
- 通过定位故障、提取相关代码上下文并生成差异(diff),最多重试三次以确保语法正确性。
实验结果
研究问题
- RQ1相比于聚焦本地的方法,仓库级知识图谱是否能够提升自动化问题解决的效率和效果?
- RQ2基于MCTS的探索策略是否能增强代理发现并利用相关仓库信息以进行补丁生成的能力?
- RQ3对故障定位和补丁质量,来自仓库的摘要与动态信息检索有何影响?
- RQ4整合仓库级知识对补丁可应用性和成功率有何影响?
主要发现
- RepoUnderstander 在 SWE-bench Lite(64 个问题)上的解决率为 21.33%,补丁应用率为 85.67%。
- 相比基于RAG的基线,RepoUnderstander 的性能提升近5倍。
- 相对于基于代理的基线,RepoUnderstander 在解决率指标上使SWE-agent的性能提高18.5个百分点。
- AutoCodeRover 和 SWE-agent 在补丁可应用性方面仍然表现出色,显示了反馈运行的价值;RepoUnderstander 与这些方法互补。
- 研究指出SWE-bench存在信息不对称,并提出一个FIX版本以实现更可靠的评估。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。