arXiv:2505.07849cs.SEcs.AI2025-05被引 26

用高效排序框架提升代码缺陷定位准确率

SweRank: Software Issue Localization with Code Ranking

  • 提出SweRank框架,通过检索-重排序机制精准定位问题代码
  • 在SWE-Bench-Lite和LocBench上超越现有模型与闭源大模型表现
  • 构建SweLoc数据集,助力其他模型训练与评估

软件缺陷定位旨在识别自然语言问题描述(如缺陷报告、功能请求)对应的精确代码位置(文件、类或函数),是软件开发中关键但耗时的环节。尽管近期基于大模型的智能体方法展现潜力,但其常因复杂的多步推理和依赖闭源大模型而带来高延迟与高成本。传统代码排序模型虽效率较高,却难以应对缺陷描述中冗长且具失败特征的查询。为此,我们提出SweRank——一种高效且有效的检索-重排序框架用于软件缺陷定位。为支持训练,我们从公开GitHub仓库构建了大规模数据集SweLoc,包含真实问题描述与对应代码修改。在SWE-Bench-Lite和LocBench上的实证结果表明,SweRank达到当前最佳性能,优于以往排序模型及使用Claude-3.5等闭源大模型的昂贵代理系统。此外,我们验证了SweLoc在提升各类现有检索器与重排序器方面的有效性,确立其作为社区宝贵资源的价值。

原文摘要 · Abstract (English)

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.

缺陷定位代码排序大模型应用数据集

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