Why merge ranks instead of raw scores?
Dense similarity scores and BM25 scores are not naturally comparable. Their scales depend on the embedding model, similarity metric, query length, corpus composition, tokenization, and BM25 configuration. Adding the two values directly can make one retrieval path dominate for reasons unrelated to relevance.
RRF avoids score calibration by using rank position only. If a document appears near the top of either list, it receives a useful contribution. Documents that rank well in both lists rise naturally, but an exact-match result from BM25 or a semantic match from dense search can still surface when the other method misses it.
- Use dense retrieval for semantic similarity and paraphrased queries.
- Use BM25 for literal terminology, IDs, filenames, and rare phrases.
- Keep the result lists independent before fusion.
- Treat rank fusion as an application-layer retrieval policy.
Apply reciprocal rank fusion
For each candidate document d, RRF computes a combined score by summing a contribution from every ranked list in which d appears: score(d) = Σ 1 / (k + rank_i(d)). The rank starts at 1, and k is a smoothing constant that reduces the difference between adjacent positions near the top of a list.
For example, an application can request a candidate set from Talqora's dense path, backed by regional S3 Vectors, and another from its sparse path, backed by Quickwit BM25. It can then deduplicate document IDs and calculate RRF over the two returned rankings. The fused order becomes the candidate set for presentation or a later reranking stage.
- Retrieve more candidates than the number ultimately displayed.
- Use a stable document identifier to deduplicate results across both paths.
- Start with the same candidate depth for dense and sparse retrieval.
- Log each document's source ranks alongside its fused rank for debugging.
Validate fusion with query slices
A hybrid strategy should be evaluated by query type, not only by an aggregate relevance number. Build a small review set containing exact product names, support-style questions, acronym-heavy queries, natural-language questions, and queries with ambiguous wording. Compare dense-only, BM25-only, and fused top results for each slice.
When a fused result looks wrong, inspect whether it was promoted by broad agreement between weak ranks or by a strong rank from one path. This diagnosis helps identify whether the next change should be better document chunking, improved metadata filters, a different candidate depth, or a reranking step rather than a wholesale change to retrieval.
- Review failures involving exact strings separately from semantic questions.
- Measure whether relevant documents enter the candidate set before judging final ordering.
- Watch for duplicate chunks from the same source overwhelming the fused list.
- Version fusion parameters and evaluation sets so tuning remains reproducible.
