Reciprocal-rank fusion and score combination
Combine ranked lists with explicit truncation and tie policies, or combine comparable features with validated scales and weights.
On this page
The question for today
What you’ll understand
- Calculate reciprocal-rank fusion with declared rank and absence conventions.
- Explain why rank fusion avoids raw-score scale alignment but loses score gaps.
- Evaluate score normalization and learned weights without claiming automatic calibration.
A lexical retriever and a dense retriever can each find evidence the other misses, but their raw scores have different scales and meanings. Reciprocal-rank fusion combines positions instead of raw values. A score-combination model can preserve richer information but needs an explicit feature and normalization contract. This lesson follows the original RRF paper while keeping its reported experimental success separate from a guarantee for every collection or query.
Declare what each ranked list contains
Use stable document identities before combining lists, especially when one branch returns chunks and another returns whole documents. Deduplication and document aggregation can change ranks and must be defined. For the practical truncated-list convention used here, an absent document contributes zero from that branch. It is not assigned an imaginary rank just below the cutoff. Increasing one branch’s depth can therefore change a fused score even when its top results are unchanged. Report branch cutoffs together with the fusion parameter.
Ranks begin at one in the displayed formula. A larger positive k reduces the relative advantage of the top few positions; the original paper fixed k at 60 after a pilot study. That choice is an experimental configuration, not a universal optimum. Ties need a documented policy, such as deterministic ordering before assigning ordinal ranks or a declared shared-rank scheme. Missing candidates and duplicate lists also matter: copying the same list twice supplies extra weight, not independent new relevance evidence.
Raw-score fusion requires a scale contract
A linear combination of BM25 and dense scores can be dominated by whichever feature has the larger numeric range, even if that feature is less useful. Specify transforms, missing-feature handling, and weights fitted on held-out queries. A per-query min-max transform can be sensitive to one outlier and undefined for a constant list without a fallback; z-score normalization also requires a meaningful spread estimate. Normalization changes feature scale but does not prove probability calibration. Evaluate it as part of the ranking system.
Rank fusion is invariant to strictly increasing transforms that preserve each list’s order, while a weighted raw-score sum usually is not. That robustness costs information: a narrow margin and a huge margin receive the same rank contribution. Choose based on observed query classes, candidate recall, latency, and labels rather than a belief that one fusion family is inherently safe. Correlated retrievers can reinforce the same mistakes, so a second branch’s existence alone does not establish useful complementarity.
Compare fusion with the same candidate evidence
Start with held-out queries and log every branch rank, raw score, transformed score, and final decision for inspected errors. Compare each branch alone, their candidate union, and the final ordering to locate whether an improvement comes from coverage or ranking. Freeze the judgment policy and audit novel unjudged documents. If a learned fusion model uses query features, split evaluation by query and time so the model cannot memorize related documents or benefit from labels that would not exist in deployment.
The vector lab provides coefficients for a separate hand calculation only. Reset, set angle to 0 degrees and magnitude to 1, predict components, then Step: the coefficient vector is (1,0). Compare a fresh Reset with both angle at 90 degrees and magnitude at 1 before Step: (0,1). For fixed features A = (0.9,0.2) and B = (0.3,0.8), compute their dot products by hand and observe the winner changes. The instrument does not fuse ranked lists or learn weights.
Work it through
Consistent high ranks can beat one first place
Use two truncated lists with k = 60 and one-based ranks. Document A appears at ranks one and ten; B appears at ranks two and two. Neither is absent. Calculate RRF and identify what the result does not tell you.
A receives 1/61 + 1/70, approximately 0.0306792. Its first place is tempered by the weaker second-list position.
B receives 1/62 + 1/62 = 1/31, approximately 0.0322581, so B ranks above A after fusion.
This ordering uses only positions, not raw score gaps or relevance judgments. It does not establish that B is actually more relevant; compare that claim against the task’s held-out evidence.
RRF rewards agreement in high positions under its declared rule while avoiding direct alignment of raw score scales.
The living notebook
Explore the model
Interactive lab · vectors
Feature-combination coefficients as a hand calculation
Reset, set θ = 0° and r = 1, predict components, then Step: (1,0). Compare a fresh Reset with both θ = 90° and r = 1 before Step: (0,1). Use these components as coefficients for the fixed feature pairs in the lesson; the instrument itself does not rank documents, perform RRF, or train fusion weights.
- x component
- 1.393
- y component
- 0.975
- Magnitude
- 1.7
Playback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. 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 forChanging feature weights can change a winner, so score scales and the weighting contract matter.
Pause & reason
Check your understanding
Your turn
Try it yourself
With k = 10, A appears only at rank one in one list, while B appears at rank two in both lists. Under the declared absent-contributes-zero convention, compute each RRF score. Then use coefficients (1,0) and (0,1) on A = (0.9,0.2), B = (0.3,0.8).
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Do not invent a second rank for absent A. The coefficient example is a separate score-combination illustration.
Compare with the solution
RRF gives A = 1/11, approximately 0.09091, and B = 2/12, approximately 0.16667, so B wins. In the separate feature example, coefficients (1,0) yield 0.9 versus 0.3 and favor A; (0,1) yield 0.2 versus 0.8 and favor B. Neither result establishes which document is relevant without judgments.
Keep the idea
Take it with you
- RRF requires declared ranks, tie handling, candidate identities, and cutoff conventions.
- Rank fusion avoids raw-score scale matching while losing score-gap information.
- Score combination needs validated transforms and weights rather than assumed comparability.
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.