Hybrid Retrieval
Hybrid retrieval combines lexical matching with dense embeddings. It is useful in retrieval pipelines because exact names, numbers, and codes often matter while semantic similarity still recovers paraphrases. Reranking can then read the merged candidates more carefully. Hybrid retrieval is the pragmatic default when a corpus contains both natural language and exact business identifiers.
Score fusion
A simple fusion normalizes each score and combines them:
Here is the query and is one candidate document or chunk. The final score is the number used to sort candidates before reranking or context packing. The lexical score may come from BM25 or another sparse retriever; the dense score usually comes from embedding similarity in a vector database. The function puts each score family onto a comparable scale, commonly by subtracting the mean and dividing by the standard deviation inside the candidate set or inside a calibration sample. The weight controls the trade-off: larger favors exact lexical evidence, while smaller favors semantic similarity.
This formula is a realistic engineering pattern, but the normalization choice matters. BM25 scores and vector similarities do not naturally live on the same scale, and their distributions can change by corpus, query type, analyzer, embedding model, and metadata filter. Reciprocal rank fusion is often more robust when scores are not comparable, because it combines ranks rather than raw scores. This fusion step is the core of the indexed design in RAG architecture comparison.
Worked example
After score normalization, combine lexical and dense scores with :
| Document | Lexical signal | Dense signal | Hybrid score | Interpretation |
|---|---|---|---|---|
| 0 | strongest | medium | 0.475 | Exact evidence dominates without losing semantic relevance. |
| 1 | weak | strongest | -0.034 | Semantically close, but lexical evidence is thin. |
| 2 | medium | weakest | -0.440 | Neither signal is strong enough. |
Document 0 wins after fusion because its lexical score is strongest and its dense score is not weak enough to offset that advantage. Document 1 has the best dense score but ranks second after its low lexical match is included, illustrating why hybrid retrieval can favor exact evidence over pure semantic similarity.
| Retrieval pattern | When it helps |
|---|---|
| Lexical-only | Exact product codes, names, legal terms, and identifiers. |
| Dense-only | Paraphrases, conceptual questions, and vocabulary mismatch. |
| Hybrid | Workflows that need both semantic recall and exact support. |
| Hybrid plus reranking | High-value answers where the system can afford a slower second pass. |
SKU and Policy-Date Query
Query:
policy exception for SKU-X19 refund in July 2026Dense retrieval may find refund-exception discussions but miss the exact SKU-X19 identifier. Lexical retrieval may find every document containing SKU-X19, including irrelevant release notes. Hybrid retrieval merges both signals so the candidate list contains documents that are semantically about refunds and lexically anchored to the SKU and date.
Evaluation
Evaluate hybrid retrieval by query type. Exact-identifier queries, semantic paraphrase queries, multilingual queries, and date-sensitive policy queries may need different fusion weights. Track recall before reranking, duplicate rate after merging, and final answer support. If lexical and dense retrievers return disjoint but useful results, reciprocal-rank fusion can be more robust than score interpolation.
Caveats
Fusion weights are corpus-specific. Evaluate exact-match queries separately from broad semantic questions. Hybrid retrieval can also over-retrieve boilerplate if exact terms appear in headers or footers, so deduplication and reranking still matter.
References
- Karpukhin et al., 2020, Dense Passage Retrieval
- Faiss documentation
- OpenAI API documentation: Embeddings
Nav