RAG & Retrieval·Question 43 of 100AdvancedAI-75

What retrieval metrics would you track - recall@k, MRR, nDCG - and what does each actually tell you?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

All require a golden set of queries with labelled relevant chunks; each answers a different question.

Full worked answer

All require a golden set of queries with labelled relevant chunks; each answers a different question.

Recall@k - of the known-relevant chunks, what fraction appear in the top k? This is the RAG north star for the retrieval stage, because generation cannot cite what retrieval never surfaced: recall@k upper-bounds end-to-end quality. Choose k to match what you actually put in the prompt (recall@5 or @10 for the final set), and also track recall at the pre-rerank cutoff (@50/@100) - first-stage recall bounds what reranking can salvage. Comparing recall@100 (first stage) against recall@5 (post-rerank) cleanly separates "candidate generation missed" from "reranker buried it."

MRR (mean reciprocal rank) - 1/rank of the first relevant result, averaged. Sensitive to top-heaviness: right for single-answer lookups and UX where the model (or user) weights the first result most. Blind to everything after the first hit, so it under-describes multi-evidence questions.

nDCG@k - discounted cumulative gain: sums (graded) relevance with logarithmic position discounting, normalized by the ideal ordering. The most complete picture when relevance is graded (highly/somewhat/not relevant) and multiple chunks matter - which describes most RAG - but it needs graded labels, which cost more to collect.

Practical regime: recall@k as the headline (it's what predicts answer quality), nDCG@k for ranking-quality tracking once you have graded labels, MRR when the product is "find the one right doc." Run the suite on every pipeline change - these metrics are deterministic, fast, and cheap, unlike generation evals, so they belong in CI. Complement offline metrics with online signals (citation clicks, answer thumbs, "no-answer" rate) since golden sets drift from live traffic.

One trap to name: optimising precision-flavoured metrics can quietly hurt RAG - retrieving one perfect chunk but missing the second needed fact looks fine on MRR and terrible in the generated answer. When in doubt, favour recall and let the reranker and the LLM handle precision.

What a good answer covers

  • All require a golden set of queries with labelled relevant chunks; each answers a different question
  • Recall@k - of the known-relevant chunks, what fraction appear in the top k?
  • This is the RAG north star for the retrieval stage, because generation cannot cite what retrieval never…
  • Choose k to match what you actually put in the prompt (recall@5 or @10 for the final set), and also…
  • MRR (mean reciprocal rank) - 1/rank of the first relevant result, averaged

Key terms: Recall@k · MRR · nDCG@k · recall@k as the headline

Interviewer follow-ups to expect

  1. Why does recall@k matter more than precision@k for RAG specifically?

  2. Your recall@100 is 95% but recall@5 post-rerank is 60% - where's the bug?

  3. How do these metrics mislead when your golden set has incomplete relevance labels?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep