Embedding recipes compared: from E5 to LLM embedders
TL;DR. Since 2022, text embedders have followed one recipe with interchangeable parts:
- Choose a backbone and an attention mask (encoder, decoder with the mask removed, or causal decoder).
- Pretrain contrastively on hundreds of millions of filtered web pairs, or skip this for a 7B LLM.
- Add LLM-written synthetic data.
- Mine hard negatives with a teacher, discarding near-positives.
- Fine-tune with InfoNCE and query-side instructions, sometimes with distillation.
- Merge checkpoints.
- Make the vector cheap (Matryoshka, quantisation, MoE, token compression).
Most of the differences between the pages in this section come down to which of these knobs a paper turned and how carefully it ablated them.
Why it matters now. A deep-research agent calls its retriever dozens of times per question, so the embedder’s quality, index size and query latency all compound. The headline scores are hard to compare: they come from different MTEB versions and leaderboard snapshots, and they use different aggregations. This page puts all embedding pages in one place with the evaluation version spelled out. All numbers are paper-reported unless marked otherwise.
First pass (read this, then one note per line)
Section titled “First pass (read this, then one note per line)”- Data: weak pairs, then labelled and synthetic fine-tuning data. Read E5-Mistral.
- Attention and pooling: causal last-token versus bidirectional mean or latent pooling. Read NV-Embed.
- Negatives: teacher-mined hard negatives with a ceiling relative to the positive. Read NV-Retriever.
- Compression: prefixes, quantisation and smaller models. Read Matryoshka.
- Evaluation: which benchmark version and aggregation a headline uses. Read MTEB and MMTEB and the leaderboard example below.
The two recipe tables and the cost table that follow are optional reference: look up a model when you need it rather than reading them row by row.
The six user picks
Section titled “The six user picks”Columns: Build = backbone (size) · attention → pooling · instruction format. Data = training pairs, synthetic data and how negatives are chosen. Signal = loss, distillation, merging. Vector = dims, Matryoshka (MRL) or quantisation, context length, languages. Headline = the paper’s main number with its benchmark version. ”—” means the paper does not state it.
| Model (page) | Build | Data | Signal | Vector | Headline (eval version) | Release |
|---|---|---|---|---|---|---|
| Nomic Embed (2024) | nomic-bert-2048, 137M, MLM-pretrained by the authors (RoPE, SwiGLU) · bidirectional · task prefixes | ~235M consistency-filtered weak pairs; supervised fine-tune with gte-base-mined hard negatives | InfoNCE, two stages | 8,192 tokens via Dynamic NTK (trained at 2,048) · English | MTEB (original English) 62.39; LoCo 85.53 | Apache 2.0; weights, code and training data |
| Nomic Embed v2 (2025) | XLM-R base + RoPE, MoE: 8 experts, top-2, every second layer; 475M total / 305M active · bidirectional · search_query / search_document prefixes | 1.6B pretraining pairs; 10 hard negatives per query with the NV-Retriever 95% rule | InfoNCE, two stages | 768 → 256 with MRL · eval truncated to 512 tokens · multilingual | BEIR 52.86, MIRACL 65.80 (nDCG@10) | Weights, code and data all open |
| NV-Embed (2024) | Mistral 7B, LoRA r16 · causal mask removed → latent-attention pooling · Instruct: … Query: on queries only | Public retrieval and non-retrieval sets; v2 adds 120K Mixtral-written examples; E5-Mistral teacher, 95%-of-positive rule | InfoNCE; stage 2 drops in-batch negatives | 4,096 · trained at 512 tokens · English | MTEB (56 tasks, English) v1 69.32, v2 72.31 | Weights CC-BY-NC-4.0 |
| Llama-Embed-Nemotron-8B (2025) | Llama-3.1-8B · causal mask → bidirectional → mean pooling · Instruct: {task} / Query: template | 16.1M pairs = 7.7M public + 8.4M synthetic from open-weight LLMs; 95%-of-positive rule | InfoNCE, two stages (retrieval pretraining ~70% of the mix, then multi-task); model merging | 4,096 · 512-token training · multilingual | MMTEB Multilingual v2: Borda #1, mean 69.46 | Weights released; paper CC BY-NC-ND |
| Jasper-Token-Compression-600M (2025) | Student from Qwen3-Embedding-0.6B · last-token → mean pooling + linear head · token compression module with a configurable ratio (trained mainly at 0.33; ρ = 0.5 for the reported 74.75 English score, ρ = 0.33 scores 74.70) | 12M English + Chinese paragraphs | Four stages: cosine distillation from Qwen3-Embedding-8B + QZhou 7B (concatenated 2,048-d target), with fixed then dynamic compression, then contrastive | 2,048 · trained up to 1,030 tokens · English, Chinese | MTEB English 74.75, Chinese 73.51 (mean task; v2 per its baselines, see below) | Weights released; paper CC BY-NC-SA |
| GritLM 7B (2024) | Mistral 7B, all parameters · bidirectional + mean for embeddings, causal for generation · <|embed|> format token | The E5-Mistral training data + S2ORC (“E5S”) + filtered Tülu 2 instructions | InfoNCE + next-token loss in one model; embed batch 2,048 | 4,096 · mainly English | MTEB (56 tasks) 66.8 and generative avg 55.5 | Weights and code released |
The other embedding pages
Section titled “The other embedding pages”| Model (page) | Build | Data | Signal | Vector | Headline (eval version) | Release |
|---|---|---|---|---|---|---|
| E5 (2022) | BERT-family encoders 33M / 110M / 330M · bidirectional → mean · query: / passage: | CCPairs: ~1.3B web pairs filtered to ~270M; fine-tune on NLI, MS MARCO, NQ with 7 hard negatives | In-batch InfoNCE (batch 32,768), then KL distillation from a cross-encoder | 384 / 768 / 1,024 · 128-token pretraining · English | BEIR unsupervised 44.2 (large) vs BM25 41.7; MTEB 61.4 | Weights released |
| E5-Mistral (2023) | Mistral 7B, LoRA r16 · causal → last token · Instruct: … Query: | 500k GPT-4 / GPT-3.5 synthetic examples (150k instructions, 93 languages) + 13 public sets; 1 hard negative | InfoNCE, under 1k steps, no contrastive pretraining | 4,096 · eval truncated to 512; passkey retrieval to 32K with a larger RoPE base | MTEB (56 tasks) 66.6; synthetic only 63.1 | Weights released |
| NV-Retriever (2024) | Mistral 7B, LoRA r16 · bidirectional → mean | Public retrieval sets; positive-aware mining with an E5-Mistral teacher | InfoNCE, two stages | 4,096 · query 192 / passage 512 tokens · English | MTEB Retrieval (15 BEIR) 60.9, first on 2024-07-11 | Weights on Hugging Face (NV-Retriever-v1) |
| LLM2Vec (2024) | Any decoder (1.3B–8B) · bidirectional + MNTP adaptation → mean | Wikitext-103 (MNTP), Wikipedia sentences (SimCSE); supervised: public E5 replica | Unsupervised SimCSE, or supervised InfoNCE | Backbone width (4,096 for 7–8B) · English | Unsupervised MTEB 56.80 (Mistral); supervised 65.01 (LLaMA-3-8B) | Code and weights released |
| BGE-M3 (2024) | XLM-R (RetroMAE-adapted), 568M · [CLS] dense + token-weight sparse + multi-vector heads | 1.2B pairs in 194 languages + GPT-3.5 questions for long documents | InfoNCE + self-knowledge distillation across the three heads | 1,024 · 8,192 tokens · 100+ languages | MIRACL dense 69.2; MLDR all heads 65.0 (nDCG@10) | Weights released |
| Qwen3 Embedding (2025) | Qwen3 0.6B / 4B / 8B · causal → last token · instruction on queries | ~150M Qwen3-written weak-supervision pairs; then ~7M labeled plus ~12M filtered synthetic pairs for supervised fine-tuning (synthetic kept if cosine > 0.7) | InfoNCE, weak then supervised stage; slerp merging | 1,024 / 2,560 / 4,096 with MRL · 32K · multilingual + code | 8B: MMTEB 70.58, MTEB English v2 75.22, Code 80.68 | Apache 2.0 |
| Gemini Embedding (2025) | Initialised from Gemini · bidirectional → mean + linear · task prompts | Gemini-written synthetic data, Gemini-filtered training sets, Gemini-mined negatives | NCE with in-batch negatives (one dataset per batch); pre-finetune → finetune → model soup | 3,072 with MRL (768, 1,536) · multilingual + code | MMTEB 68.32; MTEB English v2 73.30; Code 74.66 | API only |
| EmbeddingGemma 2 (2026) | Gemma 4 text 271M + vision 167M + audio 305M encoders (744M) · bidirectional → mean | ~2.9T tokens across pre-finetuning and finetuning | Distilled from Gemini Embedding 2; model merging; 4-bit QAT | 768 with MRL (512 / 256 / 128) · 8,192 · text, image, audio | MTEB Multilingual v2 61.36; English v2 68.46; Code 78.68 | Open weights |
| Cohere Embed 5 (2026, blog) | Not disclosed; Pro and Fast share one space | Not disclosed | Not disclosed | 2,048 → 256 (MRL); float, int8 or binary · 128K tokens · 100+ languages; text, image, fused | ViDoRe V3 85.8 (vendor metric RCP-nDCG@10) | API only |
| Bekko and static embeddings (2026) | mmBERT-small pruned to 4 or 13 of 22 layers (~8M / ~25M active parameters plus a 98M lookup table) | ~1.1B public multilingual pairs; 8,192-token hard negatives | Masked contrastive loss + MRL; no teacher | 384 → 256 / 128 / 64; int8 vocabulary table · 8,192 · multilingual | MMTEB Multilingual v2 retrieval: 56.2 (a8m), 57.5 (a25m) | Weights, stage-1 data and hard negatives released |
Matryoshka Representation Learning is a training technique rather than a model. It adds the same loss on nested prefixes of the vector (for example 8, 16, …, 2,048 dims), so a prefix is a usable embedding on its own. In the tables it shows up as “with MRL” in the Vector column.
Worked example: what a vector costs
Section titled “Worked example: what a vector costs”Index 10M passages with brute-force search. Bytes per vector are dims × bytes per number; FLOPs per query are about 2 × N × d.
| Vector | Example | Bytes / vector | Index for 10M | GFLOPs / query |
|---|---|---|---|---|
| 4,096 × float32 | NV-Embed, E5-Mistral, Nemotron | 16,384 | ≈ 164 GB | ≈ 82 |
| 2,048 × float32 | Jasper | 8,192 | ≈ 82 GB | ≈ 41 |
| 1,024 × float32 | BGE-M3 | 4,096 | ≈ 41 GB | ≈ 20 |
| 768 × float32 | Nomic Embed v2, EmbeddingGemma 2 | 3,072 | ≈ 31 GB | ≈ 15 |
| 256 × float32 (MRL prefix) | Nomic Embed v2, Qwen3, Gemini | 1,024 | ≈ 10 GB | ≈ 5.1 |
| 256 × int8 | — | 256 | ≈ 2.6 GB | — |
| 256 × 1 bit | Cohere binary | 32 | ≈ 0.32 GB | — |
From 4,096-d float32 to a 256-d binary prefix is a 512× cut in memory. MRL’s answer to the quality loss is a two-step search: shortlist with the short prefix, then rescore a few hundred candidates with the full vector. Rescoring 200 candidates at 4,096 dims costs about 1.6 MFLOPs, which is nothing next to the 5.1 GFLOPs shortlist. This is only safe for models trained with MRL; truncating NV-Embed or E5-Mistral vectors is untested. The other route is a smaller model: Bekko’s 384-d vectors take 15 GB in float32 for 10M passages.
Worked example: reading a leaderboard number
Section titled “Worked example: reading a leaderboard number”The Llama-Embed-Nemotron paper reports the MMTEB Multilingual v2 leaderboard (131 tasks, 2025-10-21), which ranks models by Borda count: every task ranks the models and gives them votes accordingly.
| Model | Borda rank | Votes | Mean over tasks |
|---|---|---|---|
| llama-embed-nemotron-8b | 1 | 39,573 | 69.46 |
| gemini-embedding-001 | 2 | 39,368 | 68.37 |
| Qwen3-Embedding-8B | 3 | 39,364 | 70.58 |
The model ranked third has the highest mean. Borda rewards being near the top on many tasks; the mean rewards large wins on some. The top three are within 209 votes (about 0.5%), but a small vote gap alone does not establish a statistical tie: inspect task-level differences and whether the ranking is stable when tasks are resampled before calling it either a win or a tie.
Three more traps show up in the tables above:
- Versions differ. NV-Embed, GritLM and E5-Mistral report the original 56-task English MTEB. Qwen3, Gemini, Jasper and EmbeddingGemma 2 report MTEB English v2 or MMTEB. Nomic Embed v2 and Bekko report retrieval-only scores. These numbers are not on one scale.
- Inferring a version. Jasper’s paper says only “the English portion of the MTEB benchmark”. Its baseline row for Qwen3-Embedding-0.6B (70.70) matches the Qwen3 paper’s MTEB English v2 score, so its 74.75 is most likely on v2. On the same scale, Qwen3-Embedding-8B scores 75.22.
- Numbers drift between tables and papers. Gemini reports 73.30 on MTEB English v2 in Table 1; 73.28 is the no-model-souping ablation in Table 6. Its MMTEB mean is 68.32 in its own paper versus 68.37 in the later comparison tables. These gaps are small but larger than some claimed wins.
For an IR question, look at the retrieval subset, or better, run your own corpus at the dimension and precision you will deploy. See MTEB and MMTEB.
What the recipes agree on
Section titled “What the recipes agree on”Reading path
Section titled “Reading path”- E5: the weak-pairs-then-fine-tune baseline that all later recipes modify.
- Matryoshka: why a prefix can be a vector, and adaptive retrieval.
- E5-Mistral: an LLM backbone plus synthetic data, and almost no training.
- NV-Embed and NV-Retriever: the ablations on mask, pooling and negatives.
- LLM2Vec and GritLM: converting or unifying a generative model.
- Nomic Embed and Nomic Embed v2: fully open and reproducible.
- Qwen3, Gemini, Llama-Embed-Nemotron: the 2025 state of the art.
- Jasper, EmbeddingGemma 2, static embeddings, Cohere Embed 5: making it small and cheap.
Connections
Section titled “Connections”- Benchmarks: MTEB and MMTEB, and BRIGHT for reasoning-heavy queries where these embedders are weak.
- Limits of one vector: embedding limits shows what a single vector of a given size cannot represent; ColBERTv2 keeps one vector per token instead.
- Instructions and reasoning: Promptriever and ReasonIR push the instruction format further.
- After retrieval: the reranker map covers the next stage.
- Agents: deep research is a retrieval problem.
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.
- Derive / compute
You will index 10M passages for a search agent. Compute the float32 index size for 4,096-d vectors (NV-Embed, E5-Mistral, Llama-Embed-Nemotron), 2,048-d (Jasper), 1,024-d (BGE-M3), 768-d (Nomic Embed v2, EmbeddingGemma 2) and a 256-d Matryoshka prefix, then for int8 and binary versions of the 256-d prefix. Then compute brute-force dot-product FLOPs per query at 4,096 and 256 dims, and the cost of shortlisting 200 passages at 256 dims and rescoring them at 4,096.
What a strong answer covers
- Bytes per float32 vector = 4·d: 16,384 / 8,192 / 4,096 / 3,072 / 1,024 bytes. Times 10M: about 164 GB, 82 GB, 41 GB, 31 GB and 10 GB.
- 256-d int8: 256 B × 10M = 2.56 GB. 256-d binary: 32 B × 10M = 0.32 GB, 512× smaller than 4,096-d float32.
- Brute force costs about 2·N·d FLOPs: 2 × 10M × 4,096 ≈ 82 GFLOPs per query versus 2 × 10M × 256 ≈ 5.1 GFLOPs, 16× fewer.
- Two steps: about 5.1 GFLOPs to shortlist plus 2 × 200 × 4,096 ≈ 1.6 MFLOPs to rescore, so rescoring is negligible. This is the adaptive retrieval of the Matryoshka paper. The full vectors still have to be stored somewhere (disk or a second tier); only the shortlist index needs RAM.
- Truncation is only safe for models trained with MRL (Nomic Embed v2, Qwen3, Gemini, EmbeddingGemma 2, Cohere Embed 5). NV-Embed and E5-Mistral were not, so cutting their vectors is untested and should be measured first.
- Critique
Three reported headlines: Llama-Embed-Nemotron-8B is first on the MMTEB leaderboard with a 69.46 mean, Qwen3-Embedding-8B has a 70.58 MMTEB mean, and NV-Embed-v2 scores 72.31 on MTEB. A colleague concludes that NV-Embed-v2 is the best of the three and Nemotron is ranked first by mistake. Explain what each number measures and what comparison you would actually need.
What a strong answer covers
- The MMTEB Multilingual v2 leaderboard (131 tasks) ranks by Borda count: each task votes by rank. Nemotron has 39,573 votes, gemini-embedding-001 39,368 and Qwen3-Embedding-8B 39,364, so the top three are within about 0.5% of votes, while their mean scores order them differently (70.58, 69.46, 68.37).
- Borda rewards being near the top on many tasks; the mean rewards large margins on some tasks. Neither ranking is a mistake. A small vote gap alone does not establish a statistical tie either; inspect task-level differences and how stable the ranking is under task resampling before naming a winner.
- NV-Embed-v2's 72.31 is on the original English MTEB (56 tasks, leaderboard of 2024-10-01). The tasks and languages differ, so it cannot be placed on the MMTEB scale at all.
- Even one model's number varies by source and configuration: Gemini Embedding reports 73.30 on MTEB English v2 in its Table 1, while 73.28 in its Table 6 is an ablation without model souping. Its MMTEB mean is 68.32 in its own paper versus 68.37 in the later Nemotron comparison table.
- Needed: one benchmark version, one snapshot, the same tasks, ideally per-task scores with paired tests. For a retrieval system, the retrieval subset or your own data matters more than the all-task mean.
- Mechanism
NV-Retriever, NV-Embed, Llama-Embed-Nemotron and Nomic Embed v2 all mine hard negatives with a rule that keeps a candidate only if its teacher score is below 95% of the positive's score. Explain what failure the rule prevents, why the failure grows with corpus size and teacher quality, and why NV-Embed also turns off in-batch negatives in its second training stage.
What a strong answer covers
- Naive top-k mining takes the documents most similar to the query, and many of them are unlabeled positives. An LLM judge in NV-Retriever flagged 38.8% of naive negatives on NQ and 47% on StackExchange as relevant; training then pushes relevant documents away from the query.
- A larger corpus contains more relevant passages to be mined, and a stronger teacher ranks them higher, so both raise the false-negative rate of top-k. A ceiling relative to the positive's score drops the candidates the teacher judges about as relevant as the labeled one.
- A relative ceiling adapts to each query's score scale, unlike an absolute threshold. NV-Retriever Table 5 (15 BEIR sets): naive top-k 51.44, absolute threshold 55.81, 95% of positive 60.55.
- In-batch negatives are other queries' positives. For few-class classification or clustering data recast as pairs, a random batch-mate often has the same label, so it is a false negative. NV-Embed Table 4: one stage with in-batch negatives 70.83, two stages 72.31.
- A related trick: GritLM and Gemini Embedding build each batch from one dataset, so in-batch negatives are harder (same domain) and less often trivially easy.
- Design
You want to fine-tune an open embedder as the retriever for an RL-trained deep-research agent on BrowseComp-Plus (about 100k documents), with 4 A100 GPUs, and you may later release the trained model. Choose a starting model from the tables on this page and a fine-tuning data recipe, and say what you would measure.
What a strong answer covers
- Licence and reproducibility: Nomic Embed v2 (open weights, data and code; 305M active parameters) or Qwen3-Embedding-0.6B (Apache 2.0) can be fine-tuned and released. NV-Embed-v2 is CC-BY-NC-4.0, fine for a research paper but not for a commercial release.
- Compute: a 7–8B embedder needs LoRA and small per-GPU batches on 4 A100s, but contrastive training gains from large batches (E5: 32k batch beats 1k; GritLM: 256 → 4,096 adds 1.0 MTEB). A sub-1B model, with gradient caching for large batches, likely gives more per GPU-hour.
- Data: agent-issued queries from rollouts are the in-distribution query set. Use gold evidence documents as positives, mine negatives with a teacher and the 95%-of-positive rule, and fill gaps with LLM-written queries as in E5-Mistral or Qwen3.
- Measure end to end: answer accuracy and searches per question, paired per question, plus recall@k of the evidence documents. Use MTEB only as a check against forgetting.
- A GritLM-style shared model would let the agent and retriever share weights, but RL updates to the policy could then shift the index space. Keep them separate unless you test that drift.