In the MTEB paper, the model with the best English average ranks 8th of these 11 at retrieval. The average mixes seven jobs, and search is 15 of its 56 datasets.
Pick the column to sort by and watch the leaderboard reorder. Then we build, piece by piece, what each column tests, the metrics behind it, the noise in it, and the small private test that makes the real decision.
You need to know that an embedding is a list of numbers for a text, and that cosine similarity ranks texts by how close their vectors point. We build the rest from zero.
Numbers come from the MTEB paper (Muennighoff et al., 2023, Table 1) and the BEIR paper (Thakur et al., 2021, Table 2). The live leaderboard changes every week. This page teaches how to read it, not who leads it.
Eleven of the 33 models in MTEB paper Table 1 (English, 2022). marks the leader by average; marks the leader of the column you chose. Today’s leaderboard has newer models and a newer English benchmark.
Chapter 0
See how a better average can give you worse search, and find what the headline number weighs
Here is a made-up but common story. You run search over 40,000 pages of developer docs. You swap your embedding model for the one at the top of the leaderboard. On your own 300 test queries, the right page sat in the top ten 71% of the time before. Now it is 63%.
The leaderboard did not lie. It sorts by an average over many datasets that someone else picked. You run one task. The average asks "good at everything, on average?" You need "good at my search?"
MTEB (the Massive Text Embedding Benchmark) has 8 task types, 58 datasets and 112 languages. Its English score averages 56 datasets in seven families. Call the number of datasets in family f nf, and the model's mean score in that family sf.
The average equals one over 56, times the sum over families f of n-f times s-f.
Multiply each family mean s-f by its dataset count n-f. Add the seven products. Divide by 56. Families with many datasets pull hardest.
ST5-XXL in MTEB Table 1: the seven products add to 3,332.7, and 3,332.7 / 56 = 59.51. Retrieval gives 15 × 42.24 = 633.6, under a fifth of the total.
Each square is one dataset. Pick what you build: its squares light up. Then add points to that family and read how far the headline moves.
Dataset counts per family from MTEB paper Table 1. The gain is a knob for you to turn, not a measured result.
To lift the headline by one point through retrieval alone, a model must gain 56 / 15 = 3.73 points of retrieval score. That is a large win for a search team, and it barely moves the sort order.
The failure. Symptom: a model wins offline on the leaderboard and loses in your product. Measure: run both models on your own queries before you re-embed the corpus. Fix: shortlist from the column for your task, then decide on your own test (Chapter 9).
Chapter 1
Read each task family as a fixed procedure on frozen vectors, and see why one space cannot please them all
Each MTEB family is a probe: a fixed procedure that runs on the model's frozen embeddings and returns one score. Know the procedure and you know the property it rewards.
| Family | Datasets | Procedure | Main metric |
|---|---|---|---|
| Classification | 12 | fit logistic regression on training vectors, test on test vectors | accuracy |
| Clustering | 11 | mini-batch k-means with k = the number of labels | V-measure |
| Pair classification | 3 | cosine of each pair against one best threshold | average precision |
| Reranking | 4 | sort a given short candidate list by cosine | MAP |
| Retrieval | 15 | search a whole corpus by cosine (the public BEIR sets) | nDCG@10 |
| STS | 10 | cosine of sentence pairs against human scores | Spearman |
| Summarization | 1 | machine summaries scored by cosine to human summaries | Spearman |
| Bitext mining | multilingual | find each sentence's translation by nearest neighbour | F1 |
Three questions split the families:
Teal and warm dots are two labels. The ring is a query with the teal label. Stretch the horizontal axis and watch the dashed line and the three cosine neighbours.
An illustrative toy in two dimensions. The dashed line is the original separating line mapped through the stretch, which is one perfect fit for the refitted probe.
A worked case. A query sits at 50°, a teal point at 70°, a warm point at 5°. The teal point is nearer: 20° against 45°.
Stretch x by 4. The angles become 16.6°, 34.5° and 1.3°. Now the warm point is nearer: 15.3° against 17.9°. The labels did not move, so the probe scores the same. The cosine ranking flipped.
The failure. Symptom: a model that tops classification disappoints in search. Measure: read the retrieval column and its worst dataset, not the classification column. Fix: map your product to a family first.
Chapter 2
Move retrievers to datasets they never trained on and watch a 1990s keyword method hold its ground
By 2020, dense retrievers beat keyword search on the datasets they trained on. DPR is the classic one: two BERT encoders, one for questions and one for passages, trained on question and passage pairs. Its rival is BM25, a keyword scorer with no training (Chapter 3).
BEIR asked what happens on new ground. It has 18 English datasets from 9 retrieval tasks: fact checking, biomedical search, argument retrieval, duplicate questions and more. Every model runs zero-shot: it gets no training data from the target dataset. The score is nDCG@10 (Chapter 5). MTEB's 15 retrieval datasets are the public BEIR sets.
Blue is BM25. The other bar is the system you pick. The top row is where that system trained. Read how many rows it wins.
nDCG@10 from BEIR paper Table 2. DPR trained on Natural Questions, so its home row is NQ and its away count leaves NQ out; the others trained on MS MARCO. The means over the 18 zero-shot rows are our own arithmetic on that table.
Take TAS-B. On MS MARCO, where it trained, it beats BM25 by 0.180 (0.408 against 0.228). On Touché-2020 it loses by 0.205 (0.162 against 0.367). Over the 18 zero-shot rows it averages 0.415 to BM25's 0.423. The paper's first finding: in-domain performance is not a good guide to out-of-domain performance.
Three shifts cause the cliff. Vocabulary: rare words, such as gene names in BioASQ, barely appeared in pretraining. Query shape: ArguAna queries are whole paragraphs. Relevance: ArguAna rewards the best counter-argument, and Touché rewards argument quality, not similarity.
The best row is a pipeline. BM25 fetches 100 candidates. A cross-encoder, a model that reads the query and a document together and outputs one score, reorders them. That is BM25+CE: it beats BM25 on 16 of 18 datasets and fails only on ArguAna and Touché.
The failure. Symptom: a dense model that wins its paper's benchmark misses exact identifiers on your corpus. Measure: score BM25 on your own queries first; it is the number to beat. Fix: ship a hybrid (Chapter 4) with a reranker on top.
Chapter 3
Weigh rare words up, let repeats saturate, discount long chunks, and count it all from your own corpus
A user pastes ERR_TLS_CERT_ALTNAME_INVALID. BM25 scores each chunk by adding up a weight for each query word. Three ideas set the weight: rare words count more, repeats add less and less, and long chunks count less.
Start with rarity. Call the number of chunks in the corpus N, and the number of chunks that contain word t df(t), its document frequency.
IDF of t equals the natural log of: N minus d-f plus a half, over d-f plus a half, plus one.
Count the chunks that hold the word: that is df. Divide the chunks without it by the chunks with it, add one, take the log. Fewer chunks with the word gives a bigger IDF.
With made-up counts and N = 40,000: the error code is in df = 3 chunks, so IDF = ln(39,997.5 / 3.5 + 1) = ln(11,429) = 9.34. The word "the" is in 39,000 chunks: ln(1.026) = 0.025. One mention of the code outweighs about 369 mentions of "the".
BM25 multiplies each word's IDF by a term factor. With the usual constants, an average-length chunk earns 1.00 for one mention, 1.38 for two and 1.96 for ten. It can never pass 2.2. A chunk twice the average length earns 1.07 for two mentions, against 1.38.
The blue curve is what one word adds as its mentions grow. The faint curve is a chunk of average length. Move both sliders.
Term factor f × 2.2 / (f + 1.2 × (0.25 + 0.75 × length ratio)), with the common BM25 constants k1 = 1.2 and b = 0.75.
Score two chunks for "webhook retry policy" (made-up counts, N = 40,000, average length 220 tokens):
| Chunk | Length | Mentions (webhook, retry, policy) | BM25 |
|---|---|---|---|
| Webhook Retries reference | 180 tokens | 6, 9, 2 | 25.70 |
| Webhooks overview | 900 tokens | 8, 1, 3 | 13.17 |
The focused page wins two to one. The rarest word, retry, carries the most weight, and the long page mentions it once.
Why does BM25 survive? Its weights come from counting your corpus at index time. A dense model learned what words mean from pretraining text that never held your error codes.
The failure. Symptom: search quality shifts after a "harmless" re-chunking. Measure: rerun your eval on every chunking change. Fix: treat chunk size as a retrieval setting, because it changes every length ratio.
Chapter 4
Merge two rankings by rank alone, and see why agreement beats one list's enthusiasm
BM25 wins on rare words. A dense model wins on paraphrase: "stop my card being charged twice" and "preventing duplicate transactions" share no content word, so BM25 scores the pair zero. Run both and merge the two ranked lists.
You cannot add a BM25 score to a cosine; the scales differ. Reciprocal rank fusion (RRF) uses ranks only. Call document d's rank in list r rankr(d), and a fixed constant k.
RRF of d equals the sum over lists r of one over k plus rank-r of d.
In each list, find d's rank, add k, take one over it. Add over the lists. A document missing from a list adds nothing for that list.
With k = 60 and made-up ranks: X is 1st and 8th, 1/61 + 1/68 = 0.03110. Y is 12th and 1st: 0.03028. Z is 3rd and 3rd: 0.03175. Z wins without topping either list.
Left, each document's rank in BM25 (blue) and dense (purple). Right, the fused order. Slide k and watch who leads.
Illustrative ranks for six documents. The formula is the standard RRF; k = 60 is the usual default.
Why k = 60? It flattens the top. Rank 1 is worth 1/61 = 0.0164 and rank 2 is worth 1/62 = 0.0161, a 2% gap. With k = 1, rank 1 is worth 0.5 and one list's favourite wins. Slide k down to 1 and X takes the lead.
The failure. Symptom: a score-weighted hybrid swings when one system's scores change scale after an upgrade. Measure: compare recall@k of the hybrid with each list alone. Fix: fuse by rank.
Chapter 5
Turn a ranked list of graded documents into one number between 0 and 1, by hand
A ranker returns ten documents for "how do I reset my password". Annotators graded each one: 3 perfect, 2 highly relevant, 1 marginal, 0 not relevant. You want one number that rewards high grades early. You must also be able to average it over queries.
Two choices build it. The gain of grade rel is 2rel − 1, so grades 0 to 3 give 0, 1, 3 and 7: one perfect page beats several fair ones. The discount at rank i is 1 / log2(i + 1): rank 1 keeps all, rank 2 keeps 0.63, rank 10 keeps 0.29. Call the grade at rank i reli.
DCG at k equals the sum over i from one to k of two to the rel-i minus one, over log base two of i plus one.
For each rank i, turn the grade rel-i into a gain, divide it by log base two of i plus one, and add the results down to rank k.
System A returns grades 2, 0, 3, 1, 0, 2, 0, 1, 0, 1. The non-zero terms are 3/1 + 7/2 + 1/2.32 + 3/2.81 + 1/3.17 + 1/3.46 = 3 + 3.5 + 0.431 + 1.069 + 0.315 + 0.289 = 8.604.
DCG grows with the number of relevant documents, so queries are not comparable yet. Divide by the best DCG this query could reach. The ideal DCG, IDCG@k, is the DCG of all judged documents sorted by grade.
n-D-C-G at k equals D-C-G at k over I-D-C-G at k.
Sort every judged grade for the query from high to low, keep the top k, and compute its DCG. Divide your DCG by that ideal.
The judged grades are 3, 2, 2, 1, 1, 1, so IDCG@10 = 11.567. A: 8.604 / 11.567 = 0.744. System B returns 3, 0, 2, 2, 0, 1, 0, 1, 0, 1: DCG 10.753, nDCG 0.930. Same six slots; B put the grade 3 page first.
Each row is a rank with a graded document. The bar is its share of DCG. Tap one row, then another, to swap them. Or load a preset.
Ten illustrative documents with fixed grades. Relevant means grade 1 or more for the three binary metrics. Here every document has a grade; in real data an unjudged document counts as 0.
The failure. Symptom: two teams report different nDCG for the same run. Measure: compare the gain, the cutoff and how each handles queries with no relevant documents. Fix: write all three next to every number.
Chapter 6
Compute the other metrics on the same two rankings, and see which ones are blind to the difference
Systems A and B from Chapter 5 differ by 0.186 in nDCG@10. Run the other common metrics on them. Count a document as relevant if its grade is 1 or more; the query has six.
| Metric | What it does | A | B |
|---|---|---|---|
| recall@5 | share of all relevant documents found in the top 5 | 0.500 | 0.500 |
| recall@10 | the same in the top 10 | 1.000 | 1.000 |
| MRR | 1 / rank of the first relevant document, averaged over queries | 1.000 | 1.000 |
| MAP | precision at each relevant hit, summed, divided by the number relevant; averaged over queries | 0.718 | 0.718 |
| nDCG@10 | graded gains with a rank discount | 0.744 | 0.930 |
Only nDCG sees the gap. Recall, MRR and MAP treat relevance as yes or no, so they erase the grades first. Flatten the grades to 0 and 1 and nDCG goes blind too: both systems score 0.875. The power to tell A from B lives in the graded judgments, not in the formula.
Which one when? A first stage that feeds a reranker: recall@100, because the order will be redone. One right page, like a password reset: MRR. Graded judgments where the top matters: nDCG@10. A generator that reads the top 5: recall@5 and nDCG@5.
STS compares the model's cosine for each sentence pair with a human score from 0 to 5. MTEB reports the Spearman correlation: the ordinary correlation computed on ranks instead of values. Rank the pairs by human score and by cosine. Call the gap between pair i's two ranks di, and the number of pairs n.
Rho equals one minus six times the sum of d-i squared, over n times n squared minus one.
Rank the pairs twice, by human score and by cosine. For each pair, subtract the ranks to get d-i and square it. Add the squares, scale by n, subtract from one. This form holds when there are no ties.
With made-up data: six pairs, and the model swaps one neighbouring pair, so two d-i are 1 and the rest 0. Then ρ = 1 − 6 × 2 / (6 × 35) = 1 − 12/210 = 0.943. The ordinary correlation on the raw values is 0.910.
Each dot is a pair: human score across, cosine up. Squash keeps the order but bends the line. Noise swaps the order. Watch which correlation moves.
Twelve illustrative pairs. Pearson is the ordinary correlation of the raw values; Spearman is the same on ranks.
Spearman ignores any change that keeps the order, so it measures agreement about which pair is more similar. The flip side: it says nothing about calibration. A high Spearman does not mean "cosine above 0.85 is a duplicate" works.
The failure. Symptom: a regression report says "nDCG down 3", and nobody knows why. Measure: report recall@k and nDCG@k together. Recall down means the page left the window; nDCG down with recall flat means it got buried.
Chapter 7
Put an error bar on a score difference, and pair the queries to shrink it
Two models, 500 queries, 2 points apart in nDCG@10. Is the gap real? Every score is a mean over a finite set of queries. So it has a standard error: the typical distance between the measured mean and the true one.
Per-query nDCG jumps between 0 and 1, so its spread is wide. With an illustrative standard deviation of 0.35, each model's mean has a standard error of 0.35 / √500 = 0.0157. The gap between two independent means has √2 times that, 0.0221. A 95% band is 1.96 times it: ±4.3 points. A 2-point gap is inside the noise.
But both models ran on the same queries. Hard queries are hard for both, so take the per-query difference di and look at its spread. Call the standard deviation of the differences sd and the number of queries n.
S-E equals s-d over the square root of n.
For each query, subtract the old system's nDCG from the new one's. Take the standard deviation s-d of those differences and divide by the root of n.
With an illustrative s-d of 0.15 and n = 500: SE = 0.15 / 22.36 = 0.0067. The band is ±1.31 points, so a 2-point gap is real. Same data, about 3.3 times sharper.
The dot is the measured gap; the bar is its 95% band. If the band crosses zero, the gap is noise. Change the queries, the gap and the method.
Illustrative spreads: 0.35 per query for one system, 0.15 for paired differences. Measure your own; the method is the point.
Turn it around. To detect a 3-point gap at 95% confidence with 80% power, a paired test needs n = (1.96 + 0.84)2 × 0.152 / 0.032 = 7.84 × 25 = 196 queries. With sd = 0.20 it needs 349. That is why 200 to 350 queries is enough.
Also count wins. Say the new model wins 62 queries, loses 38 and ties 200. Drop the ties. Under a coin flip, wins average 50 with a spread of 5. So z = (62 − 50) / 5 = 2.4, and the two-sided p is about 0.016 (0.021 by the exact binomial test). Report the paired mean and the win, loss and tie counts together.
The failure. Symptom: "model X beats Y on three datasets." Measure: 56 datasets tested at 5% give 56 × 0.05 = 2.8 false wins by chance. Fix: make claims about the family mean you care about.
Chapter 8
See two forces that lift the top of a public leaderboard above what your corpus will give, with no cheating needed
Contamination means evaluation material shows up in training data. It comes in three strengths. A model trains on a benchmark dataset's own training split: MS MARCO, Natural Questions, HotpotQA, FEVER and Quora are common training sets. A model trains on synthetic data written to look like the benchmark. Or a web scrape put the test text into pretraining data.
The score is then a mix. Take the share of contaminated items, times the near-memorised score on them, plus the clean share times the true score. With made-up numbers: 25% contaminated at 0.97, a true score of 0.60. Observed: 0.25 × 0.97 + 0.75 × 0.60 = 0.2425 + 0.45 = 0.6925. The board says 69.3. Your corpus gives 60.
Look for the fingerprint in the per-dataset columns. Say a new model gains 7.2 points on 9 retrieval datasets that have public training splits, and 0.4 on the other 6. The family gain reads (9 × 7.2 + 6 × 0.4) / 15 = 4.48. Your corpus has no training split, so you get the 0.4.
The winner's curse needs no contamination. Say 1,000 models have the same true quality, and the benchmark adds noise with a standard deviation of 1 point. The top row is the luckiest draw. The expected maximum of 1,000 standard normal draws is 3.24, so the leader sits about 3.2 points above its true quality. For 100 entries it is 2.51; for 10, 1.54.
Teal is what your corpus gets. Red layers are lift that will not travel. Change how much of the test leaked and how many models competed.
Illustrative model: true score 60, memorised items 97, measurement noise 1 point. The selection lift is the expected maximum of the competing models' noise, computed by numerical integration.
A defence you control is a canary slice: test queries and pages created after the model's training cutoff. With made-up numbers: a candidate scores 0.68 on your general set and 0.59 on the canary slice. Your current model scores 0.65 and 0.64. The candidate looked 3 points better and is 5 points worse on pages it cannot have seen.
The benchmark world reacts too. MMTEB, the multilingual successor, gathers over 500 tasks in 250+ languages. It ranks models with a Borda count, so one task with a wide score range cannot swing the order. See the LLM embedders lesson for how it works.
Chapter 9
Sample 300 queries, pool candidates, write the rubric, measure agreement and gate every change
A private eval answers the only question you have: should I ship this change? It costs about one person-week.
Raw agreement flatters. If both judges say "not relevant" 90% of the time, they agree often by chance. Cohen's kappa corrects for that. Call the observed share of agreement po and the share expected by chance pe.
Kappa equals p-o minus p-e, over one minus p-e.
Take how often the judges agreed, p-o. Subtract what chance alone would give, p-e. Divide by the room above chance, one minus p-e.
With made-up counts on 100 pairs: judges agree on 85, and mark "relevant" 38% and 37% of the time. p-e = 0.38 × 0.37 + 0.62 × 0.63 = 0.531. Kappa = (0.85 − 0.531) / 0.469 = 0.68.
The grid counts 100 double-judged pairs. Make relevance rare and watch raw agreement stay high while kappa falls.
Illustrative: both judges mark the same share relevant, and disagreements split evenly both ways.
The trap, with made-up counts: another pair agrees on 95 of 100, but each marks only 5 or 6 relevant. Then p-e = 0.06 × 0.05 + 0.94 × 0.95 = 0.896, and kappa = 0.054 / 0.104 = 0.52. Most of the 95% is two people saying no to obvious junk. If kappa is low, sharpen the rubric, not the people.
To label at scale with a language model judge, give it the same double-judged set. If its kappa against a human is near the human pair's, use it. Keep a human-only slice to catch drift when the judge changes.
python# the regression gate: paired, because Chapter 7 d = [ndcg(new, q) - ndcg(old, q) for q in golden] # one difference per query m, se = mean(d), stdev(d) / len(d) ** 0.5 if m + 1.96*se < 0: fail("significant regression") elif m - 1.96*se > 0: ok("significant improvement") else: warn(f"inconclusive: {m:+.3f} +/- {1.96*se:.3f}") assert all(rank_of_gold(new, q) <= 3 for q in must_never_break)
The failure. Symptom: the gate passes, yet one top support query broke. Measure: the worst per-query change, printed beside the mean. Fix: a hard assertion list, not only an average.
Chapter 10
Keep the terms, the numbers, the code and the next steps in one place
A public benchmark is a screening tool. It cuts twenty candidates to three. Your private eval is the deciding tool. It picks one and guards every later change.
| Term | Meaning | Number to keep |
|---|---|---|
| MTEB | embedding benchmark of 8 task types; English average over 56 datasets | retrieval is 15 of 56 |
| BEIR | 18 zero-shot retrieval datasets, scored by nDCG@10 | BM25+CE beats BM25 on 16 of 18 |
| MMTEB | multilingual successor, ranked by Borda count | 500+ tasks, 250+ languages |
| BM25 IDF | rarity weight counted from your corpus | df 3 of 40,000 gives 9.34 |
| RRF | fuse lists by 1 / (k + rank) | k = 60 |
| nDCG@k | graded gain with a log discount, over the ideal | A 0.744, B 0.930 |
| recall, MRR, MAP | binary metrics, blind to grades | same for A and B |
| Spearman | correlation of ranks, the STS metric | one swap in 6: 0.943 |
| Paired SE | spread of per-query differences over root n | 500 queries: ±1.3 paired, ±4.3 unpaired |
| Winner's curse | the top of many noisy entries is lucky | 1,000 entries: +3.24 noise units |
| Cohen's kappa | agreement beyond chance | 0.61 to 0.80 substantial |
pythonimport math def dcg(grades, k=10, exp=True): # grades[i] is the grade at rank i+1 g = (lambda r: 2**r - 1) if exp else (lambda r: r) return sum(g(r) / math.log2(i + 2) for i, r in enumerate(grades[:k])) def ndcg(ranked, judged, k=10): # judged: every graded doc for the query ideal = dcg(sorted(judged, reverse=True), k) return dcg(ranked, k) / ideal if ideal else None # None: decide and write it down def recall_at(ranked, n_rel, k): return sum(r > 0 for r in ranked[:k]) / n_rel def rr(ranked): return next((1 / (i + 1) for i, r in enumerate(ranked) if r > 0), 0.0) def ap(ranked, n_rel): hits, s = 0, 0.0 for i, r in enumerate(ranked): if r > 0: hits += 1; s += hits / (i + 1) return s / n_rel # missed relevant docs add a silent 0 def rrf(lists, k=60): # lists: ranked lists of doc ids s = {} for lst in lists: for rank, d in enumerate(lst, 1): s[d] = s.get(d, 0) + 1 / (k + rank) return sorted(s, key=s.get, reverse=True) A = [2,0,3,1,0,2,0,1,0,1]; judged = [3,2,2,1,1,1] print(round(ndcg(A, judged), 3), recall_at(A, 6, 5), rr(A), round(ap(A, 6), 3)) # 0.744 0.5 1.0 0.718
Now press Present or Teach and explain from memory why the average misleads, how nDCG is built, and why you pair a comparison. Then go back to the leaderboard and sort it by retrieval again. This time say which chapter explains each change of rank.