Introduction
Large Language Models (LLMs) have revolutionized natural intelligence tasks but remain prohibitively expensive to deploy due to their massive memory and computational requirements. Post-Training Quantization (PTQ) is a standard technique used to compress these models, typically shrinking weights from 16-bit floating-point (FP16) to 4-bit or 8-bit integers. However, LLMs present a unique challenge: the presence of "outliers"—specific weights or activations with extreme values that are critical for model reasoning.
Traditional static quantization, which uses pre-calculated scaling factors, often fails to capture these outliers, leading to significant accuracy degradation. Conversely, dynamic quantization calculates scaling factors on the fly, which preserves accuracy but introduces substantial computational overhead, making it hardware-unfriendly. This paper introduces SHMQ (Static Hierarchical Mix-precision Quantization), a framework designed to bridge this gap by achieving near-lossless performance with the efficiency of static execution.
The SHMQ Framework
SHMQ moves beyond one-dimensional mix-precision strategies by employing a hierarchical approach that operates at both the layer and channel levels. The framework intelligently allocates precision budgets where they are most needed to preserve model intelligence while maintaining a high compression ratio.
Inter-layer Mix-precision
At the macro level, SHMQ determines the sensitivity of individual layers using a unified metric based on the Hessian matrix, approximated via Fisher Information. This allows the framework to identify which layers are most susceptible to quantization errors. Layers identified as highly sensitive are allocated a larger portion of 8-bit weights, while less critical layers are compressed more aggressively to 4-bit.
Intra-layer Mix-precision and Decoupled Permutation
Within each layer, SHMQ addresses channel-level outliers. The authors introduce a "Decoupled Identification and Permutation" strategy. By reordering channels to cluster those with similar value distributions, the framework effectively "flattens" the variance within groups. This transformation makes the weights much more amenable to static quantization, allowing the model to handle outliers without the need for expensive dynamic scaling.
Experimental Evaluation
The framework was rigorously tested across a variety of open-source LLM families, including LLaMA-2, LLaMA-3.1, and the Qwen2.5 series. Performance was measured using perplexity (WikiText2, C4) and zero-shot reasoning benchmarks (ARC, BoolQ, HellaSwag, PIQA, and WinoGrande).
Accuracy and Reasoning
SHMQ consistently achieved near-lossless results. For instance, on the Qwen2.5-7B-Instruct model, a W4.8A8 configuration (averaging ~4.8 bits per weight) reached an average reasoning score of 75.58%, narrowing the gap to the original FP16 model to a mere 0.13%. In comparative tests, SHMQ outperformed existing state-of-the-art methods like QUIK and Atom, particularly on newer models like LLaMA-3.1-8B, where it maintained a 2.33% accuracy lead over the next best method.
Hardware Efficiency and Speedup
Because SHMQ is entirely static, it eliminates the runtime overhead associated with dynamic quantization. When deployed on actual edge hardware (such as a Novatek NPU), the framework achieved a significant practical speedup.
As shown in the performance benchmarks, SHMQ delivers an average 2.86× practical speedup compared to FP16 baselines. By fusing channel permutations into existing normalization layers, the authors successfully removed the computational cost of reordering, ensuring that the theoretical benefits of mix-precision translate directly into real-world performance gains.
Conclusion
SHMQ represents a significant advancement in LLM compression by proving that static quantization can achieve near-lossless accuracy through hierarchical mix-precision. By combining inter-layer sensitivity analysis with intra-layer channel permutation, SHMQ offers a hardware-friendly solution that enables high-performance LLM inference on resource-constrained devices. Future work will explore the integration of this framework with Parameter-Efficient Fine-Tuning (PEFT) methods and its effectiveness at even lower bit-widths.
Summary updated