Effective Interplay between Sparsity and Quantization: From Theory to Practice

Simla Burcu Harma, Ayan Chakraborty, Elizaveta Kostenok, Danila Mishin, Dongho Ha, Babak Falsafi, Martin Jaggi, Ming Liu, Yunho Oh, Suvinay Subramanian, Amir Yazdanbakhsh

As Deep Neural Networks (DNNs) grow to billions of parameters, deploying them on hardware increasingly relies on two primary compression techniques: Sparsity (pruning away "unimportant" weights) and Quantization (reducing the bit-precision of weights, such as moving from 32-bit floats to 8-bit integers).

Until recently, researchers and engineers tacitly assumed these two techniques were orthogonal. Under this assumption, the error introduced by pruning a model and the error introduced by quantizing it are independent. If true, one could apply them in any order and expect the final error to be a simple sum of the two individual errors. However, new research challenges this conventional wisdom, providing the first mathematical proof that sparsity and quantization interact in complex, often detrimental ways.

The Illusion of Orthogonality

The authors tackle the problem through both theoretical proofs and extensive empirical validation. They define "orthogonality in compression" and provide mathematical proofs at both the tensor level (individual weights) and the dot-product level (how weights interact with activations). Their analysis specifically targets formats like max-scaled block-wise quantization, which is prevalent in modern hardware accelerators.

To validate their theories, the researchers tested a massive range of models, including the OPT and LLaMA families (LLMs) on the WikiText2 dataset, as well as ViT and ResNet (Vision models) on ImageNet-1k. They compared two primary compression workflows:

  • S→Q: Prune the model first, then quantize the remaining weights.
  • Q→S: Quantize the model first, then prune.

The "Collision" Effect and Why Order Matters

The most significant insight from the study is understanding exactly why the Q→S order fails. Quantization forces many different continuous weight values into the same discrete "bin." If a previously "important" large weight and an "unimportant" small weight get quantized to the exact same value, a magnitude-based pruning algorithm can no longer tell them apart. It might inadvertently prune the important weight, leading to a "collision" that severely degrades model accuracy.

Because of this collision effect, the paper proves that S→Q is the optimal order. Applying sparsity first preserves the relative importance of weights before quantization limits their resolution.

Perplexity comparison of S→Q vs. Q→S ordering across different sparsity and quantization formats.

As shown in the results, the Q→S order can be disastrous for LLMs. For an OPT-125M model using HBFP6 quantization at 50% sparsity, the optimal S→Q order resulted in a perplexity of 32.51. In stark contrast, reversing the order to Q→S caused the perplexity to spike to 40.86.

The Compounded Error Penalty

Even when using the "correct" S→Q order, the researchers discovered that the errors from sparsity and quantization still snowball. By analyzing intermediate layers, they showed that the "non-orthogonal error" accumulates and amplifies as data flows through the network.

To quantify this, the authors introduced the Orthogonality Threshold—a metric that measures the extra performance drop occurring specifically because the two methods are used together.

Evaluation of perplexity, cross-entropy loss, and orthogonality thresholds across LLMs and vision models.

The data reveals that the combined error can be up to 13% higher than what would be predicted if the methods were truly orthogonal. Interestingly, vision models like ViT appear slightly more robust to these compounded errors than LLMs, though they still experience degradation at very high compression ratios (e.g., 4-bit quantization combined with 75% sparsity).

Hardware Implications and Future Directions

Despite these compounded errors, combining sparsity and quantization remains highly effective for hardware deployment when done correctly. The authors demonstrate that a 50% sparse, 6-bit quantized model can achieve a 10.7× reduction in memory footprint and bandwidth—provided the S→Q order is strictly followed to protect accuracy.

Looking forward, the study opens several avenues for future work. The current research focuses on "homogeneous" schemes where every layer is treated equally. Exploring layer-specific (heterogeneous) sparsity and quantization levels could yield even better accuracy-efficiency trade-offs. Additionally, while the paper focuses on magnitude-based pruning, investigating how advanced "second-order" pruning methods (like Wanda and SparseGPT) interact with quantization will be critical for the next generation of model compression.

Summary updated

BibTeX
@inproceedings{harma2025effective,
  author = {Simla Burcu Harma and Ayan Chakraborty and Elizaveta Kostenok and Danila Mishin and Dongho Ha and Babak Falsafi and Martin Jaggi and Ming Liu and Yunho Oh and Suvinay Subramanian and Amir Yazdanbakhsh},
  title = {{Effective Interplay between Sparsity and Quantization: From Theory to Practice}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=wJv4AIt4sK},
}
Figure