16/38
Part 3 of 6 · RetrievalLearn and do

Fuse the two lists by rank, with RRF

Here is one fusion worked by hand. BM25 returns P7, P2, P9, P4, P1. Dense retrieval, the vector search, returns P2, P5, P7, P1, P8.

PolicyBM25 rankDense rankRRF score at k = 60
P2211/62 + 1/61 = 0.03252
P7131/61 + 1/63 = 0.03227
P1541/65 + 1/64 = 0.03101
P521/62 = 0.01613
P931/63 = 0.01587
P441/64 = 0.01563
P851/65 = 0.01538

BM25 scores and cosine similarities sit on different scales, and neither is calibrated across queries. Reciprocal rank fusion, or RRF, skips the scores and uses only ranks. Cormack, Clarke and Büttcher's formula:

RRF(d)=∑r∈R1k+r(d)\text{RRF}(d) = \sum_{r \in R} \frac{1}{k + r(d)}

RR is the set of ranked lists, and r(d)r(d) is document dd's rank in list rr. Each list adds 1 over kk plus that rank. A list that doesn't contain dd adds nothing. So P5, second in dense retrieval only, scores 1/62 = 0.01613.

Every policy both retrievers found beats every policy only one found, even P1, which neither ranked above fourth. At k=60k = 60, rank 1 and rank 5 inside one list differ only a little, 1/61 against 1/65. Showing up in both lists nearly doubles the score.

That's the constant's job. The paper says kk softens the effect of a high rank from an outlier system. Set k=0k = 0 and P5, second in one list, scores 0.50 and passes P1's 0.45, though both retrievers found P1.

The authors fixed k=60k = 60 during a pilot and didn't change it afterward. Their pilot showed 60 was near-optimal, and that the choice wasn't critical.

In the editor, write rrf(rankings, k=60): the formula above, for any number of ranked lists. The table's two lists make a good test.