potentialpaper

Provable Quantization with Randomized Hadamard Transform

Ying Feng, Piotr Indyk, Michael Kapralov, Dmitrii Krachun, Boris Prokhorov

NeurIPS 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

TL;DR. We give provable guarantees for fast random-projection-based quantization methods

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)\Theta(d^2) time. The randomized Hadamard transform HDHD reduces this cost to O(dlog⁡d)O(d \log d), but its discrete structure complicates analysis and leads to weaker or purely empirical compression guarantees. In this work, we introduce DASHQuant (Dithered Accelerated Single-Hadamard Quantization) a provable variant of this approach. Specifically, the quantizer applies HDHD to the input vector and adds a random dithering 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, and a special case of EDEN, achieves mean squared error (π3/2+o(1))⋅4−b\bigl(\pi\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.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
4 May 2026NeurIPS 2026submittedNeurIPS 2026Accept (poster)reviews ↓[1]—[1]
Missing a version?

NeurIPS 2026

Accept (poster) · 3 reviews · OpenReview

Updated 25 Nov 2026, 03:49 UTC.

Program Chairs · DecisionOpenReview ↗
Decision
Accept (poster)
Read decision
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.
Final justification

The reviewers appreciated author responses and are now overall much more positive about the paper. Please incorporate all of the changes promised for the camera ready version, including the revised Section 4 and the experiments.

Area Chair HSpH · Meta-reviewOpenReview ↗
Read meta-review
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.
Final justification

The reviewers appreciated author responses and are now overall much more positive about the paper. Please incorporate all of the changes promised for the camera ready version, including the revised Section 4 and the experiments.

1 comment
Authors · CommentOpenReview ↗

thanks

Dear Reviewers and AC,

Thank you for the helpful reviews and discussion. We will revise the paper according to your comments. Should the paper be accepted, we will use the additional camera-ready page for the experiments.

Best,

The authors

Reviewer d4DCOpenReview ↗
Rating
4/6
Confidence
3/5
Quality
3/4
Clarity
2/4
Significance
3/4
Originality
2/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
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

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.

Formatting concerns

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

3 comments
Authors · RebuttalOpenReview ↗
Rebuttal

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] .

Dataset Source dimension Working dimension Sample size
GloVe 200 256 100,000
DBpedia OpenAI3 1,536 2,048 100,000
DBpedia OpenAI3 3,072 4,096 100,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

b TQ source NMSE A1 source NMSE A1/TQ TQ round trip (ms) A1 round trip (ms) Timing speedup
2 9.424e-02 1.676e-01 1.778 10.81 13.88 0.78×
3 2.706e-02 3.867e-02 1.429 10.76 13.77 0.78×
4 7.385e-03 9.016e-03 1.221 10.75 13.80 0.78×
5 1.942e-03 2.155e-03 1.110 11.00 13.86 0.79×
6 5.350e-04 5.253e-04 0.982 10.93 13.79 0.79×
7 1.906e-04 1.296e-04 0.680 10.78 13.89 0.78×
8 7.458e-05 3.217e-05 0.431 5.24 7.99 0.66×

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

b TQ source NMSE A1 source NMSE A1/TQ TQ round trip (ms) A1 round trip (ms) Timing speedup
2 9.150e-02 1.641e-01 1.794 45.63 17.94 2.54×
3 2.619e-02 3.733e-02 1.425 46.14 18.12 2.55×
4 7.143e-03 8.701e-03 1.218 46.76 19.01 2.46×
5 1.879e-03 2.086e-03 1.110 47.41 19.74 2.40×
6 5.176e-04 5.096e-04 0.985 47.94 20.00 2.40×
7 1.848e-04 1.259e-04 0.681 48.45 20.63 2.35×
8 7.263e-05 3.127e-05 0.431 40.49 12.92 3.13×

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

b TQ source NMSE A1 source NMSE A1/TQ TQ round trip (ms) A1 round trip (ms) Timing speedup
2 9.153e-02 1.654e-01 1.807 151.76 32.13 4.72×
3 2.620e-02 3.742e-02 1.428 152.76 33.23 4.60×
4 7.145e-03 8.710e-03 1.219 154.63 35.16 4.40×
5 1.880e-03 2.088e-03 1.111 156.10 36.73 4.25×
6 5.178e-04 5.101e-04 0.985 157.35 37.88 4.15×
7 1.849e-04 1.260e-04 0.681 158.63 39.16 4.05×
8 7.267e-05 3.130e-05 0.431 143.89 24.12 5.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

b Method @1 @2 @4 @8 @16 @32 @64
2 TurboQuant 55.55 72.00 84.55 92.79 97.20 99.05 99.71
2 Algorithm 1 50.19 66.19 79.71 89.20 94.78 97.90 99.12
3 TurboQuant 72.98 88.09 96.19 99.02 99.83 99.98 100.00
3 Algorithm 1 70.21 86.18 95.08 98.79 99.78 99.97 100.00
4 TurboQuant 84.85 95.80 99.33 99.94 100.00 100.00 100.00
4 Algorithm 1 83.77 95.46 99.27 99.96 100.00 100.00 100.00
5 TurboQuant 92.03 98.65 99.94 100.00 100.00 100.00 100.00
5 Algorithm 1 91.66 98.62 99.91 100.00 100.00 100.00 100.00
6 TurboQuant 95.66 99.54 99.99 100.00 100.00 100.00 100.00
6 Algorithm 1 95.68 99.62 100.00 100.00 100.00 100.00 100.00

DBpedia d=1,536 recall

b Method @1 @2 @4 @8 @16 @32 @64
2 TurboQuant 88.40 97.83 99.97 100.00 100.00 100.00 100.00
2 Algorithm 1 85.90 96.77 99.63 99.93 100.00 100.00 100.00
3 TurboQuant 93.23 99.27 99.97 100.00 100.00 100.00 100.00
3 Algorithm 1 91.63 99.00 99.97 100.00 100.00 100.00 100.00
4 TurboQuant 95.93 99.77 99.97 100.00 100.00 100.00 100.00
4 Algorithm 1 95.40 99.80 100.00 100.00 100.00 100.00 100.00
5 TurboQuant 97.43 99.90 100.00 100.00 100.00 100.00 100.00
5 Algorithm 1 97.83 99.90 99.93 100.00 100.00 100.00 100.00
6 TurboQuant 98.53 99.97 100.00 100.00 100.00 100.00 100.00
6 Algorithm 1 98.70 100.00 100.00 100.00 100.00 100.00 100.00

DBpedia d=3,072 recall

b Method @1 @2 @4 @8 @16 @32 @64
2 TurboQuant 91.47 98.57 99.83 100.00 100.00 100.00 100.00
2 Algorithm 1 90.90 98.00 99.77 100.00 100.00 100.00 100.00
3 TurboQuant 95.17 99.27 100.00 100.00 100.00 100.00 100.00
3 Algorithm 1 95.10 99.53 100.00 100.00 100.00 100.00 100.00
4 TurboQuant 97.77 99.83 100.00 100.00 100.00 100.00 100.00
4 Algorithm 1 97.90 99.90 100.00 100.00 100.00 100.00 100.00
5 TurboQuant 98.70 100.00 100.00 100.00 100.00 100.00 100.00
5 Algorithm 1 98.67 99.93 100.00 100.00 100.00 100.00 100.00
6 TurboQuant 99.37 100.00 100.00 100.00 100.00 100.00 100.00
6 Algorithm 1 99.37 100.00 100.00 100.00 100.00 100.00 100.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.

Dataset b TQ index A1 index Index speedup TQ total A1 total Total speedup
GloVe 2 6.50 8.14 0.80× 43.85 46.08 0.95×
GloVe 3 9.07 8.21 1.10× 46.48 46.16 1.01×
GloVe 4 16.90 8.19 2.06× 54.33 46.18 1.18×
GloVe 5 20.47 8.16 2.51× 57.91 46.11 1.26×
GloVe 6 27.64 8.15 3.39× 65.25 46.58 1.40×
DBpedia-1536 2 41.94 11.98 3.50× 79.73 30.40 2.62×
DBpedia-1536 3 49.00 13.98 3.51× 96.53 36.72 2.63×
DBpedia-1536 4 53.99 15.10 3.58× 105.39 40.15 2.62×
DBpedia-1536 5 58.94 15.69 3.76× 111.99 42.86 2.61×
DBpedia-1536 6 73.00 15.96 4.57× 128.16 44.97 2.85×
DBpedia-3072 2 171.49 25.74 6.66× 353.81 77.41 4.57×
DBpedia-3072 3 213.73 32.34 6.61× 466.27 107.38 4.34×
DBpedia-3072 4 252.73 37.83 6.68× 524.69 126.32 4.15×
DBpedia-3072 5 266.40 42.47 6.27× 566.71 136.92 4.14×
DBpedia-3072 6 298.41 43.95 6.79× 614.48 141.43 4.34×
Authors · CommentOpenReview ↗

Follow-up on our rebuttal

Dear Reviewer d4DC,

Thank you again for your constructive review. Since the author–reviewer discussion period closes in two days, we wanted to check whether our rebuttal addresses your concerns.

To briefly recap, your review raised several points, which we addressed as follows:

Novelty (Q1): We clarified the specific technical contribution beyond existing dithered quantization and Hadamard sketching. In particular, we highlighted the non-uniform dithering in Algorithm 1 (the uniform shift applied in quantile space, which is essential to the proof of Lemma 3.1), and explained why our analysis departs from RIP-based arguments to achieve the sharp constants without extra logarithmic factors.

Experiments (Q2/Q3): We added the requested comparison against dense random-rotation quantization (TurboQuant) on GloVe and DBpedia. The results show that Algorithm 1 achieves similar distortion and nearest-neighbor recall while being substantially faster in high dimensions, which speaks directly to the finite-bit-width, practical concern behind Q3.

We would be grateful for any further questions while the discussion is still open, and hope the additions are enough to warrant a reconsideration of the score. We are of course happy to clarify anything else.

Thank you for your time and engagement.

Best regards, The Authors

Reviewer d4DC · CommentOpenReview ↗

We thank the authors for the responses. The technical contributions now become clearer to me, and more prominently, the experiments corroborate the efficacy of the proposed method. I would suggest the authors add some small numerical examples in a later version of the paper. I'm happy to increase my score to 4.

Reviewer 6NPcOpenReview ↗
Rating
4/6
Confidence
4/5
Quality
3/4
Clarity
2/4
Significance
3/4
Originality
3/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
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.

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.

Formatting concerns

None.

3 comments
Authors · RebuttalOpenReview ↗
Rebuttal

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.

Authors · CommentOpenReview ↗

Follow-up on our rebuttal

Dear Reviewer 6NPc,

Thank you again for your constructive review. Since the discussion period closes in two days, we wanted to check whether our rebuttal addresses your concerns. We would be happy to answer any further questions you might have.

Thank you for your time and engagement.

Best regards, The Authors

Reviewer 6NPc · CommentOpenReview ↗

Regarding the rebuttal

Thank you for the explanations. I am now confident in my positive assessment of this paper and will maintain my positive score.

Reviewer FBiwOpenReview ↗
Rating
5/6
Confidence
4/5
Quality
4/4
Clarity
4/4
Significance
3/4
Originality
3/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
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

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.

Formatting concerns

N/A

3 comments
Authors · RebuttalOpenReview ↗
Rebuttal

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)
Authors · CommentOpenReview ↗

Follow-up on our rebuttal

Dear Reviewer FBiw,

Thank you again for your constructive review. Since the discussion period closes in two days, we wanted to check whether our rebuttal addresses your concerns. We would be happy to answer any further questions you might have.

Thank you for your time and engagement.

Best regards, The Authors

Reviewer FBiw · CommentOpenReview ↗

Good work!

Sorry for the delay; but thanks for the writeup! This is very clear! I'll boost the score accordingly.

A couple minor points:

  1. Seems like the Quantize() function should be calling ResidualQuant and VectorQuant? If you intentionally avoided writing this as subroutine calls because rewriting it makes for a more clear presentation, please keep it as is.
  2. You describe how scalarQuant "uses a constant number of bits per coordinate in expectation". I suspect that more practically minded people won't be too much a fan of this. From what I understand, the non-deterministic number of bits arises from ℓi\ell_i, which even if stored in binary, could be very large if a single entry of the vector viv_i (a vector with norm ∥∥r∥∥\|\|r\|\|) is much larger than ∥∥r∥∥/d\|\|r\|\|/\sqrt d. If we wanted to walk in with a budget of Binner−prodB_{\rm inner-prod} bits (or bits per entry or something) for inner-product quantization, could we do a rejection-sampling based approach to control the number of bits needed? (See, eg, Algorithm 7.1 and the end of the proof of Theorem 7.2 here).

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

Missing a submission?

Loading the discussion…