Start studying
Module 8 · Embeddings & Search Module contents
Module 8  ·  Card 9 / 17intermediate

Reciprocal Rank Fusion

Reciprocal rank fusion merges two ranked lists into a single one.

Each document scores according to its position, so being near the top of either list counts.

It needs no scores at all, only the order, which is why it is so widely used.

That matters because keyword scores and vector scores are not on a comparable scale.

It is the usual way hybrid search combines sparse and dense results.

Learn in depth ↓
Module 08 · Embeddings & Search · 17 concepts
In depth  /  15 lines

Reciprocal Rank Fusion, in more detail

Reciprocal rank fusion merges several ranked lists into one.

It ignores the scores completely and uses only each document's position.

Each list contributes one divided by a constant plus the rank.

The constant, usually 60, stops the top position dominating everything else.

A document's final score is the sum of those contributions across all lists.

So being first in one list and absent from the other still scores respectably.

Being fifth in both usually beats being first in one and nowhere in the other.

Discarding the scores sounds wasteful and is the entire reason it works.

Keyword scores and vector scores have no common scale and no stable range.

Ranks are comparable by construction, so no normalisation is needed.

It has no parameters to tune beyond that one constant.

It handles any number of lists, so a third retriever slots in without redesign.

It is the standard way hybrid search is combined, and most vector databases offer it directly.

Its weakness is that a document ranked first with overwhelming confidence gets no extra credit.

Where score quality is genuinely comparable, weighted score fusion can edge it out.

Deep dive

What is underneath Reciprocal Rank Fusion

Merging by position, not by score

RRF(d)=∑r∈R1k+rankr(d)\mathrm{RRF}(d) = \sum_{r \in R} \frac{1}{k + \mathrm{rank}_r(d)}
  • RR: the set of result lists being merged.
  • rankr(d)\mathrm{rank}_r(d): the position of document dd in list rr, counting from 1.
  • kk: a constant, conventionally 60.

Each list contributes a value that depends only on where it placed the document, so two systems with wildly different score scales can be combined with no calibration at all.

A document missing from a list contributes nothing from it, which is the same as being ranked at infinity.

What the constant does

160+1=0.0164,160+2=0.0161\frac{1}{60 + 1} = 0.0164, \qquad \frac{1}{60 + 2} = 0.0161

With k=60k = 60 the gap between first and second place is about 2 percent, so a single list cannot dominate on the strength of its top hit alone.

11+1=0.5,11+2=0.333\frac{1}{1 + 1} = 0.5, \qquad \frac{1}{1 + 2} = 0.333

With k=1k = 1 the first place is worth half again as much as the second, and the fused ranking becomes almost entirely whichever list ranked it first.

So kk is the dial between trusting the top of each list and trusting agreement across lists. Large kk flattens the curve and rewards documents that several systems all liked.

k=60k = 60

That value comes from the original 2009 paper, it was tuned once on TREC data, and it has been copied ever since because it is rarely the limiting factor.

One fusion, in order

  1. Run each retriever independently and take its top kk list.
  2. For every document in any list, find its rank in each list it appears in.
  3. Add 1/(k+rank)1/(k + \mathrm{rank}) for each appearance.
  4. Sort by the total, highest first.
  5. Cut to the number of results the next stage can afford.

Why it beats score fusion in practice

sBM25∈[0,∞),scos∈[−1,1]s_{\mathrm{BM25}} \in [0, \infty), \qquad s_{\mathrm{cos}} \in [-1, 1]

Normalising scores requires knowing each system's distribution, which changes with the query, the corpus and the model version.

Rank fusion has no such dependency, so it does not need retuning when the embedding model is swapped, and it cannot be broken by one retriever returning unusually large numbers.

It also degrades gently. If one retriever is useless for a query, its contributions are spread across documents the others did not rank highly, and the others still decide the top.

What it throws away

rank 1 at 0.99≡rank 1 at 0.31\text{rank } 1 \text{ at } 0.99 \equiv \text{rank } 1 \text{ at } 0.31

Confidence is discarded. A retriever certain about its first result and one guessing between near-ties contribute identically.

That is a real loss when one system is well calibrated, and it is the reason a tuned weighted sum can still beat RRF on a corpus somebody has invested in measuring.

RRF(d)=∑rwrk+rankr(d)\mathrm{RRF}(d) = \sum_{r} \frac{w_r}{k + \mathrm{rank}_r(d)}

Weights can be added per list, which recovers some of the control while keeping the scale independence, and it is the usual compromise when one retriever is known to be stronger.

Test yourself

One question on this card. Every option explains itself once you pick, right or wrong.

Question 1
Why does reciprocal rank fusion use positions instead of scores?
Embeddings & Search

17 concepts in this module, then a graded test with every answer explained.

Study this module →
↑↓ move↵ openesc close