Behind every search and RAG system is a choice about how to find relevant text. The two foundational approaches — sparse and dense retrieval — work in fundamentally different ways, and understanding both is key to good retrieval.

Sparse retrieval (keywords)

Sparse retrieval is the classic approach: match documents by the words they contain. It's called "sparse" because documents are represented by which specific terms appear (most terms don't, hence sparse). Methods like BM25 score documents by term overlap with the query, weighted by how rare and frequent words are. It's fast, interpretable, and excellent at exact matches — names, codes, specific jargon.

Dense retrieval (vectors)

Dense retrieval represents text as embeddings — dense vectors capturing meaning. It matches by semantic similarity, so "car" can retrieve "automobile" and paraphrases work. It's "dense" because every dimension of the vector carries information. It grasps meaning that keyword matching misses — but can overlook exact terms that don't have a strong semantic signal.

Sparse retrieval matches the words you said. Dense retrieval matches what you meant. Each catches what the other misses.

The tradeoffs

Sparse: great for exact terms, fast, no model needed, but blind to meaning and synonyms. Dense: great for meaning and paraphrase, but can miss literal matches and needs an embedding model. Neither dominates — they fail in complementary ways.

Why hybrid wins

Because their strengths are complementary, the best systems combine them (hybrid search): run both and merge the results, so you catch exact matches and semantic ones. This consistently beats either alone on real, mixed queries.

The takeaway

"Retrieval" isn't one thing. Sparse handles the literal, dense handles the semantic, and understanding both lets you diagnose why a search misses (wrong tool for the query type) and fix it — usually by combining them. It's foundational knowledge for anyone building search or RAG.

0 viewsSource: ExplainerCite · BibTeX
Was this useful?