Vector Quantization

Also known as VQ

Overview

Vector quantization replaces continuous vectors with indices into a set of representative codewords, reducing storage and creating discrete tokens for models. Common approaches learn codebooks with autoencoders, use residual or product quantization, or impose geometric structure such as lattices and spheres; they are evaluated on image and audio reconstruction, vector retrieval, language-model quality, and inference speed. Applications range from visual and speech tokenizers to compressed LLM weights and attention caches, where specialized kernels can determine whether smaller representations also run faster. A central tension is preserving task-relevant information at very low bit rates while avoiding codebook collapse, calibration costs, and hardware overhead; utilization alone does not guarantee low distortion or strong downstream results.

Latest papers

122 papers20 papers in the last four weeks, up 67% on the four weeks before. 0.1% of all new papers.

May 23, 2025

NSNQuant: A Double Normalization Approach for Calibration-Free Low-Bit Vector Quantization of KV Cache

Large Language Model (LLM) inference is typically memory-intensive, especially when processing large batch sizes and long sequences, due to the large size of key-value (KV) cache. Vector Quantization (VQ) is recently adopted to alleviate this issue, but we find that the existing approach is susceptible to distribution shift due to its reliance on calibration datasets. To address this limitation, we introduce NSNQuant, a calibration-free Vector Quantization (VQ) technique designed for low-bit compression of the KV cache. By applying a three-step transformation-1) a token-wise normalization (Normalize), 2) a channel-wise centering (Shift), and 3) a second token-wise normalization (Normalize)-with Hadamard transform, NSNQuant effectively aligns the token distribution with the standard normal distribution. This alignment enables robust, calibration-free vector quantization using a single reusable codebook. Extensive experiments show that NSNQuant consistently outperforms prior methods in both 1-bit and 2-bit settings, offering strong generalization and up to 3×\times throughput gain over full-precision baselines. Code is available at https://github.com/DHdroid/NSNQuant.
Mar 25, 2023

LVQAC: Lattice Vector Quantization Coupled with Spatially Adaptive Companding for Efficient Learned Image Compression

Recently, numerous end-to-end optimized image compression neural networks have been developed and proved themselves as leaders in rate-distortion performance. The main strength of these learnt compression methods is in powerful nonlinear analysis and synthesis transforms that can be facilitated by deep neural networks. However, out of operational expediency, most of these end-to-end methods adopt uniform scalar quantizers rather than vector quantizers, which are information-theoretically optimal. In this paper, we present a novel Lattice Vector Quantization scheme coupled with a spatially Adaptive Companding (LVQAC) mapping. LVQ can better exploit the inter-feature dependencies than scalar uniform quantization while being computationally almost as simple as the latter. Moreover, to improve the adaptability of LVQ to source statistics, we couple a spatially adaptive companding (AC) mapping with LVQ. The resulting LVQAC design can be easily embedded into any end-to-end optimized image compression system. Extensive experiments demonstrate that for any end-to-end CNN image compression models, replacing uniform quantizer by LVQAC achieves better rate-distortion performance without significantly increasing the model complexity. Code is available at: https://github.com/xzhang9308/LVQAC.