arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2311.05161cs.CL
收藏

通过权重和激活量化提升大语言模型的计算效率

Enhancing Computation Efficiency in Large Language Models through Weight and Activation Quantization

Hanyang University(汉阳大学);SAPEON Korea Inc.(SAPEON韩国公司);Seoul National University(首尔大学)

Janghwan Lee, Minsoo Kim, Seungcheol Baek, Seok Joong Hwang, Wonyong Sung, Jungwook Choi

AI总结:

本文提出AQAS和SLAC技术及dINT混合数据格式,用于大语言模型的W4A8训练后量化,解决下溢问题,在OPT和LLaMA上达到全精度水平,并实现2倍硬件效率提升。

摘要:

大语言模型(LLMs)擅长自然语言处理任务,但其部署常常受到庞大的参数规模和计算需求的限制。本文聚焦于LLMs中的训练后量化(PTQ),特别是4位权重和8位激活(W4A8)量化,以提升计算效率——这一主题相较于仅权重量化而言探索较少。我们提出了两种创新技术:激活量化感知缩放(AQAS)和序列长度感知校准(SLAC),通过考虑权重和激活的联合效应以及将校准序列长度与目标任务对齐来增强PTQ。此外,我们引入了dINT,一种结合整数和反常态表示的混合数据格式,以解决W4A8量化中的下溢问题,即小数值被舍入为零。通过对包括OPT和LLaMA在内的LLMs进行严格评估,我们证明我们的技术显著提升了任务准确率,达到与全精度模型相当的水平。通过开发与dINT兼容的算术单元,我们进一步确认我们的方法相比8位整数MAC单元实现了2倍的硬件效率提升。

英文摘要:

Large Language Models (LLMs) are proficient in natural language processing tasks, but their deployment is often restricted by extensive parameter sizes and computational demands. This paper focuses on post-training quantization (PTQ) in LLMs, specifically 4-bit weight and 8-bit activation (W4A8) quantization, to enhance computational efficiency -- a topic less explored compared to weight-only quantization. We present two innovative techniques: activation-quantization-aware scaling (AQAS) and sequence-length-aware calibration (SLAC) to enhance PTQ by considering the combined effects on weights and activations and aligning calibration sequence lengths to target tasks. Moreover, we introduce dINT, a hybrid data format combining integer and denormal representations, to address the underflow issue in W4A8 quantization, where small values are rounded to zero. Through rigorous evaluations of LLMs, including OPT and LLaMA, we demonstrate that our techniques significantly boost task accuracies to levels comparable with full-precision models. By developing arithmetic units compatible with dINT, we further confirm that our methods yield a 2$\times$ hardware efficiency improvement compared to 8-bit integer MAC unit.

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

↑