Zenaique

Define recall@k in the embedding retrieval context

Flashcard·Easy·4.0 · 0·~30s·Asked atLambda LabsLtimindtreeZilliz
Attempt it
TL;DR

Recall@k is the fraction of queries where at least one relevant document appears in the top-k retrieved results.

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

Picture asking a librarian for any book about World War II and watching them grab the top 10 from the shelf. Recall@10 asks one question: did at least one actual WW2 book make it into those 10? If yes, the librarian got credit for the query. Recall@10 across many queries is the fraction of times the librarian got credit. The blind spot: the metric doesn't care whether the WW2 book was the first one handed over or buried at position 10, only that it showed up somewhere in the pile.

Key concepts

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 is the metric you'll encounter first in any retrieval evaluation and the metric you'll outgrow last. It's clean, easy to compute, and easy to compare across systems. It's also incomplete in ways that matter for production decisions.

This deep dive walks through the definition, the calculation, the two main blind spots (rank ignorance and index confound), and the companion metrics that fill the gaps.

Definition and calculation

Recall@k starts with a labeled evaluation set. Each entry in the set is a pair: a query, and a list of document IDs that are known to be relevant to that query. The labels typically come from human annotation, search logs (click-through as a weak signal), or in 2026 increasingly from strong-LLM graders run over a candidate pool.

For each query, run the retrieval system and take the top-k results. Compare the top-k document IDs to the labeled relevant IDs. The query scores 1 (hit) if at least one labeled relevant ID is in the top-k, 0 (miss) otherwise.

Recall@k is the mean of these per-query scores across the evaluation set. A recall@10 of 0.85 across 100 queries means 85 queries had at least one relevant doc in their top-10 retrieval.

The metric has clean operational meaning. For a RAG pipeline that passes k=10 chunks to the LLM, recall@10 directly answers 'in what fraction of queries will the LLM see relevant context?'. That framing is what makes recall@k the right starting metric for most retrieval evals.

Recall@k versus precision@k
Blind spot one: rank within the top-k
Blind spot two: embedding versus index confound
Ground-truth incompleteness and false negatives
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.

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

  • BEIR benchmarks all report NDCG@10 as the primary metric, but recall@k breakouts are also published for downstream analysis.
  • MTEB's retrieval category reports NDCG@10 in the headline; per-task recall@k is available in the detailed breakdown.
Sign in to see more production examples.

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

QWhy does measuring recall@k on an HNSW index confound embedding quality and index quality?
A

HNSW's recall against an exact baseline is < 1 and depends on parameters like ef_search, M, and the data distribution. If model A produces vectors that HNSW handles well and model B produces vectors that HNSW handles poorly, model A can score higher on production HNSW even if model B has better intrinsic embeddings. The way to separate is to measure both against an exact (flat) index.

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

Confusing recall@k with precision@k. Recall@k asks 'did at least one relevant doc make it in?' Precision@k asks 'how many of the top-k are relevant?' They measure different things and can move in opposite directions.

Sign in to see all red flags and common mistakes.

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

  • Recall@k as the fraction of queries with at least one relevant doc in the top-k

  • Calculation walk-through (query loop, hit/miss decision, mean)

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
Why is cosine similarity preferred over Euclidean distance for text embeddings?
Flashcard·Easy