AlgoViz

Lexical, semantic and hybrid retrieval

medium 6 min

Lexical retrieval and dense retrieval can disagree productively.

Trace the example

Follow the evidence through each stage, then test a change in the case.

Find both a fault code and its paraphrase

Find both a fault code and its paraphrase. Selected component: Term matches inside Lexical retrieval.
Open full-size diagram

Lexical retrieval

P4 rank 1 · P9 rank 4

The rare code E17 is a strong lexical signal. This index supplies ranked IDs with its own score scale.

The term score is 12 and a cosine score is 0.84. How should the system combine them?

Re-rank two passages

P4 leads · P4 0.03227 · P9 0.03202

P4 has lexical rank 1; P9 has lexical rank 4 and dense rank 1. Both lists use RRF constant 60. Rank ties in the upstream list are allowed in this example.