Large Language Models (LLMs) are notoriously resource-hungry. To make them run efficiently on consumer hardware, researchers typically turn to two main "dietary" restrictions: sparsification (pruning away unimportant weights) or quantization (reducing the precision of weights, e.g., from 16-bit to 4-bit).
However, a new paper from researchers at Beihang University suggests that treating these as separate steps is a mistake. Their proposed framework, Joint Sparsification and Quantization (JSQ), demonstrates that by coordinating these two techniques, we can push LLMs to extreme compression ratios that would normally cause models to "crash."
TL;DR
JSQ is the first framework to jointly optimize sparsification and quantization for LLMs. It overcomes the inherent conflict where pruning tends to preserve the very outliers that make quantization difficult. By introducing a new sparsity metric and a search-based activation editor, JSQ achieves nearly an 8x reduction in computational complexity on LLaMA models while maintaining usable performance.
What Problem Does This Paper Address?
The fundamental issue in LLM compression is a technical "tug-of-war" between two dominant methods:
- Sparsification (Pruning) usually identifies "important" weights based on their magnitude. In LLMs, this means preserving "outliers"—weights with very large values that carry significant information.
- Quantization maps a range of floating-point numbers to a small set of discrete buckets. If a model retains massive outliers, the numerical "range" becomes huge. This forces the quantization buckets to spread thin, destroying the precision of all the smaller, more common values.
Existing state-of-the-art methods like OmniQuant or SparseGPT often focus on one technique or the other. When pushed to high compression ratios (low computation complexity), the models often "crash"—their perplexity shoots to infinity, rendering them useless.
Methods
The authors introduce two primary innovations to bridge the gap between pruning and quantization:
1. Salience with Activation Range (SAR)
Traditional pruning metrics (like Wanda) look primarily at weight magnitude and input activation norms. JSQ introduces SAR, a new metric that adds an "auxiliary salience" term. This term calculates how much the output activation range would change if a specific weight were pruned. If removing a weight helps shrink the activation range (making it easier to quantize later), that weight is considered less "salient" and is more likely to be pruned. This effectively bridges the gap between the two compression stages.
2. Search-based Activation Editor (SAE)
Outliers are essential for LLM performance but toxic for compression. Instead of complex "outlier migration" techniques, the authors propose a simpler "editing" approach. They use Simulated Annealing—a probabilistic search algorithm—to find the optimal clipping ratio for activations in each layer. This editor automatically eliminates the most harmful outliers before the pruning and quantization process begins, smoothing the way for extreme compression.
Datasets and Evaluation
The researchers evaluated JSQ across a wide range of models and benchmarks:
- Models: LLaMA (7B, 13B, 33B), LLaMA-2 (7B, 13B), and ChatGLM3-6B.
- Evaluation Tasks: Language Modeling (Perplexity on WikiText2) and Zero-shot Reasoning (PIQA, BoolQ, MMLU, HellaSwag, Arc-easy, Arc-challenge, and WinoGrande).
- Calibration: 128 samples from the C4 dataset were used to calibrate the compression metrics.
Key Insights and Results
- The Outlier Paradox: The paper proves that while outliers are high-impact, they are the primary bottleneck for joint compression. Directly "editing" (clipping) them via search is more effective than trying to work around them.
- Joint > Sequential: Most pipelines do pruning then quantization. JSQ shows that considering the requirements of quantization during the pruning stage (via the SAR metric) prevents the model from entering a state where it is unquantizable.
- Extreme Compression: JSQ achieved a 7.96x reduction in MACs (Multiply-Accumulate operations) for LLaMA-7B without the model crashing, maintaining a "usable" perplexity where competitors fail.
- Superior Accuracy: On the ChatGLM3-6B model, JSQ outperformed SmoothQuant by 22.04% on the HellaSwag benchmark under similar compression constraints.
- Hardware Efficiency: In practical tests, the framework delivered a 23% to 33% inference speedup and a massive 68% reduction in GPU memory usage.
Limitations and Future Work
While highly effective, JSQ does have some limitations. The use of simulated annealing to find the best activation editing ratios adds computational overhead during the compression phase (though this does not affect inference speed). Additionally, the "editing strength" search space must currently be predefined by the user; future work will investigate how to determine these boundaries automatically. Finally, while JSQ works well as a post-training tool, the authors note that adding a brief fine-tuning step could recover even more performance.
Summary updated