vector quantization
In plain wordsCompressing data by replacing each item with the nearest entry from a small catalog of representative examples, so that only the catalog number needs to be stored or sent.
A technique that maps each vector in a continuous space to the nearest of a finite set of representative vectors, the codewords of a codebook, so that the vector can be stored or transmitted as a short codeword index. Designing a codebook that minimizes average distortion (squared error) is a clusteringclustering, n.: Automatically sorting things into groups of similar items when nobody has said in advance what the groups should be, like sorting a drawer of odd socks into piles by color and size. problem, solved classically by the Lloyd or Linde–Buzo–Gray algorithm, which is essentially k-means clusteringk-means clustering, n.: A simple way to split data into a chosen number of groups: guess group centers, assign every point to its nearest center, move each center to the middle of its points, and repeat.. A single codebook fine enough for high-dimensional data would be impractically large, so structured variants split or stack the problem: product quantizationproduct quantization, n.: A compression trick for embeddings: chop each long list of numbers into short pieces and replace each piece with the ID of its closest typical piece, shrinking storage many times over while keeping search workable. encodes subvectors with separate codebooks, giving compact indexes and fast distance estimates for approximate nearest neighbor searchapproximate nearest neighbor search, n.: A family of shortcuts for finding the most similar items in a huge collection without checking every one — accepting an occasional miss in exchange for answers thousands of times faster., and residual vector quantization quantizes successive errors with a series of codebooks. In deep learning, learned vector quantization turns continuous representations into discrete tokens, as in VQ-VAEVQ-VAE, n.: A network that compresses an image or sound into a short list of entries from a learned 'codebook' — like describing a picture with a fixed set of tiles — which other models can then generate. image tokenizers, neural audio codecsneural audio codec, n.: A neural network that squeezes sound into a very compact stream of numbers and rebuilds it, used both to send audio cheaply and to let AI models 'write' speech and music piece by piece. and the Semantic IDs of generative recommendationgenerative recommendation, n.: A newer approach to recommendation that uses language-model-style AI to predict the next item a person will want, one step at a time, much as a chatbot predicts the next word., so that autoregressive modelsautoregressive model, n.: A model that produces a sequence one piece at a time, each new piece depending on the pieces already produced — like writing a sentence word by word without going back. can generate images, sound or items as token sequences.
Product quantization shrank each 768-dimensional embedding to 64 bytes with little loss in recall.
Origin
Grew out of signal compression: Stuart Lloyd's 1957 quantizer design at Bell Labs was generalized to vectors by Yoseph Linde, Andrés Buzo and Robert Gray in 1980, and Gray's 1984 survey 'Vector Quantization' consolidated the field. Hervé Jégou, Matthijs Douze and Cordelia Schmid's product quantization (2011) and Aäron van den Oord and colleagues' VQ-VAE (2017) carried it into large-scale search and generative modeling.
Usage note
Not to be confused with quantizationquantization, n.: Storing an AI model's numbers with fewer digits, like rounding prices to the nearest dollar, so the model takes less memory and runs faster, usually with only a small loss of accuracy. of model weights and activations to low-precision numbers, which is usually scalar (each number rounded separately).
Related
- k-means clusteringk-means clustering, n.: A simple way to split data into a chosen number of groups: guess group centers, assign every point to its nearest center, move each center to the middle of its points, and repeat.
- approximate nearest neighbor searchapproximate nearest neighbor search, n.: A family of shortcuts for finding the most similar items in a huge collection without checking every one — accepting an occasional miss in exchange for answers thousands of times faster.
- VQ-VAEVQ-VAE, n.: A network that compresses an image or sound into a short list of entries from a learned 'codebook' — like describing a picture with a fixed set of tiles — which other models can then generate.
- quantizationquantization, n.: Storing an AI model's numbers with fewer digits, like rounding prices to the nearest dollar, so the model takes less memory and runs faster, usually with only a small loss of accuracy.
- neural audio codecneural audio codec, n.: A neural network that squeezes sound into a very compact stream of numbers and rebuilds it, used both to send audio cheaply and to let AI models 'write' speech and music piece by piece.
- image tokenizerimage tokenizer, n.: A component that chops a picture into a short sequence of 'visual words' that a language-style AI model can read or write, and turns such sequences back into pictures.
- generative recommendationgenerative recommendation, n.: A newer approach to recommendation that uses language-model-style AI to predict the next item a person will want, one step at a time, much as a chatbot predicts the next word.
- quantizationquantization, n.: Storing an AI model's numbers with fewer digits, like rounding prices to the nearest dollar, so the model takes less memory and runs faster, usually with only a small loss of accuracy.
Sources
- Linde, Y., Buzo, A. & Gray, R. M. (1980). An Algorithm for Vector Quantizer Design. IEEE Transactions on Communications 28(1).
- Gray, R. M. (1984). Vector Quantization. IEEE ASSP Magazine 1(2).
- Jégou, H., Douze, M. & Schmid, C. (2011). Product Quantization for Nearest Neighbor Search. IEEE Transactions on Pattern Analysis and Machine Intelligence 33(1).
Mentioned in
generative recommendationgenerative recommendation, n.: A newer approach to recommendation that uses language-model-style AI to predict the next item a person will want, one step at a time, much as a chatbot predicts the next word.