Skip to content

Llama-Embed-Nemotron-8B: A Universal Text Embedding Model for Multilingual and Cross-Lingual Tasks

optionalcorefrontierpaperrubric 10/122025 · ~35 min

Yauhen Babakhin, Radek Osmulski, Ronay Ak, Gabriel Moreira, Mengyao Xu, Benedikt Schifferer, Bo Liu, Even Oldridge

Status

TL;DR. Llama-Embed-Nemotron-8B is Llama-3.1-8B with the causal mask removed, mean pooling and query-side task instructions. It is trained in two stages on 16.1M pairs (8.4M synthetic, generated by six open-weights LLMs) using an InfoNCE loss whose only negatives are mined hard negatives. Six such runs are averaged into one model. On a dated snapshot of the MMTEB leaderboard (Oct 21, 2025) it ranks first by Borda count over 131 tasks, while Qwen3-Embedding-8B has the higher mean. The weights are released.

Why it matters now. For Nandan’s work, this is the clearest recent recipe for an open, multilingual, instruction-aware embedder at the 8B scale, and its ablations isolate three choices the field argues about: which negatives to put in the loss, which LLM should write synthetic data, and whether weight averaging is worth it. It is also a good case study in reading leaderboard claims: the headline depends on the Borda aggregation, the date of the snapshot and how training data overlaps the benchmark.

From decoder to encoder. The model starts from Llama-3.1-8B, replaces the causal attention mask with full bidirectional attention, and is fully fine-tuned. The embedding is the mean of the last-layer token states (4096 dims), scored by cosine. Queries carry an instruction, Instruct: ‹task› followed by Query: ‹text›; documents get no prefix. Classification and clustering are cast as retrieval: the positive is the label name, and the negatives are wrong labels. For STS both sides get the same instruction.

Hard-negative-only InfoNCE. For a query qq with positive d+d^+ and mined hard negatives d1−,…,dK−d^-_1, \dots, d^-_K:

L=−log⁡exp⁡(s(q,d+)/τ)exp⁡(s(q,d+)/τ)+∑k=1Kexp⁡(s(q,dk−)/τ),τ=0.02.\mathcal{L} = -\log \frac{\exp(s(q, d^+)/\tau)}{\exp(s(q, d^+)/\tau) + \sum_{k=1}^{K} \exp(s(q, d^-_k)/\tau)}, \qquad \tau = 0.02 .

There are no in-batch negatives and no same-tower (query–query) negatives. K=1K = 1 in pretraining and K=4K = 4 in fine-tuning. Negatives are mined with e5-mistral-7b-instruct and Qwen3-Embedding-8B and kept only if their similarity is below 95% of the positive’s, a rule that removes likely unlabelled positives. At τ=0.02\tau = 0.02 a random in-batch document with cosine 0.2 against a positive at 0.8 contributes e−30e^{-30} to the denominator, which helps explain why the loss variants in the ablation end up close.

Two stages and a merge.

  1. Retrieval pretraining (about 70% of pairs): 11.8M question–document pairs from the Nemotron-CC-v2 Diverse-QA web data, 5.0M with existing questions and 6.8M with LLM-generated ones, one hard negative each. Batch 2,048, 5,773 steps, learning rate 1e-5.
  2. Multi-task fine-tuning (about 30%): 4.3M pairs, 2.7M from public datasets (starting from the NV-Embed mix with most MTEB data removed) and 1.6M synthetic (classification, retrieval, STS, bitext). Batch 128, 33,668 steps, learning rate 2e-6.
  3. Merging: six runs with different data mixes and hyperparameters are averaged with equal weights, θ=16∑i=16θi\theta = \tfrac{1}{6}\sum_{i=1}^{6} \theta_i.

Synthetic data comes from gpt-oss-20b and 120b, Mixtral-8x22B, Llama-3.3-70B, Llama-4-Scout and Llama-4-Maverick, mixed in equal shares and sometimes crossed (one model writes task descriptions, another writes examples). Training ran on 64 A100 80GB GPUs: 25.0 h for pretraining and 21.5 h for fine-tuning.

Llama-Embed-Nemotron-8B: from a causal LLM to a bidirectional embedder, two training stages, and a six-way weight average Top: a causal attention mask with only the lower triangle filled is replaced by a fully filled bidirectional mask, and the last-layer states are mean-pooled into one 4096-dimensional vector. Queries carry an instruction, documents do not, and the contrastive loss contrasts the positive only with mined hard negatives. Bottom: stage 1 trains on 11.8 million web question-document pairs with one hard negative; stage 2 fine-tunes on 4.3 million pairs with four hard negatives; six training runs with different data mixes and hyperparameters produce six checkpoints, which are averaged with equal weights. 1 · Turn Llama-3.1-8B into an encoder causal mask bidirectional mean-pool last layer → one 4096-d vector, cosine score query input: "Instruct: ‹task› / Query: ‹text›" documents: no prefix loss denominator: d⁺ and mined hard negatives only 2 · Two stages, six training runs, one weight average Stage 1 · retrieval 11.8M web QA pairs (6.8M synthetic queries) 1 mined hard negative batch 2,048, 5,773 steps ≈ 70% of all pairs Stage 2 · fine-tune 4.3M pairs, 4 hard negs retrieval, classification, STS, bitext mining (1.6M synthetic) ×6 runs, varied mixes Uniform weight average θ = (θ₁ + … + θ₆) / 6 +119 Borda votes and +0.84 mean over the best single run same inference cost
Original sketch. Stage boxes use the paper's Appendix A and B numbers; the paper trains multiple models with the two-stage recipe but does not say whether the stage-1 run is shared across the six.

MTEB(Multilingual, v2), 131 tasks, leaderboard snapshot of Oct 21, 2025, as reported in the paper (Tables 1 and 3).

ModelBorda rankBorda votesMean (Task)Mean (Type)Retrieval
llama-embed-nemotron-8b139,57369.4661.0968.69
gemini-embedding-001239,36868.3759.5967.71
Qwen3-Embedding-8B339,36470.5861.6970.88
Qwen3-Embedding-4B439,09969.4560.86—
  • Merging (Table 7, 8B): the six runs score 39,167 to 39,454 votes and 67.27 to 68.62 mean; the average reaches 39,573 and 69.46. Run 5 is the best retriever among them (67.33); the average reaches 68.69.
  • Loss variants (Table 4, 1B): Ours 38,225 votes / 64.03 mean; Gemini-style 38,135 / 63.83; Gecko-style 37,903 / 63.45; Qwen3-style 36,835 / 62.14.
  • Synthetic vs. in-domain (Table 6, 1B): on Amazon counterfactual, no synthetic 73.06, +1M synthetic 82.64, +in-domain 90.51.
  • Versions and protocols. The ranking is a snapshot. Borda tallies shift whenever models are added, and the paper compares leaderboard entries rather than re-running baselines under one protocol.
  • Zero-shot is partial. Most MTEB data was removed, but the fine-tuning mix still includes MIRACL, Mr. TyDi, MLDR and several BEIR training sets; the paper does not give a per-task overlap table.
  • Ablations are small. Loss and synthetic-data studies use a 1B model and, for synthetic data, 100k English classification samples.
  • Cost of serving 8B. 4096-d vectors and an 8B encoder are expensive for large corpora; the paper does not report latency, Matryoshka truncation or quantisation.
  • Short inputs. Queries and documents are capped at 512 tokens in training, so long-document retrieval is not addressed.

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

    The MMTEB leaderboard ranks by Borda count: each task is a voter that ranks all models, and a model collects more votes the more models it beats on that task. (a) Two models are evaluated on four tasks. A scores 71, 71, 71, 40; B scores 70, 70, 70, 75. Compute each model's mean and Borda tally (one vote per model beaten per task) and say which leaderboard each would top. (b) In the paper, Nemotron has 39,573 votes and Qwen3-Embedding-8B has 39,364 over 131 tasks, while Qwen3-8B's mean is higher (70.58 vs 69.46). Convert the vote gap into an average per-task difference and explain what pattern of per-task results produces this split.

    What a strong answer covers
    • (a) Means: A = 253/4 = 63.25, B = 285/4 = 71.25, so B tops a mean-based ranking. Borda: A beats B on three tasks (3 votes), B beats A on one (1 vote), so A tops the Borda ranking.
    • Borda ignores margins: A's 35-point loss on task 4 counts the same as a 1-point loss. The mean is dominated by that one large gap.
    • (b) 39,573 − 39,364 = 209 votes; 209 / 131 ≈ 1.6, so Nemotron beats about 1.6 more models per task on average, under the one-vote-per-model-beaten reading.
    • The split implies Nemotron is slightly ahead on many tasks while Qwen3-8B wins some tasks by large margins; the paper's Table 3 shows Qwen3-8B ahead on Retrieval (70.88 vs 68.69), for example.
    • Caveat: votes depend on which other models are on the board, so the tally changes as models are added; the paper's numbers are a snapshot dated Oct 21, 2025.
  2. Mechanism

    Nemotron's InfoNCE denominator holds only the positive and the mined hard negatives (1 in pretraining, 4 in fine-tuning), with τ = 0.02. Take cosine s(q, d⁺) = 0.80 and four hard negatives at 0.75, 0.72, 0.70 and 0.60. (a) Compute the loss and the share of the negative gradient carried by the 0.75 negative. (b) Estimate what 127 random in-batch negatives at cosine 0.2 would add to the denominator. (c) Using these numbers, explain why Table 4 finds that adding in-batch or same-tower negatives changes little, and why the 95% margin rule matters more when only hard negatives are used.

    What a strong answer covers
    • (a) Terms exp((s − 0.80)/0.02): e^(−2.5) ≈ 0.082, e^(−4) ≈ 0.018, e^(−5) ≈ 0.0067, e^(−10) ≈ 0.00005. Sum Z ≈ 0.107; loss = log(1 + Z) ≈ 0.10.
    • The negative at 0.75 carries 0.082 / 0.107 ≈ 77% of the push-away gradient. At τ = 0.02 the softmax concentrates almost all gradient on the hardest negative.
    • (b) 127 · e^((0.2 − 0.8)/0.02) = 127 · e^(−30) ≈ 1e−11: negligible. Easy in-batch negatives contribute almost no gradient at this temperature, consistent with all four loss variants landing within about 2 points of mean.
    • (c) With only hard negatives, a single false negative dominates. If a mined "negative" scores 0.82 (an unlabelled positive), its term is e^1 ≈ 2.7 and the loss jumps to about 1.3, pushing away a relevant document. The rule (keep negatives below 0.95 · 0.80 = 0.76) removes exactly those.
    • Side benefit: dropping in-batch negatives means the batch size does not set the number of negatives, which simplifies multi-task batches where in-batch items come from other tasks.
  3. What if…

    Using Tables 5, 6 and 7, summarise what the paper learns about (i) which LLM generates synthetic classification data, (ii) synthetic data vs. a small amount of in-domain data, and (iii) merging six checkpoints. For each, state the strongest number and one reason the result may not transfer to the 8B model or to retrieval.

    What a strong answer covers
    • (i) No single generator wins: gpt-oss-20b (37,732 votes) beats the larger gpt-oss-120b (37,594); an equal mix of all six LLMs is best (37,812 vs 37,348 for no synthetic data, +0.94 mean). The authors attribute this to more diverse task lists from step 1.
    • (ii) About 1M synthetic samples help on all five held-out classification sets, but about 75k in-domain samples help far more (e.g. Greek legal 38.21 → 42.60 synthetic vs 60.51 in-domain); 1.5k TweetTopic training samples beat 1M synthetic.
    • (iii) Uniform averaging of six runs: +119 votes and +0.84 mean over the best run (39,573 vs 39,454; 69.46 vs 68.62). Individual runs specialise (run 5 on retrieval at 67.33) and the average wins on almost every type except clustering.
    • Transfer caveats: (i) and (ii) use a 1B Llama-3.2 model, 100k English samples and classification tasks only; (iii) is at 8B but the six runs differ in data mix, so it mixes data-ensembling with weight averaging.
  4. Critique

    The paper claims first place on MMTEB and frames it as zero-shot generalisation. Write a reviewer's note on three things a reader should check before citing "the best open multilingual embedder": the ranking protocol, the training data, and the evidence chain from ablations to the final model.

    What a strong answer covers
    • Protocol: rank 1 is by Borda count on a dated snapshot (Oct 21, 2025); the lead over Gemini Embedding is 205 votes and over Qwen3-8B 209, while Qwen3-8B has the higher Mean(Task) and Retrieval. "Best" depends on the aggregation and the date.
    • Data: the authors removed most MTEB training data, but the fine-tuning mix (Appendix B) still lists MIRACL (79,648), Mr. TyDi, MLDR, MS MARCO, HotpotQA, FEVER, NFCorpus and SciFact; the paper relies on the leaderboard's zero-shot percentage and does not give a per-task overlap table.
    • Hard negatives were mined with e5-mistral and Qwen3-Embedding-8B, a competitor on the same board, so part of the teacher signal comes from a model being compared against.
    • Evidence chain: ablations are at 1B; the two best loss variants differ by 90 votes (under one per task) and 0.2 mean points; the merging gain is measured on the leaderboard itself, so checkpoint and mix selection may overfit MMTEB.
    • A fair check: a held-out multilingual retrieval set with no train split, e.g. a new TREC or CLEF collection, plus per-language comparisons against Qwen3-8B and BGE-M3.
  5. Design

    You want a Nemotron-style multilingual embedder for a lab with 8 A100 80GB GPUs. The paper used 64 A100s for 25.0 h of pretraining and 21.5 h of fine-tuning (batch 2,048 then 128, one epoch each), and averaged six runs. Estimate the GPU-hour budget, then propose a reduced recipe and the experiments that would tell you which ingredient to cut first.

    What a strong answer covers
    • One run ≈ 64 · 46.5 ≈ 2,976 A100-hours, which matches the step counts: 5,773 · 2,048 ≈ 11.8M pretraining pairs and 33,668 · 128 ≈ 4.3M fine-tuning pairs. On 8 GPUs that is about 15.5 days per run.
    • Six runs could cost up to about 18k GPU-hours if each repeats both stages; the paper does not say whether stage 1 is shared.
    • Reduced recipe: start from a 1B to 3B backbone (the paper's own ablation scale), share one stage-1 run, fine-tune 3 to 6 variants with different mixes or seeds, then average. Memory for an 8B model in full fine-tuning needs ZeRO or FSDP sharding, or LoRA.
    • Experiments: (a) stage 1 on or off at fixed fine-tuning budget; (b) 1 vs 3 vs 6 merged runs; (c) synthetic mix diversity vs volume. Evaluate on held-out retrieval such as MIRACL dev languages and BRIGHT, not only MMTEB averages.
    • Measure query and index cost too: a 4096-d fp32 vector is 16 KB, so 50M passages need about 820 GB before compression; check Matryoshka or quantisation before committing to 8B.
  6. Connect

    Place Nemotron's recipe among LLM-based embedders: compare its attention change and pooling with NV-Embed and LLM2Vec, its loss denominator with Gecko, Qwen3 Embedding and Gemini Embedding, and its use of model merging with Qwen3 Embedding and Gemini Embedding. What does the comparison suggest is the stable core of a 2025 LLM-embedder recipe?

    What a strong answer covers
    • Attention: like NV-Embed and LLM2Vec, it removes the causal mask so every token sees the whole input; it uses plain mean pooling where NV-Embed adds a latent-attention pooling layer.
    • Loss: Gecko uses in-batch plus same-tower negatives; Qwen3 adds same-tower for documents too; Gemini drops same-tower to avoid false negatives; Nemotron drops in-batch altogether. On the 1B ablation all four land within 2 mean points.
    • Merging: Qwen3 Embedding, Gemini Embedding and EmbeddingGemma also average checkpoints; Nemotron shows the gain explicitly against each component.
    • Stable core: a strong decoder LLM made bidirectional, instruction prefixes on queries only, a large weak or synthetic pretraining stage, a curated multi-task fine-tune with margin-filtered hard negatives, and checkpoint averaging. The loss details matter less than data and merging.

Done with this page?

Status