Hybrid Retrieval

Hybrid retrieval combines lexical retrieval and embedding retrieval. It is useful when exact terms, symbols, acronyms, paper titles, identifiers, or code names matter, but semantic paraphrase also matters.

The combined score can be written as:

where is a lexical score, is an embedding similarity score, and controls the mixture.

Because the two scores often have different scales, practical hybrid retrieval usually normalizes or ranks before combining:

Why It Matters

  • Lexical retrieval catches exact names, formulas, filenames, and rare terms.
  • Embedding retrieval catches paraphrases and conceptual similarity.
  • Reranking can combine both candidate sets with a more expensive model.
  • Metadata filters can enforce scope before ranking.

Pipeline

Candidate Merge

Hybrid retrieval is often more robust when lexical and dense retrieval produce separate candidate sets first.

Then a merge or reranker orders .

Merge methodUse whenRisk
score interpolationscores are calibrated or normalizedone score family dominates
rank fusionscales are not comparableloses magnitude information
reciprocal rank fusionrobust simple baselinecan overvalue shallow matches
learned rerankerenough labels or strong cross-encoder existsslower and harder to debug

Reciprocal rank fusion is a common simple form:

where is the set of retrieval runs.

When Hybrid Helps

Query typeLexical signalEmbedding signal
paper title or method nameexact phraserelated discussion
code symbol or file pathexact tokensurrounding explanation
formula or acronymliteral matchexpanded meaning
broad concept questionweaksemantic neighborhoods
public wiki navigationpage title and aliasesconceptual adjacency

Hybrid retrieval is useful for LLM Wiki because a user may search for Xid, RMSD, JEPA, or Slurm QOS, where exact terms and semantic explanation both matter.

Debugging Slices

FailureCheck
exact document missinglexical candidate set too small or tokenization issue
semantically right but wrong versionmetadata/date filter missing
many duplicateschunking too fine or merge lacks diversity
top result is related but not evidentialreranker objective too broad
rare term ignoredembedding model did not preserve identifier

Checks

  • Is the query term-sensitive, semantic, or both?
  • Are lexical and embedding scores normalized before interpolation?
  • Does the merge preserve source diversity rather than many near-duplicates?
  • Is reranking evaluated separately from initial recall?
  • Are metadata filters applied before retrieval when scope is known?
  • Does the final context cite the exact retrieved evidence?
  • Are lexical recall, embedding recall, and reranker quality evaluated separately?
  • Does merge logic preserve both exact-match and semantic candidates?