Database / LanceDB Interview questions
What is Reciprocal Rank Fusion (RRF), and how is it used in LanceDB?
Reciprocal Rank Fusion is a rank-based method for combining multiple ranked result lists into one unified ranking, by giving each item a score based on the reciprocal of its position (rank) in each list it appears in, then summing those reciprocal scores across all the lists it's present in.
from lancedb.rerankers import RRFReranker reranker = RRFReranker(k=60) # k is a smoothing constant results = table.search(query, query_type="hybrid").rerank(reranker=reranker).limit(10).to_list()
The formula for one item's RRF score in a given list is roughly 1 / (k + rank), where rank is that item's position (starting from 1) in that particular ranked list and k is a smoothing constant that reduces the influence of very high ranks; an item's final score is the sum of this value across every list it appears in, so items ranking well in both the vector and keyword results end up scored highest overall.
RRF is popular specifically because it requires no score normalization or calibration between the underlying search methods — it only needs the rank ordering from each, not the raw, differently-scaled relevance scores — making it a simple, robust default for combining fundamentally different kinds of search results.
More Related questions...