GWQ: Gradient-Aware Weight Quantization for Large Language Models
Yihua Shao, Yan Gu, Siyu Chen, Haiyang Liu, Zixian Zhu, Zijian Ling, Minxi Yan, Ziyang Yan, Chenyu Zhang, Michele Magno, Haotong Qin, Yan Wang, Jingcai Guo, Ling Shao, Hao Tang
TL;DR
GWQ introduces gradient-aware weight quantization for post-training compression of large language models, locating sensitive outliers via gradients from a single calibration sample and preserving the top 1% in FP16 while quantizing the rest to low-bit precision. The method performs per-channel, group-wise quantization with a gradient-based outlier mask, achieving data-efficient calibration and reduced inference memory. Across language modeling and multimodal tasks, GWQ delivers state-of-the-art or competitive results at average bit-width below 4 and yields about 1.2x faster inference compared to the original model. While leveraging gradient information offers robustness and data efficiency, it requires backpropagation and mixed-precision hardware considerations. Overall, GWQ provides a practical, gradient-guided PTQ paradigm that generalizes to both text-only and multimodal LLMs with meaningful performance and efficiency gains.
Abstract
Large language models (LLMs) show impressive performance in solving complex language tasks. However, its large number of parameters presents significant challenges for the deployment. So, compressing LLMs to low bits can enable to deploy on resource-constrained devices. To address this problem, we propose gradient-aware weight quantization (GWQ), the first quantization approach for low-bit weight quantization that leverages gradients to localize outliers, requiring only a minimal amount of calibration data for outlier detection. GWQ retains the top 1\% outliers preferentially at FP16 precision, while the remaining non-outlier weights are stored in a low-bit. We widely evaluate GWQ on different task include language modeling, grounding detection, massive multitask language understanding and vision-language question and answering. Results show that models quantified by GWQ performs better than other quantization method. During quantization process, GWQ only need one calibration set to realize effective quant. Also, GWQ achieves 1.2x inference speedup in comparison to the original model and effectively reduces the inference memory.
