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

BoA:无需反向传播的注意力感知训练后量化

BoA: Attention-aware Post-training Quantization without Backpropagation

Samsung Research(三星研究院)

Junhan Kim, Ho-young Kim, Eulrang Cho, Chungman Lee, Joonyoung Kim, Yongkweon Jeon

AI总结:

本文提出BoA,一种无需反向传播的注意力感知训练后量化算法,通过注意力感知Hessian矩阵建模层间依赖来优化量化权重,在LLMs上取得了最先进的权重-激活量化性能。

摘要:

训练后量化(PTQ)是在资源受限设备上部署大语言模型(LLMs)的一种有前景的解决方案。早期为ResNet等小规模网络开发的方法依赖基于梯度的优化,这对于具有数十亿参数的超大规模LLMs而言变得不切实际。虽然最近提出的免反向传播或基于变换的方法缓解了这一问题,但它们忽略了层间交互,或使用朴素的最近舍入量化权重分配来节省权重优化的高昂计算成本。在本文中,我们提出了一种新颖的免反向传播PTQ算法,该算法通过考虑层间依赖关系来优化量化权重。其关键创新在于开发了注意力感知的Hessian矩阵,用于捕获注意力模块内部的层间交互。大量实验表明,我们的方法不仅优于现有的权重量化方法,而且与抑制激活异常值的传统方法表现出良好的协同作用,从而实现了最先进的权重-激活量化性能。代码将在 https://github.com/SamsungLabs/BoA 提供。

英文摘要:

Post-training quantization (PTQ) is a promising solution for deploying large language models (LLMs) on resource-constrained devices. Early methods developed for small-scale networks, such as ResNet, rely on gradient-based optimization, which becomes impractical for hyper-scale LLMs with billions of parameters. While recently proposed backpropagation-free or transformation-based methods alleviate this issue, they ignore inter-layer interactions or use the naive nearest-rounding-based quantized weight assignment to save the heavy computational cost of weight optimization. In this paper, we introduce a novel backpropagation-free PTQ algorithm that optimizes quantized weights by considering inter-layer dependencies. The key innovation is the development of attention-aware Hessian matrices that capture inter-layer interactions within the attention module. Extensive experiments demonstrate that our approach not only outperforms existing weight quantization methods but also shows good synergy with conventional methods to suppress activation outliers, leading to state-of-the-art weight-activation quantization performance. The code will be available at https://github.com/SamsungLabs/BoA.

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

↑