Zenaique

Compute the RRF score for a candidate ranked 3 by dense and 5 by BM25

Predict output·Medium·4.0 · 0·~2 min·Asked atHarveyShopifySigmoid
Attempt it
A candidate document is ranked at position 3 by the dense retriever and position 5 by BM25. Using Reciprocal Rank Fusion with the standard k=60, compute the candidate's RRF score. Express as a decimal rounded to 5 decimal places.
TL;DR

Plug rank 3 and rank 5 with k=60 into 1/(k+rank); sum 1/63 + 1/65 ≈ 0.01587 + 0.01538 ≈ 0.03126.

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

Imagine two judges each list contestants in order of preference. A contestant comes third on one list and fifth on the other. To combine the lists fairly, each judge gives that contestant a small bonus. The bonus is one divided by a smoothing number plus the position. The smoothing number is 60 by convention, so the bonuses are about one over sixty-three and one over sixty-five. Add the two bonuses. You get about three hundredths. Notice how close the two bonuses are even though the positions differ by two slots. That closeness is the whole point: the smoothing number 60 keeps the early ranks from dwarfing each other.

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.

This question is a one-minute arithmetic check wrapped around a deeper conceptual probe. The arithmetic is small: plug two ranks into a four-term formula, evaluate the reciprocals, sum, and round. The interesting part is what the numbers tell you about why RRF was designed the way it was.

The formula is RRF(d) = sum over retrievers of 1/(k + rank). With k=60, dense rank 3, and BM25 rank 5, you get 1/63 + 1/65 ≈ 0.031258. Rounded to five decimal places, 0.03126.

The shape of the answer is more informative than the answer itself. The two contributions, 0.015873 and 0.015385, differ by less than 4% even though the underlying ranks differ by 67%. That compression is the whole reason k=60 is the convention rather than k=0 (raw reciprocal rank) or k=1000 (over-flattened curve). The mid-difficulty interview probe is checking that you both can do the arithmetic and can explain why the formula has this exact shape.

The arithmetic, step by step

Start with the formula and substitute the inputs.

The contribution from the dense retriever, where the document ranks at position 3, is 1 / (60 + 3) = 1/63. Computing the reciprocal: 1/63 = 0.01587301..., which rounds to 0.01587 at five decimal places.

The contribution from BM25, where the document ranks at position 5, is 1 / (60 + 5) = 1/65. Computing the reciprocal: 1/65 = 0.01538461..., which rounds to 0.01538.

Sum the two contributions: 0.01587 + 0.01538 = 0.03126 rounded; the more precise value is 0.01587301 + 0.01538461 = 0.03125762, which also rounds to 0.03126 at five decimal places.

That is the candidate's RRF score. It has no absolute meaning on its own; it is only useful as a relative ordering against other candidates' RRF scores. The candidate would rank higher than any document that appears in only one retriever's list and lower than a document ranked, say, position 1 in both retrievers (whose score would be 1/61 + 1/61 ≈ 0.0328).

Why the two contributions are nearly equal
What changes if you tweak k
Connecting the math back to hybrid retrieval
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 RRF retriever in 2026 uses exactly this `1/(k+rank)` formula with `k=60` as the default, and exposes the per-candidate contributions for debugging in the `_explanation` API.
  • Vespa's hybrid retrieval tutorial walks through the same arithmetic on a worked example, showing how `k=60` flattens rank differences between BM25 and dense retrievers.
Sign in to see more production examples.

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

QHow would the score change if `k` were set to 0 instead of 60?
A

At k=0, the formula becomes 1/rank, so the contributions are 1/3 ≈ 0.333 and 1/5 = 0.2, summing to 0.533. The dense retriever's contribution is 67% larger than BM25's, undoing the equal-voting property RRF was designed for. The score is also no longer dominated by rank agreement.

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 the smoothing constant in the denominator and computing one over 3 plus one over 5 instead. That gives 0.533, an order of magnitude wrong, and ignores the smoothing role of the constant.

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, naming the smoothing constant and the rank variable.

  • Plug two arbitrary ranks into the formula and compute the score under one minute.

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