Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

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

M3-Embedding trains one model for many languages, retrieval modes, and long inputs

  • Problem Most text embedding models are built for English and trained for one retrieval mode, so search systems must combine several models. Long documents are also rarely supported because training them is expensive.
  • Method M3-Embedding is one encoder that produces dense, sparse and multi-vector relevance scores. It distills the weighted sum of those scores into each retrieval mode's loss, and it uses batching changes that allow large batches on long inputs.
  • Results On the MIRACL dev set, combining all three scores reaches 71.5 average nDCG@10, compared with 69.2 for dense retrieval alone.

Three gaps in current embedding models

Most text embedding models are tuned for English, which leaves other languages with few usable options. Each of these models is also usually trained for a single retrieval functionality, while practical search systems combine several retrieval methods in one workflow. Long-document retrieval adds a third gap, because the training cost is high and most embedding models accept only short inputs.

M3-Embedding is built to close all three gaps in one model, covering more than 100 working languages, the dense, sparse and multi-vector retrieval functions, and inputs of up to 8,192 tokens. Training such a model is hard because the retrieval functions can pull the encoder in different directions, and long inputs make each training step expensive.

Three relevance scores from one encoder

The query and the passage are each encoded into hidden states, and the dense representation is the normalized hidden state at the [CLS] position. The dense relevance score is the inner product of the two normalized vectors, written as \(s_{dense} = \langle e_p, e_q \rangle\) with \(e_q = \text{norm}(H_q[0])\). Because the [CLS] vector is the only input to this score, it captures the whole-sequence representation rather than token-level detail.

The lexical score reuses the token hidden states. A linear map \(W_{lex} \in \mathbb{R}^{d \times 1}\) followed by a ReLU gives each token a non-negative weight \(w_{qt} = \text{Relu}(W_{lex}^T H_q[i])\). When a term appears more than once, only its largest weight is kept, and the lexical score sums the products of query and passage weights over the terms they share.

The multi-vector branch keeps every token: a learnable projection \(W_{mul}\) followed by normalization gives \(E_q\) and \(E_p\), and the score averages, over the query tokens, the maximum similarity to any passage token.

Combining the scores at retrieval time

The three functions can run as a pipeline: dense and lexical retrieval each produce candidates, and the multi-vector score is skipped in this first step because of its cost. The final list is then re-ranked by the weighted sum \(s_{rank} = w_1 \cdot s_{dense} + w_2 \cdot s_{lex} + w_3 \cdot s_{mul}\), where the weights depend on the downstream scenario.

The weights are set per experiment, not once for the method.

On MLDR the same combinations use different weights, with 0.2 and 0.8 for dense and lexical in Dense+Sparse, and 0.15, 0.5 and 0.35 in All.

Self-knowledge distillation objective

Each retrieval function is trained with an InfoNCE loss, \(L_s = -\log \frac{\exp(s(q,p^*)/\tau)}{\sum_{p \in \{p^*, P'\}} \exp(s(q,p)/\tau)}\), where \(s\) can be the dense, lexical or multi-vector score. Here \(p^*\) is the positive passage and \(P'\) the set of negatives for query \(q\), so minimizing the loss raises the score of the positive relative to the negatives.

The authors observe that the objectives of the three functions can conflict, so they train the functions as one unit instead of as separate losses.

The teacher signal is the weighted sum \(s_{inter} = w_1 \cdot s_{dense} + w_2 \cdot s_{lex} + w_3 \cdot s_{mul}\), which the authors motivate through ensemble learning. Each retrieval function's distillation term is \(L'_* = -p(s_{inter}) \cdot \log p(s_*)\), where \(p(\cdot)\) is the softmax, so each score is pushed toward the softmax distribution of the integrated score.

The distillation losses are averaged with weights \(\lambda_1\), \(\lambda_2\) and \(\lambda_3\) and divided by 3, and the final loss is \((L + L') / 2\), where \(L\) is the weighted sum of the three InfoNCE losses and the integrated loss divided by 4.

The weights \(w_1 = 1\), \(w_2 = 0.3\), \(w_3 = 1\), \(\lambda_1 = 1\), \(\lambda_2 = 0.1\) and \(\lambda_3 = 1\) were set because the random initialization of \(W_{lex}\) gave poor lexical scores and a high lexical loss at the start of training. The distillation objective therefore depends on these values, which were chosen to offset that early imbalance rather than tuned as a general rule.

Three training stages and their data

The second stage fine-tunes the model to learn all three functions together, using the self-knowledge distillation objective on labeled and synthetic data with hard negatives for each query. Each query is paired with 7 sampled negatives, and about 6000 warm-up steps first train the dense, sparse and multi-vector heads before unified training starts.

The unsupervised data totals 1.2B text pairs, built by extracting title-body, title-abstract and similar structures from multilingual corpora, and it includes parallel sentences from NLLB and CCMatrix for cross-lingual matching. The labeled fine-tuning data covers 8 English datasets, 7 Chinese datasets, and the Mr. TyDi and MIRACL training sets for the other languages.

The synthetic MultiLongDoc data is made by sampling lengthy articles, choosing paragraphs from them, and asking GPT-3.5 to write one question per paragraph, so that each question and its article form a new text pair.

Batching for large in-batch negatives

Training data is grouped by sequence length, and each mini-batch is drawn from one group, which reduces padding when sequences in a batch are of similar length. The random seed is fixed across GPUs during sampling, which keeps the load balanced and reduces waiting time at each step.

For long sequences, each mini-batch is cut into sub-batches that are encoded one at a time with gradient checkpointing, and all the resulting embeddings are gathered before the loss is computed. Gradient checkpointing discards the intermediate activations of each sub-batch in the forward pass, so memory does not accumulate across sub-batches.

Embeddings are then broadcast across GPUs, so each device can use all embeddings as in-batch negatives.

Without split-batch the maximum per-device batch size is 262, 25 and 6 at lengths 1024, 4096 and 8192, and with split-batch it is 855, 258 and 130. At length 8192 the batch size grows by more than 20 times, which is the largest relative gain of the three lengths.

MCLS for long inputs without long-document training

MCLS inserts an extra [CLS] token every 256 tokens of a long input, so that each [CLS] summarizes its neighborhood. The final embedding is the average of the last hidden states of all the [CLS] tokens, and no training is needed.

On the MLDR test set at maximum length 8192, the Dense-w.o.long variant rises from 41.2 to 45.0 average nDCG@10 when MCLS is applied. The authors present MCLS as a fallback for cases without long-document data or GPU budget, and the comparison covers only this one model variant.

Multi-lingual retrieval on MIRACL

Retrieval is evaluated on 18 MIRACL languages with nDCG@10, using Faiss for the dense index and Lucene for the sparse index, each taking the top-1000 candidates. BM25 is run with the XLM-RoBERTa tokenizer, so its vocabulary matches M3-Embedding.

On the average, the Dense setting reaches 69.2, above mE5large at 66.6 and E5mistral-7b at 63.4, while BM25 reaches 31.9. Sparse reaches 53.9 on the average, well above BM25 but below Dense. Multi-vec reaches 70.5, Dense+Sparse 70.4, and All 71.5, so each added score lifts the average beyond Dense alone.

The authors compare against E5mistral-7b, which uses a Mistral-7B text encoder trained with English data, and report that Dense is similar on English and higher on the other languages. The OpenAI-3 average is 54.9 and it has no per-language values in this table, so it is not compared language by language.

Cross-lingual retrieval on MKQA

MKQA has queries in 25 non-English languages, and the answers are looked up in the English Wikipedia corpus, using Recall@100 as the primary metric. The same weights as in MIRACL are used for Dense+Sparse and All, and the corpus is the one processed by BEIR.

Sparse reaches 45.3 on average, which is above BM25 but far below the dense-based settings.

The authors note that the gap is smaller than on MIRACL, because E5mistral-7b matches or exceeds some languages. Baselines fall off in low-resource languages such as ar, km and he, while M3-Embedding stays stable, which the authors attribute to pre-training on broad unsupervised data. The authors explain the weak sparse result by the small number of terms that query and passage share when they are in different languages.

Long-document retrieval on MLDR and NarrativeQA

BM25 at length 8192 averages 53.6, which is above the M3 Dense average of 52.5 in this table.

The average is 52.5 for Dense, 62.2 for Sparse, 57.6 for Multi-vec, 64.8 for Dense+Sparse and 65.0 for All. Sparse is about 10 points above Dense, and Multi-vec is 5.1 points above Dense, as the authors report.

The best baseline in that table is text-embedding-3-large at 51.6, and E5mistral-7b reaches 49.9. The authors also report that the advantage grows with sequence length, a result drawn from their length analysis.

What removing each component changes

Without self-knowledge distillation, each retrieval function is trained independently. On MIRACL the Sparse score falls from 53.9 to 36.7, while Dense moves from 69.2 to 68.7 and Multi-vec from 70.5 to 69.3. The drop is largest for sparse retrieval, and the authors read it as evidence of incompatibility between the dense and sparse objectives that the distillation largely removes.

For the Dense score, direct fine-tuning from XLM-RoBERTa reaches 60.5 on MIRACL, RetroMAE with fine-tuning reaches 66.1, and RetroMAE with unsupervised pre-training and fine-tuning reaches 69.2. The authors read this sequence as showing that the RetroMAE step and the unsupervised pre-training each raise retrieval quality.

Limitations

The authors state that generalization to other datasets and real-world scenarios still needs investigation, since different datasets can have different characteristics.

The paper does not discuss performance across the more than 100 claimed languages in depth, and the authors call for a broader language analysis. The authors also note that uneven training data across languages may lead to performance differences that could be seen as unfair. The MLDR comparisons mix baselines run at maximum length 512 with those run at 8192, so the length settings differ across rows.

Paper info

Authors
Jianlv Chen, Shitao Xiao, Peitian Zhang, Kun Luo, Defu Lian, Zheng Liu
Venue
arXiv · Preprint
First published
2024-2-5
Added
2026-11-12
Updated
2025-12-12
Version
v5
arXiv
2402.03216
Category
cs.CL · cs.AI · cs.LG
Original paper terms
CC BY 4.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Jianlv Chen, Shitao Xiao, Peitian Zhang, Kun Luo, Defu Lian, Zheng Liu (2024). M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation. arXiv:2402.03216v5. https://arxiv.org/abs/2402.03216v5

BibTeX
@misc{chen2024embedding,
  title = {{M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation}},
  author = {Jianlv Chen and Shitao Xiao and Peitian Zhang and Kun Luo and Defu Lian and Zheng Liu},
  year = {2024},
  eprint = {2402.03216},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.03216v5}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up