acceptodds
Published as a conference paper at NeurIPS 2026

Provable Quantization with Randomized Hadamard Transform

Ying Feng, Piotr Indyk, Michael Kapralov, Dmitrii Krachun, Boris 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 compression. While dense random rotations yield clean theoretical guarantees, they require time. The randomized Hadamard transform reduces this cost to , 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 to the input vector and subtracts a random scalar offset before quantizing, injecting additional randomness at negligible cost. This approach is used by popular quantizers such as RaBitQ, and is a slight modification of others, including TurboQuant and EDEN. We prove that this approach provides mean squared error bounds that asymptotically match those achievable with truly random rotation matrices. For example, we prove a dithered version of TurboQuant achieves mean squared error at bits per coordinate, where the term vanishes uniformly over all unit vectors and all dimensions as the number of quantization levels grows.

Keywords:
Atlanta, Main Track

Reviews

Among:
Shape:
123456this paper, Bottom 49%
Figure 1. Mean review rating of the reviewed papers at NeurIPS 2026. This paper averages 4.33 over 3 reviews, above 49% of the others.
Reviewer_d4DCOpenReview ↗
Rating
4
Clarity
2
Confidence
3
Originality
2
Quality
3
Significance
3
Read review
Summary

The paper studies fast data-oblivious vector quantization using a single randomized Hadamard transform followed by dithered scalar quantization - with commonly adopted random dithering. Its Theorem 1.1 proves that an unbiased version of the quantizer achieves worst-case expected squared error 4−b4^{-b} for unit vectors, matching the asymptotic constant known for dense random rotations while allowing computation faster than dense rotational matrices. Theorem 1.2 extends the approach to inner product estimation via residual quantization, giving expected squared error of order (d4b)−1(d4^b)^{-1} - the scale here is roughly a factor of d−1d^{-1} better than Thm 1.1 - this is intuitive if thinking the error as a d-dimensional random vector - in fact, Thm 1.1 provides Euclidean norm bound while Thm 1.2 controls the 1-dimensional margin.

Strengths and weaknesses

Strengths:

The theoretical results are clean and potentially significant, given that vector quantization is a fundamental problem. The paper also presents a concise proof strategy showing that - after dithering - the scalar quantization error can be controlled uniformly over all unit vectors using only subgaussian/Rademacher-sum properties.

Weaknesses:

My main reservations concern positioning and empirical validation. I would appreciate a clearer explanation of what is new beyond existing dithered scalar quantization and rate-distortion analyses. Related ideas replacing dense random matrices with faster Hadamard-based transforms already appear in the literature (e.g., [KW11]), so the main novelty seems to be the combination with dithered quantization. The paper also contains no numerical results. I understand that this is primarily a theoretical paper, but small experiments comparing against dense random rotation methods would make the practical value much clearer. If the performance is similar while the computation is faster, that would substantially strengthen the paper. I would be happy to increase my score if the authors can address either of these concerns in the rebuttal.

Questions

Q1. Novelty - conceptual or technical aspects. Could the authors clarify what is new beyond existing dithered quantization and Hadamard sketching ideas. E.g., the later appeared in [KW11] and “Isometric sketching of any set via the Restricted Isometry Property”? Also, dithered quantization with uniform dithering is widely studied - the randomness of the uniform dither helps the analysis a lot.

Q2. Experiments. Could the authors add a small comparison with dense random-rotation quantization? This seems easy to run and would show whether the proposed method preserves performance while being faster. (As in Q3, especially because the current theorems are asymptotic in nature so it would be helpful to evaluate finite-bit-width performance)

Q3. Theory interpretation. Theorems 1.1, 1.2 holds only asymptotically when b→∞b\to\infty. How should readers interpret the asymptotic result for practical bit-widths? Can the authors justify this?

Limitations

Yes

Paper formatting concerns

I am not aware of any formatting issues for this submission.

Final justification

My main concerns are on the technical contributions and lack of simulations. In the rebuttal, the authors address/alleviate both concerns. As such I plan to increase the score to 4.

1 comment

Thank you very much for very helpful comments.

Q1. Novelty - conceptual or technical aspects. Could the authors clarify what is new beyond existing dithered quantization and Hadamard sketching ideas. E.g., the later appeared in [KW11] and "Isometric sketching of any set via the Restricted Isometry Property"? Also, dithered quantization with uniform dithering is widely studied ..."

One concrete novel technical component is non-uniform dithering. More specifically, in Algorithm 1, the uniform random shift U is applied in the "quantile space", which translates into a non-uniform shift in the "coordinate space" (see Figure 1 for the explanation). In contrast, standard rate-distortion theory typically subtracts a uniform random variable from the coordinate before quantization. This difference, in combination with the specific codebook constructed in Algorithm 1, is crucial for the proof of Lemma 3.1.

More broadly, to achieve the desired constants in error bounds, our analysis is more delicate and significantly different from prior work. In particular, arguments based on the Restricted Isometry Property of randomized Hadamard transforms induce extra logarithmic factors compared to what one obtains using fully random matrices. (This is in part because the RIP solves a harder problem, bounding a supremum over a subspace, as opposed to the expected value of a single scalar random variable.)

Q2. Experiments. Could the authors add a small comparison with dense random-rotation quantization? This seems easy to run and would show whether the proposed method preserves performance while being faster. (As in Q3, especially because the current theorems are asymptotic in nature so it would be helpful to evaluate finite-bit-width performance)

Experiments included below. For TurboQuant (dense random-rotation quantization), we use a popular implementation available at https://github.com/0xSero/turboquant (to the best of our knowledge, there is no publicly available implementation by the authors). For our Hadamard-based Algorithm 1, we implement the algorithm within the same codebase.

In addition, we evaluated an Algorithm 1/TurboQuant hybrid, which uses the randomized Hadamard transform as in Algorithm 1, but quantizes using TurboQuant codebooks. The resulting NMSE is essentially the same as for pure TurboQuant, while the runtime is essentially the same as for Algorithm 1. However, at present, this hybrid does not have any theoretical guarantees. We omit the details due to space constraints.


TurboQuant vs. Hadamard Algorithm 1: distortion and nearest-neighbor comparison

Highlighting: Bold entries mark where Algorithm 1 improves over TurboQuant. In Part 1, error reduction (A1 source NMSE and A1/TQ, bold where A1/TQ < 1) and speed (A1 round trip and timing speedup, bold where speedup > 1) are highlighted independently, so a row can show one, both, or neither. In Part 2, bold entries are Algorithm 1 recall values that exceed TurboQuant at the same bit width and k. Ties are not highlighted.

Datasets

We use DBpedia and GloVe data sets as in the Turboquant paper [ZDHM25] .

DatasetSource dimensionWorking dimensionSample size
GloVe200256100,000
DBpedia OpenAI31,5362,048100,000
DBpedia OpenAI33,0724,096100,000

As described in Section 4.1 of the TurboQuant paper, we randomly sample 100,000 data from each dataset to perform our experiments. For nearest-neighbor comparisons, we extract 1,000 distinct entries from DBpedia to be used as query points. For the GloVe dataset, we use a pre-existing query set consisting of 10,000 points.


Part 1 — Distortion (source NMSE) and round-trip timing

Metric definition

Source NMSE is the squared Euclidean reconstruction error on the original coordinates (after cropping to the source dimension) divided by the squared norm of the original vector:

Source NMSE=E∥x−x^∥22∥x∥22\text{Source NMSE} = \frac{\mathbb{E} \lVert x - \hat{x}\rVert_2^2}{\lVert x \rVert_2^2}

A1/TQ < 1 means Algorithm 1 has lower distortion. Timing speedup is TurboQuant time / Algorithm 1 time, so a value greater than one favors Algorithm 1.

Round trip is a sum of encode and decode time.

GloVe, d=200 padded to 256

bTQ source NMSEA1 source NMSEA1/TQTQ round trip (ms)A1 round trip (ms)Timing speedup
29.424e-021.676e-011.77810.8113.880.78×
32.706e-023.867e-021.42910.7613.770.78×
47.385e-039.016e-031.22110.7513.800.78×
51.942e-032.155e-031.11011.0013.860.79×
65.350e-045.253e-040.98210.9313.790.79×
71.906e-041.296e-040.68010.7813.890.78×
87.458e-053.217e-050.4315.247.990.66×

DBpedia OpenAI3, d=1,536 padded to 2,048

bTQ source NMSEA1 source NMSEA1/TQTQ round trip (ms)A1 round trip (ms)Timing speedup
29.150e-021.641e-011.79445.6317.942.54×
32.619e-023.733e-021.42546.1418.122.55×
47.143e-038.701e-031.21846.7619.012.46×
51.879e-032.086e-031.11047.4119.742.40×
65.176e-045.096e-040.98547.9420.002.40×
71.848e-041.259e-040.68148.4520.632.35×
87.263e-053.127e-050.43140.4912.923.13×

DBpedia OpenAI3, d=3,072 padded to 4,096

bTQ source NMSEA1 source NMSEA1/TQTQ round trip (ms)A1 round trip (ms)Timing speedup
29.153e-021.654e-011.807151.7632.134.72×
32.620e-023.742e-021.428152.7633.234.60×
47.145e-038.710e-031.219154.6335.164.40×
51.880e-032.088e-031.111156.1036.734.25×
65.178e-045.101e-040.985157.3537.884.15×
71.849e-041.260e-040.681158.6339.164.05×
87.267e-053.130e-050.431143.8924.125.97×

Part 2 — Nearest-neighbor comparison

Retrieval metrics

  • 1@k (recall_1_at_k) is the fraction of queries whose exact top-1 neighbor appears in the approximate top-k. Recall values are percentages averaged over three quantizer seeds. Bold entries are Algorithm 1 values that exceed the TurboQuant value at the same bit width and k.

GloVe recall

bMethod@1@2@4@8@16@32@64
2TurboQuant55.5572.0084.5592.7997.2099.0599.71
2Algorithm 150.1966.1979.7189.2094.7897.9099.12
3TurboQuant72.9888.0996.1999.0299.8399.98100.00
3Algorithm 170.2186.1895.0898.7999.7899.97100.00
4TurboQuant84.8595.8099.3399.94100.00100.00100.00
4Algorithm 183.7795.4699.2799.96100.00100.00100.00
5TurboQuant92.0398.6599.94100.00100.00100.00100.00
5Algorithm 191.6698.6299.91100.00100.00100.00100.00
6TurboQuant95.6699.5499.99100.00100.00100.00100.00
6Algorithm 195.6899.62100.00100.00100.00100.00100.00

DBpedia d=1,536 recall

bMethod@1@2@4@8@16@32@64
2TurboQuant88.4097.8399.97100.00100.00100.00100.00
2Algorithm 185.9096.7799.6399.93100.00100.00100.00
3TurboQuant93.2399.2799.97100.00100.00100.00100.00
3Algorithm 191.6399.0099.97100.00100.00100.00100.00
4TurboQuant95.9399.7799.97100.00100.00100.00100.00
4Algorithm 195.4099.80100.00100.00100.00100.00100.00
5TurboQuant97.4399.90100.00100.00100.00100.00100.00
5Algorithm 197.8399.9099.93100.00100.00100.00100.00
6TurboQuant98.5399.97100.00100.00100.00100.00100.00
6Algorithm 198.70100.00100.00100.00100.00100.00100.00

DBpedia d=3,072 recall

bMethod@1@2@4@8@16@32@64
2TurboQuant91.4798.5799.83100.00100.00100.00100.00
2Algorithm 190.9098.0099.77100.00100.00100.00100.00
3TurboQuant95.1799.27100.00100.00100.00100.00100.00
3Algorithm 195.1099.53100.00100.00100.00100.00100.00
4TurboQuant97.7799.83100.00100.00100.00100.00100.00
4Algorithm 197.9099.90100.00100.00100.00100.00100.00
5TurboQuant98.70100.00100.00100.00100.00100.00100.00
5Algorithm 198.6799.93100.00100.00100.00100.00100.00
6TurboQuant99.37100.00100.00100.00100.00100.00100.00
6Algorithm 199.37100.00100.00100.00100.00100.00100.00

Timing

Means over three seeds.

Index is the sum of quantizer construction time and encode time.

Total is the sum of Index, decode time, and nearest neighbors search time.

Speedup is TurboQuant/Algorithm 1; values above one favor Algorithm 1. Index wins and total wins are highlighted independently.

DatasetbTQ indexA1 indexIndex speedupTQ totalA1 totalTotal speedup
GloVe26.508.140.80×43.8546.080.95×
GloVe39.078.211.10×46.4846.161.01×
GloVe416.908.192.06×54.3346.181.18×
GloVe520.478.162.51×57.9146.111.26×
GloVe627.648.153.39×65.2546.581.40×
DBpedia-1536241.9411.983.50×79.7330.402.62×
DBpedia-1536349.0013.983.51×96.5336.722.63×
DBpedia-1536453.9915.103.58×105.3940.152.62×
DBpedia-1536558.9415.693.76×111.9942.862.61×
DBpedia-1536673.0015.964.57×128.1644.972.85×
DBpedia-30722171.4925.746.66×353.8177.414.57×
DBpedia-30723213.7332.346.61×466.27107.384.34×
DBpedia-30724252.7337.836.68×524.69126.324.15×
DBpedia-30725266.4042.476.27×566.71136.924.14×
DBpedia-30726298.4143.956.79×614.48141.434.34×
Reviewer_6NPcOpenReview ↗
Rating
4
Clarity
2
Confidence
4
Originality
3
Quality
3
Significance
3
Read review
Summary

The authors study vector quantization using a single randomized Hadamard transform, in place of computationally expensive dense random rotations. Existing approaches either rely on fully random rotations, which incur quadratic time complexity, or use multiple structured transforms with weaker or more complex analyses. The authors show that their proposed dithered quantizer is unbiased and achieves asymptotic mean squared error matching the best known guarantees for quantization based on fully random rotations.

Strengths and weaknesses

Strengths

  1. The theoretical contribution is technically strong. The paper closes an important gap between dense random rotations and practical Hadamard-based quantizers. The proof techniques are elegant, particularly the use of dithering to induce uniformity in quantile space.

  2. The paper is well organized and clearly written. The motivation and related work are presented effectively, and the proof sketch aids comprehension of the main ideas before the reader engages with the technical appendix. I did not identify any obvious flaws in the technical arguments, though I did not verify every detail of the appendix.

  3. The work is relevant to similarity search, federated learning, vector databases, and LLM quantization, where randomized Hadamard transforms are already widely used. The theoretical guarantees provide justification for using a single randomized Hadamard transform while maintaining near-optimal distortion. The absence of experimental validation, however, limits assessment of the practical impact of these results.

Weaknesses

  1. The paper does not include experimental validation.

  2. The main theoretical results are asymptotic in the number of quantization levels. Explicit finite-bit error bounds or numerical estimates for commonly used bit-widths (e.g., 2, 4, or 8 bits) would clarify the practical implications of the theory.

  3. The paper motivates the work through applications such as approximate nearest neighbor search, federated learning, and LLM compression, but does not demonstrate how the improved theoretical guarantees translate into measurable improvements in these settings.

Questions
  1. Can the asymptotic analysis be converted into explicit finite-bit guarantees for practical values such as 4 or 8 bits?

  2. How sensitive are the guarantees to the specific choice of Gaussian-based scalar codebook?

  3. Can the proof techniques be extended to other structured orthogonal transforms?

  4. What is the runtime overhead of the unbiased construction relative to the simpler algorithm?

Limitations

The paper does not include empirical evaluation, finite-dimensional analysis, or implementation-level comparisons. The theoretical results are asymptotic and focus on worst-case guarantees. Extensions to broader classes of structured transforms and practical bit accounting remain open problems.

Paper formatting concerns

None.

Final justification

I found the authors' response satisfactory overall. I think the paper is interesting, although I remain somewhat uncertain about the extent of its technical novelty. Nevertheless, I found the results interesting and will maintain my positive score of 4. At this point, I am not sufficiently convinced to raise my score to 5.

1 comment

Thank you for very helpful comments and questions.

The paper does not include experimental validation - Now included, see the response to Reviewer d4DC (which covers applications to approximate nearest neighbor search).

Can the asymptotic analysis be converted into explicit finite-bit guarantees for practical values such as 4 or 8 bits? - In principle yes: our proof is constructive, so tracking constants would produce an explicit finite-bit bound. At 4 or 8 bits, however, that bound becomes too loose to be informative. We instead validate this regime empirically - the rebuttal to Reviewer d4DC shows the predicted low error already holds at 4 and 8 bits, indicating the asymptotic regime is entered well before our bounds tighten.

How sensitive are the guarantees to the specific choice of Gaussian-based scalar codebook? - The proof relies on the specific codebook defined in Algorithm 1. However, as long as a codebook has well-defined error guarantees, it should be possible to use them to bound the overall error.

Can the proof techniques be extended to other structured orthogonal transforms? - Yes. In particular, Lemma 3.1 only requires that the distribution of each coordinate of a transformed vector z (before quantization) is subgaussian.

What is the runtime overhead of the unbiased construction relative to the simpler algorithm? - It is the same as for the simpler algorithm, at least up to the big-Oh terms. The codebook construction is a bit more complex, but its runtime complexity is unchanged.

Reviewer_FBiwOpenReview ↗
Rating
5
Clarity
4
Confidence
4
Originality
3
Quality
4
Significance
3
Read review
Summary

This paper studies the process of compressing a unit vector in Rd\mathbb R^d to be represented using only bdb d bits of data. This process requires designing both an encoder and a decoder. The encoder is a randomized algorithm in this case. If we let x~\tilde x denote the decode of the encode of a unit vector xx, then error is measured as $ \sup_{||x||=1} \mathbb E || x - ~x ||_2^2 $

Care is taken to ensure that the randomized encoding process still allows us to have E[x~]=x\mathbb E[\tilde x] = x.

The authors propose an encoding and decoding scheme which achieves error bounds with nice constants. This system uses a single randomized Hadamard transform, which is more efficient than existing approaches, which use Haar-random, Gaussian, or multiple randomized Hadamard transforms.

The authors also produce a separate but related encode/decode process that can be used to ensure that the error of inner products is not too large. That is, again let x~\tilde x be the decode of the encode of unit vector xx, and let yy be an arbitrary unit vector. Then, E[(⟨y,x⟩−⟨y,x~,⟩)2]≲1d4b,\mathbb E [ (\langle y, x\rangle - \langle y, \tilde x,\rangle)^2 ] \lesssim \frac{1}{d 4^b}, with pretty explicit constants given.

The paper is entirely theoretical; no experiments are made. Motivations are given through the recent ML quantization literature, eg TurboQuant.

Strengths and weaknesses

Update: The authors revamped section 4, and I am happy! I have raised my scores accordingly.


The paper is good. If we ignore section 4, I think this paper merits acceptance. Section 4, which discusses the inner product problem, is a mess. I'll ask the authors to rewrite that entire section before I recommend the paper be accepted. It's only about 1.5 pages of work, but it badly needs to be updated.

The paper is timely, original, well motivated, and interesting.

The quantization problem is timely; the framing of the problem is natural and fundamental. The algorithms are, certainly by the standards of the theory literature, at least okayishly practical. The constants are pretty great; they suggest 4 bits of quantization should achieve an MSE with 1% error for the ∣∣x−x~∣∣||x - \tilde x|| problem (ignoring the few constants buried in a little-Oh; I'd like to see what those constants are...).

Ignoring section 4, the paper is written super duper well. Very easy to read. Well contextualized. Strong intuitions. Natural constructions. Simple but clever analysis ideas. Really, all complaints I have here are pedantic.

Section 4 is a mess though. It is underexplained. It has bit pseudocode blocks that do not seem very helpful for understanding the underlying ideas. It has symbols that are defined but not used, such as AA and λ\lambda. It has symbols that are used but not defined, such as ss and τB\tau_B. It suddenly shifts what it is doing mid-writing, around lines 229 vs 230. The paper suddenly goes from giving great intuition for what is going on in sections 1-3 to totally failing to describe the underlying procedure in section 4. The underlying ideas might be solid; I want to see a fully revised version of this section before I give this paper the green light. The pseudocode can be pushed to the appendix if that is limiting the amount of space available to describe the concepts of the procedure.

Otherwise, I am excited to see this paper published! Good work, folks!

Questions

I've not got anything super concrete as questions. Here's a list of recommended edits to make. For the medium edits, if you disagree, then please tell me why. For the small edits, feel free to disregard anything and everything without telling me about it.

Medium edits

  1. [Power and limitations of the quantization approach] Acknowledge the power and limitations of this kind of quantization more directly. This is useful for applications where we care a lot about communication and compression, and for settings where we need only compute inner products, but it does not allow arithmetic directly on quantized vectors. Applications needing to do operations other than inner products on compact representations should look elsewhere.

  2. [Theorem 1.2 / comparison to TurboQuant] Clarify whether Theorem 1.2 gets the same result as TurboQuant for inner products. The theorem seems to match the same qualitative rate, but with a different constant and different bit accounting. Clarify this in the writing.

  3. [Theorem 1.2 / bit accounting] State exactly how many bits suffice to use the machine in Theorem 1.2.

  4. [Lines 69–70] Is it clear that you need to use padding to a power of 2? Can we not use a DCT or something? Is this theoretical convenience or is this real?

  5. [Theorem 1.1] Theorem 1.1 is a bit too informally stated. There is “b→∞b \to \infty” on the RHS, but there is not really a visible limit as shown. Rewrite this to say lim⁡b→∞ED,U∥x−x~∥2≤…\lim_{b \to \infty} E_{D,U}\|x-\tilde x\|^2 \le \ldots. Or drop the b→∞b \to \infty part entirely.

  6. [Theorem 1.2] Remove BB and just write 2b2^b, or 4b4^b, as needed.

  7. [Line 110] This “distortion overhead that does not vanish for fixed dd” is confusing language. I assume you mean something like “distortion ≤\le normal-rotation term divided by 4b4^b plus f(d)f(d), where f(d)→0f(d) \to 0 as d→∞d \to \infty, but f(d)f(d) remains constant as b→∞b \to \infty.” As such, the only way to make the distortion arbitrarily small is by increasing the dimension. Or, the distortion cannot be made arbitrarily small by increasing the bit precision. Something along these lines would be clearer than the current text.

  8. [Lines 224–229] (I kept this from my initial pass reading section 4. This is just a bit more detailed that the other stuff, in case it's helpful.) The paragraph from lines 224–229 is notably much harder to follow than the other writing in this paper. Things are introduced without being motivated. The output of ScalarQuant is not well defined. The symbols AA and λ\lambda are set “for the analysis,” but it is not clear if this is defining symbols that will be nice for the math or if this is a way of setting parameters that are not chosen this way in practice. Saying that “By Algorithm 2, 1≤A≤21 \le A \le 2” is not very clear either. The level is not terrible but it is also not great; maybe the floor of log⁡(∣vi∣/σ)\log(|v_i|/\sigma) is easier on the eyes, or maybe the current one is better. Rewrite this paragraph.

  9. [Around line 230] (I kept this from my initial pass reading section 4. This is just a bit more detailed that the other stuff, in case it's helpful.) Clarify what is going on conceptually around line 230. What is the goal? Are we defining the scalar quantizer now? More than anything, I am looking to understand the concept of this discussion starting on line 230. It is not clear what the goal is in this part of the writing nor what the concept of the approach is.

  10. [Line 232] Why use unary? I mean, I guess you could, but why?

Small edits / notes

  1. [Abstract, last line] Remove the “uniformly over all unit vectors and dimensions” statement, as it is confusing. Maybe clarify what you mean, but probably just remove it.

  2. [Line 65] “A pair of quantizer and dequantizer” is awkward. Rephrase.

  3. [Line 65] Add “we” before “minimize.”

  4. [Line 66] “For any (worst-case) vector xx” maybe? The plural is confusing here.

  5. [Line 98] “Truly random matrix” is bad wording. Maybe use “uniformly random rotation matrix.” Randomized Hadamard is “truly random” too.

  6. [Line 128] Consider, though I am not convinced of this myself, writing the grid points as h0=U/Bh_0 = U/B, hi+1=hi+1/Bh_{i+1}=h_i+1/B.

  7. [Figure 1] Figure 1 is exceptionally useful. Great work!

  8. [Line 142] Point out that HH has ±1\pm 1 entries, up to scaling, which is why the marginal distributions are the same.

  9. [Lines 156–159] You have already shown this decomposition going down to ziz_i. It does not need to be restated.

  10. [Lemma 3.1] Fix the B→∞B \to \infty styling, as mentioned before.

  11. [Line 173] Do not say something is surprising; say “might be surprising” instead. Comes across better.

  12. [Footnote 2] “Truly random rotation” is messy language. Gaussian matrix makes more sense, I guess. Again, randomized Hadamard is a rotation matrix. I would usually say a rotation matrix must satisfy RR′=R′R=IRR' = R'R = I. So “truly random rotation” reads more like Haar-random uniform, which does not invoke the N(0,1)N(0,1) distribution, though it should lead to subgaussian marginals, as needed.

  13. [Line 209] Explain the step on line 209 more clearly. Expand the derivatives to show the exponential in zz and ζ\zeta that appears.

  14. [Line 209] Include the exact value of the expectation of 1/F′(ζ)21/F'(\zeta)^2.

  15. [Section 3.1] Section 3.1 should have clear notation to condition on the event that zz is in the central event.

  16. [Line 220] This should not really be O(1)/(dB2)⋅∥y∥2O(1)/(dB^2)\cdot \|y\|^2. It should be O(∥y∥2/(dB2))O(\|y\|^2/(dB^2)). That is the point of big-O.

  17. [Line 228] Add a comma after “analysis.”

Limitations

yes

Paper formatting concerns

N/A

Final justification

My main concern was section 4, which was originally poorly written. The authors provided a stellar rewrite of that section, which is clear and covers my concerns very well.

As such, the strengths of the original paper remain while the difficulties from section 4 have been resolved. This paper should clearly be accepted to NeurIPS.

1 comment

Thank you very much for very helpful comments. We will implement all editing suggestions. We updated Section 4 and included it in its entirety below.

Inner product quantizer

In this section we present our inner product quantizer and prove Theorem thm:inner-product-error. The quantizer is presented as Algorithm 3 below. The main idea is to add a second stage to the quantization process that decorrelates the residual r=x−x~r=x-\widetilde x with any fixed vector y∈Rdy\in\mathbb{R}^d. As a result, we obtain the approximation error for (⟨y,x⟩−⟨y,x~⟩)2(\langle y,x\rangle-\langle y,\widetilde x\rangle)^2 that scales as O(∣y∣22dB2)O(\frac{\\|y\\|_2^2}{dB^2}), as required. This decorrelation is achieved by a single application of a fresh HDHD matrix to the residual followed by a simple quantization procedure that uses a constant number of bits per coordinate in expectation. We now describe this basic scalar quantizer.

Concretely, let r=x−x~r=x-\widetilde x be the residual vector, where x~\widetilde x is the result of quantization using our main VectorQuant procedure followed by projecting onto the unit ball — see line 7 of Algorithm 3 below. The projection operator Π\Pi is defined as Π(v)=v\Pi(v)=v if ∣v∣2≤1\\|v\\|_2\leq1 and Π(v)=v/∣v∣2\Pi(v)=v/\\|v\\|_2 otherwise; since the input xx is a unit norm vector, this only improves the quality of reconstruction, and helps us ensure a deterministic upper bound on the norm of the residual.

The residual rr is then quantized by first quantizing the residual scale (line 9 of Algorithm 3 below), defined by s=∣r∣d∈[0,2d]s=\frac{\\|r\\|}{\sqrt d}\in[0,\frac{2}{\sqrt d}], and then quantizing the individual elements (lines 14–17 of Algorithm 3 below). This scale ss can be interpreted as a reference magnitude for a typical coordinate after the transform. We first quantize the scale ss using a basic scalar quantizer ScalarQuant(s)\mathsf{ScalarQuant}(s) (Algorithm 1 below) and then quantize the residual's coordinates based on the quantized scale (Algorithm 2 below).


Algorithm 1: Scalar quantization

input: scalar s∈[0,2d]s\in[0,\frac{2}{\sqrt d}], dimension dd, scale parameter B≥2B\ge2 public parameter: minimum encoded scale τB←1/(dB)\tau_B\gets1/(dB).

function ScalarQuant(s)\mathsf{ScalarQuant}(s)

  1. if s<τBs\lt\tau_B then
  2. \quad return idxσ←0\mathrm{idx}_\sigma\gets0 (truncate scales smaller than τB=1/(dB)\tau_B=1/(dB) down to zero)
  3. k←⌈log⁡2(s/τB)⌉k\gets\lceil\log_2(s/\tau_B)\rceil (a factor two approximation for scales larger than τB\tau_B)
  4. idxσ←k+1\mathrm{idx}_\sigma\gets k+1
  5. return idxσ\mathrm{idx}_\sigma

function ScalarDeQuant(idxσ)\mathsf{ScalarDeQuant}(\mathrm{idx}_\sigma)

  1. if idxσ=0\mathrm{idx}_\sigma=0 then
  2. \quad return σ←0\sigma\gets0
  3. return σ←τB⋅2idxσ−1\sigma\gets\tau_B\cdot2^{\mathrm{idx}_\sigma-1}

The goal of Algorithm 1 is to use a bounded number of bits to quantize the scale ss of the residual vector to a dyadic estimate σ\sigma. Once we have this, in the following step (Algorithm 2 below), we can then quantize each coordinate of the residual vector with an appropriate level of precision. Concretely, in Algorithm 1, if the residual scale exceeds a minimum cutoff, i.e., s≥τBs\ge\tau_B, then the quantized scale is σ=τB2idxσ−1\sigma=\tau_B2^{\mathrm{idx}_\sigma-1} satisfying s≤σ<2ss\le\sigma\lt2s.

On the other hand if s<τBs\lt\tau_B, then the quantized scale is set to σ=0\sigma=0 indicating that the residual is negligibly small (thus the residual quantization stage can be skipped). The quantized scales are indexed by idxσ\mathrm{idx}_\sigma, which can be encoded using ⌈log⁡2(⌈log⁡2(2d/τB)⌉+2)⌉=O(log⁡log⁡(dB))\lceil\log_2(\lceil\log_2(\frac{2}{\sqrt d}/\tau_B)\rceil+2)\rceil=O(\log\log(dB)) bits when s∈[0,2d]s\in[0,\frac{2}{\sqrt d}].

We next describe the residual quantizer in Algorithm 2, which uses Algorithm 1 as a subroutine.


Algorithm 2: Residual Quantization

input: dimension dd, scale parameter B≥2B\ge2 Let H∈Rd×dH\in\mathbb{R}^{d\times d} be a normalized Hadamard matrix and DD be a diagonal matrix whose entries are i.i.d. Rademacher random variables.

function ResidualQuant(r∈Rd)\mathsf{ResidualQuant}(r\in\mathbb{R}^d)

  1. idxσ←ScalarQuant(∣r∣/d)\mathrm{idx}_\sigma\gets\mathsf{ScalarQuant}(\\|r\\|/\sqrt d)
  2. if idxσ=0\mathrm{idx}_\sigma=0 then
  3. \quad return idxσ\mathrm{idx}_\sigma, ℓ=(0,…,0)\ell=(0,\ldots,0), and λ=(0,…,0)\lambda=(0,\ldots,0)
  4. σ←ScalarDeQuant(idxσ)\sigma\gets\mathsf{ScalarDeQuant}(\mathrm{idx}_\sigma)
  5. v←HDrv\gets HDr
  6. for i∈[d]i\in[d] do
  7. \quad ℓi←min⁡ℓ∈0,1,2,…:∣vi∣≤σ⋅2ℓ\ell_i\gets\min\\{\ell\in\\{0,1,2,\ldots\\}:|v_i|\le\sigma\cdot2^{\ell}\\} (store as unary word 1ℓi01^{\ell_i}0)
  8. \quad Ri←σ⋅2ℓiR_i\gets\sigma\cdot2^{\ell_i}
  9. \quad sample sign bit λi∈−1,1\lambda_i\in\\{-1,1\\} with Pr⁡(λi=1∣D,r)=1+(vi/Ri)2\Pr(\lambda_i=1\mid D,r)=\frac{1+(v_i/R_i)}{2}
  10. return idxσ\mathrm{idx}_\sigma, ℓ=(ℓ1,…,ℓd)\ell=(\ell_1,\ldots,\ell_d), and λ=(λ1,…,λd)\lambda=(\lambda_1,\ldots,\lambda_d)

function ResidualDeQuant(idxσ,ℓ,λ)\mathsf{ResidualDeQuant}(\mathrm{idx}_\sigma,\ell,\lambda)

  1. σ←ScalarDeQuant(idxσ)\sigma\gets\mathsf{ScalarDeQuant}(\mathrm{idx}_\sigma)
  2. for i∈[d]i\in[d] do
  3. \quad Ri←σ⋅2ℓiR_i\gets\sigma\cdot2^{\ell_i}
  4. \quad qi←Riλiq_i\gets R_i\lambda_i
  5. r^←DH⊤q\widehat r\gets DH^\top q
  6. return r^\widehat r

In English, for each coordinate i∈[d]i\in[d], Algorithm 2 records the level ℓi\ell_i, which reflects the absolute value of the coordinate, and separately records its sign. For simplicity the level ℓi\ell_i is recorded in unary as the word 1ℓi01^{\ell_i}0 (of course, this can be improved somewhat by a binary encoding, but the asymptitic complexity will not change). Finally, the quantizer samples one randomized sign bit λi∈−1,1\lambda_i\in\\{-1,1\\} with Pr⁡(λi=1∣D,r)=1+(vi/Ri)2\Pr(\lambda_i=1\mid D,r)=\frac{1+(v_i/R_i)}{2} to ensure that our estimator is unbiased. This probability is valid because ∣vi∣≤σ2ℓi=Ri|v_i|\le\sigma2^{\ell_i}=R_i. The intuition behind this construction is that the random value RiλiR_i\lambda_i is an unbiased estimate of viv_i: E[Riλi]=(Ri⋅1)⋅1+(vi/Ri)2+(Ri⋅(−1))1−(vi/Ri)2=vi\mathbb{E}[R_i\lambda_i]=(R_i\cdot1)\cdot\frac{1+(v_i/R_i)}{2}+(R_i\cdot(-1))\frac{1-(v_i/R_i)}{2}=v_i. And since RiR_i is chosen to be the smallest admissible dyadic radius, the variance is also controlled, allowing the coordinate to be encoded using only the level ℓi\ell_i and one sign bit λi\lambda_i.

Finally, our two-stage inner product quantizer is presented below as Algorithm 3. As summarized at the beginning of this section, it combines the MSE quantizer with a second stage that applies a fresh HDHD matrix to the residual r=x−x~r=x-\widetilde x and then quantizes the transformed residual. This construction makes the residual-quantization error sufficiently uncorrelated with any fixed query vector, yielding an inner-product error that decreases by a factor of dd. Its analysis, namely the proof of Theorem thm:inner-product-error, is presented in the appendix (app:inner-product).


Algorithm 3: Two-Stage Inner Product Quantizer

input: dimension dd, base bit-width bb

Setup

  1. H∈Rd×dH\in\mathbb{R}^{d\times d} normalized Hadamard; B←2bB\gets2^b; Π:Rd→Rd\Pi:\mathbb{R}^d\to\mathbb{R}^d unit-ball projection
  2. ε1,…,εd∼\varepsilon_1,\ldots,\varepsilon_d\sim Rademacher; Dbase←diag(ε1,…,εd)D_{\mathrm{base}}\gets\mathrm{diag}(\varepsilon_1,\ldots,\varepsilon_d)
  3. η1,…,ηd∼\eta_1,\ldots,\eta_d\sim Rademacher; Dres←diag(η1,…,ηd)D_{\mathrm{res}}\gets\mathrm{diag}(\eta_1,\ldots,\eta_d)
  4. U∼Unif[0,1)U\sim\mathrm{Unif}[0,1)
  5. ConstructScalarCodebook(B,U)\mathsf{ConstructScalarCodebook}(B,U) (defined in Algorithm alg:hsgb; builds Bj,qj\mathcal{B}_j,q_j for j∈[B]j\in[B])

function Quantize(x∈Sd−1)\mathsf{Quantize}(x\in\mathcal{S}^{d-1})

  1. Stage 1 — base dithered quantization. y←HDbasexy\gets HD_{\mathrm{base}}x
  2. for i∈[d]i\in[d] do
  3. \quad zi←d,yiz_i\gets\sqrt d\\,y_i
  4. \quad idxi←\mathrm{idx}_i\gets index j∈[B]j\in[B] such that zi∈Bjz_i\in\mathcal{B}_j (Bj\mathcal{B}_j's computed by ConstructScalarCodebook(B,U)\mathsf{ConstructScalarCodebook}(B,U))
  5. \quad y~i←(1/d)⋅qidxi\widetilde y_i\gets(1/\sqrt d)\cdot q_{\mathrm{idx}_i} (local dequantization for residual)
  6. idx←(idx1,…,idxd)∈[B]d\mathrm{idx}\gets(\mathrm{idx}_1,\ldots,\mathrm{idx}_d)\in[B]^d
  7. x~←ΠDbaseH⊤y~\widetilde x\gets\Pi D_{\mathrm{base}}H^\top\widetilde y (base reconstructed vector, projected)
  8. Stage 2 — residual quantization (Alg. 2). r←x−x~r\gets x-\widetilde x (compute the residual vector)
  9. idxσ←ScalarQuant(∣r∣/d)\mathrm{idx}_\sigma\gets\mathsf{ScalarQuant}(\\|r\\|/\sqrt d)
  10. if idxσ=0\mathrm{idx}_\sigma=0 then
  11. \quad return idx\mathrm{idx}, idxσ\mathrm{idx}_\sigma, ℓ=(0,…,0)\ell=(0,\ldots,0), λ=(0,…,0)\lambda=(0,\ldots,0)
  12. σ←ScalarDeQuant(idxσ)\sigma\gets\mathsf{ScalarDeQuant}(\mathrm{idx}_\sigma)
  13. v←HDresrv\gets HD_{\mathrm{res}}r
  14. for i∈[d]i\in[d] do
  15. \quad ℓi←min⁡ℓ∈0,1,2,…:∣vi∣≤σ2ℓ\ell_i\gets\min\\{\ell\in\\{0,1,2,\ldots\\}:|v_i|\le\sigma2^{\ell}\\} (unary word 1ℓi01^{\ell_i}0)
  16. \quad Ri←σ⋅2ℓiR_i\gets\sigma\cdot2^{\ell_i}
  17. \quad sample sign bit λi∈−1,1\lambda_i\in\\{-1,1\\} with Pr⁡(λi=1∣Dres,r)=1+vi/Ri2\Pr(\lambda_i=1\mid D_{\mathrm{res}},r)=\frac{1+v_i/R_i}{2}
  18. return idx\mathrm{idx}, idxσ\mathrm{idx}_\sigma, ℓ=(ℓ1,…,ℓd)\ell=(\ell_1,\ldots,\ell_d), and λ=(λ1,…,λd)\lambda=(\lambda_1,\ldots,\lambda_d)

function DeQuantize(idx,idxσ,ℓ,λ)\mathsf{DeQuantize}(\mathrm{idx},\mathrm{idx}_\sigma,\ell,\lambda)

  1. Stage 1 — base reconstruction. for i∈[d]i\in[d] do
  2. \quad y~i←(1/d)⋅qidxi\widetilde y_i\gets(1/\sqrt d)\cdot q_{\mathrm{idx}_i}
  3. x~←ΠDbaseH⊤y~\widetilde x\gets\Pi D_{\mathrm{base}}H^\top\widetilde y
  4. Stage 2 — residual reconstruction. σ←ScalarDeQuant(idxσ)\sigma\gets\mathsf{ScalarDeQuant}(\mathrm{idx}_\sigma)
  5. if σ=0\sigma=0 then
  6. \quad r^←0\widehat r\gets0
  7. else
  8. \quad for i∈[d]i\in[d] do
  9. \quad\quad Ri←σ2ℓiR_i\gets\sigma2^{\ell_i}
  10. \quad\quad qires←Riλiq_i^{\mathrm{res}}\gets R_i\lambda_i
  11. \quad r^←DresH⊤qres\widehat r\gets D_{\mathrm{res}}H^\top q^{\mathrm{res}}
  12. return x^←x~+r^\widehat x\gets\widetilde x+\widehat r (final reconstructed vector)

Comments on the paper

1 comment
Meta-review

The paper considers randomized quantization algorithms for large matrices, as motivated by, e.g., compression of large language models. A popular approach in this area is to use the randomized Hadamard transform (RHT) in order to increase the effectiveness of the quantization. However, previously the theoretical understanding of why we can use an RHT for this task has been limited. The authors close that gap by showing that an RHT-based quantizer is effective for preserving the norms and inner products of vectors.

The reviewers agree that the paper provides an interesting theoretical contribution, but there are some major concerns that need to be addressed:

  • The clarity of the writing needs to be substantially improved for the discussion of the inner-product preserving algorithm and the corresponding theorem (Section 4). In my view, inner product preservation is the more significant of the two guarantees, yet its presentation is much less fleshed out. If the authors can demonstrate a more comprehensible explanation of what is covered in Section 4, that would be helpful.
  • Two of the reviewers are concerned with the lack of experiments. While I accept that this is a primarily theoretical work, some experiments demonstrating the viability of the method would be helpful.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.