CONCEPT

Sparse Retrieval

Authoritative Definition

Retrieval techniques that rely on high-dimensional vectors where most values are zero, optimizing for keyword precision, rare term matching, and exact identifier lookup.

Overview & Technical Description

Sparse retrieval fundamentally maps documents and queries to high-dimensional spaces aligned with a vocabulary. Because most documents only contain a small subset of the total vocabulary, the resulting vectors are "sparse" (mostly zeroes). Classic implementations rely on term-frequency inverted indexes, such as BM25, which evaluate the statistical importance of terms based on how rarely they appear across the broader corpus. More modern, neural sparse retrieval models like SPLADE use masked language modeling to expand document terms with relevant vocabulary before generating the sparse vector. This allows the index to capture exact keyword matches while benefiting from limited semantic expansion. In AI infrastructure and RAG systems, sparse retrieval provides critical precision that dense vector search often lacks. If a user queries for a specific UUID, error code, or niche acronym, a sparse index will directly retrieve documents containing those exact tokens. Because sparse vectors can be efficiently compressed and queried using inverted indexes, they are computationally lightweight and extremely fast at scale. They are frequently deployed alongside dense semantic retrieval in hybrid search architectures. The resulting scores are combined using techniques like Reciprocal Rank Fusion (RRF) or convex combination, yielding a retrieval system that balances broad conceptual understanding with pinpoint lexical accuracy.

Editorial Notes

Essential for production RAG systems where queries include specific noun phrases, IDs, or domain-specific jargon that dense embeddings might fail to differentiate. Typically combined with dense retrieval via Reciprocal Rank Fusion (RRF).

Related Concepts