arXiv:2506.20923cs.CL2025-06被引 44

用优质数据和先进训练法,打造小而强的文本嵌入模型

KaLM-Embedding-V2: Superior Training Techniques and Data Inspire A Versatile Embedding Model

  • 采用渐进式多阶段训练,结合难样本聚焦与在线硬负例混合
  • 在20类预训练、100类微调数据上训练,性能超越同规模模型
  • 0.5B小模型媲美3-26倍大的模型,适合资源有限场景

基于大语言模型的文本嵌入模型近年主要关注数据规模或合成,对训练技术和数据质量探索不足,限制了性能提升。本文提出由Lychee-KaLM团队开发的KaLM-Embedding-V2系列,通过先进训练技术与高质量数据系统性增强大语言模型的嵌入能力。模型架构为0.5B参数量,采用简单均值池化生成固定长度嵌入,并移除因果注意力掩码以实现完全双向表示学习。训练策略包括:弱监督大规模数据预训练、有监督高质量数据微调,以及基于细粒度软信号的对比蒸馏,集成焦点式重加权与在线硬负例混合,分别强化难样本学习与丰富硬负例。数据方面,预训练覆盖20个类别,微调与对比蒸馏使用100个类别,通过任务特定指令、难负例挖掘与基于示例的多分类标注保障质量。综合各项技术,该系列在Massive Text Embedding Benchmark上达到当前最优表现,优于同等规模模型,媲美3–26倍大的模型,为10亿参数以下的通用紧凑嵌入模型树立新标准。代码、数据与模型已公开于https://kalm-embedding.github.io/。

原文摘要 · Abstract (English)

Recent advancements in Large Language Models (LLMs)-based text embedding models primarily focus on data scaling or synthesis, yet limited exploration of training techniques and data quality, thereby constraining performance. In this work, we propose KaLM-Embedding-V2 from the Lychee-KaLM team, a series of versatile and compact embedding models, systematically incentivizing advanced embedding capability in LLMs by superior training techniques and high-quality data. For model architecture, we implement the models in a 0.5B compact size with simple mean-pooling to produce fixed-length embeddings and remove the causal attention mask to enable fully bidirectional representation learning. For training techniques, we propose a progressive multi-stage training pipeline: pre-training on weakly supervised large-scale datasets, fine-tuning with supervised high-quality datasets, and contrastive distillation with fine-grained soft signals, integrated with focal-style reweighting and online hard-negative mixing to emphasize difficult samples and enrich hard negatives, respectively. For training data, we curate over 20 categories for pre-training and 100 categories for fine-tuning and contrastive distillation to improve both performance and generalization, leveraging task-specific instructions, hard-negative mining, and example-based multi-class labeling to ensure high quality. Combining these techniques, our KaLM-Embedding-V2 series achieves state-of-the-art performance on the Massive Text Embedding Benchmark, outperforming models of comparable size and rivaling models 3--26x larger, setting a new standard for versatile and compact embedding models under 1B parameters. The code, data, and models are available at https://kalm-embedding.github.io/.

文本嵌入小模型训练技巧高质量数据

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