intfloat's Multilingual-E5 Beats BM25 Across 11 Languages With One Encoder
A closer look at intfloat's multilingual-e5-base, an XLM-RoBERTa based text embedding model covering 94 languages with a two-stage training recipe.
ProTakeaways
- multilingual-e5-base is a 278M parameter, 12-layer text embedding model producing 768-dim vectors, MIT licensed
- Built on XLM-RoBERTa base, supporting 100 languages with degraded quality on low-resource ones
- Trained in two stages: contrastive pretraining on billions of weak pairs, then supervised fine-tuning
- Requires
query:andpassage:prefixes on inputs or accuracy drops significantly - Scores 65.9 average MRR@10 on Mr. TyDi across 11 languages, well above BM25 and mDPR baselines
- Details in the Multilingual E5 technical report on arXiv
Text embedding models are the quiet workhorses behind semantic search, retrieval augmented generation, clustering, and reranking. Among the most widely used open-weights options for multilingual work is multilingual-e5-base from intfloat, a 278M parameter sentence encoder built on XLM-RoBERTa and documented in the Multilingual E5 technical report.
The model card covers the architecture, training recipe, prefix conventions, and benchmark numbers. Here is what actually matters if you are wiring it into a retrieval pipeline.
The two-stage recipe under the hood
The encoder has 12 layers and a hidden size of 768, producing dense vectors suitable for cosine similarity search. It is initialized from xlm-roberta-base and continually trained on a mixture of multilingual datasets, inheriting support for the 100 languages XLM-RoBERTa covers, though low-resource languages may see quality degrade.
Training happens in two phases: contrastive pre-training with weak supervision, followed by supervised fine-tuning. The weak supervision stage draws on billions of naturally paired texts scraped from the open web:
- 1B (title, page content) pairs from filtered mC4
- 2.4B translation pairs from NLLB
- 800M (comment, response) pairs from filtered Reddit
- 400M CC News (title, content) pairs
- 150M Wikipedia (section title, passage) pairs
- Smaller slices from S2ORC, StackExchange, and xP3
The second stage layers on labeled retrieval data including MS MARCO, Natural Questions, TriviaQA, SQuAD, Quora, DuReader Retrieval, and the multilingual Mr. TyDi and MIRACL sets.
The prefix rule you cannot skip
The single most common mistake with E5 models is dropping the input prefixes. They are baked into how the model was trained, and skipping them tanks retrieval quality. Use query: and passage: for asymmetric tasks such as open-domain QA and ad-hoc information retrieval. For symmetric tasks like semantic similarity or clustering, prefix everything with query:.
Usage with sentence-transformers looks like this:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('intfloat/multilingual-e5-base')
inputs = [
'query: how much protein should a female eat',
'passage: The CDC recommends 46 grams per day for women ages 19 to 70.'
]
embeddings = model.encode(inputs, normalize_embeddings=True)One quirk worth flagging: the FAQ notes that cosine similarities cluster around 0.7 to 1.0 because training used a low temperature of 0.01 for its InfoNCE contrastive loss. Absolute scores are not calibrated, only relative ranking is meaningful, so do not hardcode similarity thresholds without measuring them on your own data.
What the benchmarks actually show
On Mr. TyDi, a multilingual dense retrieval benchmark spanning 11 languages, the base model reports an average MRR@10 of 65.9, sitting between the small (64.4) and large (70.5) variants. That comfortably beats BM25 (33.3) and the earlier mDPR baseline (16.7), and the gap holds across low-resource languages like Swahili and Telugu where lexical methods often stumble.
The card also lists over 1,800 evaluation results across MTEB tasks covering classification, clustering, reranking, retrieval, and STS. That breadth is the practical selling point: one encoder that behaves reasonably across many downstream jobs without task-specific fine-tuning.
Where it fits, where it doesn't
Good matches for this model:
- Multilingual semantic search and RAG retrieval where queries and documents may be in different languages
- Bitext mining and cross-lingual clustering
- Feature extraction for linear probes or lightweight classifiers
- Deployments where you want a single index across languages instead of one per locale
The main limitations are structural. Long texts get truncated to at most 512 tokens, so large documents need to be chunked upstream. Low-resource languages inherit whatever coverage XLM-RoBERTa had, so quality drops off outside the well-represented set. Because the model is bi-encoder only, a reranker is often worth adding on top for precision-sensitive workloads.
Shipping it
The weights ship in sentence-transformers, PyTorch, ONNX, Safetensors, and OpenVINO formats under an MIT license, which makes deployment on CPU inference stacks straightforward. At 278M parameters producing 768-dimensional vectors, the tradeoff sits in a comfortable spot for most vector databases: small enough to run on modest hardware, large enough to hold up against monolingual English encoders on cross-lingual tasks.
If you need every last point of accuracy and can afford a 24-layer model with 1024 dimensions, the large variant is a drop-in swap with the same prefix conventions and training pipeline. For latency-sensitive systems, the small variant trades a few MRR points for a much lighter footprint. Full training details are in the technical report.