Issue localization, which identifies faulty code elements such as files or functions, is critical for effective bug fixing. While recent LLM-based and LLM-agent-based approaches improve accuracy, they struggle in large-scale repositories due to concern tangling, where relevant logic is buried in large functions, and concern scattering, where related logic is dispersed across files. To address these challenges, we propose RepoLens, a novel approach that abstracts and leverages conceptual knowledge from code repositories. RepoLens decomposes fine-grained functionalities and recomposes them into high-level concerns, semantically coherent clusters of functionalities that guide LLMs. It operates in two stages: an offline stage that extracts and enriches conceptual knowledge into a repository-wide knowledge base, and an online stage that retrieves issue-specific terms, clusters and ranks concerns by relevance, and integrates them into localization workflows via minimally intrusive prompt enhancements. We evaluate RepoLens on SWE-Lancer-Loc, a benchmark of 216 tasks derived from SWE-Lancer. RepoLens consistently improves three state-of-the-art tools, namely AgentLess, OpenHands, and mini-SWE-agent, achieving average gains of over 22% in Hit@k and 46% in Recall@k for file- and function-level localization. It generalizes across models (GPT-4o, GPT-4o-mini, GPT-4.1) with Hit@1 and Recall@10 gains up to 504% and 376%, respectively. Ablation studies and manual evaluation confirm the effectiveness and reliability of the constructed concerns.


翻译:问题定位(即识别存在缺陷的代码元素,如文件或函数)对于有效修复软件缺陷至关重要。尽管近期基于大语言模型(LLM)及基于LLM智能体的方法提升了定位精度,但在大规模代码库中仍面临挑战,主要源于"关注点纠缠"(相关逻辑埋藏于庞大函数中)与"关注点分散"(相关逻辑散布于多个文件)。为应对这些挑战,我们提出RepoLens——一种通过抽象化并利用代码库概念知识的新方法。RepoLens将细粒度功能模块解构后,重组成高层次关注点(即语义连贯的功能集群)以指导LLM进行定位。该方法包含两个阶段:离线阶段提取并增强概念知识,构建覆盖全代码库的知识库;在线阶段则检索问题相关术语,对关注点进行聚类与相关性排序,并通过最小侵入式的提示增强技术将其整合至定位流程。我们在SWE-Lancer-Loc基准测试集(包含216项源自SWE-Lancer的任务)上评估RepoLens。实验表明,RepoLens持续提升了三种前沿工具(AgentLess、OpenHands与mini-SWE-agent)的性能,在文件级与函数级定位任务中,平均Hit@k提升超过22%,Recall@k提升达46%。该方法在多种模型(GPT-4o、GPT-4o-mini、GPT-4.1)上均表现优异,Hit@1与Recall@10最高分别提升504%和376%。消融实验与人工评估验证了所构建关注点的有效性与可靠性。

0
下载
关闭预览

相关内容

通过学习、实践或探索所获得的认识、判断或技能。
FlowQA: Grasping Flow in History for Conversational Machine Comprehension
专知会员服务
34+阅读 · 2019年10月18日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
60+阅读 · 2019年10月17日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
STRCF for Visual Object Tracking
统计学习与视觉计算组
15+阅读 · 2018年5月29日
Focal Loss for Dense Object Detection
统计学习与视觉计算组
12+阅读 · 2018年3月15日
IJCAI | Cascade Dynamics Modeling with Attention-based RNN
KingsGarden
13+阅读 · 2017年7月16日
国家自然科学基金
13+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
23+阅读 · 2021年12月19日
Arxiv
19+阅读 · 2021年2月4日
Arxiv
38+阅读 · 2020年12月2日
VIP会员
相关资讯
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
STRCF for Visual Object Tracking
统计学习与视觉计算组
15+阅读 · 2018年5月29日
Focal Loss for Dense Object Detection
统计学习与视觉计算组
12+阅读 · 2018年3月15日
IJCAI | Cascade Dynamics Modeling with Attention-based RNN
KingsGarden
13+阅读 · 2017年7月16日
相关论文
Arxiv
23+阅读 · 2021年12月19日
Arxiv
19+阅读 · 2021年2月4日
Arxiv
38+阅读 · 2020年12月2日
相关基金
国家自然科学基金
13+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员