E5 Models

E5 is Microsoft's family of open-weight embedding models, known for one distinctive rule: you prepend query: to searches and passage: to documents. This asymmetric design — plus strong multilingual and LLM-backed variants — makes E5 a popular open choice for retrieval and semantic search.

💡 In one line: E5 is Microsoft's open embedding family whose defining trait is the query: / passage: prefixes you must add for good retrieval.

What Are E5 Models?

E5 stands for "EmbEddings from bidirEctional Encoder rEpresentations." The models are open-weight and MIT-licensed, so you can self-host, fine-tune, and use them freely. They're built on BERT / XLM-RoBERTa encoders (with a Mistral-based LLM variant too) and perform strongly on the MTEB and BEIR benchmarks.

The Defining Feature: query: / passage: Prefixes

E5 is trained for asymmetric retrieval, meaning queries and documents get different prefixes:

  • Prepend query: to every search query.
  • Prepend passage: to every document you store.

This isn't optional — skip the prefixes and quality drops noticeably. The same prefixes apply to both English and multilingual models.

The E5 Family

ModelDimsNote
e5-small / base / large-v2384 / 768 / 1024English models
multilingual-e5-small / base / large384 / 768 / 1024100+ languages (XLM-RoBERTa); -large ~560M params
multilingual-e5-large-instruct1024Instruction-tuned multilingual
e5-mistral-7b-instruct4096LLM-backbone (from Mistral-7B) — top quality, but heavy

multilingual-e5-large is competitive with BGE-M3 on many languages; e5-mistral-7b-instruct is a top MTEB performer but costly to run.

Instruct Variants

Newer E5 models (-large-instruct, e5-mistral) go further: they take a task instruction on the query side — for example "Given a question, retrieve passages that answer it." This customises the embedding per task. Note: the instruction goes on the query, not the document.

Retrieval Pipeline

Documents are indexed offline; queries are embedded at search time — each with its prefix. 

Whiteboard
Whiteboard diagram

Code Example


Strengths & Trade-offs

Strengths

  • Open / MIT — self-host, fine-tune, no per-token cost.
  • Strong multilingual (multilingual-e5-large) and top-tier quality (e5-mistral).
  • Instruction control on the newer variants.

Trade-offs

  • You must remember the prefixes — the most common E5 mistake.
  • e5-mistral-7b is a 7B model — heavy, best for batch/offline indexing.
  • Smaller E5 models can trail BGE-M3 or Qwen-Embedding on some retrieval tasks.

When to Use It

  • Open, self-hosted retrieval — especially multilingual (multilingual-e5-large).
  • e5-mistral-7b for maximum quality when you have GPUs and index in batch.
  • And always: add the prefixes.

A Note on Currency

E5 — especially multilingual-e5-large and e5-mistral-7b-instruct — remains a strong open option in 2026, though leaderboard leaders shift over time. Always check the model card for the correct prefixes and instructions.

Summary

  • E5 is Microsoft's open-weight (MIT) embedding family, strong on MTEB/BEIR.
  • Its defining rule: prepend query: and passage: — skipping them hurts quality.
  • Variants span English (e5-*-v2), multilingual-e5 (100+ languages), and e5-mistral-7b (LLM-backbone).
  • Instruct models add a task instruction on the query side.
  • Great for open, self-hosted, multilingual retrieval — just don't forget the prefixes. EOF echo created