ld.← ALL FIELD NOTESTHE RELATED CASE STUDY ↗
FIELD NOTES / 03RANKING   ·   RETRIEVAL & RAG

How do you combine two different rankings?

Dense and sparse retrieval can find different useful results. Their scores, however, do not necessarily speak the same language.

The score problem

A dense similarity score might be between zero and one, while a BM25 score can be on a very different scale depending on the query and dataset. Adding the raw scores would give their magnitudes meaning they do not necessarily have.

Reciprocal Rank Fusion (RRF) takes a different approach: it combines where a document appears in each ranked list, rather than comparing the systems’ raw scores.

RECIPROCAL RANK FUSION
RRF(d) = Σ 1 / (k + rank(d))

For each result list, add the reciprocal of the document’s rank plus k.

A small example

Suppose dense retrieval ranks A, B, C, while sparse retrieval ranks C, A, D. With k = 60, A scores 1/61 + 1/62 ≈ 0.0325; C scores 1/63 + 1/61 ≈ 0.0323.

Both surface strongly because they appear near the top of both lists. The constant k controls how much weight goes to the highest ranks. RRF is useful here because it combines complementary signals without calibrating their scores to the same scale.

ONE QUERY / TWO RANKINGS
DENSEA → B → C
SPARSEC → A → D
FUSED / k = 60A ≈ .0325
C ≈ .0323

The bigger lesson

The interesting part is not that one retrieval method is always better. It is that different methods can contribute useful evidence—and the pipeline needs a thoughtful way to bring that evidence together.

Continue the conversation

KEEP READING / 02Why dense and sparse search work together.

Another note from the notebook.