Retrieval, Hybrid Search, and Reranking
Retrieval, Hybrid Search, and Reranking
Key jargon
| Term | Plain-language meaning |
|---|---|
| Sparse retrieval | Term-based search that rewards lexical overlap, commonly using BM25. |
| Dense retrieval | Vector search that compares learned embeddings. |
| Hybrid search | Combining sparse and dense retrieval signals. |
| Reranking | Applying a more expensive relevance scorer to a smaller candidate set. |
Key concepts
- Sparse search is strong for exact names and identifiers; dense search helps with paraphrases and semantic similarity.
- A reranker improves ordering only among candidates already retrieved, so candidate recall still matters.
Concept map
flowchart LR
A["Run sparse and dense search"] --> B["Fuse candidate rankings"]
B --> C["Rerank shortlist"]
C --> D["Return evidence with scores"]| Method | Strength | Weakness |
|---|---|---|
| Lexical/BM25 | Exact names, identifiers, rare terms | Misses paraphrases |
| Dense vector | Semantic similarity | Can blur exact constraints |
| Metadata filter | Tenant, date, type, policy | Depends on correct metadata |
| Hybrid | Balances exact and semantic signals | Requires score fusion/tuning |
| Reranker | Better ordering of candidates | Adds latency and model risk |
Retrieve broadly enough to include the answer, then rerank/filter narrowly enough for useful context. Tune on real questions, including “no answer” cases.
Exercise
Create queries containing exact error codes, synonyms, dates, and ambiguous terms. Compare lexical and vector results, then define a simple hybrid rule.
Metrics
Recall@k, precision@k, mean reciprocal rank, nDCG, policy-filter correctness, freshness, latency, and cost. Metrics require labeled relevance judgments.