Define recall@10 for a vector index, and spell out exactly what 'ground truth' means in that definition.
Give a precise definition of recall@10 as used to evaluate a vector index, and explain what 'ground truth' refers to in that metric.
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.
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.
Detailed answer & concept explanation~5 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: precise recall@K formula + Flat as ground truth and why + metric/corpus/query-set discipline + recall as a curve over tuning knobs + reading vendor benchmark numbers honestly.
| What you compute | What it tells you | Valid? |
|---|---|---|
| |ANN_K intersect Flat_K| / K | Recall against true nearest neighbors | Yes, this is the definition |
| |ANN_K(A) intersect ANN_K(B)| / K | Agreement between two ANN methods | Not recall; meaningless as a quality metric |
| Mean reciprocal rank against Flat top-1 | Ranking quality for the single best result | Useful, but different metric (MRR, not recall@K) |
| nDCG against labeled judgments | Relevance-graded retrieval quality | Useful 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.
- The SIFT1M benchmark (1M 128-dim SIFT descriptors with 10k queries) is the canonical ANN testbed. Its ground-truth file is a published artifact reused across two decades of papers.
- Pinecone's internal eval pipeline runs Flat over a frozen corpus snapshot weekly and uses that as the recall reference for every customer-facing benchmark number.
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?
QWhy is recall@10 the most common K in practice, and when would you measure recall@100 instead?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
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.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.