arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2503.22424cs.SEcs.AIcs.CL
收藏

基于LLM驱动的迭代代码图搜索的Issue定位

Issue Localization via LLM-Driven Iterative Code Graph Searching

The State Key Laboratory of Blockchain and Data Security, Zhejiang University, Hangzhou, China(区块链与数据安全国家重点实验室,浙江大学,杭州,中国);School of Big Data and Software Engineering, Chongqing University, Chongqing, China(大数据与软件工程学院,重庆大学,重庆,中国)

Zhonghao Jiang, Xiaoxue Ren, Meng Yan, Wei Jiang, Yong Li, Zhongxin Liu

AI总结:

本文提出CoSIL,一种无需训练的LLM驱动函数级issue定位方法,通过两阶段代码图搜索和剪枝机制平衡搜索广度与深度,在SWE-bench基准上Top-1定位准确率达44.6%,并显著提升Agentless的issue解决率。

摘要:

Issue解决旨在根据issue描述生成补丁,以修复真实世界代码库中报告的issue。Issue定位构成了准确issue解决的基础。近期,基于LLM的issue定位方法已展现出最先进的性能。然而,这些方法要么从issue描述中提及的文件进行搜索,要么在整个代码库中搜索,难以平衡搜索空间的广度与深度以高效收敛于目标。此外,它们允许LLM自由探索整个代码库,使得控制搜索方向以防止LLM搜索错误目标极具挑战。本文提出CoSIL,一种由LLM驱动、无需训练或索引的强大函数级issue定位方法。CoSIL采用两阶段代码图搜索策略。它首先利用动态构建的模块调用图在文件级进行广泛探索,随后通过将模块调用图扩展为函数调用图并执行迭代搜索,在函数级进行深入分析。为精确控制搜索方向,CoSIL设计了剪枝器以过滤无关方向与不相关上下文。为避免长上下文中出现错误交互格式,CoSIL引入反思机制,在短上下文中使用额外独立查询以增强格式化能力。实验结果表明,使用Qwen2.5-Coder-32B,CoSIL在SWE-bench Lite和SWE-bench Verified上分别达到43.3%和44.6%的Top-1定位准确率,平均较最先进方法高出96.04%。将CoSIL集成至issue解决方法Agentless中时,issue解决率提升了2.98%--30.5%。

英文摘要:

Issue solving aims to generate patches to fix reported issues in real-world code repositories according to issue descriptions. Issue localization forms the basis for accurate issue solving. Recently, LLM-based issue localization methods have demonstrated state-of-the-art performance. However, these methods either search from files mentioned in issue descriptions or in the whole repository and struggle to balance the breadth and depth of the search space to converge on the target efficiently. Moreover, they allow LLM to explore whole repositories freely, making it challenging to control the search direction to prevent the LLM from searching for incorrect targets. This paper introduces CoSIL, an LLM-driven, powerful function-level issue localization method without training or indexing. CoSIL employs a two-phase code graph search strategy. It first conducts broad exploration at the file level using dynamically constructed module call graphs, and then performs in-depth analysis at the function level by expanding the module call graph into a function call graph and executing iterative searches. To precisely control the search direction, CoSIL designs a pruner to filter unrelated directions and irrelevant contexts. To avoid incorrect interaction formats in long contexts, CoSIL introduces a reflection mechanism that uses additional independent queries in short contexts to enhance formatted abilities. Experiment results demonstrate that CoSIL achieves a Top-1 localization accuracy of 43.3\% and 44.6\% on SWE-bench Lite and SWE-bench Verified, respectively, with Qwen2.5-Coder-32B, average outperforming the state-of-the-art methods by 96.04\%. When CoSIL is integrated into an issue-solving method, Agentless, the issue resolution rate improves by 2.98\%--30.5\%.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑