Reciprocal Rank Fusion for Result Merging
You'll learn: How to intelligently combine ranked results from multiple retrieval methods (like dense vector search and BM25) into a single, unified ranking.
The Core Challenge
When you run hybrid search—combining dense embeddings and sparse lexical retrieval—you get two separate ranked lists of documents. But which results should you actually return to the user? Simply concatenating lists doesn't work well because:
- Different retrieval methods score on incompatible scales (cosine similarity vs. BM25 scores)
- The same document might appear in both lists at different positions
- You need a fair way to value each retrieval strategy's opinion
How Reciprocal Rank Fusion Works
Reciprocal Rank Fusion (RRF) is an elegant, score-free merging technique. Instead of trying to normalize incompatible scores, it uses rank positions.
The formula: For each document, sum up 1 / (k + rank) across all retrieval methods where it appears.
rank= position in that result list (1st, 2nd, 3rd...)k= a constant (usually 60) that prevents top-ranked items from dominating
Think of it like a voting system: A document appearing at position 1 in dense search and position 3 in BM25 gets credit from both "voters." The reciprocal nature means higher ranks contribute more, but diminishingly so.
Why It Works
RRF naturally handles:
- Different scoring scales (rank position is universal)
- Duplicate documents (scores simply add up)
- Missing documents (no contribution from that retrieval method)
- Balanced fusion (no method dominates unfairly)
The constant k=60 ensures that even mid-ranked documents get meaningful consideration—a document at rank 60 still contributes 1/120 to its total score.
Key Takeaway: Reciprocal Rank Fusion provides a simple, score-agnostic way to merge results from multiple retrieval strategies by leveraging rank positions instead of raw scores, making hybrid search practical and effective.