Learning outcomes

  • Combine retrieval signals
  • Place reranking stages
  • Tune retrieval breadth

Mental model

Retrieval is a staged ranking problem: broad candidate generation seeks recall; later fusion and reranking spend more computation to improve precision.

Lexical candidates + dense candidates
Rank fusion
Reranker
Diversity and policy
Context set

Theory

Lexical and dense retrievers produce differently scored lists, so rank-based fusion is often safer than mixing raw scores. A reranker evaluates query-passage pairs and reorders a limited candidate set. The final context selector also considers diversity, duplication, authority, recency, and token budget.

Alternatives and trade-offs

Dense-only is simple, lexical-only is inspectable, hybrid improves mixed queries, and query rewriting or multi-query retrieval broadens recall at additional cost.

Failure modes and misconceptions

Do not rerank too few candidates, blend incomparable raw scores blindly, optimize retrieval without answer evaluation, or let duplicates consume the context.

Knowledge check

Reflect before revealing the guide

Why is rank fusion often preferred to directly averaging lexical and vector scores?

Decision scenario

For developer documentation, combine exact API symbol search with semantic retrieval, rerank the top candidates, deduplicate versions, and retain authoritative pages.

Relationships

Primary sources