Create passage-level judgments with time, permission and disagreement rules so release scores mean the same thing across runs.
Retrieval evaluation labels: build a trustworthy judged set
Define the unit of judgment
A retrieval test needs a question, corpus snapshot, principal scope, answerable state and one or more supporting passage IDs. Labeling only a final answer string loses the evidence path: two passages may express the same value, but only one may be active for the query date or visible to the principal. Include the exact fact or relation each passage supports. Claim-level support can then be checked without treating a merely related document as a positive hit.
Collect questions from distinct failures
Sample real query shapes only where consent and access rules allow it. Add exact-ID requests, paraphrases, two-hop joins, table calculations, time-bounded questions, revoked documents, ambiguous names and no-answer cases. Synthetic queries are useful for rare traps, but they should be reviewed against an actual corpus snapshot. Keep a held-out set that prompt and ranker tuning cannot see. Otherwise the next release may memorize the test's wording instead of improving retrieval.
Make disagreement visible
Two reviewers should independently judge a difficult slice. If one marks a passage relevant because it mentions the same topic while the other requires the answer-bearing sentence, the rubric is incomplete. Record both labels and a resolution reason; do not silently average them. A third reviewer can adjudicate disputed examples. Store the rubric version with each label, because changing 'relevant' from topical to supporting changes every reported metric.
Lock the evaluation context
A query that was answerable on Monday may be unanswerable after a Tuesday deletion. Freeze or identify the corpus generation, permission policy and query-as-of time for each run. When the source changes, create a new judgment revision instead of overwriting the old one. Generation swaps and access rules are part of the test context, not incidental metadata.
Report slices with uncertainty
Measure recall at the candidate window, recall after reranking, citation support and abstention accuracy by question family. A single mean hides a catastrophic permission regression in a small slice. For a tiny slice, show counts along with percentages rather than implying precision the data cannot support. Attach first-loss traces for every regression; that makes adjudication and repair practical instead of a debate over one aggregate score.
Worked contract
from dataclasses import dataclass
@dataclass(frozen=True)
class Judgment:
question_id: str
corpus_generation: str
visible_passages: frozenset[str]
supporting_passages: frozenset[str]
candidate_passages: tuple[str, ...]
def recall_at_window(judgments: list[Judgment]) -> tuple[int, int]:
found = eligible = 0
for judgment in judgments:
gold = judgment.supporting_passages & judgment.visible_passages
if not gold:
continue
eligible += 1
found += bool(gold & set(judgment.candidate_passages))
return found, eligible
cases = [Judgment("q-47", "g-8", frozenset({"policy-r3"}),
frozenset({"policy-r3"}), ("policy-r3", "memo-r2")),
Judgment("q-48", "g-8", frozenset({"memo-r2"}),
frozenset({"private-r7"}), ("private-r7",)),
Judgment("q-49", "g-8", frozenset({"manual-r4"}),
frozenset({"manual-r4"}), ("notice-r1",))]
assert recall_at_window(cases) == (1, 2)Performance and operating cost
This simple metric scans each candidate list once, O(C) time for C total candidates, and builds temporary sets up to the window size. Human labeling and adjudication dominate cost. The example excludes questions with no eligible supporting passage; report those separately as no-answer and permission slices rather than burying them in recall.
Common Mistakes
- Treating a topical passage as if it supported the requested fact.
- Changing the corpus or permission scope while comparing two releases.
- Discarding reviewer disagreement instead of fixing the rubric.
- Reporting only a pooled metric that conceals no-answer or restricted-document failures.
Validation drill
Label 72 questions in six families, including 12 no-answer cases. Double-label 18 difficult examples and adjudicate disagreements before comparing two retrieval releases on the same corpus generation.
Read next
- Retrieval release gates: evaluate slices before changing an index
- Retrieval traces: locate the stage that lost the answer
- Claim-level citations: verify each answer against its passage
- Retrieval corpus contracts: identity, permissions and document lifecycle
