Sistava

What is Sparse Retrieval?

Also called lexical retrieval.

Sparse retrieval scores documents using term based representations in which most entries are zero, matching on the words a query and document actually share. Classical keyword ranking functions are the best known form, and learned sparse models extend the idea by predicting term weights with a neural network. It complements embedding based search rather than competing with it.

In a sparse representation each dimension corresponds to a term in the vocabulary, and a document holds nonzero weights only for the terms it contains. Because the vast majority of entries are zero, these representations are stored in an inverted index that maps each term to the documents containing it, which makes lookups extremely fast and lets the index scale to very large collections on modest hardware.

The strengths are exactness and interpretability. A part number, a legal citation, an error code, or an unusual surname is matched literally, and it is always possible to explain a result by pointing at the matched terms and their weights. There is no training step for classical scoring functions, and adding a document requires only updating posting lists, so index freshness is easy to maintain.

The weakness is vocabulary mismatch. A query phrased with different words than the document will score poorly no matter how well the meanings align. Stemming, stop word handling, and query expansion reduce this problem but never remove it, which is exactly the gap embedding based retrieval fills and the reason hybrid setups are so common.

Learned sparse models sit between the two worlds. They use a language model to assign weights to terms and to add related terms that do not literally appear, then store the result in a conventional inverted index. The result keeps the exact matching and infrastructure advantages of keyword search while recovering some tolerance for paraphrase, at the cost of an inference step during indexing.

Key points

In practice

A support engineer searches for error ERR_5521_TIMEOUT. Sparse retrieval finds the three documents containing that exact token, ranked by how rare the token is across the corpus. An embedding search over the same corpus returns generic timeout troubleshooting pages instead, because the specific code barely shifts the passage vector away from other timeout content.

Related terms

Back to the AI Glossary