Sparse retrieval (BM25/SPLADE) beats dense on exact rare tokens — error codes, part numbers, acronyms, out of domain jargon — that embeddings blur into a fuzzy region; dense wins on paraphrase and cross-lingual.
Imagine two librarians. One has read every book and groups them by meaning, so if you ask about 'dogs' she'll also hand you books on 'puppies' and 'canines.' The other is a literal index-card matcher: she finds books containing the exact words you said. Now you ask for a book mentioning the serial number 'ERR_0x80070057.' The meaning-based librarian is stumped — that string has no meaning to group by, so she fetches vaguely related junk. The literal matcher finds it instantly, because she only cares about exact words. That literal matcher is sparse retrieval like BM25. It wins precisely on rare exact strings — codes, part numbers, odd acronyms — where the meaning-based one has nothing to grab onto.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
The sparse versus dense question looks like a trivia choice, but it is really testing whether you understand what an embedding actually throws away. Dense retrieval is the glamorous default — semantic search, vectors, similarity. It is so dominant in tutorials that many engineers reach for it reflexively and are then surprised when production retrieval misses on the queries that matter most: the ones with a specific error code, a part number, a customer id.
The deeper truth is that dense and sparse retrieval fail on opposite query distributions, and neither is strictly better. Knowing which regime you are in — and that most real corpora contain both — is what separates a hybrid by default senior engineer from someone who ships dense-only and debugs exact-match misses for a month.
This deep dive explains the mechanism that makes embeddings blur exact tokens, why sparse methods nail them, what SPLADE adds over classic BM25, and how production systems fuse the two so you stop choosing and start weighting.
What an embedding throws away
A dense embedding model takes a string and produces a fixed-length vector positioned in a learned semantic space. The whole point of that space is to place strings with similar meaning near each other, regardless of their surface form. 'How do I get a refund' and 'what is the return policy' land close together even though they share almost no words. This is dense retrieval's superpower.
But compression has a cost: the surface form is largely discarded. The model does not store the literal characters; it stores a learned representation of meaning. For most text that is fine, because meaning is what you want to match on. For a token like an error code, it is catastrophic — the token has essentially no semantic meaning to represent. There is nothing for the model to place it near, so it lands in a diffuse region driven by whatever sub-word pieces it was split into.
There is a second, compounding problem: vocabulary coverage. A freshly minted error code, a niche product SKU, or an in-house acronym may have appeared rarely or never in the embedding model's training data. A token the model never learned has no well-formed location at all; its embedding is essentially noise. So both the no-meaning problem and the out of vocabulary problem push rare identifiers into fuzzy regions uncorrelated with their literal form, and similarity search returns vaguely-related junk.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Elasticsearch and OpenSearch pair BM25 with dense vectors and fuse them with reciprocal rank fusion for hybrid search.
- SPLADE produces learned-sparse vectors that match exact terms while expanding to related vocabulary, served in Qdrant and Vespa.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow does reciprocal rank fusion combine sparse and dense rankings without needing comparable scores?
RRF ignores raw scores and uses only rank positions: each document gets a score summed over lists as 1/(k + rank). Explain why this sidesteps the incompatible-scale problem between BM25 scores and cosine similarities, and discuss the constant k and what tuning it trades off between top-rank dominance and tail contribution.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Claiming sparse retrieval is always more accurate than dense. It loses badly on paraphrase, synonyms, and cross-lingual queries — which is exactly why production stacks fuse both.
60 second bullets to scan on the way to the call.
Define sparse versus dense retrieval and how each scores a match
Explain why dense embeddings blur exact rare tokens
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.