ConceptioArchivearXiv CS
arXiv CSopen access

HyperQuant: A Rate-Distortion-Optimal Quantization Pipeline for Large Language and Diffusion Models

Unknown · 2026 · arxiv_cs
arXiv CS · Papers · License: Open Access · 2026
Open Source ↗Direct PDF ↓
artificialintelligenceknowledgerepresentationreasoning
artificial intelligence, reasoning, knowledge representation

HyperQuant: A Rate–Distortion-Optimal Quantization Pipeline for Large Language and Diffusion Models

arXiv:2606.23406v1 [cs.LG] 22 Jun 2026

Yuval Domb Hadar Sackstein Tomer Solberg [email protected]

Abstract We present HyperQuant (Hadamard, optimallY Packing, Entropy Rice-coding), a unified post-training quantization pipeline for the weights and the KV cache of large language and diffusion transformers. Across a suite of self-contained experiments (Table 1), HyperQuant outperforms the recent HIGGS scheme at every operating point from 3 to 5 bits per scalar (bps) on weights, and beats both TurboQuant and OCTOPUS on KV quantization down to 1.7 bps. Beyond the LLM setting, HyperQuant quantizes the 19B-parameter LTX-2 DiT video model with no observable per-frame artifacts. End-to-end on an H100 at 4 bps, HyperQuant compresses the linear weights ∼ 3.9× and the KV cache ∼ 3.79× at near-lossless quality. HyperQuant combines four known ideas into a single construction: (i) a per-tile Randomized Hadamard Transform that makes the per-coordinate distribution of weights and activations approximately Gaussian; (ii) quantization to a low-dimensional optimal lattice (E8 , D4 , A2 , or Z); (iii) lossless bit-stripping and near-entropy-optimal variable-length Rice coding of the lattice indices; and (iv) bias-correction methods for the KV cache that keep the reconstruction unbiased under inner products, preserving attention semantics. We further integrate the pipeline with 8-bit and 4-bit Tensor-Core MMA paths (fp8-e4m3, int8, nvfp4, mxfp4), and find that int8 beats fp8 on the post-RHT lattice output. Project page: https://moonmath.ai/hyperquant/

Table 1: Typical HyperQuant operating points across settings. Weights/KV/int8-MMA rows are Llama-3.1-8B-Instruct on WikiText-2; the OCTOPUS row is KV-only on Qwen2.5-7B-Instruct (perplexity (PPL) ∆% at 32-token residual window); LTX-2 is the 19B DiT video model. Setting

rate

criterion

HyperQuant

reference

Weights+KV cache, int8 MMA Weights Weights KV cache KV cache KV cache LTX-2 video

4 bps 4 bps 3 bps 2 bps 2 bps 1.7 bps 4 bps

PPL ↓ ∆PPL% ↓ ∆PPL% ↓ ∆PPL% ↓ compression ↑ ∆PPL% ↓ LPIPS ↓

7.50 (+0.47%) +3.8% +22.1% +7.4% 6.4× +26.9% 0.20–0.21

7.16 (bf16) +6.4% (HIGGS) +33% (HIGGS) +34.7% (OCTOPUS) 3.0× (TurboQuant) – 0 (bf16)

Contents 1 Introduction

3

2 Related work

4

3 Preliminaries 3.1 Randomized Hadamard Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Optimal low-dimensional lattices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5 5 5

1

3.3 3.4

Entropy coding and Rice codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bias correction: rotation and subtractive dither . . . . . . . . . . . . . . . . . . . . . . . . . .

7 7

4 The HyperQuant design 4.1 RHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Rotate (KV only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Normalize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 Add dither (KV only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5 Quantize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6 Strip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.7 Rice encode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.8 Cast (decode only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.9 Parameters and how to set them . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8 9 9 9 9 10 10 12 12 12

5 Implementation 12 5.1 Application to linear weights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 5.2 Application to the KV cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 5.3 Decoding a variable-length code on the GPU . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 5.4 Reference implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 6 Experiments 15 6.1 Weight-only quantization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 6.2 KV-cache-only quantization and bias correction . . . . . . . . . . . . . . . . . . . . . . . . . . 15 6.3 Full-model quantization at 8-bit MMA precision . . . . . . . . . . . . . . . . . . . . . . . . . 18 6.4 Full-model quantization at 4-bit MMA precision . . . . . . . . . . . . . . . . . . . . . . . . . 18 6.5 Beyond LLMs: LTX-2-19B video DiT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 6.6 End-to-end throughput and memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 6.7 Comparison to prior quantization schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 7 Ablation study 25 7.1 Lattice choice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 7.2 RHT tile size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 7.3 HIGGS-codebook efficiency analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 8 Conclusion and discussion

27

A Proof of subtractive-dither unbiasedness 31 A.1 Setup and notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 A.2 The mod-Λ pushforward is uniform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 A.3 Subtractive dither produces an unbiased estimator . . . . . . . . . . . . . . . . . . . . . . . . 33 A.4 Composition with the HyperQuant KV pipeline . . . . . . . . . . . . . . . . . . . . . . . . 33 A.5 Contrast: QJL alone is biased per-vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 A.6 Practical sampler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 B Calibration: setting the operating point 34 B.1 From a target rate to an SNR (empirical) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 B.2 From an SNR to the scale (closed form) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 B.3 One calibration for all data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 B.4 Stripping is rate-optimal: marginal entropy meets the lattice ideal . . . . . . . . . . . . . . . 37

2

1

Introduction

Frontier language and generative models [1, 17] routinely exceed tens of billions of parameters and produce KV caches that dominate inference memory at modern context lengths. Autoregressive decoding is memory-bandwidth-bound: each token requires streaming the entire weight set and KV cache while performing only a thin matrix-vector product, keeping arithmetic intensity well below the hardware’s compute-to-bandwidth ratio [28]. Post-training quantization (PTQ) turns this bottleneck into a rate-distortion compression problem. For weight quantization, a long line of work (GPTQ [14], AWQ [18], SmoothQuant [37], OmniQuant [33]) has chipped away at the rate, typically at the cost of a calibration dataset and per-layer optimization. Data-free schemes are simpler and generally preferred for deployment. The state of the art among them, HIGGS [20], identifies two levers: (1) apply an RHT to weights so their per-coordinate distribution is approximately Gaussian, and (2) quantize to multi-dimensional codebooks that are MSE-optimal for that Gaussian. Its headline result, a linearity theorem reducing global perplexity damage to per-layer ℓ2 error, justifies focusing the design on per-layer MSE. HIGGS, however, leaves rate on the table: its codebooks are finite Lloyd grids with fixed-rate indices, and information theory predicts that an entropy-coded quantizer of equal MSE always needs fewer bits [19]. Our measurements on real LLM weights (Section 6.1) confirm the gap: HIGGS’s index entropy is 0.6–5.9 % below its fixed bit budget at 3–5 bps. Lattice coding theory provides the solution [6, 38]: combine a lattice quantizer with a variable-length code over its indices. KV-cache quantization has converged on a different rotation-plus-marginal scheme. TurboQuant [41] rotates each head’s KV vector, exploits the Beta marginal of the resulting unit-norm coordinates, and Lloyd-quantizes each scalar. OCTOPUS [4] extends the marginal trick to coordinate triplets via an octahedral parameterization, gaining nearly an extra bit at 2 bps. Both are data-free, yet both pay the same fixed-rate overhead as HIGGS, on a different marginal. The closest lattice-based contemporary is NestQuant [31], which combines nested Gosset lattices with a calibration-style QA-LDLQ correction; quantizing weights and KV cache to 4 bps, it raises Llama-3-8B perplexity by ∼ 3.9% over its bf16 baseline. Contributions. We propose HyperQuant, a data-free, post-training pipeline that applies the rate-distortion-optimal triplet of per-tile RHT, lattice quantization, and entropy coding to both the weights and the KV cache. It integrates with Hopper’s fp8/int8 and Blackwell’s nvfp4/mxfp4 MMA paths [22–24], and is benchmarked end-to-end on Llama-3.1-8B-Instruct and LTX-2-19B (Sections 4 and 5). Our contributions are: • Per-tile Randomized Hadamard Transform (RHT). Each linear layer’s input and weight are independently randomly rotated in tiles sized to the lattice dimension and the hardware’s MMA tile, implemented via the RHT (Section 3.1). The RHT folds into the preceding LayerNorm/RMSNorm where possible (no runtime cost), and is otherwise installed as a forward hook. • Lattice quantization, bit-stripping, and Rice coding. We quantize each rotated tile with one of E8 (8-D), D4 (4-D), A2 (2-D), or scalar Z, strip the bits that lattice membership fixes deterministically, and encode the resulting indices with a Rice code calibrated on the per-norm Gaussian; the realized rate then lands within ∼ 0.01 bps of any requested target (Section 6.1). • A bias-correction menu for the KV cache: a per-layer random rotation (±1 signs or full Quantized Johnson-Lindenstrauss, QJL [40]) and optional Schuchman subtractive dither [32, 39]. We prove (Appendix A) that subtractive lattice dither is strictly inner-product unbiased on every cached vector, unlike the distribution-average unbiasedness of QJL’s 1-bit sketch [40]. 3

• A rate-distortion decomposition of the A2 -vs-HIGGS gap at matched bps (Section 6.1). At 4 bps, a ∼ 0.75 dB piece is HIGGS’s fixed-rate index redundancy (recoverable by any entropycoded retrofit), and a ∼ 0.36 dB piece is the structural advantage of an unbounded codebook over any finite one, enabled by variable-length coding; by 5 bps the latter grows to ∼ 1.79 dB while the index-entropy piece shrinks to ∼ 0.18 dB. Switching from A2 to HyperQuant’s default E8 adds a further ∼ 0.49 dB granular gain, a purely geometric advantage that is most pronounced at low rates (0.53 PPL at 3 bps) and negligible above 4.25 bps. • A two-regime characterization of KV-cache quantization quality (Section 6.2): a high-quality regime (≥ 2.5 bps) where all bias-correction variants lie within 0.04 PPL, and a high-compression regime (1.7–2.5 bps) where QJL-style rotation pulls ahead by up to ∼ 0.5 PPL. • An end-to-end stress test on the 19B-parameter LTX-2 video DiT, showing that the same pipeline transfers to a non-LLM transformer architecture and delivers 3.7× weight compression with no perceptible quality loss (Section 6.5). Outline. Section 3 reviews the classical ingredients (RHT, optimal low-dimensional lattices, Rice coding, and dithering); Section 4 assembles them into the HyperQuant pipeline, adding the bit-stripping transform that makes Rice coding near rate-optimal, and Section 5 covers its implementation. Sections 6 and 7 give benchmark comparisons against HIGGS, TurboQuant, and OCTOPUS, together with per-component ablations. Section 8 concludes and suggests future directions.

2

Related work

Weight quantization with rotations and finite codebooks. HIGGS [20] is the data-free state of the art: RHT plus a multi-dimensional Lloyd codebook with fixed-rate indices. HyperQuant shares this architecture but replaces the finite Lloyd codebook with an infinite lattice (codeword density set by a continuous SNR knob) and bit-strips and entropy-codes the index stream with a Rice code rather than transmitting at a fixed log2 N bits per index. Section 6.1 quantifies both differences. Calibration-based methods. GPTQ [14], AWQ [18], OmniQuant [33], SmoothQuant [37], SpQR [9], and SliceGPT [3] use calibration data to refine per-channel scales, salvage outlier features, or solve a Hessian-aware weight-allocation problem. HyperQuant is data-free by design and orthogonal to these methods; composing its bit-allocation knob with an LDLQ-style calibration update [31, 34] is a natural future direction. KV-cache quantization. TurboQuant [41] rotates each head’s KV vector and Lloyd-Max scalarquantizes the resulting Beta-distributed coordinates, reaching 4–7× compression with near-zero quality loss. OCTOPUS [4] extends this to triplets via an octahedral parameterization, pushing to extreme (≤ 2-bit) operating points. Both stay strictly scalar (or 3-D) after rotation; HyperQuant instead uses true multi-dimensional lattices (E8 is 8-D) with a variable-length code, giving higher granular gain and an unbounded codebook. On the bias side, both TurboQuant and OCTOPUS offer only distribution-average unbiasedness; subtractive dither [11, 32, 39], which HyperQuant adopts, is strictly per-vector unbiased, as we prove in Appendix A.

4

Nested-lattices. NestQuant [31] is the closest contemporary: like HyperQuant it uses the E8 lattice, but relies on calibration-style QA-LDLQ post-processing. HyperQuant stays data-free, substituting an entropy code and a richer rotation menu; QA-LDLQ is orthogonal to our design and could be composed with HyperQuant as a future calibration step. On a baseline-normalized basis, HyperQuant’s data-free W+KV path costs +4.6% at 4 bps on Llama-3.1-8B, within a fraction of a point of NestQuant’s +3.9% obtained with QA-LDLQ; NestQuant’s own ablation shows that removing QA-LDLQ raises its cost to +7.6%. Diffusion and video transformers. Quantization of diffusion transformers [12, 17, 27] is less explored than LLM quantization, and most published numbers target image rather than video models. The LTX-2 [17] stress test in Section 6.5 is, to our knowledge, the first end-to-end PTQ result on a billion-parameter video DiT, complementing earlier OCTOPUS results [4] on the Wan-1.3B DiT. Numerical formats. fp8 was standardized on NVIDIA’s H100 [22, 23]; the smaller fp4 formats (nvfp4 and OCP mxfp4) target the Blackwell generation [24, 25, 30]. The two fp4 formats differ in scale encoding (fp8-e4m3 in nvfp4 vs. power-of-2 e8m0 in mxfp4) and block size (16 vs. 32). HyperQuant targets both; our experiments show nvfp4 is the only one quality-viable for KV quantization (Section 6.4).

3

Preliminaries

This section reviews the four classical ingredients the rest of the paper builds on: the RHT, optimal low-dimensional lattices as vector quantizers, Rice entropy coding, and the subtractive-dither and random-rotation bias-correction mechanisms. The material is well-established and included to fix notation. Section 4 assembles these ingredients into HyperQuant, identifying the design choices that diverge from the classical constructions.

3.1

Randomized Hadamard Transform

The RHT composes the Walsh-Hadamard matrix Hn (an n × n orthonormal matrix, O(n log n) Cooley-Tukey butterfly) with a random sign diagonal D = diag(±1): RHTn (x) = Hn D x,

Dii ∈ {−1, +1} iid uniform.

(1)

Two properties are key. First, RHT is a fast Johnson-Lindenstrauss-style mixer: applying Hn D to any deterministic x ∈ Rn yields a vector whose empirical distribution is, with high probability, close to N (0, ∥x∥2 /n · I) [2, 8, 16]. Second, because RHTn is orthogonal, applying it before quantization and inverting it after preserves ℓ2 error, since the lattice cell volume is the same in the pre- and post-RHT spaces. RHT therefore redistributes the per-coordinate quantization error from a few outlier coordinates (in the raw activation space) into an approximately isotropic spread [5, 20].

3.2

Optimal low-dimensional lattices

A lattice Λ ⊂ Rn is the set of integer linear combinations of n basis vectors. Two lattice invariants characterize its quality as a vector quantizer:

5

• the normalized second moment G(Λ) :=

  1 EU ∼Uniform(V(Λ)) ∥U ∥2 · det(Λ)−2/n , n

the per-coordinate mean-squared error of quantizing a uniform point of the Voronoi cell V(Λ) to the origin, made scale-invariant by the det(Λ)−2/n factor. It is bounded below by 1/(2πe), attained asymptotically by the n-dimensional ball, and a smaller G(Λ) gives lower granular distortion at fixed rate [6, 38]: intuitively, G(Λ) measures how “round” the Voronoi cell is. • the packing density ∆(Λ), the fraction of Rn covered by non-overlapping balls of radius rpack (Λ) (the Voronoi inradius, half the lattice minimum distance) centered at every lattice point. A higher ∆(Λ) fits more codewords at a fixed minimum separation, controlling how densely the codebook tiles space at fixed cell radius [6]. In every dimension ≤ 8 for which the optimum is known, the densest sphere packing also achieves the smallest known G(Λ): Z = Z in 1-D, the hexagonal A2 in 2-D, the Schläfli lattice D4 in 4-D, and the Gosset lattice E8 in 8-D [6]. Table 2 collects their normalized second moments and the resulting high-rate gap to the Shannon bound. Lattice

n

G(Λ)

High-rate gap to Shannon

Decoder O(·)

Z A2 D4 E8 ∞-D sphere

1 2 4 8 —

1/12 = 0.0833 0.0802 0.0766 0.0717 1/(2πe) = 0.0586

1.53 dB 1.36 dB 1.17 dB 0.88 dB 0 dB

O(1) O(1) O(1) O(1) —

Table 2: Classical lattice quantizer constants for the four lattices used in this paper. The high-rate gap to the Shannon bound is 10 log10 (G(Λ) · 2πe). The asymptotic limit 1/(2πe) is the infinitedimensional sphere bound. These normalized second moments are scale-invariant, so they apply int unchanged to the integer realizations E8int /D4int /Aint 2 /Z1 used in our code.

Nearest-neighbor decoding. For A2 , D4 , and E8 , the closest-point algorithm follows ConwaySloane [6, Ch. 20]: round each coordinate to the nearest integer; if the result violates the lattice’s parity constraint, move to the nearest point of the complementary coset (the half-integer coset D8 + 12 1 for E8 , the parity-flipped neighbor for D4 and A2 ), and keep the candidate with smaller residual norm. The work is O(1) per scalar. E8 is the highest-dimensional lattice admitting such a constant-time closed-form decoder [6]. Granular gain. The advantage of multi-dimensional vector quantization (VQ) over scalar quantization is the freedom to choose the shape of the quantization cell. A scalar quantizer’s cell is forced to be an interval, the Voronoi cell of Z, fixing its normalized second moment at G(Z) = 1/12 ≈ 0.0833. In higher dimensions the optimal Voronoi cell grows rounder and G descends toward the ball’s limit G∞ = 1/(2πe) ≈ 0.0586. The ratio 10 log10 (G(Z)/G(Λ)) is the granular gain of Λ over the scalar quantizer, the source-coding counterpart of the channel-coding shaping gain from constellation design [13, 38]. The four lattices traverse the 1.53 dB budget from Z to the Shannon bound: A2 recovers 0.17 dB, D4 recovers 0.37 dB, and E8 recovers 0.65 dB (42% of the total) while retaining an O(1) constanttime decoder. The 24-D Leech lattice, the best known structured lattice in its dimension [6], adds a 6

further ∼ 0.38 dB (25%) at the cost of a significantly more complex decoder, still leaving 0.50 dB to Shannon. Closing the residual gap requires high-dimensional random lattices, which asymptotically approach the bound [38] but admit no practical nearest-neighbor decoder. E8 is therefore not where the gap closes but where the gain-per-decoder-complexity curve sharply drops.

3.3

Entropy coding and Rice codes

Entropy coding. For a discrete source X with probability mass function p, Shannon’s source coding theorem bounds the average code length per symbol of any uniquely decodable code below by the entropy X H(X) = − p(x) log2 p(x), x

and this bound is achievable to within a fraction of a bit per symbol by practical coders such as Huffman or arithmetic coding [7]. Entropy is thus the rate floor for lossless compression of a discrete source. A lossy pipeline like ours splits into two stages: a quantizer maps a continuous input to a discrete index, trading distortion for the index bit count (its rate-distortion behavior), and a lossless entropy coder then represents the index stream at an expected rate near its entropy. The entropy coder neither distorts the source nor changes the quantizer’s distortion; it only realizes the information-theoretic floor on the indices in actual bits. Variable-length codes and unbounded alphabets. A fixed-length code over an alphabet of size N pays exactly log2 N bits per symbol and is undefined when N = ∞. A variable-length code has no such limit: it addresses an arbitrary discrete alphabet at finite expected rate whenever the source entropy is finite. This is the operative advantage in our setting. A lattice quantizer’s output is an integer vector with unbounded support, so a fixed-length code is not even well-defined; yet for Gaussian-like inputs the integer histogram has finite entropy, which a variable-length code attains at finite cost [7, 38]. We quantify this advantage empirically in Section 6.1. Rice codes. Among variable-length codes, the Rice code [29] is the practical near-optimal choice for sources whose integer histogram is two-sided geometric (Laplacian on the integer lattice); it is the power-of-two-parameter specialization of the Golomb code, optimal in this regime. Given a parameter k, a non-negative integer m is encoded as ⌊m/2k ⌋ in unary followed by m mod 2k in k raw bits; signed values use zig-zag interleaving or an explicit sign bit. The optimal k for a geometric distribution with parameter p is k ∗ = log2 ⌈− ln(2 − p) / ln(1 − p)⌉ . 



The histograms we encounter (lattice indices of RHT-transformed weights and activations) are not exactly Laplacian, but close enough that a Rice code with empirically calibrated k stays within ∼ 0.1 bps of the symbols’ marginal entropy across our calibration sweep (Section B.1). We adopt it throughout: it has constant per-codeword cost and is a genuine variable-length code over Z, and the ∼ 0.1 bps it concedes to an ideal marginal coder buys a stateless, table-free O(1) decoder. No context coder can do better, since the stripped symbols carry essentially no inter-symbol redundancy (Section B.4).

3.4

Bias correction: rotation and subtractive dither

A nearest-neighbor lattice quantizer is deterministic in its input, hence biased: the reconstruction x̂ = QΛ (x) satisfies x̂ = x + e(x) with a non-zero, x-dependent error e(x) ∈ −V(Λ). For weight 7

quantization this is harmless: biased reconstructions are absorbed by surrounding affine parameters and disappear into the linearity theorem [20]. For the KV cache, however, attention Attention(q, k, v) = softmax √1d q ⊤ k v 

is linear in k and v inside the dot product, so a deterministic bias in k accumulates through the softmax denominator and shifts attention scores systematically. Two classical mechanisms can remove this bias. Random rotation (QJL-style). Apply a Haar-uniform orthogonal matrix S ∼ Uniform(O(n)) before quantization and S ⊤ after: x̂rot (x; S) = S ⊤ QΛ (S x).

(2)

Averaged over S, the error erot (x) = −S ⊤ πΛ (Sx) is zero-mean and isotropic [40, 41]. In deployment, however, S is drawn once per layer and frozen, so the error is deterministic given (x, S0 ) and biased on every individual cached vector. We formalize this in Proposition 2. Subtractive dither (Schuchman-Zamir-Feder). Draw U ∼ Uniform(V(Λ)) fresh on every forward call, independently of everything else, and reconstruct x̂dith (x; U ) = QΛ (x + U ) − U.

(3)

The error edith (x; U ) = −πΛ (x + U ) is then exactly uniform on −V(Λ) and independent of x, by the Crypto Lemma [32, 39] (self-contained proof in Appendix A). In particular, EU ⟨q, x̂dith (x; U )⟩ x = ⟨q, x⟩ 



∀ q, x ∈ Rn .

(4)

We call this strict, per-vector inner-product unbiasedness, in contrast to QJL’s averaged-over-S unbiasedness. Composing rotation and dither. The two mechanisms are statistically orthogonal: the rotation is a deterministic-given-x linear map and the dither is independent of x, so the inner-product unbiasedness of (4) survives composition with any orthogonal pre-rotation and any further deterministicgiven-x linear post-processing (Proposition 1). The composed scheme keeps the rotation’s isotropic error and the dither’s strict unbiasedness. A standard alternative to the Haar-uniform rotation is the sign-rotation S = diag(±1), which costs only n bits per layer and suffices when the source is approximately exchangeable under coordinate permutations.

4

The HyperQuant design

Figure 1 is the end-to-end HyperQuant block diagram and the map for this section. The encode path (top, left to right) turns a bf16 tile into a compact code; the decode path (bottom, right to left) inverts every active block in reverse order and feeds the low-precision matrix-multiply-accumulate (MMA). A single encode path serves both linear weights (offline) and the KV cache (online), differing only in the two bias-correction blocks, Rotate and Add dither, which run for the KV cache alone. We cover the blocks in figure order, each forward block with its inverse under one heading (marked KV only where applicable), folding the integer-lattice detail into the Quantize and Strip blocks where it is used. 8

Encode W/KV

MMA

Cast

RHT

Rotate

Normalize

Add dither

Quantize

Strip

Rice encode

RHT−1

Derotate

Denormalize

Undither

Dequantize

Unstrip

Rice decode

absorbed by MMA operand

Decode

shared core

bias corr. (KV only)

cast

Figure 1: HyperQuant end-to-end pipeline. Encode (top, left to right) and Decode (bottom, right to left), each inverse directly below its forward block. Colour marks applicability: blue is the shared core (weights and KV), orange dashed is bias correction (KV cache only, ablated in Section 7), and purple is the cast to the Tensor-Core format. The RHT has no decode block: orthogonal along the contraction axis, it is absorbed into the matching rotation on the other MMA operand (ghosted). The MMA is the terminal consumer, not a codec step. Each block names the subsection that documents it.

4.1

RHT

RHT. Partition x ∈ Rn into tiles of size ntile = 2k matched to the MMA unit (128 on H100/Blackwell) and apply the RHT (1); the O(ntile log ntile ) butterfly folds into the preceding LayerNorm. Inverse RHT. None is applied explicitly. The RHT is orthogonal along the contraction axis, so W = (W H ⊤ )H: the rotation cancels against the matching rotation on the other MMA operand, and the decoder never runs an RHT−1 block (ghosted in Figure 1).

4.2

Rotate (KV only)

Rotate. Optionally rotate by none, signs (S = diag(±1), one bit/coordinate, self-inverse), or qjl (Haar S ∼ Uniform(O(n))); the best choice tracks the bit-rate (Section 6.2). Derotate. Apply S ⊤ . Storage cost and the rotation-dither interaction are detailed in Section 5.2.

4.3

Normalize

Normalize. Rescale to the lattice’s calibration radius: for KV, each (head, token) vector by its own norm, √ Sx x̃ = α n , ∥Sx∥ with α = α(SNR, Λ) the closed-form scale realizing the target SNR (Section 3.4 and Appendix B). Being deterministic in x, this preserves unbiasedness (Proposition 1). Denormalize. Multiply back by α−1 and the stored norm.

4.4

Add dither (KV only)

Add dither. Optionally add a fresh U ∼ Uniform(V(Λ)) before quantization. Undither. Subtract the same U after dequantization. By the Crypto Lemma the error is then uniform on V(Λ) and the reconstruction is strictly inner-product unbiased (Corollary 2, Appendix A).

9

4.5

Quantize

Quantize. Map x̃ (plus dither, if enabled) to its nearest point c = QΛ (·) in the integer realization of Λ; decoding is O(1) for E8 , D4 , A2 [6, Ch. 20] and nearest-integer rounding for Z. Dequantize. Re-embed the stored integer code vector as its lattice point. Integer realizations. The quantization, stripping, Rice coding, and decoding stages touch the lattice only through (a) its nearest-neighbor decoder and (b) the integer code vector it emits. We are therefore free to pick any integer realization of each lattice, tuned for cheap arithmetic and compact int storage. We use the four families {E8int , D4int , Aint 2 , Z1 } of Table 3. Two properties motivate these embeddings: • 8-bit code budget. After per-vector α-scaling, the integer coordinates are approximately N (0, α2 ), so a signed-byte overflow (|ci | > 127) is a 127/α-sigma tail event. Even at the top of our sweep (5 bps, where α is largest) the binding lattice sits ≥ 7σ from the boundary: fewer than ∼ 10−3 of the model’s ∼ 7 × 109 coordinates are expected to saturate, and a saturation is a harmless clamp to ±127, not a corruption (Section B.2). The raw code vector thus fits one signed byte per scalar, matching the storage tile of Hopper/Blackwell Tensor Cores and giving HyperQuant a natural fallback when entropy coding is disabled. • Closed-form membership constraints. Each lattice obeys a small set of integer linear constraints (parity, coset, sum modulo a power of two). These pin a fixed number of bits per code vector, which can be stripped from the bitstream before Rice coding without loss. The four embeddings. E8int = 2 E8 ⊂ Z8 , D4int = D4 ⊂ Z4 , Zint 1 = Z, √ int A2 = {( 3 ny , nx ) : ny , nx ∈ Z, ny +nx ≡ 0 (mod 2)}. The factor-of-two dilation embeds E8 in Z8 , clearing the half-integer coset D8 + 12 1 of the bare P E8 ; the α-scaling undoes it. The bare D4 is the integer checkerboard lattice {x ∈ Z4 : i xi ≡ 0 (mod 2)}, which has no half-integer coset, so D4int = D4 already lives in Z4 and needs no dilation. √ For Aint 3 scaling of the y-axis into α so 2 we store the two integer coefficients (ny , nx ), folding the it never enters the integer arithmetic. The bare Zint has no nontrivial membership constraint. 1

4.6

Strip

Strip. Strip the bits that lattice membership pins deterministically (lossless), leaving a compact symbol stream for Rice coding. Unstrip. Reconstruct the pinned bits from the parity relation and undo the halving. Membership constraints. The following equations characterize membership and form the basis of the bit-stripping transform. • E8int : there exists a coset bit c ∈ {0, 1} such that all coordinates share the same parity, ci ≡ c P (mod 2) for i = 0, . . . , 7, and the halved coordinates satisfy 7i=0 (ci − c)/2 ≡ 0 (mod 2). • D4int :

i=0 ci ≡ 0 (mod 2).

P3

• Aint 2 : ny + nx ≡ 0 (mod 2). 10

• Zint 1 : no constraint. Each modulo-2 constraint pins one bit of the code vector deterministically given the rest. The bit-stripping transform. For each lattice we apply, before Rice coding, an invertible map ′ StripΛ : Zn → Zn that removes the pinned bits and compacts the remaining symbols: Lattice

Computation

Output

Saving

E8int

c = c0 mod 2; si = (ci − c)/2, i = 0, . . . , 7; P6 p = ( i=0 si ) mod 2; t = (s7 − p)/2 p = (c0 + c1 + c2 ) mod 2; t = (c3 − p)/2

(c, s0 , . . . , s6 , t)

1.0 b/sc

(c0 , c1 , c2 , t)

0.25 b/sc

p = nx mod 2; ty = (ny − p)/2

(ty , nx )

0.5 b/sc

(none)

n

0 b/sc

D4int Aint 2 Zint 1

The stripped symbols are signed, so the strip’s final step maps each through the zig-zag bijection zigzag(n) = 2n for n ≥ 0 and −2n−1 for n < 0, which keeps small values small and yields the non-negative indices the Rice coder of Section 3.3 expects. Each transform is bit-for-bit invertible: the decoder reads the output stream, recovers the halved symbol t, reconstructs the dropped coordinate (s7 for E8int , c3 for D4int ) from the parity bit p computed on the other symbols, rescales by 2, and, for E8int , adds back the coset bit. Rice parameters. Halving a symbol narrows its shifted-geometric distribution and lowers its optimal Rice parameter by one, so a symbol coded at ks has its halved counterpart best coded at kt = ks − 1 (checked at runtime). The three non-trivial lattices exploit this differently: • E8int : the coset bit c is folded into the low bit freed by halving via comb = 2 · zigzag(t) + c. Doubling lifts comb back to the s-symbols’ scale, so kcomb = ks and all eight symbols share a single parameter ks : c rides for free in a bit Rice would emit anyway. Without the fold, t would need its own kt = ks − 1 and c a separate uncompressed bit. • D4int : with no coset bit to fold, the halved symbol t keeps its own parameter, so the stream uses two levels: ks for c0 , c1 , c2 and kt = ks − 1 for t. √ • Aint 3-scaled y-axis is wider), so they too use 2 : the two coordinates have different spreads (the two levels: kty for ty and knx for nx .

n Embedding Cosets Membership constraints Bits stripped per scalar Rice parameters

E8int

D4int

Aint 2

Zint 1

8 2E8 ⊂ Z8 2 (even/odd) coset + sum-mod-4 1.00 1 (ks , with c)

4 D4 ⊂ Z4 2 sum-mod-2 0.25 2 (ks , kt )

√2 hex. ( 3ny , nx ) 2 sum-mod-2 0.50 2 (kty , knx )

1 Z — none 0 1

Table 3: Integer-coordinate realizations of the four lattices used in HyperQuant. “Bits stripped per scalar” is the deterministic information removed by the bit-stripping transform of Section 4.6; these savings are lossless and applied before Rice coding.

11

Effect on the achievable bit-rate. The last row of Table 3 is what the entropy of the stripped symbol stream lower-bounds, not the raw code vector. At a typical 21 dB SNR (Gaussian high-rate slope ∼ 3.7 bps), the four lattices reach empirical Rice rates of 3.74, 3.77, 3.81, and 3.84 bps, within 0.10 bps of the high-rate lattice ideal. Removing the bit-stripping pass would raise the E8int rate by 1.0 bps and the Aint 2 rate by 0.5 bps, exactly the deterministic-information overhead Rice coding cannot otherwise recover. Remark (Stripping is rate-optimal, not heuristic). Stripping does more than delete deterministic bits: it leaves symbols that are statistically near-independent. At high rate their per-symbol marginal entropy already equals the lattice ideal RD + 12 log2 (2πe G(Λ)), the rate of an entropy-coded lattice quantizer, so a memoryless coder such as Rice is near rate-optimal by construction, with no inter-symbol redundancy left for a context model. We prove this in Section B.4.

4.7

Rice encode

Rice encode. Entropy-code the stripped symbols with the calibrated Rice code (Section 3.3); onthe-fly bit accounting, fed by the SNR calibration of Section B.1, lands the realized rate within int ∼ 0.01 bps of any target. E8int and Zint 1 each use a single Rice parameter (for E8 , the coset bit c is folded into its remainder, above); D4int uses two (ks and kt = ks −1) and Aint 2 two (kty , knx ). Rice decode. Unpack the bitstream into symbols.

4.8

Cast (decode only)

On the 8-/4-bit MMA path, the reconstruction is cast at the matmul boundary to fp8-e4m3/int8 (Hopper) or nvfp4/mxfp4 (Blackwell); pure-bf16 deployments skip it. This block has no encode counterpart and no inverse: it feeds the terminal MMA. Format choices and the measured fp8-vsint8 and nvfp4-vs-mxfp4 trade-offs are in Sections 6.3 and 6.4.

4.9

Parameters and how to set them

Table 4 lists every knob HyperQuant exposes, our default values, and a one-line rationale. Most parameters have broad sweet spots: Hadamard tile size 128–1024 and Rice parameter k ∈ {0, 1, 2} all work equally well at every operating point we tested, so practitioners typically tune only the target bits-per-scalar and rotation kind.

5

Implementation

5.1

Application to linear weights

The weight path (top of Figure 1) is applied once at load time: 1. For each linear layer of shape (m, n), partition W into tiles of size ntile along the input dimension and independently RHT each tile. 2. (If MMA path) cast each tile to fp8/int8. 3. Lattice-quantize each tile, bit-strip, and Rice-encode. 4. Store the resulting integer codes and per-tile scales. During inference decoding occurs on the fly into the MMA’s input format (fp8, int8, nvfp4, mxfp4, bf16) just in time for the matmul; for a fused-Triton implementation the dequant fuses into 12

Knob

Default

Rationale

Lattice Λ

E8

RHT tile ntile

128

Target bps b SNR (derived)

4.0 (W), 3.0 (KV) lookup b → SNR

Rotation kind (KV) Dither (KV)

qjl off

Rice parameter k lm_head precision

1 bf16

Best 8-D granular gain, constant-time decoder, fits MMA tile. Matches H100/Blackwell MMA K-dim; auto-shrinks if layer is smaller. Sweet spot; ∆PPL ≤ 0.3 vs bf16 at LLM scale. Invert the empirical rate curve (Appendix B); α then closed-form. Default at b ≥ 2 bps; switch to none at b ≤ 1.6. Enable when strict per-vector unbiasedness is required. Auto-tuned per layer if requested. Cheap layer; keep full precision to avoid logit clipping.

Table 4: HyperQuant’s complete parameter list, with defaults benchmarked in Sections 6 and 7. Most knobs are relatively insensitive; only the target bps and (at very low bps) the rotation kind require tuning per deployment. the matmul prologue and adds small latency over the bare MMA. We do not quantize the lm_head / output projection: its outputs feed directly into the softmax, where quantization noise is amplified.

5.2

Application to the KV cache

The KV path (bottom of Figure 1) replaces the bf16 cache tensor with the Rice-coded bitstream plus per-vector norms. Concretely, for each attention layer we install pre-forward hooks on k_proj and v_proj that: 1. Receive the projection output in shape [B, T, nheads · dhead ]. 2. Reshape to [B, T, nheads , dhead ] and apply the encoding path (pre-rotation through Rice coding) on the last axis. 3. Store the bitstream as the cache (in our pseudo-quant harness we keep an equivalent bf16 dequantized tensor for simplicity). At read time the decoder returns a bf16 tensor of the original shape (the “pseudo-quantization” regime used for all quality measurements); a true memory-saving implementation stores only the Rice-coded bitstream and dequantizes on the fly in a fused attention kernel (Section 6.6). We hook pre-RoPE: since RoPE is a per-position orthogonal rotation that commutes with ℓ2 normalization, pre- and post-RoPE quantization are statistically equivalent, requiring no modification to the attention forward function; for GQA/MQA [1] the hook attaches to each head’s projection in isolation. Choice of pre-rotation. The three options from Section 3.4 differ in storage cost. A Haar-uniform S ∼ Uniform(O(n)) stores n2 floats per layer (64 KiB per layer in fp32 for n=128, totalling ∼ 4 MiB across the 32 Llama-3.1-8B attention layers). The sign-rotation S = diag(±1) costs only n bits per layer and is self-inverse; it suffices when post-RHT activations are approximately exchangeable under coordinate permutations. We benchmark all three (none, signs, qjl) in Section 6.2: at ≥ 2 bps qjl gives the best PPL; at ≤ 1.6 bps rotation hurts and none is best; signs is a near-free middle ground. 13

Composing rotation with dither. When subtractive dither is enabled, we draw the rotation S once per layer at quantize time and the dither U once per forward call; the two are independent and the composed scheme inherits isotropic-error covariance from S and strict per-vector inner-product unbiasedness from U (Section 3.4).

5.3

Decoding a variable-length code on the GPU

The challenge. HyperQuant’s rate gain comes from the variable-length Rice code over lattice indices (Section 4.7): each index costs a data-dependent number of bits, so the bit position of symbol j depends on every preceding symbol. This sequential dependency is the central obstacle to GPU decoding: unlike a fixed-width format (int8 or int4), a Rice stream cannot be random-accessed or bulk-loaded, and a naive decoder is a single serial scan. Approaches. Four strategies appear in the literature: (i) bit-serial decode [36], which parallelizes across independent slices but stays serial within each stream; (ii) fixed-chunk multi-pass synchronization [35], which decodes chunks provisionally in parallel then recovers codeword boundaries with synchronization passes; (iii) offset-indexed one-pass, which stores an explicit start bit-offset per sub-stream so each thread decodes independently in a single pass; and (iv) rANS [10], which admits N -way SIMD decoding at near-identical rate but requires changing the codec. Our choice. HyperQuant uses the offset-indexed one-pass decoder. The encoder groups lattice symbols into sub-streams of S symbols and emits, per sub-stream, a 32-bit start bit-offset and the per-stream Rice parameter k. The decoder launches one thread per sub-stream, each seeking to its offset and decoding S symbols with the inverse bit-strip and per-tile MMA cast fused inline, directly into the bf16/int8/fp8/nvfp4 input format. This design is (i) single-pass and branch-light (no seam synchronization); (ii) cheap in metadata, with the offset+k table at 32/S bits per symbol (≲ 1% of the ∼ 4-bps payload at S=512); and (iii) composable with bit-stripping and the MMA cast in a single pass. The trade-off is that S couples compression against parallel occupancy (larger S: fewer threads); we use S=512.

5.4

Reference implementation

The HyperQuant reference implementation is ∼ 3 k lines of Python plus the CUDA implementation of the decoder. A single post-training pass over the loaded bf16 model installs the KV hooks and quantizes-in-place the linear weights; it is parallelizable per layer and finishes in ∼ 30 s for Llama-3.1-8B on a single H100. Calibration: SNR-to-bps lookup table. For a Gaussian input x ∼ N (0, σ 2 In ) with lattice scaled so that the per-scalar quantization noise has variance σq2 , the per-scalar SNR is SNR = 10 log10 (σ 2 /σq2 ), and the Rice-coded bit-rate is a monotone function of SNR. We pre-build a calibration table mapping SNR to empirical Gaussian bps on ∼ 105 iid-Gaussian vectors per operating point and cache it to disk. At inference time we look up the SNR whose realized rate lands within ∼ 0.01 bps of any requested target (full procedure: Appendix B), enabling arbitrary fractional bit-rates that fixed-rate codebooks cannot match. Hyperparameter auto-tuning. For a given target rate, the implementation looks up the lattice SNR via interpolation in the cached table and applies it uniformly across all quantized tensors.

14

Per-layer bit allocation is supported but disabled by default; we leave its study as future work (Section 8).

6

Experiments

We evaluate HyperQuant in three stages: characterizing the method on its own (Section 6.1– Section 6.5), measuring deployment cost (Section 6.6), and comparing against prior codecs (Section 6.7). Quality numbers are exact pseudo-quantization PPL/quality measurements; throughput and memory are measured end-to-end on an H100. Setup. The LLM weight/KV experiments use Llama-3.1-8B-Instruct [1] evaluated on the WikiText-2 raw test split [21] using 141 non-overlapping windows of 2048 tokens (bf16 baseline PPL 7.1606); the KV comparison against OCTOPUS additionally uses Qwen2.5-7B-Instruct-1M at 4096-token context (Section 6.7.2). The video experiment uses LTX-2-19B [17] on a 32-prompt suite at 512×320 resolution and 49 frames (Stage 1 only). All experiments are post-training and use no fine-tuning or calibration data; the calibration that is required is the synthetic SNR↔bps lookup table of Section B.1, computed once. Part I: Method characterization.

6.1

Weight-only quantization

HyperQuant quantizes every nn.Linear weight (except lm_head) with per-tile RHT, per-block α-scaling, lattice quantization, bit-stripping, and Rice coding of the integer codes (Sections 4 and 4.6); no fp8 cast and no calibration data. We sweep target rates from 3.0 to 5.0 bps for all four lattices (E8 , D4 , A2 , Z). Because the Rice code is variable-length, the rate knob is continuous: a single α per RHT tile lands the realized rate within 0.01 bps of any requested target. Lattice ordering follows the Voronoi second moment. The per-lattice weight SNR (paramsweighted over the 224 quantized layers) is constant to within ±0.05 dB across layers and orders exactly as the textbook normalized second moments G(Λ) (Figure 2b and Table 2): E8 > D4 > A2 > Z. The advantage of the best lattice over the worst grows with rate (E8 − Z: 0.81 dB at 3 bps to 0.65 dB at 5 bps), reflecting the high-rate regime where granular gain dominates. In practice we pick E8 below 3.25 bps, E8 /D4 in the 3.5–4.0 range, and any lattice above 4.25 bps (where the choice is below the PPL noise floor, so kernel simplicity, Z scalar, A2 2-D, D4 4-D, E8 8-D, decides). SNR is the sufficient statistic. Across all four lattices and all rates, model PPL is a single monotone function of weight SNR, as the linearity theorem [20] predicts: it reduces global perplexity damage to a sum of per-layer mean-squared errors, so equal weight SNR implies equal expected PPL hit regardless of error shape. We therefore calibrate on one synthetic SNR↔bps table and let PPL fall out for free rather than running end-to-end PPL per configuration; Section 6.7.1 shows this collapse holds across schemes too.

6.2

KV-cache-only quantization and bias correction

We benchmark the HyperQuant KV path with bf16 weights, sweeping target bps from 1.5 to 4.0 and dequantizing the cache to bf16 before attention. Figure 3 summarizes the rate-quality behavior. 15

Figure 2: Weight quantization on Llama-3.1-8B at matched bps across the four lattices (E8 , D4 , A2 , Z). (a) WikiText-2 PPL vs rate (bf16 baseline 7.161): at b ≤ 3.25 the higher-dimensional E8 wins by a clear margin, while at b ≥ 4.5 the four lattices cluster within 0.05 PPL, below the run-to-run evalnoise floor. (b) Model-wide weight SNR (dB, params-weighted) vs rate: the on-model SNR matches the iid-Gaussian calibration target to within ±0.02 dB and orders exactly as E8 > D4 > A2 > Z at every rate.

Figure 3: KV-only HyperQuant on Llama-3.1-8B with bf16 weights, shown over the two working regimes. (Left) High-compression regime (1.7–2.5 bps): QJL/signs rotation pulls ahead of plain none as the rate falls, reaching ∼ 0.5 PPL at 2.0 bps. (Right) High-quality regime (2.5–4.0 bps): all six bias-correction variants collapse onto the bf16 baseline, within 0.04 PPL of one another at b ≥ 2.5. Two operating regimes. Figure 3 splits cleanly into two working regimes, summarized in Table 5: High-compression floor. The marginal cost steepens sharply toward the bottom of the highcompression regime: each 0.05-bps step below b ≈ 1.8 roughly doubles the added PPL (+2.9 → +6.1 16

Regime

bps range

Best variant

∆ PPL vs. bf16

High-quality High-compression

≥ 2.5 1.7–2.5

none (variants tied) qjl / signs

0.05–0.79 0.79–13.9

Table 5: The two working regimes of KV-only lattice quantization. In the high-quality regime (b ≥ 2.5) every bias-correction variant is within 0.04 PPL, so the cheapest (none) is fine; in the high-compression regime (1.7–2.5 bps) QJL or the ±1 signs rotation pulls ahead, by ∼ 0.5 PPL at 2.0 bps. PPL per 0.05-bps for none between 1.8 bps and 1.7 bps). The lattice cell radius grows faster than the per-vector signal at this rate, and the linearity-of-attention argument that makes the high-quality regime forgiving breaks down, setting the ∼ 1.7-bps practical floor for data-free KV quantization. (Section 6.7.2 shows that a small residual window of recent tokens largely defers this floor.) Sweet spot at 3.0 bps. HyperQuant achieves ∆PPL = +0.25 at 3.0 bps with an 81% KVcache memory reduction. This is, to our knowledge, the best published KV-only quality at 3 bps on Llama-3.1-8B without calibration. Bias-correction variants. HyperQuant’s KV path supports two bias-correction variants (Section 5.2): a per-layer random rotation (none, a cheap ±1 signs diagonal, or a full Haar QJL matrix) to reduce within-vector anisotropy, and subtractive dither to make the inner-product error strictly unbiased per cached vector (provable via the Schuchman conditions; Appendix A). Table 6 sweeps all six (rotation × dither) combinations KV-only at E8 , 2.0 bps (bf16 weights), the high-compression regime where the choice actually moves PPL. variant

rotation

dither

PPL

∆PPL vs. bf16

per-vec bias

none dither signs signs+dith qjl qjl+dith

– – ±1 ±1 Haar Haar

off on off on off on

10.089 9.622 9.896 9.706 9.557 9.685

+2.928 +2.462 +2.735 +2.546 +2.397 +2.524

−2.2×10−2 ≈0 −4.0×10−2 ≈0 +1.9×10−2 ≈0

Table 6: Bias-correction variants for HyperQuant KV on Llama-3.1-8B (KV-only, E8 at 2.0 bps, bf16 weights; ∆PPL is over the bf16 baseline at 7.161). Unlike at 4 bps, the choice matters in this high-compression regime: the variants span ∼ 0.53 PPL. qjl (no dither) is the PPL winner, and both a rotation (qjl/signs) and dither independently improve on plain none; dither additionally buys exact per-vector unbiasedness (≈ 0 bias), and the ±1 signs rotation tracks QJL at 1/128 the stored memory. At 4 bps this choice is in the noise (all six within 0.014 PPL); the dominant gain there is the bf16 →4-bit quantization itself. The spread opens at lower rates, where rotation pulls ahead by ∼ 0.5 PPL (Table 5) and dither matters most for long-context workloads where per-vector bias compounds across thousands of tokens. We default to qjl (or signs when rotation storage is a concern), adding dither only when provable unbiasedness is required.

17

6.3

Full-model quantization at 8-bit MMA precision

We compose all four HyperQuant components: weights and KV at 4 bps, with a per-tile fp8 or int8 cast for the MMA and optional bias correction. Table 7 summarizes the end-to-end quality. MMA cast

Path

PPL

∆PPL

bf16 fp8 fp8 int8 int8

— weights-only weights+KV weights-only weights+KV

7.161 7.535 7.644 7.433 7.503

— +0.37 +0.48 +0.27 +0.34

Table 7: Llama-3.1-8B end-to-end HyperQuant at 4 bps with 8-bit MMA. Adding the KV-cache pipeline on top of the weights+8-bit path costs only +0.11 PPL (fp8) or +0.05 PPL (int8). KV bias-correction choice (none/dither/signs) moves PPL by < 0.01 (none shown). INT8 wins on post-RHT data. int8 beats fp8-e4m3 by ∼ 0.10 PPL at matched precision (Table 7). Post-RHT, post-lattice tensors have light tails (almost bounded), so int8’s 256 equally spaced levels are more useful than fp8’s logarithmic spacing of 200 effective levels plus 56 wasted on the tails. The order flips on raw activations where outliers dominate; the lattice path renders that trade-off in favor of int8.

6.4

Full-model quantization at 4-bit MMA precision

The Blackwell generation exposes nvfp4 (16-element fp8-scaled blocks) and mxfp4 (32-element power-of-2-scaled blocks). We feed HyperQuant’s lattice output into both formats at 4 bps and 3 bps; Table 8 summarizes the results. Format

Path

Bias

PPL

∆PPL

4 bps HyperQuant nvfp4 weights-only nvfp4 weights+KV nvfp4 weights+KV mxfp4 weights-only mxfp4 weights+KV mxfp4 weights+KV

none none dither none none dither

8.43 9.29 9.24 9.46 ∼ 18 13.61

+1.27 +2.13 +2.08 +2.30 ∼ +11 +6.45

3 bps HyperQuant nvfp4 weights+KV mxfp4 weights+KV

dither dither

12.81 25.42

+5.65 +18.26

Table 8: Blackwell fp4 path at HyperQuant lattice bases of 4 and 3 bps (∆PPL vs. bf16 7.161). nvfp4 + dither is the only mxfp4-class configuration that survives the KV cache; mxfp4’s e8m0 scale loses too much dynamic range to handle KV tails. Dither has a small effect on nvfp4 (−0.05 PPL, the none→dither weights+KV rows) but a large positive effect on mxfp4 (−0.33 PPL at 4 bps); at 3 bps the dither rescue on mxfp4 jumps to −5.89 PPL (model goes from broken to borderline). The pattern is consistent with the dither role being more important at higher quantization noise, which both lower bps and the coarser mxfp4 grid produce. 18

6.5

Beyond LLMs: LTX-2-19B video DiT

We apply HyperQuant to LTX-2-19B [17], a 19B-parameter diffusion transformer (DiT) for text-to-video synthesis with 1370 linear layers, quantizing all weights at 4 bps with fp8 or int8 MMA and leaving the rest of the pipeline (Gemma-3-12B text encoder, VAE, scheduler) at bf16.

Figure 4: Per-prompt PSNR (a) and LPIPS (b), and per-frame PSNR (mean ± std) for HyperQuant on LTX-2-19B versus the bf16 baseline, on a 32-prompt suite at 512×320, 49 frames. int8 MMA edges fp8 on both PSNR and LPIPS. Config

PSNR (dB) ↑

SSIM ↑

LPIPS ↓

(∞) 22.04 22.74

1.000 0.8068 0.8172

0 0.2144 0.2008

bf16 baseline HyperQuant + fp8 MMA HyperQuant + int8 MMA

Table 9: LTX-2-19B quality under HyperQuant, 32-prompt evaluation. The int8 MMA path is better than fp8 on every metric at identical 4 bps. int8 MMA achieves PSNR 22.74 dB, SSIM 0.8172, and LPIPS 0.2008 at 4 bps, improving on the fp8 variant on every metric. The int8-beats-fp8 result from the LLM experiments (Section 6.3) thus replicates on a much larger model in a qualitatively different domain. Weight memory shrinks 35.16 → 9.5 GiB (3.7×); generation wall-clock is slightly slower (fp8 254.0 s vs. bf16 209.7 s) because the pseudo-quantization harness adds a decode pass without exercising MMA acceleration. As on the LLM (Section 6.6), HyperQuant’s hardware win is the 3.7× weight-memory reduction, not wall-clock.

19

Figure 5: Sample frames from HyperQuant on LTX-2: bf16 baseline (top), int8 + lattice (middle), and per-frame error map (bottom). No visible artefacts; per-frame PSNR is flat across the 49-frame window. Per-frame analysis. Per-frame PSNR is essentially constant across the 49-frame window (Figure 5): quantization noise does not compound through the DiT’s temporal conditioning. The low absolute PSNR (22–23 dB) reflects the natural posterior divergence of any diffusion model under perturbation, not visible artefacts. Part II: Deployment.

6.6

End-to-end throughput and memory

Table 10 reports end-to-end Llama-3.1-8B throughput and resident memory on a single H100 (decode: autoregressive M =1; prefill: one 2048-token forward), together with the weight and KV compression. HyperQuant compresses the linear weights 3.9×, cutting full-model resident memory ∼ 2.8× (14.96 → 5.29 GiB). The full-model factor trails the 3.9× weight factor because the token 20

embeddings and lm_head are kept in bf16: that 5.29 GiB is 3.32 GiB of compressed linear weights plus 1.96 GiB of bf16 embeddings/head. For much larger models we expect this difference between the compression factors to shrink significantly. For the KV cache the resident column (measured before any generation begins) does not change, because the cache is empty at model-load time. The KV savings materialize during generation: E8 lattice codes are stored as a variable-length Rice-coded bitstream plus a float16 per-vector L2 norm, yielding ∼ 3.8× actual GPU memory reduction per cached token (0.516 bytes/scalar vs. 2 bytes/scalar for bf16; saving ∼0.09 GiB per 1,024 tokens and ∼2.9 GiB per 32,768-token context). The gap between the 3.8× actual figure and the 4× theoretic value is metadata overhead (bit-offset table and Rice-k entry per stream). Neither path is a throughput win on this hardware. For the weight path, a warp-specialized fused decode+GEMV kernel reduces per-layer memory traffic from ∼4.5 B/scalar (read bitstream + write scratch + read scratch by cuBLAS) to ∼2.5 B/scalar (bitstream read only, x in shared memory), yielding ∼1.5× decode speedup on the weight-quantized path. For the KV path, the past bitstream is maintained as a single contiguous tensor and decoded with one kernel call per role per layer; the remaining overhead is the O(T ) per-step re-decode of all past tokens and the QJL inverse rotation (O(T D2 ) per layer). Eliminating these requires the kernel directions in Section 8. Config bf16 baseline HyperQuant W (4 bps) HyperQuant KV (4 bps) HyperQuant W+KV

prefill (tok/s)

decode (tok/s)

resident (GiB)

weight cmp.

KV cmp.

16,505 3,915 16,261 4,655

51.8 7.8 10.8 5.4

14.96 5.29 14.99 5.69

– 3.9× – 3.9×

– – 3.79× 3.79×

Table 10: End-to-end Llama-3.1-8B-Instruct on one H100, bf16 base, all at 4 bps. HyperQuant compresses the linear weights 3.9× (full-model resident 2.8×, 14.96 → 5.29 GiB) and stores the KV cache as variable-length Rice bitstreams, at a throughput cost from the per-forward weight decode and the O(T ) per-step KV re-decode.

Part III: Comparison to prior work.

6.7

Comparison to prior quantization schemes

We compare HyperQuant against the strongest published codecs in each setting: HIGGS for weights (Section 6.7.1) and TurboQuant/OCTOPUS for the KV cache (Section 6.7.2). 6.7.1

Weights: HyperQuant vs. HIGGS

We compare the HyperQuant weight path against HIGGS [20] at matched bit-rates from 3 to 5 bps. HIGGS runs at its native fixed rates (3, 3.5, 4, 4.5, 5 bps √ for bp=2; 3, 4, 5 bps for p=1), with half-integer points using a Lloyd-trained codebook of size 2 · 2 [26]; HyperQuant runs continuously via Rice. Figure 6 shows the headline result: every HyperQuant lattice beats HIGGS-p2 at every rate. A dimension-matched comparison. HIGGS-p2 is a Lloyd-optimal two-dimensional codebook, so the fair head-to-head is against HyperQuant’s two-dimensional lattice A2 (not the higherdimensional E8 , which we return to below). Even at matched dimension, A2 wins at every rate: 21

Figure 6: Llama-3.1-8B WikiText-2 PPL versus bits per scalar for HyperQuant (lattices E8 , D4 , A2 , scalar Z) and HIGGS (p ∈ {1, 2}). HyperQuant significantly outperforms HIGGS at every bps. The four lattices cluster together at b ≥ 4.25 because their asymptotic G(Λ) values are within 0.5 dB. bps

3.0

3.5

4.0

4.5

5.0

HIGGS-p2 PPL HyperQuant (A2 ) PPL ∆ PPL

9.527 9.273 −0.25

8.140 7.921 −0.22

7.618 7.500 −0.12

7.427 7.341 −0.09

7.288 7.252 −0.04

Where the gap comes from. HIGGS uses a finite codebook of N = 2pb codewords at a fixed log2 N bits per index; HyperQuant uses an unbounded integer lattice with a variable-length Rice code, allowing the codebook to extend to infinity at finite expected rate [38]. Converting rate slack to SNR at the high-rate Gaussian slope (6.02 dB/bps) splits the A2 -vs-HIGGS-p2 gap into two separable pieces (Table 11): • Index-entropy piece. HIGGS spends log2 N bits per index even though its index histogram has lower entropy; Rice coding recovers this slack (Figure 7b). It dominates at low rate (0.61 dB at 3 bps) but shrinks as the Lloyd histogram becomes more uniform (0.18 dB at 5 bps). • Unbounded-codebook piece. A finite codebook must stretch its outermost cells to cover the Gaussian tails; the lattice has no boundary cell, so a tail outlier merely produces a larger-integer code that costs proportionally more bits. This residual grows with rate (0.13 → 1.79 dB from 3 bps to 5 bps) and is realizable only because variable-length coding lets the codebook be unbounded in the first place. 22

(b) Entropy slack: fixed-rate budget minus the empiri(a) Weight SNR (dB) vs. bps. HyperQuant domi- cal index entropy of the HIGGS codebook. The lattice nates by 1.3–2.5 dB across the entire range. + Rice path closes this slack by entropy coding.

Figure 7: The two components of the HyperQuant-vs-HIGGS gap. bps

HIGGS-p2 SNR

A2 +Rice SNR

total ∆

entropy-coding piece

unbounded-codebook piece

3.0 4.0 5.0

15.28 dB 21.10 dB 26.29 dB

16.02 dB 22.21 dB 28.26 dB

0.74 dB 1.11 dB 1.97 dB

0.61 dB 0.75 dB 0.18 dB

0.13 dB 0.36 dB 1.79 dB

Table 11: Dimension-matched decomposition of the A2 -vs-HIGGS-p2 SNR gap (both 2-D). The “entropy-coding piece” is the rate slack HIGGS would recover by re-encoding its existing index histogram with a variable-length code, converted to dB at the local 6.02 dB/bps Gaussian R-D slope; it dominates at low rate. The “unbounded-codebook piece” is the residual that even an entropy-coded HIGGS cannot recover, realizable only because the Rice code lets the codebook be unbounded; it dominates at high rate. Higher-dimensional lattices. The A2 comparison is deliberately conservative. HIGGS decodes by table lookup, so its 2pb codewords must fit in GPU shared memory, which caps it at p ∈ {1, 2} in practice (a bf16 p=4, 4 bps table already needs 512kiB). HyperQuant decodes algebraically with an O(n) closest-point step and pays no memory penalty for dimension, so it can use D4 and E8 . Their lower Voronoi second moments, G(E8 ) is only 0.88 dB above the Shannon bound versus ≈ 1.3 dB for any 2-D grid (Table 2), widen the SNR advantage to 1.3–2.5 dB for E8 (Figure 7a): pure granular gain that is structurally unavailable to HIGGS. Concretely, E8 drives weight-path PPL down to 8.744 at 3 bps and 7.434 at 4 bps (bf16 baseline 7.161), improving on the dimension-matched A2 (9.273 / 7.500) by 0.53 / 0.07 PPL and on HIGGS-p2 (9.527 / 7.618) by 0.78 / 0.18 PPL, the margin largest in the low-rate regime where granular gain dominates. 6.7.2

KV cache: HyperQuant vs. TurboQuant / OCTOPUS

OCTOPUS [4] reports a KV-codec comparison (vs. TurboQuant and PolarQuant) on Qwen2.57B-Instruct-1M at context 4096 with symmetric K=V , measuring WikiText-2 and C4 PPL. We reproduce that exact setting and match OCTOPUS’s two bias-correction variants. First, OCTOPUS notes a stability prerequisite: K-side protection on the outer transformer blocks at each end. We confirm it independently: with all K/V tiles quantized, HyperQuant (and any per-vector codec) 23

diverges on Qwen2.5-1M even at 4 bps (PPL ∼ 3500) despite ∼ 22 dB per-vector SNR. Keeping those two K tiles in bf16 (counted at 16 bits in the rate) restores near-lossless behavior. Second, OCTOPUS uses a 32-token residual window (recent K/V kept exact); we report HyperQuant both with and without it. We implement the window per-query and charge its rate exactly: at W =32, T =4096, it costs ≈ 0.1 bps and trims KV× only marginally. Because absolute WikiText-2 baselines differ between harnesses (ours 7.25 vs. OCTOPUS’s 10.03; C4 baselines agree to within 5%), the comparison is on ∆% relative to each method’s own bf16 baseline and on the true compression KV× = 16/effective-bps. nom. bits

codec

corr.

res. win.

W2 ∆% ↓

C4 ∆% ↓

KV× ↑

4

TurboQuant-MSE TurboQuant-QJL OCTOPUS OCTOPUS-QJL HyperQuant HyperQuant HyperQuant HyperQuant

none qjl none qjl none qjl none qjl

32 32 32 32 – – 32 32

+3.1 +8.0 +2.7 +2.7 +0.8 +1.4 +0.1 +0.2

+1.7 +7.9 +1.5 +1.5 +1.0 +1.0 +0.2 +0.3

2.2 2.2 2.2 2.0 3.7 3.6 3.6 3.5

3

TurboQuant-MSE TurboQuant-QJL OCTOPUS OCTOPUS-QJL HyperQuant HyperQuant HyperQuant HyperQuant

none qjl none qjl none qjl none qjl

32 32 32 32 – – 32 32

+8.6 +50.4 +7.2 +7.2 +5.5 +4.8 +1.8 +1.6

+8.3 +59.9 +5.9 +6.1 +5.7 +6.5 +1.4 +1.5

2.6 2.5 2.5 2.3 4.8 4.6 4.6 4.5

2

TurboQuant-MSE TurboQuant-QJL OCTOPUS OCTOPUS-QJL HyperQuant HyperQuant HyperQuant HyperQuant

none qjl none qjl none qjl none qjl

32 32 32 32 – – 32 32

+63.0 +772.0 +34.7 +34.7 +42.0 +44.0 +7.4 +14.7

+77.4 +1349.0 +41.5 +41.4 +54.3 +53.7 +8.1 +15.2

3.0 3.0 2.9 2.6 6.6 6.4 6.4 6.1

1.7

HyperQuant

none

32

+26.9

+33.7

7.1

Table 12: HyperQuant KV-only vs. OCTOPUS/TurboQuant on Qwen2.5-7B-Instruct-1M (context 4096, symmetric K=V ). For each prior codec we report both its no-bias-correction baseline (TurboQuant-MSE / OCTOPUS, none) and its 1-bit-JL-residual variant (TurboQuant-QJL / OCTOPUS-QJL, qjl), and HyperQuant both with and without the 32-token residual window. OCTOPUS/TurboQuant rows and their KV× are from [4, Table 2] and natively include the 32-token window plus K-side outer-block protection; HyperQuant rows are this work (WikiText-2 over 72 windows, C4 en/validation over 39 windows). KV× is the true compression (effective bits include the bf16-protected tiles and the residual window). Bold marks the best ∆% per bit-width block. Table 12 supports three conclusions. (i) Matched bias-correction. At matched scheme, HyperQuant’s qjl beats OCTOPUS-QJL (+0.2% vs. +2.7% at 4 bits) and none beats native OCTOPUS at every rate; the within-HyperQuant spread mirrors the rotation-inversion at low bps. (ii) Matched residual window. With the same 32-token window, HyperQuant wins on both quality and 24

compression at every operating point (+7.4% vs. OCTOPUS’s +34.7% at 2 bits, KV × 6.4 vs. 2.9). The window is decisive at 2 bits: without it OCTOPUS leads on quality (+34.7% vs. +42.0%), but it costs only ≈ 0.1 bps (Table 13). (iii) Compression. The comparison is not compression-matched: OCTOPUS’s 2-bit point uses ≈ 5.5 effective bits (KV × 2.9) from per-triplet norm overhead, vs. HyperQuant’s ≈ 2.5 (KV × 6.4). On a compression-matched basis the advantage widens further, reaching KV × 7.1 at 1.7 bps where OCTOPUS tops out near 3.0×. bps

∆% (no window)

∆% (window 32)

KV×

4 3 2 1.7

+0.8 +5.5 +42.0 +325.1

+0.1 +1.8 +7.4 +26.9

3.7 → 3.6 4.8 → 4.6 6.6 → 6.4 7.5 → 7.1

Table 13: Effect of the 32-token residual window on HyperQuant (none, WikiText-2 ∆%). The window adds ≈ 0.1 bps and so trims KV× slightly, but the quality gain grows sharply as the rate falls, exactly where recent-token fidelity matters most.

7

Ablation study

This section isolates the contribution of each HyperQuant component on Llama-3.1-8B and identifies the parameters that materially move quality. We organize by component; ablations we did not run are folded into the future directions of Section 8.

7.1

Lattice choice

We compare Z, A2 , D4 , E8 on the weight path (Figure 6): bps

PPL(E8 )

PPL(D4 )

PPL(A2 )

PPL(Z)

3.0 4.0 5.0

8.744 7.434 7.236

8.835 7.435 7.227

8.973 7.466 7.249

9.318 7.527 7.252

Two practical conclusions: • Above 4.25 bps, all four lattices are essentially equivalent; use whichever has the simplest decoder (Z scalar is fine). • Below 3.5 bps, E8 ’s additional granular gain becomes meaningful (up to 0.57 PPL over Z at 3 bps): the only regime where the lattice choice has practical purchase.

7.2

RHT tile size

The RHT tile is the block length over which we apply the RHT and amax-scale before lattice quantization. We sweep it over {128, 256, 512, 1024, 2048} on Llama-3.1-8B with E8int at 3 and 4 bps on the weight, KV, and joint W+KV paths (Figure 8; WikiText-2 PPL over 141 windows, bf16 baseline 7.161). To separate a genuine tile effect from the seed-to-seed noise of the random rotation, we repeat the sweep over four independent RHT seeds and report the across-seed mean ±1 standard deviation. The SNR is calibrated once on iid-Gaussian data and held fixed across tiles; the realized 25

Figure 8: PPL vs. RHT tile size on Llama-3.1-8B (E8int , no MMA cast, true RHT), as ∆PPL relative to the bf16 baseline for the weight, KV, and joint W+KV paths at 3 bps (left) and 4 bps (right). Markers are the mean over four RHT seeds; error bars are ±1 standard deviation. KV is nearly tile-invariant with negligible seed variance, while for the weight and W+KV paths the per-tile differences fall within the seed error bars at both rates, i.e. tile size is not a quality lever. W+KV tracks the sum of the two independent paths. rate stays within ±0.01 bps of target, with larger tiles coding marginally fewer bits (≈ 0.005 bps) by tightening the post-RHT Gaussian fit. Two conclusions: • KV is essentially tile-insensitive, and this is the one rock-solid effect: the per-tile means span only 3.5–3.7% at 3 bps and 0.74–0.83% at 4 bps, with tiny seed variance (≤ 0.24 pp, mostly < 0.1). KV vectors are low-dimensional and well-conditioned per head, so the RHT tile size barely matters once the tile covers a head or more. Per-head RHT (tile = 128) is a fine, cheap default. • For weights and weights+KV, tile size is not a quality lever. Across seeds the weight path stays at ≈ 21–22.5% at 3 bps and ≈ 3.6–4.3% at 4 bps, with per-tile gaps (≤ 1.6 pp) that are smaller than the ±1 s.d. seed noise (≈ 1.3 pp at 3 bps, 0.2–0.7 pp at 4 bps); W+KV behaves the same way. Apparent “best” tiles from any single basis (e.g. a deterministic Hadamard, or one random seed) do not survive averaging over rotations, so the marginally better Gaussianization and lower rate of a longer transform do not translate into a reproducible PPL gain. The W+KV damage tracks the sum of the independent paths (e.g. at 4 bps, tile 128: weights +3.57% and KV +0.83% compose to W+KV +4.58%), confirming the two error sources are roughly additive in PPL. Because the tile has no reproducible effect on quality, we set it on kernel-efficiency grounds: the default tile of 128 matches the MMA K-dim and is therefore preferred for downstream kernel fusion at no measurable accuracy cost.

7.3

HIGGS-codebook efficiency analysis

To corroborate the rate-gain decomposition in Section 6.1, we measured HIGGS’s empirical codebook index histograms on Llama-3.1-8B weights (Figure 9). The Lloyd grids exhibit clear non-uniform 26

(a) Index frequency for HIGGS p=1, 3 bps.

(b) Empirical entropy efficiency H/b for HIGGS codebooks at b ∈ {3, . . . , 5}, p ∈ {1, 2}.

Figure 9: HIGGS codebook index distributions are non-uniform on Llama weights, with 0.6–5.9% entropy slack relative to the fixed-rate budget log2 N (red labels). HyperQuant recovers this slack via Rice coding. usage: the most-used codeword is consistently 10–22× more frequent than the least-used, and the empirical index entropy is 0.6–5.9% below the fixed-rate budget log2 N (equivalently, 94–99% coding efficiency). This is not a bug in HIGGS; it is the expected behavior of any finite codebook on a smooth distribution. It is however a recoverable bit-rate gap, which Rice coding closes.

8

Conclusion and discussion

We presented HyperQuant, a data-free PTQ pipeline that unifies five ingredients, per-tile RHT, optimal low-dimensional lattice quantization, lossless bit-stripping, Rice entropy coding, and Schuchman-Zamir-Feder subtractive dither, into a single recipe for both the weights and the KV cache of modern transformers. The pipeline plugs into Hopper’s 8-bit and Blackwell’s 4-bit MMA paths via a per-tile fp8/int8 cast, which is near-optimal once the RHT has Gaussianized each tile’s coordinates. Summary of empirical findings. • Weight quantization: HyperQuant’s E8 +Rice path dominates HIGGS at every bps from 3 to 5. The gap decomposes into (i) a small index-entropy piece (0.6–0.8 dB across the range) that any entropy-coded HIGGS could recover, and (ii) a larger structural “unbounded-codebook” piece that even an entropy-coded HIGGS cannot match (0.67 dB at 3 bps, 0.91 dB at 4 bps, 2.34 dB at 5 bps), enabled by the variable-length coding that allows the lattice to be unbounded. • KV-cache quantization: a clean two-regime story emerges. Above 2.5 bps all bias-correction choices are equivalent; in the high-compression regime (1.7–2.5 bps) QJL rotation pulls ahead by up to ∼ 0.5 PPL. Run head-to-head on OCTOPUS’s own Qwen2.5-7B protocol, HyperQuant beats both TurboQuant and OCTOPUS at matched bias correction; with a matched 32-token residual window it wins on both quality and compression at every operating point (+7.4% vs. OCTOPUS’s +34.7% perplexity at 2 bits, at KV × 6.4 vs. 2.9), and reaches KV × 7.1 at 1.7 bps where OCTOPUS tops out near 3.0×. • 8-bit MMA: int8 consistently beats fp8 on post-RHT lattice data by ∼ 0.1 PPL (LLM) and ∼ 0.7 dB PSNR (LTX-2 video), reversing the conventional wisdom that fp8 is preferred for 27

outlier-heavy distributions: post-RHT the distribution is no longer outlier-heavy. • 4-bit MMA: nvfp4 is viable; mxfp4’s e8m0 scale cannot accommodate KV-cache tails without dither rescue. • Generalization: the entire pipeline transfers cleanly from an 8B language model to a 19B video DiT. When to use HyperQuant. The defaults in Table 4 deliver ∆PPL ≤ 0.3 on Llama-3.1-8B at 4 bps for both weights and KV with no fine-tuning, no calibration set, and a ∼ 30-second post-training pass. For workloads where KV-cache memory is the bottleneck (long-context decoding, batch inference, multi-tenancy) we recommend 3 bps (KV), which delivers ∼ 81% KV memory reduction for +0.25 PPL. For aggressive memory-constrained deployments at 2 bps (KV), enable QJL rotation; below 1.7 bps the operating regime is too noisy for any data-free method we know, and either calibration-based methods or fine-tuning is needed. Limitations. 1. Memory win, not a speedup, on H100. We measure 3.9× weight compression (2.8× full-model resident) and 3.79× KV-cache compression at near-lossless quality (Table 10), but the per-forward variable-length decode adds latency rather than removing it, because bf16 cuBLAS is already near roofline and a Rice stream cannot be fed into a tuned MMA mainloop. Turning the rate gain into a wall-clock speedup needs the kernel work below. 2. Single-bps allocation. HyperQuant currently uses uniform bps; the dynamic-programming bit allocator of HIGGS can be composed with our entropy code and should help in the very low-bit regime. Future directions.

The most natural extensions, in order of expected impact:

1. Kernel optimizations toward a throughput win. Three directions build on the offset-indexed decoder (Section 5): (a) intra-stream parallelism via delta-coded sub-offsets, restoring occupancy at ∼ 1% metadata overhead; (b) warp-specialized fused decode+MMA, with producer warps decoding tiles into shared memory while consumer warps run wgmma, hiding decode under the matmul; (c) rANS in place of Rice [10], removing the serial unary scan for N -way SIMD decode. 2. Close the FP-INT gap with a Gaussian-aware cast. Post-RHT tiles are approximately iid Gaussian and light-tailed, making int8’s uniform levels a better match than fp8’s logarithmic spacing. An fp8 cast designed for the known post-RHT density (e.g. companding or an analytic-tail saturation point) should close the ∼ 0.1 PPL/∼ 0.7 dB gap without calibration, since the RHT fixes the marginal distribution data-free. 3. Add a calibration pass such as LDLQ. A one-shot LDLQ-style update [31, 34] adjusting each layer’s unquantized weights to absorb prior quantization errors should close the residual gap to calibration-based methods with only a data-light pass over the model. 4. Per-layer bit allocation. Composing HIGGS’s dynamic-programming allocator [20] with our entropy code should concentrate gains in the very low-bit regime. 5. Higher-dimensional lattices. The Leech lattice Λ24 offers a ∼ 0.4 dB granular-gain advantage over E8 at the cost of a more expensive decoder, to be weighed against its PPL benefit at 3, 3.5, and 4 bps. 28

References [1] Meta AI. The Llama-3 herd of models. Meta AI research publication, 2024. URL https: //ai.meta.com/research/publications/the-llama-3-herd-of-models/. [2] Nir Ailon and Bernard Chazelle. The fast Johnson–Lindenstrauss transform and approximate nearest neighbors. SIAM Journal on Computing, 39(1):302–322, 2009. [3] Saleh Ashkboos, Maximilian L. Croci, Torsten Hoefler, and James Hensman. SliceGPT: Compress large language models by deleting rows and columns. In ICLR, 2024. URL https: //arxiv.org/abs/2401.15024. [4] Mark Boss, Vikram Voleti, Simon Donné, and Shimon Vainer. Octopus: Optimized kv cache for transformers via octahedral parametrization under optimal squared error quantization, 2026. URL https://arxiv.org/abs/2605.21226. [5] Jerry Chee, Yaohui Cai, Volodymyr Kuleshov, and Christopher De Sa. QuIP: 2-bit quantization of large language models with guarantees. In NeurIPS, 2023. URL https://arxiv.org/abs/ 2307.13304. [6] John H. Conway and Neil J. A. Sloane. Sphere Packings, Lattices and Groups. Springer, 3rd edition, 1999. [7] Thomas M. Cover and Joy A. Thomas. Elements of Information Theory. Wiley, 2nd edition, 2006. [8] Anirban Dasgupta, Ravi Kumar, and Tamás Sarlós. A sparse Johnson–Lindenstrauss transform. In STOC, 2010. [9] Tim Dettmers, Ruslan Svirschevski, Vage Egiazarian, Denis Kuznedelev, Elias Frantar, Saleh Ashkboos, Alexander Borzunov, Torsten Hoefler, and Dan Alistarh. SpQR: A sparse-quantized representation for near-lossless LLM weight compression. In ICLR, 2024. URL https://arxiv. org/abs/2306.03078. [10] Jarek Duda. Asymmetric numeral systems: Entropy coding combining speed of Huffman coding with compression rate of arithmetic coding. arXiv preprint arXiv:1311.2540, 2013. [11] Uri Erez and Ram Zamir. On the closeness of the random-dither mapping to the informationtheoretic optimum for vector quantization. IEEE Transactions on Information Theory, 51(10): 3617–3631, 2005. [12] Patrick Esser et al. Scaling rectified flow transformers for high-resolution image synthesis. arXiv preprint arXiv:2403.03206, 2024. URL https://arxiv.org/abs/2403.03206. [13] G. David Forney and Lee-Fang Wei. Multidimensional constellations—Part I: Introduction, figures of merit, and generalized cross constellations. IEEE Journal on Selected Areas in Communications, 7(6):877–892, 1989. [14] Elias Frantar, Saleh Ashkboos, Torsten Hoefler, and Dan Alistarh. GPTQ: Accurate posttraining quantization for generative pre-trained transformers. In ICLR, 2023. URL https: //arxiv.org/abs/2210.17323.

29

[15] Herbert Gish and John N. Pierce. Asymptotically efficient quantizing. IEEE Transactions on Information Theory, 14(5):676–683, 1968. [16] Nathan Halko, Per-Gunnar Martinsson, and Joel A. Tropp. Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions. SIAM Review, 53(2):217–288, 2011. URL https://arxiv.org/abs/0909.4061. [17] Lightricks. LTX-Video: A real-time video generation model. GitHub repository, 2024. URL https://github.com/Lightricks/LTX-Video. [18] Ji Lin, Jiaming Tang, Haotian Tang, Shang Yang, Wei-Ming Chen, Wei-Chen Wang, Guangxuan Xiao, Xingyu Dang, Chuang Gan, and Song Han. AWQ: Activation-aware weight quantization for on-device LLM compression and acceleration. In MLSys, 2024. URL https://arxiv.org/ abs/2306.00978. [19] Thomas D. Lookabaugh and Robert M. Gray. High-resolution quantization theory and the vector quantizer advantage. IEEE Transactions on Information Theory, 35(5):1020–1033, 1989. [20] Vladimir Malinovskii, Andrei Panferov, Ivan Ilin, Han Guo, Peter Richtárik, and Dan Alistarh. Pushing the limits of large language model quantization via the linearity theorem. In NAACL, 2025. URL https://arxiv.org/abs/2411.17525. [21] Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. In ICLR, 2017. URL https://arxiv.org/abs/1609.07843. [22] Paulius Micikevicius et al. FP8 formats for deep learning. arXiv preprint arXiv:2209.05433, 2022. URL https://arxiv.org/abs/2209.05433. [23] NVIDIA. NVIDIA hopper h100 architecture white paper. NVIDIA white paper, 2022. URL https://resources.nvidia.com/en-us-tensor-core. [24] NVIDIA. NVIDIA blackwell architecture technical brief. NVIDIA technical brief, 2024. URL https://resources.nvidia.com/en-us-blackwell-architecture. [25] Open Compute Project. OCP Microscaling Formats (MX) specification v1.0. OCP specification, 2023. URL https://www.opencompute.org/documents/ ocp-microscaling-formats-mx-v1-0-spec-final-pdf. [26] Gilles Pagès and Jacques Printems. Optimal quadratic quantization for numerics: The Gaussian case. Monte Carlo Methods and Applications, 9(2):135–165, 2003. [27] William Peebles and Saining Xie. Scalable diffusion models with transformers. In ICCV, 2023. URL https://arxiv.org/abs/2212.09748. [28] Reiner Pope, Sholto Douglas, Aakanksha Chowdhery, Jacob Devlin, James Bradbury, Jonathan Heek, Kefan Xu, Shivani Agrawal, and Jeff Dean. Efficiently scaling transformer inference. In MLSys, 2023. URL https://arxiv.org/abs/2211.05102. [29] Robert F. Rice. Some practical universal noiseless coding techniques. JPL Publication 79-22, 1979. [30] Bita Darvish Rouhani, Nitin Garegrat, Tom Madian, Jeremy Lo, Brian Cook, Daniel Pinto, et al. Microscaling data formats for deep learning. arXiv preprint arXiv:2310.10537, 2023. URL https://arxiv.org/abs/2310.10537. 30

[31] Semyon Savkin, Eitan Porat Chen, Or Lou, and Yury Polyanskiy. NestQuant: Nested lattice quantization for matrix products and LLMs. In ICML, 2025. URL https://arxiv.org/abs/ 2502.09720. [32] Leonard Schuchman. Dither signals and their effect on quantization noise. IEEE Transactions on Communication Technology, 12(4):162–165, 1964. [33] Wenqi Shao, Mengzhao Chen, Zhaoyang Zhang, Peng Xu, Lirui Zhao, Zhiqian Li, Kaipeng Zhang, Peng Gao, Yu Qiao, and Ping Luo. OmniQuant: Omnidirectionally calibrated quantization for large language models. In ICLR, 2024. URL https://arxiv.org/abs/2308.13137. [34] Albert Tseng, Jerry Chee, Qingyao Sun, Volodymyr Kuleshov, and Christopher De Sa. QuIP#: Even better LLM quantization with hadamard incoherence and lattice codebooks. In ICML, 2024. URL https://arxiv.org/abs/2402.04396. [35] André Weißenberger and Bertil Schmidt. Massively parallel Huffman decoding on GPUs. In Proceedings of the 47th International Conference on Parallel Processing (ICPP), 2018. [36] Thomas Wiegand, Gary J. Sullivan, Gisle Bjøntegaard, and Ajay Luthra. Overview of the H.264/AVC video coding standard. IEEE Transactions on Circuits and Systems for Video Technology, 13(7):560–576, 2003. [37] Guangxuan Xiao, Ji Lin, Mickael Seznec, Hao Wu, Julien Demouth, and Song Han. SmoothQuant: Accurate and efficient post-training quantization for large language models. In ICML, 2023. URL https://arxiv.org/abs/2211.10438. [38] Ram Zamir. Lattice Coding for Signals and Networks. Cambridge University Press, 2014. [39] Ram Zamir and Meir Feder. On universal quantization by randomized uniform/lattice quantizers. IEEE Transactions on Information Theory, 38(2):428–436, 1992. [40] Amir Zandieh, Majid Daliri, and Insu Han. QJL: 1-bit quantized JL transform for KV cache quantization with zero overhead. arXiv preprint arXiv:2406.03482, 2024. URL https: //arxiv.org/abs/2406.03482. [41] Amir Zandieh, Majid Daliri, Majid Hadian, and Vahab Mirrokni. TurboQuant: Online vector quantization with near-optimal distortion rate. In ICLR, 2026. URL https://arxiv.org/ abs/2504.19874.

A

Proof of subtractive-dither unbiasedness

This appendix gives a self-contained proof that subtractive-dithered lattice quantization satisfies the Schuchman conditions and is therefore exactly unbiased under inner products on every realization: for any deterministic query q and source x, the dithered reconstruction x̂ satisfies EU [⟨q, x̂⟩ | x] = ⟨q, x⟩, the expectation being over the dither U alone. We then show the guarantee survives composition with the full HyperQuant KV pipeline, and contrast it with the weaker approximate unbiasedness of QJL without dither.

31

A.1

Setup and notation

Definition 1 (Lattice and Voronoi cell). A lattice Λ ⊂ Rn is a discrete subgroup of (Rn , +) of full P rank n, i.e., Λ = { ni=1 ki bi : ki ∈ Z} for some R-basis b1 , . . . , bn of Rn . The Voronoi cell of Λ at the origin is V(Λ) := {x ∈ Rn : ∥x∥ ≤ ∥x − λ∥ for all λ ∈ Λ}. (5) The Voronoi cell V(Λ) is a closed convex polytope. It is centrally symmetric, V(Λ) = −V(Λ), because the defining inequalities (5) are invariant under x 7→ −x together with λ 7→ −λ (which is a bijection of Λ). The translates {V(Λ) + λ : λ ∈ Λ} tile Rn , overlapping only on the measure-zero boundary ∂V(Λ). Definition 2 (Fundamental domain). A measurable set D ⊂ Rn is a fundamental domain for Λ if F Rn = λ∈Λ (D + λ) up to sets of Lebesgue measure zero. By the tiling property, V(Λ) is itself a fundamental domain. The covolume of Λ is vol(V(Λ)) = | det(b1 , . . . , bn )|. Definition 3 (Nearest-neighbor quantizer and mod-Λ projection). Define QΛ (y) := arg min∥y − λ∥, λ∈Λ

πΛ (y) := y − QΛ (y),

with a fixed measurable tie-break rule on ∂V(Λ). The map πΛ sends y ∈ Rn to the unique representative of y + Λ in V(Λ) (uniqueness up to the boundary). The map πΛ has two properties we will use repeatedly: (P1) Range. πΛ (Rn ) ⊆ V(Λ). (P2) Lattice periodicity. πΛ (y +λ) = πΛ (y) for all λ ∈ Λ and y ∈ Rn , because QΛ (y +λ) = QΛ (y)+λ. Hence πΛ descends to a well-defined map Rn /Λ → V(Λ).

A.2

The mod-Λ pushforward is uniform

Lemma 1. Let D ⊂ Rn be a fundamental domain of Λ with finite positive measure. If Y ∼ Uniform(D), then πΛ (Y ) ∼ Uniform(V(Λ)). −1 Proof. Let A ⊆ V(Λ) be measurable. We have Pr[πΛ (Y ) ∈ A] = vol(πΛ (A) ∩ D)/ vol(D). By (P2), F −1 πΛ (A) = λ∈Λ (A + λ), which tiles A + Λ exactly once when restricted to any fundamental domain −1 D. Hence vol(πΛ (A) ∩ D) = vol(A), so Pr[πΛ (Y ) ∈ A] = vol(A)/ vol(D) = vol(A)/ vol(V(Λ)), which is the uniform-on-V(Λ) probability.

The lemma has the following “shift-invariance” consequence, which is the engine of the proof. Corollary 1 (Crypto Lemma). Let U ∼ Uniform(V(Λ)). For every deterministic x ∈ Rn , πΛ (x + U ) ∼ Uniform(V(Λ)),

independent of x.

Proof. Since V(Λ) is a fundamental domain, so is the translate x + V(Λ). The variable Y := x + U has distribution Uniform(x + V(Λ)), and Lemma 1 applies with D = x + V(Λ).

32

A.3

Subtractive dither produces an unbiased estimator

Definition 4 (Dithered reconstruction). Fix x ∈ Rn and let U ∼ Uniform(V(Λ)) be independent of any other randomness. The subtractive-dithered reconstruction of x is x̂(x; U ) := QΛ (x + U ) − U.

(6)

The quantization error is e(x; U ) := x̂(x; U ) − x. Theorem 1 (Schuchman). With U and x̂ as in Definition 4, for every x ∈ Rn the error e(x; U ) is distributed as −U ′ ∼ Uniform(−V(Λ)), independent of x. In particular, by central symmetry, e(x; U ) ∼ Uniform(V(Λ)) as well, and EU [e(x; U ) | x] = 0.

(7)

Proof. Expand the error: e(x; U ) = x̂(x; U ) − x = QΛ (x + U ) − U − x = −((x + U ) − QΛ (x + U )) = −πΛ (x + U ). By the Crypto Lemma (Corollary 1), πΛ (x + U ) ∼ Uniform(V(Λ)), so e(x; U ) = −πΛ (x + U ) ∼ Uniform(−V(Λ)) independent of x. The mean is zero because V(Λ) is centrally symmetric. Corollary 2 (Inner-product unbiasedness). For any deterministic q ∈ Rn and any source x ∈ Rn , EU [⟨q, x̂(x; U )⟩ | x] = ⟨q, x⟩. Proof. By linearity of expectation and Theorem 1, EU [⟨q, x̂⟩ | x] = ⟨q, x⟩ + ⟨q, EU [e | x]⟩ = ⟨q, x⟩ + ⟨q, 0⟩ = ⟨q, x⟩. Corollary 3 (Variance bound). With the same notation, and writing σV2 := n1 EU ∼Uniform(V) [∥U ∥2 ] for the per-coordinate second moment of the Voronoi cell, VarU (⟨q, x̂⟩ | x) = q ⊤ CovU (U )q ≤ λmax (CovU (U ))∥q∥2 . If V(Λ) is isotropic, i.e., Cov(U ) = σV2 In , this becomes VarU (⟨q, x̂⟩ | x) = σV2 ∥q∥2 . Remark. For the lattices used in HyperQuant (Z, A2 , D4 , E8 ), the Voronoi cell is isotropic — the lattice’s symmetry group acts irreducibly on Rn , and by Schur’s lemma any invariant rank-2 tensor is a scalar multiple of In . Hence Cov(U ) = σV2 In exactly. Numerically, σV2 (Z) = 1/12 = 0.0833 and σV2 (E8 ) ≈ 0.287 in our scaling.

A.4

Composition with the HyperQuant KV pipeline

Proposition 1. Let R be any orthogonal matrix (R⊤ R = I), let α > 0 be the lattice’s calibration scale, and let x̂ be the HyperQuant KV reconstruction of x: √ α n s(x) := · Rx, ∥x∥ sb := QΛ (s(x) + U ) − U, ∥x∥ x̂ := √ R⊤ sb. α n Then EU [x̂ | x] = x, and in particular EU [⟨q, x̂⟩ | x] = ⟨q, x⟩ for every deterministic q ∈ Rn . 33

Proof. Apply Theorem 1 in the lattice’s coordinate system to s := s(x): EU [sb | s] = s. The √ post-quantization map sb 7→ (∥x∥/(α n))R⊤ sb is linear and depends only on x (not on U ), so by √ linearity of conditional expectation, EU [x̂ | x] = (∥x∥/(α n))R⊤ s(x) = R⊤ Rx = x. Inner-product unbiasedness follows. Proposition 1 holds for any orthogonal R: deterministic identity, deterministic permutation, random Haar, random sign diagonal; including when R is itself random but independent of U , because the proof conditions on R and then averages.

A.5

Contrast: QJL alone is biased per-vector

The QJL-without-dither variant uses random rotation but no dither, so its reconstruction is x̂QJL (x; S) := S ⊤ QΛ (Sx),

S ∼ Uniform(O(n)),

(8)

with error eQJL (x; S) = −S ⊤ πΛ (Sx). Proposition 2. For every fixed realization S = S0 ∈ O(n) and every fixed source x ∈ Rn , the QJL error is a deterministic vector −S0⊤ πΛ (S0 x), generally non-zero, so x̂QJL (x; S0 ) is a biased estimator of x. There is no per-vector analog of Corollary 2 for QJL alone. Proof. Self-evident from (8): with S0 fixed, neither side of the equation depends on any further randomness. (i) (i) Why the empirical QJL bias appears small. A typical sweep test N1 N i=1 ⟨q , eQJL (x ; S0 )⟩ averages over many iid (q (i) , x(i) ). Because q is independent of everything else and zero-mean, this average converges to ⟨Eq, ·⟩ = 0. That follows from Eq = 0, not from any QJL property: a non-rotated lattice quantizer passes the same test. What QJL does provide is approximately isotropic error covariance, S0⊤ Covx (πΛ (S0 x))S0 close to a scalar multiple of In for a generic Haar S0 . This is the genuine benefit of the random rotation, but it is not unbiasedness.

P

A.6

Practical sampler

The proof requires U ∼ Uniform(V(Λ)). The implementation uses the “mod-Λ trick”: Ucube ∼ Uniform([−2, 2)n ),

U := πΛ (Ucube ).

This is exact iff [−2, 2)n is itself a fundamental domain of Λ (Lemma 1). For E8 , the cube [−2, 2)8 is not a union of Λ-translates of V(Λ), so the projection is only approximately uniform; we validate the sampler by checking that n1 E∥U ∥2 matches the analytical σV2 to within 5% on all four lattices. An iid

exact alternative is the fundamental-parallelepiped sampler: draw Ti ∼ Uniform[0, 1) for i = 1, . . . , n, P form Y = Ti bi over the lattice basis {bi }, and project U := πΛ (Y ). This is exactly uniform on V(Λ) by Lemma 1, since the parallelepiped is by construction a fundamental domain.

B

Calibration: setting the operating point

HyperQuant exposes one user-facing knob, the target rate b in bits/scalar, and turns it into a concrete quantizer in two steps: choose the quantization SNR that yields b, then set the per-vector scale α that realizes that SNR. The first step needs an empirical rate curve b(SNR), since the Rice-coded rate has no closed form; the second is closed-form in the lattice’s Voronoi second moment. 34

Both are built once on synthetic iid-Gaussian data and, crucially, apply unchanged to every weight and KV tensor in any model (Section B.3). This is what lets HyperQuant hit an arbitrary fractional rate, which fixed-rate codebooks cannot.

B.1

From a target rate to an SNR (empirical)

The rate of the stripped, Rice-coded stream combines the lattice’s granular gain, the bit-stripping transform, an integer-parameter Rice coder, and the 8-bit clip, none of which has a clean closed form at the operating points of interest. We therefore measure it: for each lattice we draw N ∼ 105 iid-Gaussian tiles, quantize at a grid of SNRs (each set by the closed-form α of Section B.2), and record the realized Rice rate (Figure 10).

Figure 10: Empirical Rice rate versus target SNR on iid-Gaussian tiles (N =105 , seed 42), for the four lattices. Solid: achieved bits/scalar; dashed: the lattice ideal RD + 12 log2 (2πe G(Λ)); dotted: the Gaussian rate-distortion bound RD = 12 log2 SNRlin . Each curve is smooth and monotone, so inverting it sends any target rate to a unique SNR; the achieved rate stays ≈ 0.1 bps above the lattice ideal throughout, ordering E8 < D4 < A2 < Z. Two properties make this usable. (i) Invertibility. b(SNR) is monotone increasing, so the implementation interpolates the tabulated curve to recover the unique SNR achieving any requested b; because the table stores the realized Rice rate (not an entropy estimate), selecting against it hits any target to within ∼ 0.01 bps (Section 6.1 confirms this on-model). (ii) Tightness. The realized rate sits ≈ 0.1 bps above the lattice ideal. This gap is almost entirely the redundancy of the stateless, power-of-two Rice code over the symbols’ marginal entropy; that marginal entropy already meets the lattice ideal (Section B.4), so the 0.1 bps reflects the coder’s simplicity, not residual lattice or inter-symbol inefficiency. The table is the rate of the per-lattice Rice structure: E8 uses a single parameter ks (the coset bit folded into the combined symbol); D4 and A2 use two (ks with kt = ks − 1 for D4 , and kty , knx for A2 ); Z uses one. The halving identity kt = ks − 1 is checked at runtime (Section 4.7).

35

B.2

From an SNR to the scale (closed form)

Given the SNR, the scale is analytic. For x ∼ N (0, IN ) the high-rate quantization error has mean 2/N square equal to the lattice’s Voronoi second moment, MSEvor = G(Λ) N VΛ , while the signal power is E∥αx∥2 = α2 N . Setting their ratio to the target SNRlin = 10SNR/10 yields s

α(SNR, Λ) =

SNRlin MSEvor = N

q

2/N

SNRlin G(Λ) VΛ

,

(9)

with VΛ the covolume of the integer realization. No calibration data are needed; the only assumption is the high-rate approximation, which we verify: the empirical Voronoi second moment is within 5% of MSEvor for E8 , D4 , A2 (within 20% for Z, whose tiny cell is sensitive to bf16 rounding), and the realized SNR lands within ≈ 0.1 dB of the target across 20–30 dB. The code fits a signed byte. Equation (9) also fixes the code magnitudes, hence whether the stored integer coordinates fit int8. After the per-tile RHT and ℓ2 normalization each input scalar has unit variance (Section B.3); the quantizer rounds αu to the lattice, so each stored coordinate tracks αui , giving Yi ≈ N (0, α2 ), (10) with the granular noise adding only O(G(Λ)) to the variance, negligible against α2 . An overflow √  (|Yi | > 127) is therefore a 127/α-sigma tail event, with per-coordinate probability erfc 127/(α 2) . Bit-stripping (Sections B.4 and 4.6) only shrinks magnitudes: for E8 /D4 the stored s-coordinates have Y ≫ 1 and the parity coordinate is halved again, so the only un-shrunk coordinates are Z’s scalars and A2 ’s nx . The raw lattice integer is thus the binding case, and bounding it bounds the entropy-coded symbols a fortiori. The binding rate is the top of the sweep, 5 bps, where α (and with it the code magnitude) is largest; Table 14 evaluates (10) there. Lattice

α

127/α

P (|Yi | > 127)

exp. overflows / 7×109

E8 D4 A2 (nx ) Z

14.7 17.3 13.6 7.4

8.6σ 7.3σ 9.3σ 17σ

6 × 10−18 2 × 10−13 1 × 10−20 <10−60

4 × 10−8 1 × 10−3 7 × 10−11 ≈0

Table 14: Worst-case int8 overflow at the top of the sweep (5 bps), the rate at which α, and hence the code magnitude, is largest. With Yi ≈ N (0, α2 ) an overflow is a 127/α-sigma event; the last column multiplies the per-coordinate tail by the ∼ 7 × 109 quantized weights of Llama-3.1-8B. The binding lattice is D4 (largest α), still 7.3σ from the byte boundary. Even the worst lattice, D4 , expects only ∼ 10−3 saturations across the whole model; the default E8 sits 8.6σ out, at ∼ 4 × 10−8 . And a saturation, when it occurs, is a clamp to ±127 that perturbs one coordinate by less than the granular step, not a corruption. The analytic tail is moreover conservative: empirically (Figure 11) the largest coordinate over the full 20–30 dB √ sweep is ≈ 3.4σ (|Y | ≈ 50 for E8 ), because the per-tile ℓ2 normalization caps the maximum near 2 ln 1024 ≈ 3.7σ, tighter than a free Gaussian. This justifies storing the raw code in one signed byte per scalar: the int8 Tensor-Core format and the entropy-free fallback.

B.3

One calibration for all data

Both pieces are built on iid-Gaussian tiles, yet HyperQuant applies them to real weights and KV activations with no per-tensor recalibration. The justification is the per-tile RHT followed by ℓ2 36

Figure 11: E8 calibration detail. Top: achieved Rice rate tracks the lattice ideal within ≈ 0.1 bps over 20–30 dB (the dashed scalar_bps is the byte-aligned int8 fallback, which steps with the integer byte budget; the scalar_entropy curve, the marginal entropy of the stripped indices, lies essentially on the lattice ideal, cf. Section B.4). Bottom: sampled int8 overflow rate P (|ci | > 127), which is 0 at every operating point (markers floored at 10−12 to render on the log axis); the largest coordinate seen is ≈ 3.4σ, well inside the ≥ 7.3σ analytic margin of Table 14. normalization (Sections 4.1 and 4.3): the RHT spreads each tile’s energy across its coordinates and normalization fixes its radius, so every tile is approximately an isotropic Gaussian on the sphere √ of radius α n, precisely the distribution the calibration was measured on. A single table and the closed form of Equation (9) therefore serve all tensors, layers, and models, which is what makes HyperQuant data-free.

B.4

Stripping is rate-optimal: marginal entropy meets the lattice ideal

A striking feature of the sweep is that the per-scalar marginal entropy of the stripped symP bols ( N1 i H(si ), reported as scalar_entropy) coincides with the lattice ideal Rideal = RD + 1 −2 bps at every operating point and lattice (Figure 11, top, where 2 log2 2πe G(Λ) to within ∼ 10 the two curves overlie). This is no coincidence: it follows from composing two classical high-resolution results with the design of the strip. (i) The index entropy equals the lattice ideal. For a source X with finite differential entropy quantized by a lattice Λ at fine resolution, the index entropy obeys the high-resolution law H QΛ (X) = h(X) − log2 vol(V(Λ)) + o(1), 

37

(11)

the o(1) vanishing as the cell shrinks [15, 19]. With per-dimension distortion D = G(Λ) vol(V(Λ))2/N [6, Ch. 3] and a white Gaussian source X ∼ N (0, σ 2 IN ), for which h(X)/N = 12 log2 (2πe σ 2 ), dividing (11) by N gives   1 σ2 H QΛ (X) −→ 21 log2 + 12 log2 2πe G(Λ) = Rideal . N | {z D}

(12)

RD

The excess 12 log2 (2πe G(Λ)) over the Gaussian rate-distortion bound RD is the lattice’s space-filling loss, exactly the redundancy of an entropy-coded dithered lattice quantizer above R(D) [11, 38, 39]. (ii) Stripping reduces the marginal sum to the joint entropy. The quantity scalar_entropy P is not the joint entropy (12) but the per-scalar sum of marginals, N1 i H(si ). The strip StripΛ is a lossless bijection Λ ↔ ZN (Section 4.6), hence preserves the joint entropy, H(s1 , . . . , sN ) = H(QΛ (X)), and by subadditivity  1 1 X C H(si ) = H QΛ (X) + , N i N N

C =

X

H(si ) − H(s1 , . . . , sN ) ≥ 0,

(13)

i

with C the total correlation (multi-information) of the symbols [7, Ch. 2]. Two design choices send C → 0. First, the strip is built to annihilate exactly the lattice’s deterministic dependencies, the parity and coset constraints of Section 4.6, the only exact couplings among the integer coordinates. Second, the residual statistical dependence vanishes in the high-rate limit: as the cell shrinks QΛ (X) → X, so each stripped symbol converges to a scaled copy of an i.i.d. Gaussian source coordinate (si → αXi /2 for E8int , and likewise for the others) and the symbols become mutually independent. The subtractive dither of Corollary 1 makes this precise: it renders the quantization error independent of X [32, 39], removing the input-dependent part of the residual correlation at P any rate. Hence C/N → 0 and, combining (13) with (12), N1 i H(si ) → Rideal . Residual gap and consequence. The measured discrepancy is ≲ 0.02 bps and changes sign: C/N ≥ 0 pushes scalar_entropy above Rideal , while finite-rate corrections to (11) and the ≈ 0.06 dB bf16 SNR deficit push it below; both effects are O(10−2 ). Because the stripped symbols are statistically near-independent and their marginal entropy sits at the lattice ideal, a memoryless coder is near rate-optimal: no context or joint coder can recover more than the vanishing C/N . Stripping is thus rate-optimal by construction, not a heuristic, letting the Rice coder (Section 4.7) concede only ∼ 0.1 bps to the ideal.

38

Record · ID 299979 · SHA-256 dbba719febcc368d
Retrieved via Conceptio — every document is proof-bundled with source, license, and retrieval metadata.