arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2509.12892cs.CLcs.AI
收藏

Conan-Embedding-v2:从零训练LLM用于文本嵌入

Conan-Embedding-v2: Training an LLM from Scratch for Text Embeddings

Basic Algorithm Center, PCG, Tencent(基础算法中心、PCG、腾讯)

Shiyu Li, Yang Tang, Ruijie Liu, Shi-Zhe Chen, Xi Chen

AI总结:

提出从零训练的1.4B参数模型Conan-embedding-v2,通过添加多语言数据、软掩码机制和动态困难负样本挖掘弥合LLM与嵌入模型的训练差异,在MTEB和中文MTEB上达到SOTA。

摘要:

大型语言模型(LLMs)近期在文本嵌入任务中展现出卓越性能。以往工作通常使用LoRA微调现有LLM,这受限于LLM与嵌入模型之间的数据和训练差异。在本研究中,我们提出Conan-embedding-v2,一个从零训练并微调为文本嵌入器的全新1.4B参数LLM。首先,我们在LLM预训练中加入新闻数据和多语言对以弥合数据差异。基于此,我们提出跨语言检索数据集,使LLM能更好整合不同语言的嵌入。其次,LLM使用因果掩码与token级损失,而嵌入模型使用双向掩码与句子级损失。该训练差异使全量微调效果不如LoRA。我们引入软掩码机制以在两种掩码间平滑过渡,使模型学习更全面的表示。基于此,我们提出动态困难负样本挖掘方法,在训练全程让模型接触更困难的负样本。直观且有效的是,仅凭约1.4B参数,Conan-embedding-v2在Massive Text Embedding Benchmark (MTEB)和Chinese MTEB(2025年5月19日)上均达到SOTA性能。

英文摘要:

Large language models (LLMs) have recently demonstrated excellent performance in text embedding tasks. Previous work usually use LoRA to fine-tune existing LLMs, which are limited by the data and training gap between LLMs and embedding models. In this work, we introduce Conan-embedding-v2, a new 1.4B-parameter LLM trained from scratch and fine-tuned as a text embedder. First, we add news data and multilingual pairs for LLM pretraining to bridge the data gap. Based on this, we propose a cross-lingual retrieval dataset that enables the LLM to better integrate embeddings across different languages. Second, whereas LLMs use a causal mask with token-level loss, embedding models use a bidirectional mask with sentence-level loss. This training gap makes full fine-tuning less effective than LoRA. We introduce a soft-masking mechanism to gradually transition between these two types of masks, enabling the model to learn more comprehensive representations. Based on this, we propose a dynamic hard negative mining method that exposes the model to more difficult negative examples throughout the training process. Being intuitive and effective, with only approximately 1.4B parameters, Conan-embedding-v2 achieves SOTA performance on both the Massive Text Embedding Benchmark (MTEB) and Chinese MTEB (May 19, 2025).

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

↑