Retrieval evaluation
Missing relevance judgments are not zero scores
Diagnose unavailable RAG retrieval metrics, distinguish unjudged documents from irrelevant ones, and avoid misleading query averages.
By RAG Compare editorial · Published
Original worked examples are hypothetical, not measured product results. Sources checked 2026-11-09.
An unjudged document is an unanswered question
A retrieval run returns a document that nobody has labeled. Is that document irrelevant, or is it a useful result your evaluation set has not covered? Assigning zero without review answers that question by assumption. It can make the evaluation favour runs that retrieve familiar documents over runs that surface new ones.
RAG Compare uses a deliberately strict policy: an unknown judgment within the selected top k makes all three metrics unavailable for that run. Unavailable is shown as N/A, not zero. This is the workbench’s policy, not a claim that every evaluation library handles missing judgments in the same way.
Follow one missing label through a comparison
Use a fictional query with Run A ranked as doc-a, doc-b, doc-c and Run B ranked as doc-a, doc-d, doc-b. The supplied judgments are doc-a = 1, doc-b = 0 and doc-c = 1. There is no judgment for doc-d. Set k to 3.
All three of Run A’s returned documents are judged, so its Precision@3 is 2/3, approximately 0.6667. Run B has an unjudged document in second place. The workbench withholds its precision, recall and nDCG rather than filling the missing label with a zero.
Even Run A’s recall is unavailable if the relevant set is not declared complete. Knowing that two retrieved documents are relevant does not tell you how many relevant documents exist elsewhere in the corpus. A precision value can therefore be available while recall and nDCG remain unavailable.
Completeness is evidence, not a switch for better scores
The complete flag is a declaration about the relevant set for that query. It does not create judgments or make an incomplete pool exhaustive. Setting it to true merely to produce a number gives the calculation an unsupported premise.
Suppose the fictional corpus really contains only doc-a through doc-d, and review establishes that doc-d is relevant. Now label it 1 and declare the relevant set complete: doc-a, doc-c and doc-d are the three relevant documents. Run A retrieves two of them and Run B retrieves two, so both have Recall@3 of 2/3.
If you had instead assumed doc-d was nonrelevant and called the original two positives complete, Run A’s recall would have appeared to be 1. The apparent improvement would come from changing the denominator, not retrieving more useful evidence. Keep the judgment process and its limits alongside the score.
Technical references: NIST TREC common evaluation measures
Distinguish a genuine zero from an undefined denominator
A zero score can be informative. If the complete relevant set contains useful documents but a fully judged run retrieves none of them, recall is zero. That differs from not knowing the complete relevant set.
A query with no relevant documents in the declared complete set is another special case. The recall denominator is zero, and the ideal gain used for nDCG is zero. The workbench withholds those normalized metrics rather than presenting them as successful or failed retrieval.
For an answerable-versus-unanswerable workload, evaluate abstention behaviour separately with an appropriate labeled test. Do not force every query into a retrieval metric that assumes a nonempty relevant set. A system that correctly declines to answer needs a clear evaluation rule of its own.
A missing query should not disappear from the average
RAG Compare gives every query equal weight in its macro average and does not silently drop unavailable values. If any query lacks a metric for a run, that metric’s macro is unavailable for that run. One run can have an available macro while the other does not; the difference requires both.
Imagine two queries with Run A precision values 1 and 0. Its macro precision is 0.5. Run B has precision 1 on the first query and an unknown top-k judgment on the second. Reporting Run B as 1 by averaging only the available query would compare a one-query result against a two-query result. The apparent advantage would conceal a coverage difference.
Other tools may offer different aggregation policies. If you use them, state which queries were included and why, and compare identical scopes. A smaller evaluated subset is not automatically a better system.
Repair the evidence before interpreting the delta
Review the union of returned documents at the chosen evaluation depth, using a written relevance rule. Keep disagreements for adjudication rather than resolving them in favour of a preferred retriever. Record the corpus version and the boundaries of the judgment exercise.
Then rerun the comparison and inspect both scores and coverage. In RAG Compare, unknown labels remain gaps in cutoff exploration; increasing k may introduce a new unknown. Use that gap to locate missing work. Do not treat filling the chart as the objective: the objective is a comparison whose assumptions you can defend.
Sources and scope
Provider rules and supported features can change. These sources support the technical background; the worked examples and decision checklists are authored for this article.
- NIST TREC common evaluation measures
Recall denominator depends on relevant items in the collection; opened 9 November 2026.
- Microsoft RAG evaluators
Document retrieval evaluation uses relevance labels and distinguishes it from generation evaluation; opened 9 November 2026.
- scikit-learn nDCG documentation
Normalized discounted gain background; app-specific undefined and missing-label policies are documented separately; opened 9 November 2026.