# Sparse Vector

> A long list of numbers, mostly zeros. Each slot stands for one word.

**Field:** Artificial Intelligence  
**Category:** Retrieval & Search  
**Also known as:** Sparse Embedding, Sparse Retrieval, Lexical Vector

## Think of it like

It is like a huge egg box with eggs in just a few cups.

## Definition

A sparse vector is a very long list of numbers where nearly all are zero. Each slot stands for one word in a big vocabulary. Only the words in the text get a value, often a weight for how much that word matters. Keyword search methods like BM25 work this way. Sparse vectors are great at exact words, names and codes. They miss matches that use different words.

## Example

A support bot gets the code "E-404". A sparse vector finds the one manual page with that exact code, where a dense vector drifts to error pages in general.

## Why it matters

Exact terms matter in real search. Sparse and dense vectors together are the base of hybrid search.

## Common mistake

Thinking sparse means old and useless. For names, codes and rare words, it often beats dense vectors.

## Three principles

- **Mostly zeros.** Only the text's words get a value.
- **One slot per word.** Slots map to a vocabulary.
- **Exact matches.** Strong on names and codes.

## Related terms

- [Dense Vector](https://learn.benibix.com/term/ai/dense-vector)
- [Keyword Search](https://learn.benibix.com/term/ai/keyword-search)
- [Okapi BM25](https://learn.benibix.com/term/ai/okapi-bm25)
- [Hybrid Search](https://learn.benibix.com/term/ai/hybrid-search)
- [Inverted Index](https://learn.benibix.com/term/ai/inverted-index)

## Told apart from

- [Dense Vector vs Sparse Vector](https://learn.benibix.com/compare/dense-vector-vs-sparse-vector): People think a sparse vector is a weaker dense one, and it is not. A dense vector scores hidden traits of meaning, so it finds texts that say the same thing in other words. A sparse vector has one slot per word, so it finds exact words, names and codes. Each catches what the other misses, which is why hybrid search uses both.

![The text cheap flights to Rome as two rows of boxes. Dense row: every box holds a small number, like 0.12 and -0.40, running to between 384 and 3,072 numbers. Sparse row: nearly every box holds 0, and only the boxes for the words cheap and Rome hold a weight.](https://learn.benibix.com/diagrams/ai3-dense-sparse.svg)

---

Source: https://learn.benibix.com/term/ai/sparse-vector
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
