M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation

Jianlyu Chen, Shitao Xiao, Peitian Zhang, Kun Luo, Defu Lian, Zheng Liu

Abstract

M3-Embedding is a versatile text embedding framework designed to unify three critical dimensions of information retrieval: Multi-Linguality (supporting 100+ languages), Multi-Functionality (integrating dense, sparse, and multi-vector retrieval), and Multi-Granularity (handling inputs from short sentences to 8,192-token documents). By employing a novel self-knowledge distillation framework, the model allows these diverse retrieval objectives to mutually reinforce one another. M3-Embedding achieves state-of-the-art results across multilingual and long-document benchmarks, demonstrating that a unified, specialized architecture can outperform significantly larger models.

Introduction

In modern Information Retrieval (IR), embedding models serve as the foundational engines for semantic search. However, existing models often face a trilemma of constraints: they are frequently biased toward English, siloed into single retrieval functionalities (e.g., only dense or only lexical), and limited by short context windows (typically 512 tokens).

M3-Embedding addresses these gaps by providing a "Swiss Army Knife" approach to text embeddings. It supports over 100 languages and provides a unified output that can be used for semantic (dense), keyword-based (sparse), and fine-grained interaction (multi-vector) retrieval simultaneously.

Overview of M3-Embedding's three core dimensions: Multi-Linguality, Multi-Functionality, and Multi-Granularity.

Methodology

Self-Knowledge Distillation

The core innovation of M3-Embedding is its self-knowledge distillation framework. Rather than relying on an external teacher model, M3 generates an integrated "teacher" score by ensembling its own internal retrieval heads (dense, sparse, and multi-vector). The model is then trained to minimize the discrepancy between its individual predictions and this integrated ensemble score. This synergy allows the different retrieval methods to learn from each other's strengths—for instance, lexical grounding from sparse retrieval can improve the semantic accuracy of dense embeddings.

Multi-Stage Training Pipeline

The training process is divided into two primary stages:

  1. Unsupervised Pre-training: The model is pre-trained on a massive corpus of 1.2 billion text pairs across 194 languages using RetroMAE, a masked auto-encoding strategy optimized for retrieval.
  2. Multi-task Fine-tuning: The model undergoes fine-tuning on a curated mix of labeled benchmarks (like MS MARCO and MIRACL) and synthetic data generated by GPT-3.5 to address the scarcity of long-document training pairs.
The M3-Embedding training workflow, illustrating the transition from unsupervised pre-training to fine-tuning with integrated self-distillation.

Handling Long Contexts

To support up to 8,192 tokens, the authors implemented two key technical solutions:

  • Split-Batch Strategy: Large batches are partitioned into smaller sub-batches with gradient checkpointing, increasing the effective batch size for long sequences by over 20x. This is critical for the contrastive learning required for high-quality embeddings.
  • Multi-CLS (MCLS): For long-form retrieval, the model can insert multiple [CLS] tokens throughout a document and average their embeddings, significantly boosting performance without requiring additional training parameters.

Key Results

State-of-the-Art Multilingual Retrieval

M3-Embedding achieved new SOTA results on the MIRACL (multilingual) and MKQA (cross-lingual) benchmarks. Notably, despite being based on a standard-sized XLM-RoBERTa encoder, it outperformed much larger models such as E5-Mistral-7B on multilingual tasks. This suggests that architectural specialization and multi-objective training are more effective for retrieval than raw parameter scaling.

Long-Document Performance

On the MultiLongDoc (MLDR) benchmark, M3 showed a consistent performance advantage as document length increased. The hybrid approach—combining dense and sparse retrieval—proved particularly effective at preventing the "lost in the middle" phenomenon common in long-context models.

Conclusion

M3-Embedding represents a significant step toward a universal embedding model. By unifying multi-lingual support, hybrid retrieval functionalities, and long-document processing into a single framework, it simplifies the deployment of complex IR systems while setting new performance standards. Future work will focus on optimizing tokenization for sparse representations across diverse language families and extending support to even longer context windows.

Summary updated

BibTeX
@inproceedings{chen2024m,
  author = {Jianlyu Chen and Shitao Xiao and Peitian Zhang and Kun Luo and Defu Lian and Zheng Liu},
  title = {{M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.137},
}
Figure