Skip to content

Embedding recipes compared: from E5 to LLM embedders

TL;DR. Since 2022, text embedders have followed one recipe with interchangeable parts:

  1. Choose a backbone and an attention mask (encoder, decoder with the mask removed, or causal decoder).
  2. Pretrain contrastively on hundreds of millions of filtered web pairs, or skip this for a 7B LLM.
  3. Add LLM-written synthetic data.
  4. Mine hard negatives with a teacher, discarding near-positives.
  5. Fine-tune with InfoNCE and query-side instructions, sometimes with distillation.
  6. Merge checkpoints.
  7. 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.

The shared recipe behind modern text embedding models Seven stages, left to right and top to bottom. One: choose a backbone and attention mask; encoders for E5, BGE-M3, Nomic and EmbeddingGemma 2, decoder LLMs with the causal mask removed for NV-Embed, Llama-Embed-Nemotron, LLM2Vec and GritLM, and causal LLMs with last-token pooling for Qwen3 and E5-Mistral. Two: contrastive pretraining on hundreds of millions of consistency-filtered web pairs. Three: LLM-written synthetic tasks, queries and hard negatives. Four: hard negatives mined by a teacher, keeping only candidates scoring below 95 percent of the positive. Five: fine-tuning with InfoNCE and query-side instructions, sometimes with distillation or a language-modeling loss. Six: merging several fine-tuned checkpoints. Seven: making the vector cheap with Matryoshka prefixes, mixture of experts, token compression or quantisation. The output is one vector per text whose index cost is N times d times bytes per dimension. One recipe, many variants: where each page makes its choice 1 Backbone + mask encoder: E5, M3, Nomic, EmbedGemma 2 LLM, mask removed: NV-Embed, Nemotron, LLM2Vec, GritLM causal LLM: Qwen3, E5-Mistral 2 Weak pairs mined web pairs, filtered for consistency: E5 ~270M, Nomic ~235M, M3 1.2B, Nomic v2 1.6B; E5-Mistral skips it 3 Synthetic data an LLM writes the task, query and hard negative: E5-Mistral (GPT-4), Qwen3 ~150M weak, Nemotron 8.4M, Gemini (by Gemini) 4 Hard negatives teacher scores the pool; drop any doc scoring above 95% of the positive (TopK-PercPos): NV-Retriever, NV-Embed, Nemotron 5 Fine-tune InfoNCE, with an instruction on the query side only. E5: reranker KD; M3: self-distil; Jasper: KD from 8B; GritLM: + LM loss 6 Merge average or slerp several fine-tuned checkpoints: Qwen3, Gemini (model soup), Nemotron, EmbedGemma 2 7 Make it cheap MRL prefixes: Nomic v2, Qwen3, Gemini; MoE: Nomic v2; token compression: Jasper; 4-bit QAT: EmbedGemma 2; int8 or binary: Cohere Output one d-dim vector per text. Index cost = N × d × bytes per dim; truncate or quantise to cut it
Original sketch. The shared seven-stage recipe; each box lists which pages in this section make a notable choice at that stage.

First pass (read this, then one note per line)

Section titled “First pass (read this, then one note per line)”
  1. Data: weak pairs, then labelled and synthetic fine-tuning data. Read E5-Mistral.
  2. Attention and pooling: causal last-token versus bidirectional mean or latent pooling. Read NV-Embed.
  3. Negatives: teacher-mined hard negatives with a ceiling relative to the positive. Read NV-Retriever.
  4. Compression: prefixes, quantisation and smaller models. Read Matryoshka.
  5. 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.

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)BuildDataSignalVectorHeadline (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 negativesInfoNCE, two stages8,192 tokens via Dynamic NTK (trained at 2,048) · EnglishMTEB (original English) 62.39; LoCo 85.53Apache 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 prefixes1.6B pretraining pairs; 10 hard negatives per query with the NV-Retriever 95% ruleInfoNCE, two stages768 → 256 with MRL · eval truncated to 512 tokens · multilingualBEIR 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 onlyPublic retrieval and non-retrieval sets; v2 adds 120K Mixtral-written examples; E5-Mistral teacher, 95%-of-positive ruleInfoNCE; stage 2 drops in-batch negatives4,096 · trained at 512 tokens · EnglishMTEB (56 tasks, English) v1 69.32, v2 72.31Weights CC-BY-NC-4.0
Llama-Embed-Nemotron-8B (2025)Llama-3.1-8B · causal mask → bidirectional → mean pooling · Instruct: {task} / Query: template16.1M pairs = 7.7M public + 8.4M synthetic from open-weight LLMs; 95%-of-positive ruleInfoNCE, two stages (retrieval pretraining ~70% of the mix, then multi-task); model merging4,096 · 512-token training · multilingualMMTEB Multilingual v2: Borda #1, mean 69.46Weights 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 paragraphsFour stages: cosine distillation from Qwen3-Embedding-8B + QZhou 7B (concatenated 2,048-d target), with fixed then dynamic compression, then contrastive2,048 · trained up to 1,030 tokens · English, ChineseMTEB 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 tokenThe E5-Mistral training data + S2ORC (“E5S”) + filtered Tülu 2 instructionsInfoNCE + next-token loss in one model; embed batch 2,0484,096 · mainly EnglishMTEB (56 tasks) 66.8 and generative avg 55.5Weights and code released
Model (page)BuildDataSignalVectorHeadline (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 negativesIn-batch InfoNCE (batch 32,768), then KL distillation from a cross-encoder384 / 768 / 1,024 · 128-token pretraining · EnglishBEIR unsupervised 44.2 (large) vs BM25 41.7; MTEB 61.4Weights 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 negativeInfoNCE, under 1k steps, no contrastive pretraining4,096 · eval truncated to 512; passkey retrieval to 32K with a larger RoPE baseMTEB (56 tasks) 66.6; synthetic only 63.1Weights released
NV-Retriever (2024)Mistral 7B, LoRA r16 · bidirectional → meanPublic retrieval sets; positive-aware mining with an E5-Mistral teacherInfoNCE, two stages4,096 · query 192 / passage 512 tokens · EnglishMTEB Retrieval (15 BEIR) 60.9, first on 2024-07-11Weights on Hugging Face (NV-Retriever-v1)
LLM2Vec (2024)Any decoder (1.3B–8B) · bidirectional + MNTP adaptation → meanWikitext-103 (MNTP), Wikipedia sentences (SimCSE); supervised: public E5 replicaUnsupervised SimCSE, or supervised InfoNCEBackbone width (4,096 for 7–8B) · EnglishUnsupervised 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 heads1.2B pairs in 194 languages + GPT-3.5 questions for long documentsInfoNCE + self-knowledge distillation across the three heads1,024 · 8,192 tokens · 100+ languagesMIRACL 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 merging1,024 / 2,560 / 4,096 with MRL · 32K · multilingual + code8B: MMTEB 70.58, MTEB English v2 75.22, Code 80.68Apache 2.0
Gemini Embedding (2025)Initialised from Gemini · bidirectional → mean + linear · task promptsGemini-written synthetic data, Gemini-filtered training sets, Gemini-mined negativesNCE with in-batch negatives (one dataset per batch); pre-finetune → finetune → model soup3,072 with MRL (768, 1,536) · multilingual + codeMMTEB 68.32; MTEB English v2 73.30; Code 74.66API only
EmbeddingGemma 2 (2026)Gemma 4 text 271M + vision 167M + audio 305M encoders (744M) · bidirectional → mean~2.9T tokens across pre-finetuning and finetuningDistilled from Gemini Embedding 2; model merging; 4-bit QAT768 with MRL (512 / 256 / 128) · 8,192 · text, image, audioMTEB Multilingual v2 61.36; English v2 68.46; Code 78.68Open weights
Cohere Embed 5 (2026, blog)Not disclosed; Pro and Fast share one spaceNot disclosedNot disclosed2,048 → 256 (MRL); float, int8 or binary · 128K tokens · 100+ languages; text, image, fusedViDoRe 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 negativesMasked contrastive loss + MRL; no teacher384 → 256 / 128 / 64; int8 vocabulary table · 8,192 · multilingualMMTEB 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.

Index 10M passages with brute-force search. Bytes per vector are dims × bytes per number; FLOPs per query are about 2 × N × d.

VectorExampleBytes / vectorIndex for 10MGFLOPs / query
4,096 × float32NV-Embed, E5-Mistral, Nemotron16,384≈ 164 GB≈ 82
2,048 × float32Jasper8,192≈ 82 GB≈ 41
1,024 × float32BGE-M34,096≈ 41 GB≈ 20
768 × float32Nomic Embed v2, EmbeddingGemma 23,072≈ 31 GB≈ 15
256 × float32 (MRL prefix)Nomic Embed v2, Qwen3, Gemini1,024≈ 10 GB≈ 5.1
256 × int8—256≈ 2.6 GB—
256 × 1 bitCohere binary32≈ 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.

ModelBorda rankVotesMean over tasks
llama-embed-nemotron-8b139,57369.46
gemini-embedding-001239,36868.37
Qwen3-Embedding-8B339,36470.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.

  1. E5: the weak-pairs-then-fine-tune baseline that all later recipes modify.
  2. Matryoshka: why a prefix can be a vector, and adaptive retrieval.
  3. E5-Mistral: an LLM backbone plus synthetic data, and almost no training.
  4. NV-Embed and NV-Retriever: the ablations on mask, pooling and negatives.
  5. LLM2Vec and GritLM: converting or unifying a generative model.
  6. Nomic Embed and Nomic Embed v2: fully open and reproducible.
  7. Qwen3, Gemini, Llama-Embed-Nemotron: the 2025 state of the art.
  8. Jasper, EmbeddingGemma 2, static embeddings, Cohere Embed 5: making it small and cheap.

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

    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.
  2. 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.
  3. 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.
  4. 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.