Crucible
Retrieval metrics
Answer quality can hide a broken retriever: a model can paper over a missing source, and a good answer can ride on evidence that only landed by luck. Retrieval metrics score the retrieval pipeline on its own terms— did it find the right chunks, and did it rank them well — using the standard information-retrieval measures, computed as pure, deterministic functions over the run's ranked results and the golden set's graded relevance judgments (qrels). They are the component-mode half of the evaluation framework.
The inputs
Every metric is a pure function of two things: the ranked list the retriever returned (doc or chunk ids, best first) and a qrels map from id to graded relevance. Grades are 0–3 in the TREC tradition — 0 irrelevant, 1 marginal, 2 relevant, 3 perfectly relevant. Binary metrics (recall, precision, hit, MRR) treat any grade ≥ 1 as relevant; graded metrics (nDCG) use the full scale. No model runs at scoring time, so the numbers are reproducible to the last digit.
The five measures
- recall@k — of all the relevant chunks that exist for this query (per qrels), how many are in the top
k? The direct measure of whether retrieval found the evidence. Low recall means the answer never had a chance — aretrieval_miss, not a generation failure. - precision@k — of the top
kthe retriever returned, how many are relevant? The measure of noise in the context window — low precision is what feeds thenoise_sensitivityfailures downstream. - hit@k — a blunt 0/1: did any relevant chunk make the top
k? The floor below which an answer is impossible. - MRR (mean reciprocal rank) —
1 / (rank of the first relevant result). Rewards putting a relevant chunk early; the difference between rank 1 and rank 5 is the difference between1.0and0.2. - nDCG@10 — the graded, rank-weighted headline. It rewards placing the most relevant chunks at the top, and it is the metric that uses the full 0–3 scale rather than collapsing it to relevant/not.
nDCG with exponential gain — pinned and documented
There are two conventions for DCG's gain function, and they give different numbers, so the choice is pinned and stated rather than left implicit. This implementation uses the exponential gain:
The exponential form 2^rel − 1 is the one used by TREC web tracks and the LETOR learning-to-rank benchmarks (it is the gain LambdaMART optimizes), and it is deliberately super-linear: a grade-3 chunk is worth 7, a grade-1 chunk only 1, so surfacing one perfectly-relevant result matters far more than surfacing several marginal ones. The alternative — linear gain, where the gain is just the grade — under-weights the highly-relevant results this platform cares about most. Both are "nDCG"; reporting which one is the difference between a comparable number and a meaningless one.
A worked example
Suppose the qrels grade three chunks — A=3, B=2, C=1 — and everything else 0, and the retriever returns [B, X, A, C] (X is irrelevant):
The metrics disagree on purpose. Recall says "everything was found"; nDCG's 0.738says "but the ordering left points on the table" — the grade-3 chunk A sat at rank 3 behind a distractor. That gap is exactly what a reranker is meant to close, and this is how you prove it did.
Where they surface
Each eval result carries a retrievalMetrics object — { recallAtK, precisionAtK, ndcgAt10, mrr, hitAtK }— computed against that item's qrels using the config's defaultRetrievalK (default 10). They roll up per run and per question facet (type, popularity, dynamism), read back over GET /api/v1/evals/runs/{id}/metrics, and render in the retrieval-metrics panel of the evals dashboard alongside the AURC / risk–coverage chart. In component mode the runner computes these without generating an answer — a fast, cheap loop for tuning the retriever before spending a single generation token.
Deterministic by construction
Next