Section 7 · Learn · Retrieval
Reciprocal Rank Fusion
Merging ranked lists using each item's rank position rather than its score, so incomparable scoring scales never have to be reconciled.
Merging ranked lists using each item's rank position rather than its score, so incomparable scoring scales never have to be reconciled.
What it is
Each list contributes 1/(k + rank) for every item it ranks. Contributions are summed, and the total orders the fused list.
Why it is needed
This is the step most people get wrong. BM25 scores are unbounded and query-dependent; cosine similarities sit in a narrow band near 1. Normalising them to a common scale requires assumptions that are wrong in different ways for every query. Rank sidesteps the problem entirely — rank 3 means rank 3 in any scale.
How it works
The constant k (60 here, the value from the original paper) damps the influence of the very top ranks. Without it, a single first place would dominate everything. With it, appearing in both lists at middling rank beats appearing first in one and nowhere in the other.
Formula
RRF(d) = sum over lists L of 1 / (k + rank_L(d)) k = 60 A passage at rank 1 in one list only: 1/61 = 0.016393 A passage at rank 5 in both lists: 2 * 1/65 = 0.030769
- rank_L(d)
- 1-indexed position of d in list L; absent means no contribution
- k = 60
- damping constant from the original paper; larger flattens the top ranks further
In this project
Shown in the walkthrough: expanding a fused result reveals its actual arithmetic, for example lexical 1/(60+3) plus dense 1/(60+11) equals 0.029968. The reader watches ranks combine rather than reading the formula.
Trade-offs
Advantages
- No score normalisation, no calibration
- Robust when one retriever misbehaves
- Rewards agreement across retrievers
Limitations
- Discards score magnitude, including confidence
- k is a tuned constant with no principled derivation
- Cannot express that one retriever is more trustworthy
Common mistakes
- Using 0 for a missing rank instead of no contribution
- Tuning k per query, which overfits immediately
When to use it
Reach for it when
- Merging retrievers whose scores are not comparable
Avoid it when
- When scores are genuinely calibrated and comparable
How it interacts with the rest of the system
BM25 and lexical searchEmbeddings and dense retrievalHybrid retrievalCross-encoder reranking