Zenaique

Define recall@10 for a vector index, and spell out exactly what 'ground truth' means in that definition.

Short answer·Medium·4.0 · 0·~3 min·Asked atDroomOlaPinecone·Relevant atMicrosoftNVIDIA
Attempt it

Give a precise definition of recall@10 as used to evaluate a vector index, and explain what 'ground truth' refers to in that metric.

Free · 2 AI evals / day
TL;DR

Recall@10 is `|ANN_top10 intersect Exact_top10| / 10`, averaged over a held-out query set. Ground truth is the exact top-10 from Flat brute-force search over the same corpus under the same metric.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine a librarian who claims they can find the 10 books most similar to yours in a giant library by walking only a few aisles. To check whether they really did the job well, you need a slow, honest comparison: someone who actually checks every single book in the library, takes their time, and writes down the true list of the 10 closest matches. Recall@10 is the score 'out of those 10 true closest matches, how many did the speedy librarian also find?' If they found 9 of the 10, recall is 0.9. The slow honest checker is the only fair judge, and they have to use the same definition of 'similar' as the speedy librarian.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

Recall@K looks like a simple metric until you try to compute it correctly. The formula is one line. The discipline around constructing the ground truth, holding the corpus fixed, matching the metric, holding out queries, is where most production evals go wrong. The question is asking for both halves: the formula and the ground-truth discipline.

The formula and what each term means

Recall@K is a set-overlap metric. For each query in a held-out query set Q, you have two sets of size K: what the ANN index returned, and what the true nearest neighbors actually are. The per query recall is the size of their intersection divided by K. The reported recall@K for the system is the mean of these per query values across Q.

It is bounded between 0 and 1. Recall = 1 means the ANN index returned exactly the true top-K (in any order; order is not graded by this metric). Recall = 0 means none of the true top-K appeared.

It is not the only retrieval metric. nDCG, MRR, and precision-at-K all exist and grade different things. Recall@K specifically asks 'what fraction of the true neighbors did you find', which is the right metric when the downstream system (a re-ranker, a cross-encoder, a human) will inspect the K candidates and is willing to ignore the others.

Why Flat is the unique valid ground-truth method
The three rules that get violated in production evals
Recall is a curve, not a point
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.
What you computeWhat it tells youValid?
|ANN_K intersect Flat_K| / KRecall against true nearest neighborsYes, this is the definition
|ANN_K(A) intersect ANN_K(B)| / KAgreement between two ANN methodsNot recall; meaningless as a quality metric
Mean reciprocal rank against Flat top-1Ranking quality for the single best resultUseful, but different metric (MRR, not recall@K)
nDCG against labeled judgmentsRelevance-graded retrieval qualityUseful for RAG end to end eval, not vector recall

Real products, models, and research that use this idea.

  • ANN-Benchmarks (ann-benchmarks.com) is the open source evaluation harness that publishes recall-vs-QPS curves for every major ANN library; the ground-truth files ship with the dataset.
  • Faiss includes IndexFlatL2 and IndexFlatIP specifically so engineers can compute the reference top-K for their own corpora before measuring ANN recall.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow do you compute ground truth at a billion vectors when Flat would take days?
A

Sub-sample to a representative slice (say 10M vectors) for ground truth, or use GPU-accelerated Flat (faiss-gpu) which is roughly 100x faster than CPU. Some teams accept partial ground truth on a few thousand queries rather than the full set.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Using one ANN method's results as ground truth for evaluating another ANN method. You end up measuring agreement between two approximations, not recall against truth.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Recall@K is intersection size over K, averaged over queries

  • Flat is the unique valid ground-truth method (exactness)

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
HNSW vs IVF, when…
Flashcard·Medium