Software issue localization, the task of identifying the precise code locations (files, classes, or functions) relevant to a natural language issue description (e.g., bug report, feature request), is a critical yet time-consuming aspect of software development. While recent LLM-based agentic approaches demonstrate promise, they often incur significant latency and cost due to complex multi-step reasoning and relying on closed-source LLMs. Alternatively, traditional code ranking models, typically optimized for query-to-code or code-to-code retrieval, struggle with the verbose and failure-descriptive nature of issue localization queries. To bridge this gap, we introduce SweRank, an efficient and effective retrieve-and-rerank framework for software issue localization. To facilitate training, we construct SweLoc, a large-scale dataset curated from public GitHub repositories, featuring real-world issue descriptions paired with corresponding code modifications. Empirical results on SWE-Bench-Lite and LocBench show that SweRank achieves state-of-the-art performance, outperforming both prior ranking models and costly agent-based systems using closed-source LLMs like Claude-3.5. Further, we demonstrate SweLoc's utility in enhancing various existing retriever and reranker models for issue localization, establishing the dataset as a valuable resource for the community.
翻译:软件问题定位是一项识别与自然语言问题描述(如缺陷报告、功能请求)相关精确代码位置(文件、类或函数)的任务,是软件开发中至关重要但耗时的环节。尽管近期基于大语言模型的智能体方法展现出潜力,但这类方法常因复杂的多步推理以及对闭源大语言模型的依赖而带来显著延迟与成本。另一方面,传统代码排序模型——通常针对查询到代码或代码到代码的检索任务进行优化——在处理问题定位查询时,难以应对其冗长且聚焦于失败描述的文本特性。为弥合这一差距,我们提出了SweRank,一个高效且有效的面向软件问题定位的检索-重排序框架。为支持模型训练,我们构建了SweLoc,这是一个从公开GitHub仓库中整理的大规模数据集,其中包含真实世界的问题描述及对应的代码修改。在SWE-Bench-Lite和LocBench上的实证结果表明,SweRank达到了最先进的性能,超越了先前的排序模型以及使用Claude-3.5等闭源大语言模型的昂贵智能体系统。此外,我们展示了SweLoc在增强多种现有面向问题定位的检索器与重排序模型方面的效用,使该数据集成为社区中的宝贵资源。