cs.LGMay 13, 2026

Provable Quantization with Randomized Hadamard Transform

Authors: Ying FengPiotr IndykMichael KapralovDmitry KrachunBoris Prokhorov

Abstract

Vector quantization via random projection followed by scalar quantization is a fundamental primitive in machine learning, with applications ranging from similarity search to federated learning and KV cache compression. While dense random rotations yield clean theoretical guarantees, they require Θ(d2)Θ(d^2) time. The randomized Hadamard transform HDHD reduces this cost to O(dlogd)O(d \log d), but its discrete structure complicates analysis and leads to weaker or purely empirical compression guarantees. In this work, we study a variant of this approach: dithered quantization with a single randomized Hadamard transform. Specifically, the quantizer applies HDHD to the input vector and subtracts a random scalar offset before quantizing, injecting additional randomness at negligible cost. We prove that this approach is unbiased and provides mean squared error bounds that asymptotically match those achievable with truly random rotation matrices. In particular, we prove that a dithered version of TurboQuant achieves mean squared error (π3/2+o(1))4b\bigl(π\sqrt{3}/2 + o(1)\bigr) \cdot 4^{-b} at bb bits per coordinate, where the o(1)o(1) term vanishes uniformly over all unit vectors and all dimensions as the number of quantization levels grows.

Explore similar work

May 7, 2026cs.LG

Quantizing With Randomized Hadamard Transforms: Efficient Heuristic Now Proven

Uniform random rotations (URRs) are a common preprocessing step in modern quantization approaches used for gradient compression, inference acceleration, KV-cache compression, model weight quantization, and approximate nearest-neighbor search in vector databases. In practice, URRs are often replaced by randomized Hadamard transforms (RHTs), which preserve orthogonality while admitting fast implementations. The remaining issue is the performance for worst-case inputs. With a URR, each coordinate is individually distributed as a shifted beta distribution, which converges to a Gaussian distribution in high dimensions. Generally, one RHT is not suitable in the worst case, as individual coordinates can be far from these distributions. We show that after composing two RHTs on any dd-sized input vector, the marginal distribution of every fixed coordinate of the normalized rotated vector is within O(d1/2)O(d^{-1/2}) of a standard Gaussian both in Kolmogorov distance and in 11-Wasserstein distance. We then plug these bounds into the analyses of modern compression schemes, namely DRIVE and QUIC-FL, and show that two RHTs achieve performance that asymptotically matches URRs. However, we show that two RHTs may not be sufficient for Vector Quantization (VQ), which often requires weak correlation across fixed-size blocks of coordinates (as opposed to only marginal distribution convergence for single coordinates). We prove that a composition of three RHTs leads to decaying coordinate covariance. This ensures that any fixed, bounded, multi-dimensional VQ codebook optimized for URRs has the same expected error when using three RHTs, up to an additive term that vanishes with the dimension. Finally, because practical inputs are rarely adversarial, we propose a linear-time O(d){O}(d) check on the input's moments to dynamically adapt the number of RHTs used at runtime to improve performance.
Ran Ben-Basat, William Kuszmaul, Michael Mitzenmacher +2
Apr 20, 2026cs.LG

A Note on TurboQuant and the Earlier DRIVE/EDEN Line of Work

This note clarifies the relationship between the recent TurboQuant work and the earlier DRIVE (NeurIPS 2021) and EDEN (ICML 2022) schemes. DRIVE is a 1-bit quantizer that EDEN extended to any b>0b>0 bits per coordinate; we refer to them collectively as EDEN. First, TurboQuantmse_{\text{mse}} is a special case of EDEN obtained by fixing EDEN's scalar scale parameter to S=1S=1. EDEN supports both biased and unbiased quantization, each optimized by a different SS (chosen via methods described in the EDEN works). The fixed choice S=1S=1 used by TurboQuant is generally suboptimal, although the optimal SS for biased EDEN converges to 11 as the dimension grows; accordingly TurboQuantmse_{\text{mse}} approaches EDEN's behavior for large dd. Second, TurboQuantprod_{\text{prod}} combines a biased (b1)(b-1)-bit EDEN step with an unbiased 1-bit QJL quantization of the residual. It is suboptimal in three ways: (1) its (b1)(b-1)-bit step uses the suboptimal S=1S=1; (2) its 1-bit unbiased residual quantization has worse MSE than (unbiased) 1-bit EDEN; (3) chaining a biased (b1)(b-1)-bit step with a 1-bit unbiased residual step is inferior to unbiasedly quantizing the input directly with bb-bit EDEN. Third, some of the analysis in the TurboQuant work mirrors that of the EDEN works: both exploit the connection between random rotations and the shifted Beta distribution, use the Lloyd-Max algorithm, and note that Randomized Hadamard Transforms can replace uniform random rotations. Experiments support these claims: biased EDEN (with optimized SS) is more accurate than TurboQuantmse_{\text{mse}}, and unbiased EDEN is markedly more accurate than TurboQuantprod_{\text{prod}}, often by more than a bit (e.g., 2-bit EDEN beats 3-bit TurboQuantprod_{\text{prod}}). We also repeat all accuracy experiments from the TurboQuant paper, showing that EDEN outperforms it in every setup we have tried.
Ran Ben-Basat, Yaniv Ben-Itzhak, Gal Mendelson +3
May 19, 2026cs.LG

Block-Sphere Vector Quantization

Vector quantization is a fundamental primitive for scalable machine learning systems, enabling memory-efficient storage, fast retrieval, and compressed inference. Recent rotation-based quantizers such as EDEN, RabitQ, and TurboQuant have introduced strong guarantees and empirical performance, but the surrounding comparisons have been difficult to interpret because they rely on different distortion criteria, probability regimes, and implementation assumptions. As our first contribution, we provide a unified theoretical comparison of these methods and show that their relative advantages are criterion-dependent rather than absolute: EDEN and TurboQuant are favorable for MSE distortion, EDEN is also effective for expected inner-product distortion, and RabitQ provides strong high-probability control. This comparison further clarifies that EDEN provides particularly strong guarantees for expected distortion measures. As our second contribution, we introduce Block-Sphere Quantization (BlockQuant), a new rotation-based block quantization algorithm designed around the spherical geometry of randomly rotated vectors. Unlike coordinate-wise quantizers, BlockQuant quantizes blocks on the sphere, preserving the geometry of rotated embeddings more faithfully. We prove that this block-spherical design theoretically improves over the baselines considered in this paper for both reconstruction MSE and expected inner-product distortion. Our experiments on real embedding datasets and long-context LLM inference tasks show practical gains that are consistent with our theoretical improvements.
Heesang Ann, Joongkyu Lee, Min-hwan Oh