arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.12644cs.SEcs.AI
收藏

CodeXEmbed:面向多语言和多任务代码检索的通用嵌入模型家族

CodeXEmbed: A Generalist Embedding Model Family for Multiligual and Multi-task Code Retrieval

Salesforce AI Research(Salesforce人工智能研究)

Ye Liu, Rui Meng, Shafiq Joty, Silvio Savarese, Caiming Xiong, Yingbo Zhou, Semih Yavuz

AI总结:

针对代码检索领域未被充分探索的问题,提出大规模通用嵌入模型家族CodeXEmbed,通过统一多语言和任务的训练流程,在CoIR基准上超越前SOTA模型超20%,并显著提升了端到端RAG性能。

摘要:

尽管文本检索在许多NLP任务中取得了成功,但代码检索在很大程度上仍是一个未被充分探索的领域。大多数文本检索系统是为自然语言查询量身定制的,往往忽略了检索代码的特定挑战。这一差距使得现有模型无法有效捕捉不同领域间编程语言和任务的多样性,凸显了对代码检索进行更专注研究的需求。为了解决这一问题,我们引入了CodeXEmbed,一系列参数规模从400M到7B的大规模代码嵌入模型。我们新颖的训练流程统一了多种编程语言,并将各种代码相关任务转化为通用的检索框架,增强了模型的泛化能力和检索性能。我们的7B模型在代码检索中创造了新的最先进(SOTA)水平,在CoIR基准上超越了之前领先的模型Voyage-Code超过20%。除了在代码检索中表现出色外,我们的模型在广泛采用的BeIR文本检索基准上也展现了具有竞争力的性能,提供了跨领域的通用性。实验结果表明,提升检索性能能显著增强代码相关任务的端到端检索增强生成(RAG)性能。

英文摘要:

Despite the success of text retrieval in many NLP tasks, code retrieval remains a largely underexplored area. Most text retrieval systems are tailored for natural language queries, often neglecting the specific challenges of retrieving code. This gap leaves existing models unable to effectively capture the diversity of programming languages and tasks across different domains, highlighting the need for more focused research in code retrieval. To address this, we introduce CodeXEmbed, a family of large-scale code embedding models ranging from 400M to 7B parameters. Our novel training pipeline unifies multiple programming languages and transforms various code-related tasks into a common retrieval framework, enhancing model generalizability and retrieval performance. Our 7B model sets a new state-of-the-art (SOTA) in code retrieval, outperforming the previous leading model, Voyage-Code, by over 20% on CoIR benchmark. In addition to excelling in code retrieval, our models demonstrate competitive performance on the widely adopted BeIR text retrieval benchmark, offering versatility across domains. Experimental results demonstrate that improving retrieval performance significantly enhances end-to-end Retrieval-Augmented Generation (RAG) performance for code-related tasks.

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

↑