01 / 05

What is a sparse vector, and how does it differ structurally from the dense vectors used in semantic search?

Sparse vectors store mostly non-zero weighted dimensions in a high-dimensional space

A sparse vector represents an item in a very high-dimensional feature space where most dimensions are zero and only a relatively small set of dimensions have explicit weights. In information retrieval, those dimensions often correspond to terms or learned token features, with the non-zero values representing their relevance. A dense embedding is different: it usually has a fixed, much smaller dimensionality such as 384, 768, or 1536 and nearly every component contains a value. Structurally, Qdrant represents sparse vectors as indexed values paired with their non-zero weights rather than a full array of mostly-zero numbers. Sparse retrieval is especially good at exact lexical signals such as product names, IDs, rare terms, and technical terminology, while dense vectors capture semantic similarity. A common misconception is that sparse means low-dimensional; sparse vectors are typically high-dimensional but contain few non-zero entries.

javascript
  1. 1

    Dense example: [0.12, -0.31, 0.44, ...] where most dimensions have values.

  2. 2

    Sparse example: indices [12, 41, 9001] with weights [2.1, 0.7, 4.3], leaving the remaining dimensions at zero.

  3. 3

    Trade-off: sparse retrieval preserves lexical precision but generally does not provide the same semantic generalization as dense embeddings.

  4. 4

    Qdrant supports sparse vectors as a separate vector type. The exact client model names and API syntax can vary by client version, so production code should be checked against the installed Qdrant client/server version.

Difficulty: 6/10
Topics: Sparse vectors, Dense vs sparse, Lexical retrieval

Scenario Questions

0-2 years experience
  1. 1

    A vector has one million possible dimensions but only 30 non-zero values. Is it sparse or dense, and why?

  2. 2

    A search for a product SKU fails with a semantically similar dense result. What sparse-retrieval property could help?

2-5 years experience
  1. 1

    Your corpus contains many technical error codes and class names. Why might sparse retrieval outperform dense-only retrieval for these terms?

  2. 2

    A developer stores a sparse vector as a million-element zero-filled array. What problem does that representation create?

5-8 years experience
  1. 1

    You need one retrieval system that handles both product names and natural-language descriptions. How would dense and sparse representations complement each other?

  2. 2

    How would you choose and monitor sparse-vector dimensionality and non-zero distribution for a production corpus?

8+ years experience
  1. 1

    How would you evaluate whether a learned sparse model such as SPLADE provides enough relevance gain to justify its inference and index costs?

  2. 2

    Your corpus changes rapidly and vocabulary statistics drift. What sparse-retrieval characteristics would you monitor to detect relevance degradation?

Follow-up Questions

  • Why are sparse vectors effective for exact terms and rare keywords?
  • When would you choose sparse retrieval over a dense embedding search?