Skip to content

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

optionalextendedfrontierpaperrubric 8/122024 · ~25 min

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

Status

TL;DR. BGE-M3 is a multilingual XLM-R encoder (568M parameters, inputs up to 8,192 tokens) that returns three relevance signals from one forward pass: a dense [CLS] vector, learned sparse term weights and ColBERT-style multi-vector embeddings. During training, the weighted sum of the three scores acts as a teacher for each head (“self-knowledge distillation”). On MIRACL it reports 69.2 nDCG@10 dense and 71.5 with all three heads, and on long-document MLDR the sparse head beats dense by about 10 points.

Why it matters now. BGE-M3 is still a default open multilingual baseline, the source of training data for later models such as Nomic Embed v2, and a common first stage in RAG systems. It is the clearest example of one model covering dense, sparse and late-interaction retrieval, and its fine-tuning data includes MIRACL and Mr. TyDi training splits, which matters for anyone reading its MIRACL numbers.

Let HH be the encoder’s last-layer states for an input.

  • Dense: e=norm⁡(H[CLS])e = \operatorname{norm}(H[\text{CLS}]), score sdense=⟨eq,ep⟩s_{\text{dense}} = \langle e_q, e_p \rangle.
  • Sparse: each token gets a weight w=ReLU⁡(Wlex⊤H[i])w = \operatorname{ReLU}(W_{\text{lex}}^\top H[i]) (the maximum weight is kept for a repeated term), and slex=∑t∈q∩pwq(t) wp(t)s_{\text{lex}} = \sum_{t \in q \cap p} w_q(t)\, w_p(t).
  • Multi-vector: E=norm⁡(Wmul⊤H)E = \operatorname{norm}(W_{\text{mul}}^\top H), scored by late interaction, smul=1N∑i=1Nmax⁡jEq[i]⊤Ep[j]s_{\text{mul}} = \frac{1}{N} \sum_{i=1}^{N} \max_j E_q[i]^\top E_p[j].

The three are combined as sinter=w1sdense+w2slex+w3smuls_{\text{inter}} = w_1 s_{\text{dense}} + w_2 s_{\text{lex}} + w_3 s_{\text{mul}} with w=(1,0.3,1)w = (1, 0.3, 1) in training. Each head has its own InfoNCE loss, and the softmax over sinters_{\text{inter}} is the teacher distribution for each head:

L∗′=− p(sinter)log⁡p(s∗),Lfinal=12(L+L′),\mathcal{L}'_{*} = -\,p(s_{\text{inter}}) \log p(s_{*}), \qquad \mathcal{L}_{\text{final}} = \tfrac{1}{2}\big(\mathcal{L} + \mathcal{L}'\big),

where L\mathcal{L} averages the three head losses (weighted λ=(1,0.1,1)\lambda = (1, 0.1, 1)) and the loss on sinters_{\text{inter}}, and L′\mathcal{L}' averages the three distillation losses.

Training. The encoder is XLM-R adapted with RetroMAE to 8,192 tokens, then trained on 1.2B unsupervised pairs in 194 languages (including 2,655 cross-lingual pairings), then fine-tuned on English and Chinese sets, Mr. TyDi and MIRACL training data, and MultiLongDoc (questions generated by GPT-3.5 for long documents). Hard negatives are mined ANCE-style. Batches are grouped by length and split into gradient-checkpointed sub-batches, which allows more than 20× larger batches at length 8,192.

Paper-reported, nDCG@10 unless noted.

SettingMIRACLMLDR
BM2531.9—
mE5-large66.6—
E5-mistral-7b63.4—
BGE-M3 Dense69.252.5
BGE-M3 Sparse53.962.2
BGE-M3 Multi-vector70.557.6
BGE-M3 Dense + Sparse70.464.8
BGE-M3 All71.565.0
  • Cross-lingual MKQA Recall@100: Dense 75.1, All 75.5, Sparse 45.3 (sparse cannot match across scripts).
  • Multi-vector scores rerank the dense top 200; Dense + Sparse reranks the union of each head’s top 1,000.
  • Hybrid cost is not reported. Storing per-token vectors and a sparse index for 100+ languages is expensive; latency and index sizes are absent.
  • MIRACL is in-domain, and long-document questions are LLM-generated.
  • Sparse vocabulary is XLM-R’s subwords, so lexical matching across scripts or with heavy subword splitting is weak.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    BGE-M3 scores one query–passage pair three ways. Dense: s_dense = 0.70. Sparse: the query term weights are solar 0.8, panel 0.6, cost 0.3 and the passage weights are solar 0.5, panel 0.4, price 0.7. Multi-vector: for the three query tokens, the best-matching passage-token similarities are 0.9, 0.8 and 0.5. (a) Compute s_lex, s_mul and the combined score with the paper's training weights w = (1, 0.3, 1). (b) Explain why the sparse head's weight is 0.3 in the combination and why its loss weight λ₂ is only 0.1. (c) Explain why "cost" and "price" contribute nothing to s_lex but can still match in the other two heads.

    What a strong answer covers
    • (a) s_lex sums products over shared terms: solar 0.8 · 0.5 + panel 0.6 · 0.4 = 0.40 + 0.24 = 0.64. s_mul averages max-sims over query tokens: (0.9 + 0.8 + 0.5) / 3 ≈ 0.733.
    • Combined: 1 · 0.70 + 0.3 · 0.64 + 1 · 0.733 ≈ 0.70 + 0.192 + 0.733 = 1.625.
    • (b) Sparse scores are unbounded dot products of ReLU weights and live on a different scale from cosines, so they are down-weighted when summed. The projection W_lex starts from random initialisation, so early sparse scores are noisy; λ₂ = 0.1 stops that noise from dominating the gradient while the head learns.
    • (c) The sparse score only counts exact vocabulary overlap, and "cost" and "price" are different tokens. Dense and multi-vector scores compare contextual vectors, so semantically similar tokens can still align, which is why the heads are complementary and their sum is a useful teacher.
  2. What if…

    Using Tables 5 and 6 and the MLDR results, explain what self-knowledge distillation, RetroMAE adaptation and unsupervised pretraining each contribute, and which head benefits most from distillation. Then explain why sparse retrieval beats dense retrieval on long documents in MLDR.

    What a strong answer covers
    • Self-KD on MIRACL nDCG@10: without it, Dense 68.7, Sparse 36.7, Multi-vector 69.3; with it, 69.2, 53.9 and 70.5. The sparse head gains about 17 points; the others gain 0.5 to 1.2.
    • Training stages (Dense, MIRACL): fine-tuning only 60.5; RetroMAE then fine-tuning 66.1; plus 1.2B-pair unsupervised pretraining 69.2. Each stage adds several points.
    • MLDR nDCG@10: Dense 52.5, Sparse 62.2, Multi-vector 57.6, Dense + Sparse 64.8, all three 65.0. One dense vector must summarise thousands of tokens, while sparse term weights keep exact lexical evidence wherever it appears.
    • Without long training data, dense MLDR drops to 41.2; MCLS (inserting extra CLS tokens and averaging them at inference) recovers part of it, to 45.0.
  3. Critique

    BGE-M3 reports 71.5 nDCG@10 on MIRACL with all three heads, against 66.6 for mE5-large and 31.9 for BM25. As a MIRACL author reviewing this, what would you check about the training data and the hybrid evaluation protocol before calling this a fair comparison, and what does a deployed system actually pay for the "All" number?

    What a strong answer covers
    • Training data: the fine-tuning set includes the MIRACL and Mr. TyDi training splits, so MIRACL is in-domain. Compare against baselines trained on the same splits, or report languages or collections held out from training.
    • Protocol: the multi-vector score reranks the dense top 200, and Dense + Sparse reranks the union of each head's top 1,000, so "All" is a retrieve-then-rerank pipeline, not three independent retrievers. Recall is bounded by the first-stage candidates.
    • Baselines: BM25 at 31.9 depends on tokenisation and analyser choices per language; MIRACL's own BM25 baselines use language-specific analysers. Check the BM25 setup before quoting the gap.
    • Deployment cost: running all three heads needs a dense index, an inverted index for sparse weights, and per-token vectors (one 1,024-d vector per token) for multi-vector scoring, which is far larger than the dense index. Report latency and storage alongside the 2.3-point gain of All over Dense (71.5 vs 69.2).

Done with this page?

Status