TL;DR
This paper provides a unified theoretical framework comparing state-of-the-art rotation-based vector quantizers and introduces BlockQuant, a novel block-spherical quantization algorithm. By grouping coordinates into blocks and leveraging the exact spherical geometry of randomly rotated vectors, BlockQuant achieves superior reconstruction accuracy and inner-product estimation, delivering notable performance gains in tasks like long-context LLM KV-cache compression.
What Problem Does This Paper Address?
High-dimensional vector embeddings are the backbone of modern machine learning systems, appearing everywhere from similarity search and retrieval to large language model (LLM) key-value (KV) caches. However, storing and transmitting these massive collections of vectors creates a severe memory and computational bottleneck.
Vector quantization (VQ) compresses these vectors into low-bit representations. Recent state-of-the-art methods use random rotation (multiplying vectors by a random orthogonal matrix) before quantization to smooth out data distributions and provide strong theoretical guarantees. Unfortunately, existing rotation-based methods (like EDEN, RabitQ, and TurboQuant) have been difficult to compare because they were analyzed under different distortion criteria and assumptions. Furthermore, they all rely on coordinate-wise scalar quantization, which treats each dimension independently and fails to exploit the spherical geometry inherent to rotated unit vectors.
Methods
The authors tackle these challenges with a two-part approach:
- Unified Theoretical Framework: They place existing quantizers under a single framework, evaluating them across three criteria: reconstruction mean squared error (MSE), expected inner-product distortion, and high-probability bit complexity.
- Block-Sphere Quantization (BlockQuant): Instead of quantizing each coordinate independently after a random rotation, BlockQuant groups coordinates into small blocks of size $p$. Because a randomly rotated unit vector is uniformly distributed on a sphere, the authors derive the exact block marginal distribution induced by the unit sphere. They then use this distribution to optimize quantization centroids via K-means.
To keep the online quantization process fast and practical, the authors also introduce a Cartesian Lookup Table (LUT) approximation. Instead of searching the entire exponential codebook space, they partition the block domain into a grid and precompute a small set of nearest candidate centroids for each grid cell.
Additionally, the paper introduces a sharper Shannon lower bound for MSE distortion on a sphere, correcting previous bounds by accounting for the sphere's intrinsic dimension ($d-1$) rather than its ambient dimension ($d$).
Datasets
The authors evaluated BlockQuant and the baseline methods using the following datasets and benchmarks:
- DBpedia Entities: 1,536-dimensional embeddings used to measure reconstruction MSE and inner-product estimation error.
- GloVe & OpenAI3: 200-dimensional, 1,536-dimensional, and 3,072-dimensional embeddings used to evaluate approximate nearest-neighbor retrieval quality.
- Needle-In-A-Haystack: A benchmark designed to test long-context retrieval performance in LLMs.
- LongBench-E: A bilingual, multitask benchmark for evaluating long-context understanding in LLMs.
Key Insights and Ideas
- No Single Baseline Dominates: The unified comparison reveals that baseline advantages are criterion-dependent. EDEN and TurboQuant excel at expected MSE, while RabitQ provides better high-probability control.
- The Geometry of Rotation: When you randomly rotate a unit vector, it maps uniformly to a hypersphere. Coordinate-wise quantizers treat coordinates as independent, effectively placing centroids in a hypercube. This wastes codebook space on corners that lie far from the actual sphere. BlockQuant fixes this by optimizing centroids directly on the block-spherical marginals (see Figure 1 in the paper).
- Intrinsic Dimension Matters: Previous lower bounds used the ambient dimension $d$. The authors show that because unit vectors live on a sphere, the true lower bound must reflect the intrinsic dimension $d-1$, leading to a tighter, more accurate theoretical limit.
Key Results
- Superior Distortion Rates: BlockQuant theoretically and empirically outperforms EDEN, RabitQ, and TurboQuant in both reconstruction MSE and inner-product distortion across various bit-widths ($b=1, 2, 3, 4$). For instance, at $b=2$ and block size $p=3$, BlockQuant achieves an MSE distortion of 0.101 compared to EDEN's 0.117 and RabitQ's 0.119.
- Better Retrieval Recall: In nearest-neighbor search tasks on GloVe and OpenAI3 datasets, BlockQuant consistently achieved higher recall than baselines, particularly in the low-$k$ regime where ranking is highly sensitive to quantization noise.
- Downstream LLM Gains: When applied to KV-cache quantization for
Llama-3.1-8B-Instructat an effective 3.5 bits, BlockQuant achieved a Needle-In-A-Haystack score of 0.962—nearly matching the full 16-bit precision cache score of 0.965, while outperforming EDEN (0.953), RabitQ (0.944), and TurboQuant (0.933). It also achieved the highest average score across all tasks in LongBench-E.
Limitations and Future Work
- Codebook Scaling: The exact nearest-centroid assignment cost scales exponentially with the block size $p$ and bit-width $b$ ($K = 2^{bp}$). While the authors' LUT approximation successfully mitigates this for small block sizes ($p=2, 3$), scaling to much larger blocks remains computationally prohibitive.
- Hardware Optimization: Although the LUT approximation brings BlockQuant's runtime down to a level comparable with the fastest coordinate-wise baselines, achieving maximum efficiency in production environments will require dedicated low-level hardware optimizations, such as custom CUDA kernels.
Summary updated