Why merge rankings instead of raw scores?
Dense-search similarity scores and BM25 scores are not naturally comparable. They are produced by different retrieval methods, have different ranges, and can shift as embeddings, analyzers, or corpus composition change.
RRF avoids treating either score as a universal relevance scale. It uses only each document's rank in a result list, making it a useful application-layer fusion strategy when Talqora-backed dense retrieval and Quickwit BM25 retrieval return separate candidate sets.
- Dense retrieval supports semantic matches and paraphrases.
- BM25 preserves strong signals from exact words and identifiers.
- Rank-based fusion reduces dependence on score calibration.
Fuse a dense list and a sparse list with RRF
For each query, request the top N candidates from dense search and the top N candidates from BM25. Give every returned document an RRF score based on its position in each list: score(document) = Σ 1 / (k + rank). A document absent from a list contributes nothing from that list.
The constant k softens the difference between adjacent positions. Keep it configurable, rather than embedding a value in business logic, so relevance testing can evaluate it alongside candidate depth and field-selection changes.
- Use stable document IDs to deduplicate candidates across both lists.
- Treat rank as one-based: the first result has rank 1.
- Sum contributions when a document appears in both result sets.
- Sort by the fused score, then apply a deterministic tie-breaker such as document ID.
Make fusion observable and testable
Log the dense rank, BM25 rank, and fused rank for the results shown to users. These fields make it possible to diagnose whether a poor answer was caused by candidate retrieval, fusion behavior, or a later stage such as reranking or generation.
Evaluate with a query set that includes both semantic questions and exact-match tasks. Product names, error codes, acronyms, and quoted phrases are particularly important because they reveal whether sparse retrieval remains available when dense similarity is less precise.
- Record the candidate depth requested from each retriever.
- Track which retrieval path contributed each final result.
- Include no-result and low-confidence queries in relevance reviews.
- Version query normalization, embedding selection, and BM25 configuration separately.
