Applied AI Vol. 1 · 5 min read
A retrieval-augmented system is only as good as what it retrieves. Before tuning the language model, measure the retriever on its own.
You need labeled relevance
For a set of queries, you need to know which documents or passages are relevant. This can come from human judgment, from the known source passage when you generate questions from documents, or from logged user behavior with care about bias. The quality of those labels limits everything that follows.
The metrics
- Recall@k: of the relevant items, what fraction appear in the top k results? It answers whether the right evidence made it into the context window at all.
- Mean reciprocal rank (MRR): average of 1 divided by the rank of the first relevant result. It rewards putting a good result first.
- nDCG@k: discounts gains by rank position and supports graded relevance, so a highly relevant result at rank 1 counts more than a marginal one at rank 5.
Choosing
If your generator reads the top k passages and one good passage is enough, recall@k is the natural headline. If users see a ranked list, MRR or nDCG matters. Report more than one metric, and give an interval, since query sets are often small.
Pitfalls
- Unlabeled relevant documents count as misses, so incomplete labels depress scores.
- Duplicate or near-duplicate passages can make results look better than they are.
- Retrieval metrics do not measure whether the final answer is correct or supported. Measure that separately.
