Ranking error analysis by query class
Localize ranking failures and uncertainty with per-query evidence, class denominators, paired comparisons, and stable judgment policies.
On this page
The question for today
What you’ll understand
- Distinguish traffic-weighted aggregate quality from macro class quality.
- Locate failures at analysis, candidates, reranking, or final evidence selection.
- Report label uncertainty and sample support without turning small slices into certainty.
An overall ranking improvement can hide a severe regression on rare identifiers, negated questions, another language, or recent facts. Error analysis should identify which stage lost the evidence and how certain the relevance verdict is. DPR’s qualitative comparisons and BEIR’s heterogeneous evaluation motivate looking beyond one average, while NIST’s judgment research warns against treating every label disagreement as a definitive model failure.
Define classes before chasing attractive examples
Choose useful classes from the task: exact identifiers, compositional questions, temporal constraints, languages, ambiguous intents, or document formats. Record how queries enter a class and allow overlapping categories when the analysis requires them, while avoiding double counting in a mutually exclusive aggregate. Include class sizes and the traffic distribution. A class mean based on a few handpicked failures is a diagnostic illustration, not a population estimate. Keep discovered examples separate from the held-out set used to assess the final correction.
Inspect the full path for each error. Was the relevant content indexed and eligible? Did analysis preserve the identifier or negation? Did either retriever return it? Did fusion retain it at the reranker cutoff? Did the reranker see the decisive passage, and did diversity selection discard it? Preserve candidate identities, scores, ranks, and visible text so these questions have evidence. A wrong final answer can arise even with good retrieval, while a reranker cannot repair content absent from every candidate list.
Compare systems on matched queries and labels
A paired comparison uses the same queries, corpus snapshot, candidate eligibility, and judgment policy for both systems. Report the distribution of per-query differences as well as the mean: a small gain on common easy queries can offset large losses elsewhere. Query-level resampling can estimate uncertainty under a declared sampling model, but related queries, repeated users, or time clusters may require grouped treatment. Repeatedly searching many slices and reporting only the most favorable one creates selection bias. Reserve fresh evaluation for changes motivated by exploratory findings.
Ground-truth uncertainty deserves its own category. An unjudged passage, disputed interpretation, outdated annotation, or partial-support document can make a metric difference ambiguous. Collect blinded supplementary judgments where they affect the comparison, retaining assessor disagreement and provenance. Do not force every inspected case into either retriever failure or success when the evidence is unresolved. Separate observed errors, suspected label errors, and unknowns, then explain which conclusion would change under plausible alternate judgments. Confidence in a stage diagnosis should follow the available evidence.
Turn a diagnosis into a testable correction
Change the component implicated by the trace. A tokenizer fix, broader candidate branch, new reviewed hard negatives, reranker input repair, or different diversity policy addresses different failure mechanisms. Compare the corrected system against the same baseline, checking neighboring classes and latency costs for regressions. Keep uncertainty and sample size visible when deciding whether a change is supported. A dramatic example can justify an investigation, but a deployment claim needs a stable evaluation protocol and representative evidence.
The probability lab illustrates sample-size sensitivity for a hypothetical independent binary hit event. Reset, set p to 0.8 and trials to 10, predict mean count, then Step: eight. Compare a fresh Reset with both p at 0.8 and trials at 30 before Step: twenty-four. Dividing count variance by the squared trial count gives different mean variances. This exact binomial instrument is not the distribution of NDCG, does not resample real queries, and cannot resolve uncertain relevance judgments or estimate a class’s unknown true rate.
Work it through
An aggregate gain can hide a class regression
For a hypothetical normalized per-query ranking metric, 90 head queries have class mean 0.9 under A and 0.95 under B. Ten tail queries have mean 0.4 under A and 0.2 under B. Treat these as supplied class means on the same judged queries. Compare traffic-weighted and macro means.
A’s traffic-weighted mean is (90 × 0.9 + 10 × 0.4)/100 = 0.85. B’s is (90 × 0.95 + 10 × 0.2)/100 = 0.875, an aggregate increase of 0.025.
The head class gains 0.05 while the tail loses 0.2. Equal-class macro means are (0.9 + 0.4)/2 = 0.65 and (0.95 + 0.2)/2 = 0.575, a decrease of 0.075.
Inspect tail traces and judgment coverage before deciding whether the tradeoff is acceptable. The two summaries encode different weights; neither arithmetic result establishes that the supplied labels are complete or that the tail regression is harmless.
Averages answer the weighting question they encode, so class outcomes and evidence remain necessary.
The living notebook
Explore the model
Interactive lab · probability
Sample-size sensitivity under an assumed hit model
Reset, set p = 0.8 and n = 10, predict mean hits, then Step: eight. Compare a fresh Reset with both p = 0.8 and n = 30 before Step: twenty-four. This exact independent-binomial model is not a query bootstrap, an NDCG distribution, or an estimate of a real class’s unknown hit rate.
- Mean · np
- 5
- Variance · np(1−p)
- 2.5
- Total probability
- 1
These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forClass size affects evidence precision, while real query dependence and label uncertainty require separate analysis.
Pause & reason
Check your understanding
Your turn
Try it yourself
Two mutually exclusive classes have 80 and 20 queries. A’s class means are 0.8 and 0.5; B’s are 0.85 and 0.4 for the same normalized metric and judged queries. Compute traffic-weighted and macro means and state one uncertainty to investigate.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Weight by class counts for the first mean and equally by classes for the second.
Compare with the solution
Traffic means are A = (64 + 10)/100 = 0.74 and B = (68 + 8)/100 = 0.76. Macro means are A = 0.65 and B = 0.625. The aggregate rises 0.02 while macro falls 0.025. Investigate the smaller class’s candidate misses, visibility and reranking behavior, alongside unjudged or disputed evidence and its sample support; the means alone cannot determine the cause or acceptable utility tradeoff.
Keep the idea
Take it with you
- Report class denominators and weighting choices alongside aggregate ranking quality.
- Trace evidence through each retrieval stage before choosing a correction.
- Paired comparisons, representative queries, and judgment uncertainty determine the strength of a conclusion.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.