Source-linked AI summary

SpectrumQuant: Spectrum Alignment for LLM Quantization

Dwaipayan Haldar, Indranil Patra, Azhar Yousuf, Chandra Sekhar Seelamantula

arXiv:2610.20303v1cs.LGstat.ML

TL;DR

Activation outliers hinder accurate low-bit quantization, and existing rotations trade data independence for costly learned adaptation. SpectrumQuant derives a closed-form covariance-aware rotation from calibration statistics. It reports competitive accuracy alongside lower calibration time and memory than SpinQuant.

  • Problem

    Activation outliers distort quantization ranges and degrade low-bit accuracy, while fixed rotations are data-agnostic and learned rotations incur iterative optimization and calibration costs.

    Source: §1 · p. 2
  • Method

    SpectrumQuant uses a covariance-based objective and calibration statistics to construct a closed-form hybrid orthogonal transform with alignment and mixing components.

    Source: §1 · p. 2, §4.2.1 · p. 6
  • Results

    For 70B, SpectrumQuant calibrates in 43 minutes and achieves 21× faster calibration and 9.8× lower memory than SpinQuant, with on-par or better accuracy.

    Source: §1 · pp. 2–3, §5.2 · p. 10
  • Takeaways & Limitations

    Across diverse LLMs, the analysis presents covariance maximization as a first-principles basis for variance equalization and reports consistent gains over data-agnostic baselines while remaining competitive with learned baselines.

    Source: §6 · p. 13

    The covariance formulation assumes mean-centred data when defining the sample covariance matrix.

    Source: §4.1 · p. 4

Abstract

from arXiv · show

Orthogonal transforms have emerged as an effective tool for low-bit quantization of large language models (LLMs), as they reshape activation distributions without changing the underlying model function. Existing approaches typically rely either on fixed data-agnostic transforms, such as Hadamard rotations, or on calibration-time optimization of learned rotations. We study rotation selection from first principles and show that maximizing covariance leads to spectral alignment and provides a principled criterion for constructing quantization-friendly orthogonal transforms. Based on this insight, we propose SpectrumQuant, a closed-form rotation method that estimates activation covariance from calibration data and uses it to construct a covariance-aware orthogonal transform for post-training quantization. Our formulation characterizes quantization-friendly rotations as compositions of alignment and mixing components, while recovering Hadamard matrices as a special case. Interestingly, a class of butterfly matrices belongs to this category. In the realm of LLM quantization, SpectrumQuant bridges the gap between data-agnostic structured rotations and learned rotations, providing an effective and efficient data-aware alternative for post-training quantization. Experiments on Llama and Mistral models show that SpectrumQuant is competitive with state-of-the-art rotation strategies while requiring less than one-third of the GPU memory and significantly less time than learned rotations approaches like SpinQuant and DartQuant.

1 Introduction

Activation outliers undermine low-bit LLM quantization, while existing rotation strategies trade data awareness for calibration cost. SpectrumQuant derives a closed-form, covariance-aware hybrid rotation and reports competitive accuracy with substantially lower calibration cost.

1 Introduction

  • Extreme activation outliers distort quantization ranges and degrade low-bit accuracy, making activation quantization especially challenging.Post-training quantization is attractive because it reduces memory use and inference cost without expensive retraining or fine-tuning.Source: §1 · p. 2
  • Rotation-based methods use rotational invariance to disperse outlier magnitude across dimensions without changing network outputs.The resulting smoother activations are described as more quantizable.Source: §1 · p. 2
  • Fixed Hadamard rotations are efficient but data-agnostic, whereas learned rotations adapt to activation statistics at substantial iterative-optimization and calibration cost.The passage also notes that learned methods lack theoretical guarantees and require specialized procedures to enforce orthogonality.Source: §1 · p. 2
  • SpectrumQuant derives a closed-form hybrid orthogonal transform from a covariance-based objective, combining a Hadamard mixing backbone with calibration-data-based alignment.The formulation unifies data-independent structured rotations and data-dependent alignment.Source: §1 · p. 2
  • For 70B, SpectrumQuant calibrates in 43 minutes, with 21× faster calibration and 9.8× lower memory than SpinQuant, at on-par or better accuracy.It can also be calibrated efficiently on CPU.Source: §1 · pp. 2–3

2 Related Work

Related work spans non-orthogonal transforms and rotation-based approaches to LLM quantization. The cited methods differ in how they handle outliers, preserve computation properties, and obtain data-dependent rotations.

2 Related Work

  • The section frames related work as a concise description of orthogonal and non-orthogonal transforms for post-training LLM quantization.Source: §2 · p. 3

2.1 Non-orthogonal Transforms

  • Non-orthogonal transforms mitigate outliers through scaling or paired weight-activation quantization, but they are not invariant to RMSNorm and can add inference overhead.SmoothQuant shifts outliers from activations to weights; OmniQuant uses learnable clipping and block-wise error minimization.Source: §2.1 · p. 3

2.2 Rotation-based Transforms

  • Rotation-based methods include random Hadamard transforms for incoherence and learned rotations optimized end-to-end or through calibration-time loss.SpectrumQuant instead constructs a data-aware orthogonal transform in closed form from calibration statistics, without iterative optimization.Source: §2.2 · p. 3

3 Motivation

The motivation is to find a rotation that distributes activation magnitude evenly across axes. Covariance maximization motivates aligning data to its covariance eigenbasis before mixing it with a Hadamard transform.

3 Motivation

  • The motivating question is whether a closed-form optimal rotation can evenly distribute magnitude when activation outlier axes and magnitudes are known.Source: §3 · p. 4
  • With shared-scale quantization, the highest-variance coordinate sets the step size, so equal coordinate variances avoid coarse binning of low-variance values.The motivation passage identifies a 45° principal-axis alignment as ideal in its two-dimensional example.Source: §3 · p. 4
  • Figure 1 contrasts the original distribution, fixed Hadamard rotation, and proposed hybrid transform, with corresponding marginals below.Source: Figure 1 · p. 4
  • SpectrumQuant composes covariance-eigenbasis alignment with Hadamard mixing to produce the desired variance-equalizing transform.The passage characterizes the transform as having alignment and mixing components.Source: §3 · p. 4

4 Method

SpectrumQuant derives orthogonal rotations by maximizing covariance, reducing the design to a variance-equalizing transform. Its construction combines covariance-eigenvector alignment with a mixing matrix, with Hadamard and butterfly matrices providing structured mixing solutions and shared-scale quantization motivating variance equalization.

4 Method

  • The method derives a closed-form orthogonal transform from a covariance-based objective, distinguishing it from data-agnostic rotations and rotations learned by gradient descent.The objective seeks to maximize off-diagonal covariance; the paper recasts it as a minimization using invariance of the Frobenius norm under orthogonal transformations.Source: §4 · p. 4, §4.1 · p. 5

4.2 Construction of Solution

  • The covariance objective is minimized if and only if the transformed covariance has equal diagonal entries, each equal to the average trace of the sample covariance.The construction therefore seeks a variance-equalizing orthogonal transform.Source: §4.2 · pp. 5–6

4.2.1 Family of Solutions

  • Writing Q = UV uses the covariance eigenvector matrix U for alignment and reduces construction to choosing the mixing component V.The transformed covariance is V⊤ΛV, where Λ contains the sample covariance eigenvalues.Source: §4.2.1 · p. 6
  • For V to equalize transformed variances for every admissible spectrum, its entries must satisfy v_ki^2 = 1/d.The covariance-maximizing construction has multiple solutions, with (d−1)(d−2)/2 degrees of freedom.Source: §4.2.1 · p. 6

4.2.2 Hadamard Solutions

  • Normalized Hadamard matrices are exactly the data-independent mixing solutions, and butterflies with specified angles form a subset that includes the Sylvester-Hadamard matrix.These butterfly solutions admit O(d log d) multiplications; the general butterfly construction also includes Sylvester-Hadamard matrices.Source: Figure 2 · p. 7, §4.2.2 · pp. 7–8

4.3 Optimal Rotation Under Shared-Scale Quantization

  • Under shared-scale quantization, total quantization error is minimized if and only if the rotation equalizes per-coordinate variance.The shared-scale regime applies one scale per quantization group, so the transformed coordinate variances determine the error bound and its equality condition.Source: §4.3 · pp. 8–9

5 Experiments

SpectrumQuant is evaluated on Llama and Mistral models using covariance-calibrated rotations and comparisons with rotation-based baselines. Across benchmark results, calibration cost, and ablations, it is competitive with learned rotations while retaining low inference cost.

5.1 Implementation Details

  • R1 and R2 use covariance-calibrated UH or UB rotations, while R3 and R4 remain random Hadamard matrices; covariance is estimated offline from 128 WikiText2 samples.R1 is calibrated once per model using activations pooled across layers.Source: §5.1 · p. 10

5.2 Main Results

  • The experiments evaluate Llama-2, Llama-3, and Mistral models using WikiText-style perplexity and eight downstream zero-shot tasks.The reported comparison uses 4-bit weight, activation, and KV-cache quantization.Source: §5.2 · p. 10
  • SpectrumQuant matches or outperforms SpinQuant on all five models and shows no statistically significant difference from DartQuant on four of five, while avoiding iterative optimization.At 70B, calibration takes 43 minutes on one A6000 GPU after activations are saved, with 21× calibration speedup and 9.8× lower memory than SpinQuant.Source: §5.2 · p. 10, Table 2 · p. 10, Table 3 · p. 11

5.3 Inference Cost Analysis

  • Rotation-based methods show no statistically significant inference-throughput difference from the no-transform baseline on Llama-3 8B.The rotations are absorbed into weights through RMSNorm commutativity, avoiding additional inference cost.Source: Table 4 · p. 11, §5.3 · p. 11

5.4.1 Calibration with different datasets

  • Results remain broadly consistent across WikiText2, PTB, and C4 calibration data for Llama-2 7B and Mistral 7B v0.3.For Mistral, the table reports no statistically significant difference across calibration datasets.Source: §5.4.1 · p. 11, Table 5 · p. 12

5.4.2 Calibration with different sample sizes

  • Llama-2 7B perplexity results show no statistically significant difference when calibration uses 64 to 256 WikiText2 samples.The paper uses 128 samples by default, consistent with SpinQuant and DartQuant.Source: §5.4.2 · p. 12, Table 6 · p. 12

5.4.3 Comparison with Hadamard case

  • SpectrumQuant has 2% less quantization MSE than Hadamard on average across almost all layers, with gains across projection types and network depths.For down projection, the compared methods use the same R4 matrix.Source: §5.4.3 · p. 12, Figure 4 · p. 12

5.4.4 Butterfly as a replacement for Hadamard matrix

  • Replacing R3 and R4 Hadamard matrices with random butterfly matrices yields results within the same statistical boundary as SpectrumQuant.The tested configuration uses UB as calibrated R1 and R2, with random butterfly matrices for R3 and R4.Source: Table 7 · p. 13, §5.4.4 · p. 13

6 Conclusion

The conclusion presents SpectrumQuant as a principled post-training quantization framework derived from a first-principles covariance objective. Its closed-form rotations equalize variance, and experiments show gains over data-agnostic baselines while remaining competitive with learned methods.

6 Conclusion

  • The paper presents SpectrumQuant as a principled framework for post-training quantization of LLMs.Its theoretical and empirical contributions are summarized as a framework for LLM quantization.Source: §6 · p. 13
  • SpectrumQuant derives a closed-form solution for covariance maximization over the Stiefel manifold, leading to variance equalization.The analysis identifies a family of optimal rotations for faithful LLM quantization.Source: §6 · p. 13
  • Experiments across diverse LLMs show consistent gains over data-agnostic baselines and competitiveness with end-to-end learned baselines.The analysis also justifies the effectiveness of Hadamard and Butterfly rotations for LLM quantization.Source: §6 · p. 13

Appendix

The appendix introduces a detailed per-task comparison of SpectrumQuant and baselines on Llama-family and Mistral-family models.

Appendix

  • The appendix provides detailed per-task comparisons for Llama-2, Llama-3, and Mistral model evaluations.The listed models include Llama-2 7B, 13B, and 70B; Llama-3 8B; and Mistral 7B v0.3.Source: Appendix · p. 16

A Welford Algorithm for Covariance Estimation

The appendix describes online Welford covariance estimation from calibration activations, updating the mean and accumulated second-moment matrix as samples arrive.

A Welford Algorithm for Covariance Estimation

  • Welford estimation initializes the sample count, mean, and M2 matrix, then updates them for each calibration activation.For each sample, it computes a deviation from the current mean, updates the mean, computes the updated deviation, and accumulates their outer product.Source: A Welford Algorithm for Covariance… · p. 16

B Detailed Results Pertaining to Table 3

Across Llama and Mistral evaluations, SpectrumQuant generally matches or improves on DartQuant and outperforms QuaRot and SpinQuant, while using substantially less calibration memory.

B Detailed Results Pertaining to Table 3

  • Across the reported settings, SpectrumQuant outperforms QuaRot and SpinQuant and shows no statistically significant difference from DartQuant.The comparisons cover perplexity and accuracy for Llama and Mistral models.Source: B Detailed Results Pertaining to Table 3 · p. 16
  • For Llama-2 7B, both variants are statistically indistinguishable from each other on perplexity and from DartQuant in average accuracy, and are ahead of SpinQuant.The perplexity results place both variants between QuaRot and DartQuant.Source: Table 8 · p. 16, Table 9 · p. 17
  • For Llama-2 13B, SpectrumQuant (UB) has the lowest average perplexity, while matching DartQuant in average accuracy within statistical error.The accuracy comparison is reported without in-context examples.Source: Table 10 · p. 17, Table 11 · p. 17
  • For Llama-3 8B, both variants match DartQuant on average perplexity and accuracy, and exceed SpinQuant on every commonsense benchmark.The results are reported alongside substantially lower calibration memory than SpinQuant.Source: Table 12 · p. 17, Table 13 · p. 18
  • For Mistral 7B v0.3, SpectrumQuant (UH) matches DartQuant on perplexity and is statistically tied for the highest average accuracy.The passages identify this as evidence of generalization beyond Llama.Source: Table 14 · p. 18, Table 15 · p. 18
  • For Llama-2 70B, both SpectrumQuant variants match or improve on DartQuant in average perplexity, using less than one-sixth its calibration memory.Calibration finishes in under 43 minutes on one GPU with pre-saved activations.Source: Table 16 · p. 18

C Experiments on Gaussian distributed data

The synthetic Gaussian experiment compares quantization distortion before and after rotations, finding lower distortion for the proposed rotation under the described calibration setup.

C Experiments on Gaussian distributed data

  • The experiment uses 10,000 samples from a 4096-dimensional Gaussian with exponentially decaying covariance eigenvalues to compare direct, Hadamard, and proposed-rotation quantization.The proposed rotation is Q = UH, where U comes from the covariance construction and H is a Hadamard transform.Source: C Experiments on Gaussian distributed… · p. 19
  • For a b-bit uniform quantizer, a smaller dynamic range A gives a smaller step size and typically lower mean squared error.For transformed samples, the range is chosen from transformed sample statistics.Source: C Experiments on Gaussian distributed… · p. 19
  • The proposed rotation achieves lower distortion in the Gaussian experiment because it reduces the worst-coordinate variance and thus the quantization step.The percentile-based range contains 99% of values; the figure reports distortion across bit widths under two calibration rules.Source: C Experiments on Gaussian distributed… · p. 19, Figure 5 · p. 19

D Comparison of Layerwise Quantization Error

Figure 6 compares mean squared quantization error across hidden dimensions for different projection activations in Llama-2 7B.

D Comparison of Layerwise Quantization Error

  • Figure 6 compares projection-activation quantization error across hidden dimensions at layers 2, 5, 8, 15, 21, 27, and 30.The panels run from layers 2 through 30 from top to bottom.Source: Figure 6 · p. 20
Loading 2610.20303v1…