Skip to content
BENIBIX Learn

Sparse Vector

Also known as Sparse Embedding, Sparse Retrieval, Lexical Vector

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

Think of it like

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

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.

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.
The bottom row is sparse: mostly zeros, with a few words given weight.

Common mistake

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

Key takeaways

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

Compare