# Sparse Retrieval

- **Canonical URL:** https://getaimath.com/dictionary/sparse-retrieval/
- **Topics:** [Context, Memory & Retrieval](https://getaimath.com/dictionary/category/context-memory-and-retrieval/)
- **Last updated:** 2026-11-25

## What is Sparse Retrieval?

**In one sentence:** Sparse retrieval finds documents by matching words, using long lists that are mostly zeros except for the words present.

Each document is represented by which words it contains and how important they are. Most entries are zero, so it is "sparse." BM25 is the classic example.

![Context Window vs. Memory: Your Desk vs. The Filing Cabinet — Simple cartoon comparing the AI Context Window (a small desk that can only fit a few pages right now) with External Memory & Search (a big filing cabinet where a librarian grabs just the 3 pages you need).](https://getaimath.com/diagrams/context-memory-and-retrieval.png)
*Napkin Diagram (Context, Memory & Retrieval): The context window is the small desk the AI can see right now; search grabs the right pages from the filing cabinet.*

## What is an example of Sparse Retrieval?

A search for "solar panel cost" finds pages that actually contain those words.

## Why does Sparse Retrieval matter?

Sparse retrieval is fast, exact and great for names and rare terms.

## Sparse Retrieval vs. Dense Retrieval

Dense retrieval matches meaning using neural embedding vectors, while sparse retrieval (like BM25) matches exact words and rare identifiers—which is why Hybrid Search combines both.

| Dimension | Sparse Retrieval | [Dense Retrieval](https://getaimath.com/dictionary/dense-retrieval/) |
| --- | --- | --- |
| Matches on | Exact keywords, error codes, SKUs, names | Conceptual meaning and synonyms |
| Representation | Sparse word-weight index (BM25 / SPLADE) | Compact float vector (e.g., 768–1,536 dims) |
| Blind spot | Misses paraphrases that use different words | Can blur exact product IDs or numbers |

## Related Concepts

- [Hybrid Search](https://getaimath.com/dictionary/hybrid-search/): Hybrid search combines keyword search and semantic vector search to get better results than either alone.
- [Dense Retrieval](https://getaimath.com/dictionary/dense-retrieval/): Dense retrieval finds documents by comparing embeddings, where every number in the vector has a value.
- [Relevance Score](https://getaimath.com/dictionary/relevance-score/): A relevance score is a number showing how well a result matches a search query.
- [BM25](https://getaimath.com/dictionary/bm25/): BM25 is a classic keyword-based ranking formula that scores documents by how often and how importantly query words appear.
- [Reranking](https://getaimath.com/dictionary/reranking/): Reranking reorders search results with a more careful model so the most relevant ones end up on top.
- [Chunk Overlap](https://getaimath.com/dictionary/chunk-overlap/): Chunk overlap repeats a little text between neighboring chunks so ideas split at the edges are not lost.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/sparse-retrieval/)
