Skip to content

Bitcoin accepted at checkout  |  Ships from Laval, QC, Canada  |  Expert support since 2016

Vector Quantization

Sovereign AI

Definition

Vector quantization (VQ) is a lossy compression technique borrowed from signal processing and now central to efficient embedding search. It maps any vector in a high-dimensional space to the nearest member of a finite, pre-learned set of representative vectors. That set is called a codebook, each entry is a codevector or centroid, and a compressed vector is stored as nothing more than the integer index of its closest centroid.

How a codebook is learned

The standard way to build a VQ codebook is k-means clustering, which is itself a vector-quantization algorithm. Given a target codebook size k, k-means partitions the training vectors into k clusters and sets each centroid to the mean of its cluster, iterating until the centroids stabilize and the total distortion (the summed squared distance from each vector to its assigned centroid) is minimized. At encode time, a new vector is simply assigned the index of its nearest centroid; at decode time, that index is replaced by the centroid itself, an approximation of the original.

Why it matters for self-hosted AI

VQ is the conceptual ancestor of the compression schemes that let large retrieval indexes fit on hardware you own. A single global codebook is rarely fine-grained enough for high-dimensional embeddings, so practical systems extend the idea: product quantization splits the vector and quantizes each piece with its own codebook, while binary quantization is VQ taken to the one-bit extreme. Knowing the base concept makes those derivatives easy to reason about.

For the two most common extensions used in local search, see product quantization and binary quantization of embeddings.

In Simple Terms

Vector quantization (VQ) is a lossy compression technique borrowed from signal processing and now central to efficient embedding search. It maps any vector in a…

Explore the Full Glossary

Browse all Bitcoin mining terms from A to Z. Whether you are a beginner or expert, deepen your understanding of the mining ecosystem.

Mining Glossary

ASIC Miner Database

Compare 500+ miners with real-time profitability data, home mining scores, and detailed specs.

Compare Miners