arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.05352cs.LGcs.AI
收藏

使用训练后量化为LLMs实现二值化权重和激活

Achieving binary weight and activation for LLMs using Post-Training Quantization

MAIS, Institute of Automation, Chinese Academy of Sciences(自动化研究所,中国科学院);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);Central Media Technology Institute, Huawei Technologies Ltd.(华为技术有限公司媒体技术研究所)

Siqing Song, Chuang Wang, Ruiqi Wang, Yi Yang, Xu-Yao Zhang

AI总结:

提出W(1+1)A(1*4)训练后量化框架,通过Hessian感知分组和EM方案优化权重,将INT4激活分解为4*INT1并平滑缩放因子,在W2A4上超越SOTA基线,推动LLM完全二值化。

摘要:

将大型语言模型(LLMs)量化到1位精度显著降低了计算成本,但现有的量化技术在权重和激活精度低于4位(W4A4)时会出现明显的性能下降。在本文中,我们提出了一种具有W(1+1)A(1*4)配置的训练后量化框架,其中权重量化为1位并附加1位用于细粒度分组,激活量化为1位且通道数量增加4倍。对于权重量化,我们提出利用Hessian感知的细粒度分组以及基于EM的量化方案。对于激活量化,我们将INT4量化的激活等效分解为4 * INT1格式,并同时基于量化误差平滑缩放因子,这进一步减少了激活中的量化误差。我们的方法在多个任务上的W2A4设置中超越了最先进(SOTA)的LLM量化基线,将现有LLM量化方法的边界推向完全二值化模型。代码可在https://github.com/JimmyCrave/LLM-PTQ-binarization获取。

英文摘要:

Quantizing large language models (LLMs) to 1-bit precision significantly reduces computational costs, but existing quantization techniques suffer from noticeable performance degradation when using weight and activation precisions below 4 bits (W4A4). In this paper, we propose a post-training quantization framework with W(1+1)A(1*4) configuration, where weights are quantized to 1 bit with an additional 1 bit for fine-grain grouping and activations are quantized to 1 bit with a 4-fold increase in the number of channels. For weight quantization, we propose utilizing Hessian-aware fine-grained grouping along with an EM-based quantization scheme. For activation quantization, we decompose INT4-quantized activations into a 4 * INT1 format equivalently and simultaneously smooth the scaling factors based on quantization errors, which further reduces the quantization errors in activations. Our method surpasses state-of-the-art (SOTA) LLM quantization baselines on W2A4 across multiple tasks, pushing the boundaries of existing LLM quantization methods toward fully binarized models. Code is available at https://github.com/JimmyCrave/LLM-PTQ-binarization.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑