Research Explainer · Zandieh (2025)

A random rotation turns vector quantization into a solved problem, within a factor of 2.7 of perfection

TurboQuant achieves near-optimal distortion for both MSE and inner product metrics across all bit-widths, requires zero preprocessing, and matches full-precision LLM quality at 3.5 bits per channel.

Published April 2025

≈2.7× factor from information-theoretic optimality for MSE distortion, shrinking to 1.45× at 1-bit width

3.5 bits per channel achieves absolute quality neutrality with full-precision KV cache on LongBench

~0 sec indexing time for nearest neighbor search, vs. 240–4000 seconds for Product Quantization and RabitQ

0.997 Needle-in-a-Haystack score, identical to the uncompressed baseline despite 4× compression

MSE distortion vs. bit-width: TurboQuant between upper and lower bounds

Empirical MSE of TurboQuant_mse on 1536-d OpenAI embeddings, plotted against the proven upper bound (√3π/2 · 4^-b) and information-theoretic lower bound (4^-b). Recreated from Figure 3b of Zandieh et al. (2025).

Large language models, vector databases, and nearest neighbor search systems all share a common bottleneck: they must store and compute with enormous collections of high-dimensional vectors. The key-value cache in transformer models grows linearly with context length. Vector databases hold millions of embeddings. In both cases, reducing those vectors from 16-bit or 32-bit floating point down to 2, 3, or 4 bits per coordinate would save memory, bandwidth, and compute.

The trouble is that most existing quantization methods either require expensive data-dependent preprocessing (making them useless for online settings like KV cache quantization, where new vectors arrive continuously) or achieve distortion rates that are far worse than what information theory says is possible. TurboQuant solves both problems simultaneously: it is data-oblivious, works in streaming mode, runs on GPUs with full vectorization, and comes within a small constant factor of the theoretical optimum.

Needle-in-a-Haystack retrieval scores across KV cache compression methods

Overall recall scores on Llama-3.1-8B-Instruct with 4× KV cache compression. TurboQuant matches the full-precision baseline exactly. Recreated from Figure 4 of Zandieh et al. (2025).

Nearest neighbor recall@1@k on 1536-d OpenAI embeddings

Recall@1@k for TurboQuant, Product Quantization (PQ), and RabitQ at 2-bit and 4-bit quantization on the DBpedia dataset (d=1536). Recreated from Figure 5b of Zandieh et al. (2025).

The core insight is deceptively simple. Multiply your input vector by a random rotation matrix. After rotation, each coordinate of a unit-norm vector follows a Beta distribution that, in high dimensions, concentrates tightly around a Gaussian. Better still, distinct coordinates become nearly independent of one another. This near-independence is the crucial property: it means you can quantize each coordinate separately using an optimal scalar quantizer and still get near-optimal performance for the whole vector.

The optimal scalar quantizers are found by solving a one-dimensional k-means problem (the Lloyd-Max algorithm) for the known Beta distribution. These codebooks are precomputed once for each bit-width and stored as a small lookup table. At runtime, the algorithm rotates the vector, finds the nearest codebook entry for each coordinate, and stores the index. Dequantization reverses the process: look up centroids, rotate back.

TurboQuant operates in two stages to handle both MSE and inner product distortion:

  1. MSE-optimal quantizationRandomly rotate the input vector, then apply a precomputed Lloyd-Max scalar quantizer to each coordinate independently. This minimizes mean-squared reconstruction error with a distortion of at most (√3π/2) · 4^(-b) for bit-width b.
  2. Residual correction via QJLMSE-optimal quantizers are biased for inner product estimation (at 1-bit, the multiplicative bias is 2/π). To fix this, apply the MSE quantizer at bit-width b-1, compute the residual, then apply a 1-bit Quantized Johnson-Lindenstrauss (QJL) transform to the residual. The result is an unbiased inner product estimator at the full b-bit budget.

The paper provides a formal information-theoretic lower bound: no randomized quantization algorithm mapping unit-norm vectors in d dimensions to b·d bits can achieve MSE distortion below 1/4b. TurboQuant's upper bound is (√3π/2) · 1/4b, making the gap a factor of roughly 2.7. At low bit-widths the gap shrinks further: at b=1, TurboQuant is only 1.45× away from optimal.

The lower bound proof is elegant. It uses Yao's minimax principle to convert the worst-case-input, randomized-algorithm problem into a randomized-input, deterministic-algorithm problem, then applies Shannon's distortion-rate function for uniform distributions on the hypersphere. The inner product lower bound follows by a pigeonhole argument over coordinates. These bounds hold for any compression scheme whatsoever, not just scalar quantizers.

On KV cache quantization with Llama-3.1-8B-Instruct, TurboQuant at 3.5 bits per channel scores 50.06 on LongBench, identical to the full 16-bit cache. At 2.5 bits it scores 49.44, a marginal drop that still beats KIVI at 3 bits (48.50) and PolarQuant at 3.9 bits (49.78). On the Needle-in-a-Haystack test, TurboQuant achieves a perfect 0.997 recall score across context lengths from 4k to 104k tokens, matching the uncompressed model exactly.

For nearest neighbor search, TurboQuant consistently outperforms both Product Quantization and RabitQ in recall across three datasets (GloVe at d=200, OpenAI embeddings at d=1536 and d=3072) at both 2-bit and 4-bit precision. The speed advantage is even more dramatic: quantizing 100,000 vectors at 4 bits in 3072 dimensions takes 494 seconds for PQ, 3957 seconds for RabitQ, and 0.002 seconds for TurboQuant. That is not a typo.

The Ministral-7B-Instruct results confirm generality. At 2.5 bits TurboQuant scores 49.62 on LongBench, compared to 49.89 for the full 16-bit cache. Compressing by more than 6× for a 0.27-point drop is a trade most practitioners would take happily.

The KV cache is one of the sharpest bottlenecks in serving long-context language models. It scales with both model depth and sequence length, consuming memory that could otherwise allow larger batches or longer contexts. Methods that require calibration data or per-layer Hessian computation are impractical when tokens arrive one at a time during generation. TurboQuant applies instantly, with no data-specific tuning, making it directly compatible with online, streaming inference.

The combination of provable optimality, zero preprocessing, and GPU-friendly vectorized operations puts TurboQuant in a rare position: it is both theoretically satisfying and practically deployable. The two-stage design that bolts an MSE-optimal quantizer onto a QJL residual correction is a clean architectural pattern, and the information-theoretic lower bounds confirm there is not much room left for improvement. At 3.5 bits per channel, you get the full-precision model's quality. At 2.5 bits, you get almost all of it. The search for better vector quantizers at these bit-widths is, for practical purposes, done.

BOTTOM LINE

TurboQuant shows that a random rotation followed by optimal scalar quantization, with a 1-bit QJL correction on the residual, is enough to come within a factor of 2.7 of the information-theoretic limit for vector quantization. It needs no training data, no preprocessing, and runs in microseconds on a GPU. For KV cache quantization at 3.5 bits per channel, the quality loss is literally zero.

Reference

Zandieh, A., Daliri, M., Hadian, M., & Mirrokni, V. (2025). TurboQuant: Online Vector Quantization with Near-optimal Distortion Rate. arXiv preprint arXiv:2504.19874. https://arxiv.org/abs/2504.19874