Zenaique

Complete the Reciprocal Rank Fusion (RRF) score formula

Fill in blank·Medium·4.0 · 0·~1 min·Asked atCohereRobloxUipath
Attempt it
Reciprocal Rank Fusion combines two ranked retrieval results by summing for each candidate across retrievers, where k is a small constant (commonly 60) and rank is the candidate's in each retriever's result list.
TL;DR

RRF sums 1/(k+rank) over retrievers, where rank is the candidate's position in each retriever's result list and k smooths the curve.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Picture two judges scoring contestants but on totally different scales. One scores out of ten, the other out of a hundred. You cannot just add their numbers; the bigger scale would always win. A fair fix is to ignore the raw numbers and only use the ranking. Each judge says who is first, second, third. You give every contestant a small bonus when a judge ranks them high, and a much smaller bonus when ranked low. Add the bonuses across judges and that is the final score. The bonus for rank position uses a soft slope so first place and second place do not differ by miles. That soft slope is the small number called k. Reciprocal Rank Fusion is exactly this trick applied to search results.

Key concepts

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

Reciprocal Rank Fusion is the workhorse fusion algorithm of modern hybrid retrieval. Every production retrieval stack that combines dense and sparse retrievers (and that is most of them in 2026) eventually meets RRF as the default first thing they try, and most stop there because nothing reliably beats it without a serious investment in labeled data and learned rerankers.

The formula is small enough to write on a napkin. For each candidate document, the RRF score is the sum over retrievers of 1 / (k + rank), where rank is the candidate's position in that retriever's ranked list and k is a smoothing constant conventionally fixed at 60. Sort by RRF score and that is the fused ranking.

The interview question asks you to fill in two blanks: the per-retriever contribution and the variable in the denominator. The first is 1/(k+rank) and the second is rank (or position). Getting the formula right is the surface skill. Understanding why it has the shape it has, and why every piece is doing structural work, is the deeper skill the question is probing.

Why ranks instead of raw scores

The single most important property of RRF is that it operates on ranks, not on the raw scores produced by each retriever. This is what makes it robust to the score-calibration problem that plagues score-level fusion.

BM25 produces unbounded log-domain scores whose typical magnitude depends on corpus statistics: the total number of documents, the average document length, the idf curve of the vocabulary. Cosine similarity sits in a bounded interval that varies by embedding model and by whether the vectors are unit-normalized. The two distributions are not just on different scales; they have different shapes, and the shapes drift with corpus and query distribution.

Any fusion that consumes raw scores has to bridge that gap, usually with a normalization step (min-max, z-score, or learned). That normalization works on the eval set you tuned on and quietly fails when the distribution shifts. Ranks sidestep the problem entirely: ranks are invariant under any monotonic transform of the score, so rank-level fusion inherits no calibration burden when corpora change or models get swapped.

The practical consequence is that you can ship RRF once and stop worrying about whether your fusion is still calibrated next quarter.

Why `+ k` is the load-bearing piece
Where the value 60 came from
The shape of the fused ranking in practice
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • Elastic's hybrid retrieval API ships `rrf` as a named retriever with `k` defaulting to 60, paired with dense vector and BM25 sub-retrievers.
  • Vespa documents RRF as the canonical hybrid fusion with the exact `1/(k+rank)` formula and `k=60` default in its 2026 retrieval guide.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QWhy does the `+ k` term in RRF matter, and what would happen at `k=0`?
A

At k=0 the contribution for rank 1 is 1.0 and rank 2 is 0.5. That dwarfs every later contribution, so the fusion behaves like a winner takes all over the rank-1 candidates from each retriever. The + k term flattens the top of the curve so being in the top 10 of both retrievers wins over rank 1 in only one.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Forgetting that RRF works on ranks, not raw scores. Replacing rank with the cosine or BM25 score gives a fundamentally different (and worse) fusion.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Write the RRF formula from memory, including the smoothing constant.

  • State why the formula uses ranks rather than raw scores.

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Why is cosine similarity preferred over Euclidean distance for text embeddings?
Flashcard·Easy