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.


翻译:大规模代码库的检索是基于大型语言模型的现代软件工程系统的关键组成部分。现有方法主要依赖稠密嵌入模型,而学习的稀疏检索在代码领域仍鲜有探索。然而,将稀疏检索应用于代码面临诸多挑战:子词分割、自然语言查询与代码之间的语义鸿沟、编程语言及子任务的多样性,以及代码文档的长度(可能损害稀疏性和延迟)。我们提出了SPLADE-Code,这是首个专门为代码检索设计的大规模学习的稀疏检索模型系列(参数量从6亿到80亿)。尽管采用了轻量级的单阶段训练流程,SPLADE-Code在参数低于10亿的检索器中达到了最先进的性能(在MTEB代码基准上得分为75.4),并在更大规模上取得具有竞争力的结果(8B参数版本得分为79.0)。我们证实,学习的扩展标记对于弥合词汇匹配与语义匹配至关重要,并提供了延迟分析,表明LSR能够在100万条目的语料库上实现亚毫秒级检索,且效果损失极小。

0
下载
关闭预览

相关内容

【博士论文】电商搜索中的排序学习
专知会员服务
13+阅读 · 2025年11月15日
【CMU博士论文】在学习与推理中融入搜索
专知会员服务
17+阅读 · 2025年9月12日
《深度学习代码智能》综述、基准和工具集
专知会员服务
57+阅读 · 2024年1月2日
智能数据库学习型索引研究综述
专知会员服务
23+阅读 · 2023年1月14日
【MIT博士论文】机器学习中的稀疏性:理论与应用,122页pdf
Query 理解和语义召回在知乎搜索中的应用
DataFunTalk
25+阅读 · 2020年1月2日
一种关键字提取新方法
1号机器人网
21+阅读 · 2018年11月15日
稀疏性的3个优势 -《稀疏统计学习及其应用》
遇见数学
15+阅读 · 2018年10月24日
尽早跑通深度学习的实践代码,是入门深度学习的最快途径
算法与数据结构
22+阅读 · 2017年12月13日
TextInfoExp:自然语言处理相关实验(基于sougou数据集)
全球人工智能
12+阅读 · 2017年11月12日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
VIP会员
相关主题
最新内容
非对称防御中的自组织临界性:俄乌战争
专知会员服务
7+阅读 · 8月10日
《战争中的大语言模型监管》
专知会员服务
7+阅读 · 8月10日
《边缘计算关键技术分析及美军作战实践应用》
边缘计算的军事应用
专知会员服务
11+阅读 · 8月9日
一种考虑资源机动性的武器目标分配混合算法
专知会员服务
12+阅读 · 8月8日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员