Embedding Benchmarks

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.

Sort the leaderboard

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

The Leaderboard Trap

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?"

How the headline number is built

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.

avg = 1/56 · Σf nf · sf
Say it aloud

The average equals one over 56, times the sum over families f of n-f times s-f.

avg
average the headline score that the leaderboard sorts by.
1/56
one over 56 divide by the number of English datasets.
Σf
the sum over f one term for each of the seven families.
nf
n-f how many datasets family f has: 15 for retrieval, 1 for summarization.
sf
s-f the model's mean score over the datasets of family f.
In plain words

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.

With numbers

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.

Count what the average weighs

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.

4.0

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).

The road

  1. What each family tests: seven probes and the three questions that split them.
  2. The zero-shot cliff: BEIR, and why in-domain wins do not travel.
  3. BM25: the keyword baseline that still wins on rare words.
  4. Fusion: merge keyword and dense lists by rank.
  5. nDCG: grades, discounts and the ideal ranking, by hand.
  6. Recall, MRR, MAP, Spearman: what each one cannot see.
  7. The noise floor: when a gap is real.
  8. Inflation: contamination and the winner's curse.
  9. Your own eval: 300 queries, a rubric, kappa and a gate.
  10. Field guide: terms, numbers, code and links.
A new model scores 4.5 points higher on the MTEB average and 8 points lower on your own 300 search queries. Which explanation fits?

Chapter 1

What Each Family Tests

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.

FamilyDatasetsProcedureMain metric
Classification12fit logistic regression on training vectors, test on test vectorsaccuracy
Clustering11mini-batch k-means with k = the number of labelsV-measure
Pair classification3cosine of each pair against one best thresholdaverage precision
Reranking4sort a given short candidate list by cosineMAP
Retrieval15search a whole corpus by cosine (the public BEIR sets)nDCG@10
STS10cosine of sentence pairs against human scoresSpearman
Summarization1machine summaries scored by cosine to human summariesSpearman
Bitext miningmultilingualfind each sentence's translation by nearest neighbourF1

Three questions split the families:

  1. Does the probe use distance at all? Classification does not.
  2. Does it compare scores across pairs, or only inside one query? STS and pair classification need one global scale. Retrieval and reranking do not.
  3. How many rivals must the right answer beat? Reranking has a short list. Retrieval has the whole corpus.

Stretch the space

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.

1.0×

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.

Why can a model score well on classification and poorly on STS with the same vectors?

Chapter 2

The Zero-Shot Cliff

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.

Compare a system with BM25 on every dataset

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.

TAS-B beats BM25 by 0.18 on MS MARCO but averages slightly below it on the 18 zero-shot datasets. What does this show most directly?

Chapter 3

BM25, the Baseline That Will Not Die

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(t) = ln( (N − df + 0.5) / (df + 0.5) + 1 )
Say it aloud

IDF of t equals the natural log of: N minus d-f plus a half, over d-f plus a half, plus one.

IDF(t)
I-D-F of t the weight of word t, its inverse document frequency.
ln
the natural log grows slowly, so a word 1,000 times rarer weighs only about 7 more.
N
N the number of chunks in your corpus: 40,000 here.
df
d-f how many chunks contain word t.
df + 0.5
d-f plus a half the half keeps the ratio finite when a count is zero.
0.5
a half the same smoothing on top.
+ 1
plus one keeps the log above zero for the most common words.
In plain words

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 numbers

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.

Saturate the repeats

The blue curve is what one word adds as its mentions grow. The faint curve is a chunk of average length. Move both sliders.

2
1× avg

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):

ChunkLengthMentions (webhook, retry, policy)BM25
Webhook Retries reference180 tokens6, 9, 225.70
Webhooks overview900 tokens8, 1, 313.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.

With N = 40,000, word A appears in 3 chunks and word B in 39,000. What does BM25's IDF do?

Chapter 4

Fuse Keyword and Dense Lists

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(d) = Σr 1 / (k + rankr(d))
Say it aloud

RRF of d equals the sum over lists r of one over k plus rank-r of d.

RRF(d)
R-R-F of d document d's fused score. Sort by it, high first.
Σr
the sum over r one term for each ranked list: here BM25 and dense.
k
k a smoothing constant, 60 by convention. It is not a cutoff.
rankr(d)
rank-r of d where list r puts d: 1 is the top.
In plain words

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 numbers

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.

Fuse two lists

Left, each document's rank in BM25 (blue) and dense (purple). Right, the fused order. Slide k and watch who leads.

60

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.

With k = 60, a document ranked 3rd in both lists beats one ranked 1st and 8th. Why?

Chapter 5

nDCG From Scratch

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@k = Σi=1..k (2reli − 1) / log2(i + 1)
Say it aloud

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.

DCG@k
D-C-G at k discounted cumulative gain of the top k results.
Σi=1..k
the sum over i from one to k one term per rank, from the top down to the cutoff k, here 10.
2reli − 1
two to the rel-i minus one the gain of the document at rank i; rel-i is its grade, 0 to 3.
log2(i + 1)
log base two of i plus one the divisor that shrinks lower ranks: 1 at rank 1, 3.46 at rank 10.
In plain words

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.

With numbers

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.

nDCG@k = DCG@k / IDCG@k
Say it aloud

n-D-C-G at k equals D-C-G at k over I-D-C-G at k.

nDCG@k
n-D-C-G at k normalised DCG: 1 means no order could do better.
DCG@k
D-C-G at k your ranking's score from the equation above.
IDCG@k
I-D-C-G at k the ideal: DCG of the judged grades sorted high to low. It depends on the judgments, never on your system.
In plain words

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.

With numbers

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.

Rearrange the ranking

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.

0.744nDCG@10
0.500recall@5
1.000reciprocal rank
0.718average precision

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.

A and B put relevant documents in the same six slots. B has the grade 3 page at rank 1, A at rank 3. What does nDCG@10 do?

Chapter 6

Recall, MRR, MAP and Spearman

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.

MetricWhat it doesAB
recall@5share of all relevant documents found in the top 50.5000.500
recall@10the same in the top 101.0001.000
MRR1 / rank of the first relevant document, averaged over queries1.0001.000
MAPprecision at each relevant hit, summed, divided by the number relevant; averaged over queries0.7180.718
nDCG@10graded gains with a rank discount0.7440.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.

Spearman, the STS metric

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.

ρ = 1 − 6 Σ di2 / ( n (n2 − 1) )
Say it aloud

Rho equals one minus six times the sum of d-i squared, over n times n squared minus one.

ρ
rho the Spearman correlation: 1 if the orders agree, −1 if reversed.
6 Σ di2
six times the sum of d-i squared d-i is pair i's human rank minus its cosine rank; square each and add.
n (n2 − 1)
n times n squared minus one scales the sum so a full reversal gives −1; n is the number of pairs.
In plain words

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 numbers

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.

Squash the cosines

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.

0.00
0.00

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.

Your first-stage retriever feeds its top 100 to a cross-encoder that reorders them. Which metric should judge the retriever?

Chapter 7

The Noise Floor

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.

SE = sd / √n
Say it aloud

S-E equals s-d over the square root of n.

SE
S-E the standard error of the mean per-query difference. The 95% band is 1.96 S-E either side.
sd
s-d the standard deviation of the differences: new nDCG minus old nDCG, one per query.
√n
the square root of n n is the number of queries. Four times the queries halves the error.
In plain words

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 numbers

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.

Find the noise floor

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.

500
2.0

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.

Two models differ by 2 points of nDCG@10 on the same 500 queries. What is the right conclusion?

Chapter 8

Contamination and the Winner’s Curse

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.

Split a reported score

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.

25%
1,000

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.

A thousand models of identical true quality face a benchmark with 1 point of noise. How far above its true quality is the top row expected to sit?

Chapter 9

Build Your Own Eval

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.

  1. Sample about 300 queries from your logs. Stratify: some head queries, more torso and tail, plus known failures such as zero-result queries.
  2. Pool the candidates. Take the top 10 from each of three systems: BM25, your current model, the candidate. With overlap, about 18 unique documents per query: 5,400 judgments.
  3. Write the rubric first. Grades 0 to 3, each with an anchor example from your corpus, plus rules for edge cases such as a right answer for an old version.
  4. Double-judge 20% and measure agreement. 6,480 judgments at 20 seconds each is 36 hours.
  5. Gate every retrieval change with a paired test, plus a short list of queries that must never break.

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.

κ = (po − pe) / (1 − pe)
Say it aloud

Kappa equals p-o minus p-e, over one minus p-e.

κ
kappa agreement beyond chance: 1 perfect, 0 chance level. 0.61 to 0.80 is called substantial.
po
p-o the share of double-judged items where the two judges gave the same label.
pe
p-e chance agreement: both judges' rates of "relevant" multiplied, plus both rates of "not relevant" multiplied.
In plain words

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 numbers

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.

Agree by chance

The grid counts 100 double-judged pairs. Make relevance rare and watch raw agreement stay high while kappa falls.

38%
15%

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.

Two judges agree on 95% of pairs, but kappa is 0.52. What does that mean?

Chapter 10

Field Guide

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.

Terms and numbers

TermMeaningNumber to keep
MTEBembedding benchmark of 8 task types; English average over 56 datasetsretrieval is 15 of 56
BEIR18 zero-shot retrieval datasets, scored by nDCG@10BM25+CE beats BM25 on 16 of 18
MMTEBmultilingual successor, ranked by Borda count500+ tasks, 250+ languages
BM25 IDFrarity weight counted from your corpusdf 3 of 40,000 gives 9.34
RRFfuse lists by 1 / (k + rank)k = 60
nDCG@kgraded gain with a log discount, over the idealA 0.744, B 0.930
recall, MRR, MAPbinary metrics, blind to gradessame for A and B
Spearmancorrelation of ranks, the STS metricone swap in 6: 0.943
Paired SEspread of per-query differences over root n500 queries: ±1.3 paired, ±4.3 unpaired
Winner's cursethe top of many noisy entries is lucky1,000 entries: +3.24 noise units
Cohen's kappaagreement beyond chance0.61 to 0.80 substantial

The checklist

  1. Write down which probe your product runs: retrieval, reranking, clustering or another.
  2. Measure BM25 on your own queries. It is the number to beat.
  3. Shortlist from the right column and its worst dataset. Check index size, encoder cost, token limit and required query prefixes.
  4. Run the shortlist on your eval, paired, with a 95% band and win, loss and tie counts.
  5. Report k, the gain, the relevance threshold and the empty-query rule with every number.
  6. Ship the pipeline: a rank-fused hybrid with a reranker on top. Gate every retrieval change.

The core as code

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

Keep going

The takeaway. Read the column for your task, not the average. Beat BM25 on your own queries, fuse by rank, judge with graded labels, compare paired with an error bar, and let your private eval decide.
You shortlisted three models from a leaderboard. What is the right next step?

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.

Sources

Embedding Benchmarks
MTEB paper · BEIR paper · MMTEB paper · Back to Gleams