arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2603.22008cs.IRcs.CL
收藏

关于学习稀疏检索在代码中的挑战与机遇

On the Challenges and Opportunities of Learned Sparse Retrieval for Code

NAVER LABS Europe(NAVER欧洲实验室)

Simon Lupart, Maxime Louis, Thibault Formal, Hervé Déjean, Stéphane Clinchant

AI总结:

本文探讨了学习稀疏检索在代码检索中的挑战与机遇,提出SPLADE-Code模型,通过轻量级训练流程实现高性能代码检索,展示了稀疏检索在效率与效果上的优势。

摘要:

在大规模代码库上进行检索是现代基于大语言模型的软件工程系统的关键组成部分。现有方法主要依赖密集嵌入模型,而学习稀疏检索(LSR)在代码中的应用仍较少探索。然而,将稀疏检索应用于代码存在挑战,包括子词碎片化、自然语言查询与代码之间的语义差距、编程语言和子任务的多样性以及代码文档的长度,这些因素可能损害稀疏性和延迟。我们引入SPLADE-Code,首个大规模学习稀疏检索模型家族,专门用于代码检索(600M-8B参数)。尽管采用轻量级单阶段训练流程,SPLADE-Code在1B参数下实现了检索器中的最佳性能(75.4在MTEB Code上),并在更大规模下也取得了竞争性结果(8B时79.0)。我们展示了学习扩展标记在连接词法和语义匹配中的关键作用,并提供延迟分析,表明LSR可以在1M文档集合上实现亚毫秒级检索,且效果损失很小。

英文摘要:

Retrieval over large codebases is a key component of modern LLM-based software engineering systems. Existing approaches predominantly rely on dense embedding models, while learned sparse retrieval (LSR) remains largely unexplored for code. However, applying sparse retrieval to code is challenging due to subword fragmentation, semantic gaps between natural-language queries and code, diversity of programming languages and sub-tasks, and the length of code documents, which can harm sparsity and latency. We introduce SPLADE-Code, the first large-scale family of learned sparse retrieval models specialized for code retrieval (600M-8B parameters). Despite a lightweight one-stage training pipeline, SPLADE-Code achieves state-of-the-art performance among retrievers under 1B parameters (75.4 on MTEB Code) and competitive results at larger scales (79.0 with 8B). We show that learned expansion tokens are critical to bridge lexical and semantic matching, and provide a latency analysis showing that LSR enables sub-millisecond retrieval on a 1M-passage collection with little effectiveness loss.

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

↑