Sparse Vectors

A sparse vector is a mathematical construct consisting of a fixed array of real values. Vectors are considered sparse if most of their elements are zero.

In the context of search, sparse vectors are generated by specialized parse embedding models like SPLADE. These vectors can detect the presence of exact keywords while also capturing semantic similarity between terms.

Because the size of sparse vectors frequently exceeds the 2,000 entry limit of the vector type, sparse vectors can be stored in ParadeDB with the sparsevec type. This type compresses sparse vectors by storing nonzero values and their positions rather than the entire vector, and can support up to 1,000 non-zero entries.

Sparse HNSW Index

The sparse HNSW index enables search over sparse vectors using the HNSW algorithm. This index is powered by the pgvector Postgres extension.