Skip to content

LearnRank & assemble

Reciprocal rank fusion

RRF

Merges several ranked lists into one by giving each document 1 / (k + rank) from every list that returned it, ignoring raw scores.

In DocSlurpIllustrated explainer

On this page

Keyword list BM25

  1. Ccharter-agreement.pdf p.2
  2. Ttravel-desk-guide.pdf p.3
  3. Acharter-agreement.pdf p.6
  4. Ptravel-desk-guide.pdf p.7

Vector list embeddings

  1. Llaunch-review.pdf p.5
  2. Ptravel-desk-guide.pdf p.7
  3. Ttravel-desk-guide.pdf p.3
  4. Acharter-agreement.pdf p.6

Fused sum of 1 / (k + rank)

  1. T0.0320
  2. P0.0318
  3. A0.0315
  4. C0.0164
  5. L0.0164
Agreement beats a single first place. At k = 60, T (ranked 2nd and 3rd) outranks C and L, which each topped only one list. Two bar segments mean both retrievers found it. Drag k toward 0 and lone winners jump back to the top: small k trusts the head of each list, large k trusts consensus.

The problem: two good lists that disagree

You ask “How fast can my assistant get the Learjet to London?” and run two searches. Keyword search puts charter-agreement.pdf first because it contains the exact word “Learjet”. Vector search puts the London launch review first because it talks about flying the team over, in different words. Both lists are reasonable. You can only show one.

The obvious move is to add up their scores. That fails. A BM25 score of 14.2 and a similarity of 0.83 aren’t on the same scale, and neither has a fixed maximum. BM25 scores grow with query length and corpus statistics; vector scores bunch together in a narrow band. Adding them lets whichever retriever uses bigger numbers win, regardless of which was right.

The trick: throw away the scores, keep the ranks

Reciprocal rank fusion ignores raw scores. It only asks where each list placed a document, and gives it a vote that shrinks with distance from the top:

RRF(d) = Σ over lists   1 / (k + rank of d in that list)

Ranks start at 1. A document a list didn’t return gets nothing from that list. The constant k (60 in the original paper) flattens the curve so the gap between rank 1 and rank 2 is small.

Work it through with the lists in the figure and k = 60:

Doc Keyword rank Vector rank Fused score
T travel-desk-guide.pdf p.3 2 3 1/62 + 1/63 = 0.03200
P travel-desk-guide.pdf p.7 4 2 1/64 + 1/62 = 0.03175
A charter-agreement.pdf p.6 3 4 1/63 + 1/64 = 0.03150
C charter-agreement.pdf p.2 1 — 1/61 = 0.01639
L launch-review.pdf p.5 — 1 1/61 = 0.01639

Nobody’s first place survives. T was never first anywhere, yet it wins because both retrievers independently ranked it near the top. That is RRF’s whole bet: two different methods agreeing is stronger evidence than one method being sure.

What k really controls

With k = 60, a document at rank 1 in one list earns 1/61. A document at rank r in both lists earns 2/(60 + r), which beats 1/61 whenever r < 62. In practice, being found by both retrievers almost always beats topping one.

Set k close to 0 and the curve becomes steep: rank 1 is worth 1, rank 2 is worth 0.5. Now a lone winner beats a pair of runners-up. Drag the slider in the figure to watch C and L climb back to the top as k falls. Small k trusts each list’s head; large k trusts consensus. The paper found 60 a robust default across collections, and most systems never change it.

Where it breaks

  • It can’t find what neither list found. Fusion only reorders candidates. If the passage with the answer is missing from every input list, RRF won’t conjure it. Fix recall upstream with better chunking, query rewriting or deeper candidate lists.
  • It throws away confidence. A vector hit at similarity 0.95 and one at 0.31 get the same vote if they share a rank. When one retriever is clearly unsure, RRF still listens to it.
  • The fused number isn’t a relevance score. 0.032 isn’t “3% relevant”. It is only meaningful for ordering within this query. Don’t threshold on it across queries.
  • Correlated lists add little. Two vector models trained on similar data tend to agree on the same mistakes. Fusion helps most when the inputs fail differently, as keyword and semantic search do.

When to reach for it

Use RRF whenever you combine retrievers whose scores aren’t comparable: keyword plus vector, several query rewrites, several embedding models, or several indexes. It needs no training data, no score normalization and no tuning beyond k. Spend the saved effort on a reranker over the fused shortlist, which can read the passages instead of just their positions.

In DocSlurp

In DocSlurp

Hybrid search fuses its keyword and vector candidate lists with RRF at k = 60 (core/server/src/search/rrf.ts). After fusion, results are re-scored by position as 1 / (1 + index), so the score you see is an ordinal, not the RRF sum. See retrieval controls.

Sources

Jump to