Define recall@10 for a vector index, and spell out exactly what 'ground truth' means in that definition.
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
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.
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.
What an interviewer would ask next. Try answering before peeking at the approach.
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.