Hypothetical scenario. Northwind’s approximate-search comparison exposes another mismatch. Maya’s exact policy identifier is easy to find lexically, while Dev’s paraphrased question works better with dense retrieval. Priya asks how the two lists should meet.
Maya: “One query names the identifier; the other describes what it means.”
Dev: “We can retain both candidate lists and fuse their ranks.”
Priya: “Do not average their raw scores as if the scales meant the same thing.”
You will connect BM25 and dense retrieval to reciprocal rank fusion, then explain how a cross-encoder jointly scores selected query-document pairs. Keep candidate coverage, deduplication and reranking work distinct.
How should different matching signals meet?
A bi-encoder computes query and document representations separately, allowing document vectors to be indexed ahead of time. A cross-encoder processes a query-document pair jointly and emits a pair score. It can examine interactions that a single stored vector comparison does not expose, but must process each selected pair. Sentence Transformers' cross-encoder documentation describes this retrieve-then-rerank pattern.
Hypothetical scenario. Dense retrieval returns 30 IDs and BM25 returns 20, with 10 shared IDs. The union contains 30 + 20 − 10 = 40 unique candidates. Reranking every candidate therefore requires 40 pair evaluations for one query, not 50. Choosing only ten fused candidates reduces that work to ten but may discard the needed passage before the cross-encoder sees it. Keep candidate omission distinct from reranking error.
Hypothetical scenario. Vector search misses an exact product identifier that keyword search finds immediately.
In short. Retrieve lexical and semantic candidates separately. Fuse ranks without equating incompatible scores.
The right passage never reaches the reranker
Hypothetical scenario. A product assistant answers broad questions well but misses an exact error identifier. The team adds a sophisticated reranker, yet the relevant passage remains absent because the first retrieval stage never selected it. Improving the second stage cannot recover a candidate it never receives.
This lesson extends the basic evidence path with multiple candidate sources and a separate ranking stage. Scope includes lexical and embedding candidates, identity-aware fusion, bounded reranking and stage-specific evaluation. It does not promise one universal hybrid configuration.
The decision is where additional work addresses the actual failure. Exact identifiers, paraphrases and ambiguous queries can benefit from different signals, but adding signals also adds compatibility, deduplication, permission and cost obligations.
Keep fusion and reranking as separate handoffs
Hypothetical scenario. Lexical retrieval finds an exact part number while dense retrieval finds a paraphrase. Fuse ranked identities under a declared policy, deduplicate source revisions and send a bounded candidate set to a cross-encoder. The cross-encoder sees only what candidate generation preserved.
| Artifact | Concrete evidence | Decision boundary |
|---|---|---|
| Lexical result | identity, rank, source revision | Exact-term signal |
| Dense result | identity, rank, compatible space | Semantic signal |
| Rerank input | deduplicated eligible candidates | Bounded second-stage work |
Reciprocal rank fusion uses rank positions rather than assuming unrelated raw scores share a scale. Choose the fusion constant and candidate limits as evaluation configuration. Current permission applies before disclosing content to the reranker as well as before the final answer. If an identifier must resolve exactly, keep that contract distinct from approximate relevance. Diagnose candidate omission separately from reranker misordering so a larger model is not asked to fix invisible evidence.
Adding incompatible scores is not a ranking policy
A lexical score and a vector similarity value can use different ranges and meanings. Adding their raw numbers can let one scale dominate without a justified relationship to relevance. Equal weights do not establish equal influence.
Rank-based fusion avoids depending directly on those raw score scales, but substitutes its own assumptions about list position and contribution. Learned or calibrated fusion offers another route when appropriate data exists. All require evaluation on the intended query families.
Candidate identity matters before fusion. Two chunks from one source can be distinct useful passages or near-duplicates wasting the budget. Decide whether the ranking unit is a document, passage or source region, and preserve source versions through deduplication.
Build two stages with an explicit handoff
Retrieve bounded eligible candidate lists from the selected lexical and semantic paths. Normalize source identities and remove only duplicates under the declared unit. Apply a fusion policy, then send a bounded candidate set to the more expensive reranking stage.
Reciprocal Rank Fusion is one concrete rank-combination method. Its contribution from a list uses the reciprocal of a constant plus the candidate's rank. The constant and available lists affect the result; the method is not proof that every hybrid retrieval system improves.
A reranker can evaluate a query-candidate relationship using more context than the first-stage similarity lookup. It still needs the relevant evidence in its input and a meaningful training or evaluation scope. Enforce permission and version rules before expanding candidate text.
Apply Hybrid Retrieval: Fusing BM25 and Vectors, Then Reranking at the acceptance boundary
Hybrid retrieval combines candidate signals that fail in different ways. Lexical matching can preserve an exact identifier while a dense representation can connect different wording. A reranker compares candidates already supplied to it. None of those stages can repair a missing source record by asserting a more confident final answer.
Use a hypothetical lexical list containing forty eligible documents and a dense list containing fifty. If twenty document identities occur in both, the combined unique set has 40 + 50 − 20 = 70 documents. Adding the list lengths and claiming ninety independent candidates would count the intersection twice. Preserve stable document identities before fusion and deduplication.
Rank-based fusion can avoid pretending that unrelated raw score scales are calibrated. Under an illustrative reciprocal-rank rule with constant sixty, ranks one and ten contribute 1 / 61 and 1 / 70 respectively. Those contributions are ranking signals under the chosen rule, not probabilities that a document contains the correct answer. Choose and compare the rule on the required task rather than interpreting its numeric output as an acceptance confidence.
A reranking budget should also name the material crossing a service boundary. If seventy candidates each provide two hundred illustrative tokens, the supplied candidate text totals 70 × 200 = 14,000 tokens before request wrappers. A smaller reranking set changes that workload and can remove useful evidence. Permission and source-version checks must govern the material before it is sent to a provider, not only the text eventually shown in the answer.
Evaluate candidate coverage, ranking quality and supported answers separately. A stronger reranker is a reasonable candidate when good evidence is present but ordered poorly. If the needed passage was absent or withdrawn, investigate source publication, chunking and candidate generation instead. Keep the tested corpus, query slices, fusion settings and reranker identity together so a release and its rollback refer to a coherent evidence path.
Derive a fusion result and candidate budget
Hypothetical scenario. Choose a fusion constant of ten. Candidate A appears at rank one in the lexical list and rank five in the semantic list. Its score is 1 ÷ (10 +1) +1 ÷ (10 +5) = 1/11 +1/15 ≈0.15758.
Candidate B appears at rank two in both lists. Its score is 1/12 +1/12 ≈0.16667. Under this chosen rule, B ranks above A despite A being first in one list. The example illustrates the effect of combining evidence, not a claim that B is actually more relevant.
Choose 30 lexical and 30 semantic candidates with ten exact identity overlaps. The union contains 30 +30 −10 = 50 candidates. A reranking budget of 20 means 30 union candidates do not enter that stage. If the only relevant passage is among those 30, reranking cannot repair the omission.
For a separate cost illustration, choose two milliseconds of processing per query-candidate pair in a serial toy model. Twenty candidates require 20 × 2 = 40 milliseconds, while 50 require 100 milliseconds. These chosen times are not a hardware or model benchmark; real batching, parallelism and contention require measurement.
A labeled query has four required eligible passages. Fusion includes three, and the final top five contain two. Candidate recall is 3 ÷ 4 = 0.75; final recall is 2 ÷ 4 = 0.5 and final precision is 2 ÷ 5 = 0.4. Keeping both stage measurements shows that one relevant passage was lost after candidate generation.
The context budget constrains candidate expansion as well. With an illustrative 1,000-token wrapper and 2,000-token output reserve, the 14,000 candidate tokens require 14,000 + 1,000 + 2,000 = 17,000 positions. Under a chosen 16,000-position allowance, at least 1,000 positions must be removed or the request changed before admission. This is a declared toy limit, not a named provider specification.
In the wild: Hybrid Retrieval: Fusing BM25 and Vectors, Then Reranking
Reciprocal Rank Fusion: Reciprocal Rank Fusion combines ranked-list contributions under its stated rule.
Query families need their own comparisons
Evaluate exact identifiers, paraphrases, rare terminology, ambiguous queries and missing-evidence cases separately. A fusion rule can improve semantic questions while burying exact matches. A higher mean can conceal the failure category the product most needs to preserve.
Keep the first-stage reference meaningful. Approximate-vector neighbor recovery is not relevance recall, and relevance recall is not answer correctness. The basic index lesson's exact-neighbor comparison still helps diagnose approximation independently of the new ranking stages.
Source diversity can also matter. Selecting several nearly identical passages can crowd out an exception from another section. A diversity constraint is another policy with trade-offs, not a universal replacement for ranking by relevance.
A reranker sees text the reader cannot access
Hypothetical scenario. The vector path filters permissions, but the lexical path returns restricted candidates. Fusion forwards their full text to an external reranking service before the final answer stage removes them.
The final response filter did not protect the earlier disclosure. Eligibility must cover candidate expansion and every service receiving source content. Apply a coherent scope to all candidate paths and keep the actual data-handling boundary in the design.
Cache reranking results only under compatible query, candidate versions and permission scope. Similar queries can belong to different users or source snapshots. Reuse is safe only under a declared equivalence, not because the strings look close.
Three hybrid-retrieval misconceptions
“The reranker fixes retrieval.” It can reorder only its input candidates. Missing evidence requires first-stage diagnosis.
“Rank fusion removes every calibration decision.” It changes the combination rule and still has constants, list limits and evaluation assumptions.
“More candidates always improve the answer.” They can increase cost, exceed context budgets or introduce distracting evidence. Measure the full path.
Carry the candidate budget into the document-assistant architecture. If a permission filter removes the only supporting passage before reranking, adding a larger reranker does not repair the missing candidate. Compare the eligible first-stage pool, the fused handoff and final source support separately. The migration argument adds the representation-version boundary when those candidate paths are upgraded.
Change one stage with a reason
Use hybrid candidates when labeled failures show complementary retrieval signals. Add reranking when the candidate set contains useful evidence that the current order fails to surface. Preserve a simple baseline so each added stage has an observable purpose.
Version analyzers, embeddings, fusion settings and reranker configuration. Compare paired queries and report stage recall, final relevance, answer support and resource demand separately. Changing every stage together can evaluate a release bundle, but cannot identify one component's causal contribution.
Reject a configuration justified only by a fashionable default. Reject permission filtering after external text expansion. The useful outcome is a bounded evidence path whose failures point to a specific next intervention.
Limits of Hybrid Retrieval: Fusing BM25 and Vectors, Then Reranking
Fusion scores are ranking signals, not calibrated answer probabilities. A reranker cannot restore an absent source passage. Candidate expansion and provider calls must preserve source eligibility before restricted material leaves the authorized serving boundary.
Test the lexical result boundary
The relevant passage is absent from both initial lists. Can a better reranker fix it?
Reveal the design reasoning
No. Repair candidate generation or query interpretation, then evaluate reranking on the resulting set. Preserve permission at each handoff, including third-party rerankers.
Decision: Measure coverage, fusion and ordering separately under one evidence contract.
Check yourself: review the handoff
The relevant passage is absent from the reranking input. Which stage should be inspected first?
Candidate generation, identity handling and the fusion cutoff. A reranker cannot select evidence it never receives.
Lexical and vector scores use different scales. Does averaging establish a justified order?
No. Define and evaluate a calibrated or rank-based combination policy rather than assuming raw scale compatibility.
Restricted text reaches a reranking provider but is removed before the answer. Was access preserved?
No. The disclosure happened during candidate expansion. Scope every path and service that receives the evidence.
Northwind decision log
Retrieve lexical and semantic candidates separately.
Fuse ranks without equating incompatible scores.
Evaluate the final evidence set after reranking.
Go deeper into fusion and relevance
- Book chapter: Relevant Search, chapter 2: Search — Under The Hood — Doug Turnbull and John Berryman. Use Search — Under The Hood to examine this chapter’s data representation and operation boundaries.
- Book chapter: Relevant Search, chapter 8: Providing relevance feedback — Doug Turnbull and John Berryman. Use Providing relevance feedback to examine this chapter’s data representation and operation boundaries.
- Video lecture: HNSW for Vector Search Explained and Implemented with Faiss (Python) — James Briggs. Inspect graph-based candidate search and compare its work with exact scoring under one corpus.
- Primary paper: Reciprocal Rank Fusion outperforms Condorcet and individual Rank Learning Methods — Gordon Cormack, Charles Clarke and Stefan Buettcher. Read the actual fusion rule and tested setting.
Check the mechanism in this lesson
Why do thirty dense and twenty sparse results require only forty reranking pairs in the chosen example?
Compare the explanation
Ten IDs appear in both lists. Deduplicating the union gives 30 + 20 − 10 = 40 unique query-document pairs. Repeated retrieval of one ID is not another document to score.
Carry the decision forward
Northwind can combine different retrieval signals without equating their scores. Page 15 changes the search query itself and asks whether a reformulation preserves the employee’s meaning and access scope.