arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.17233cs.LG
收藏

CLAQ:突破LLM低位训练后量化的极限

CLAQ: Pushing the Limits of Low-Bit Post-Training Quantization for LLMs

Shanghai Jiao Tong University(上海交通大学);Meituan(美团)

Haoyu Wang, Bei Liu, Hang Shao, Bo Xiao, Ke Zeng, Guanglu Wan, Yanmin Qian

AI总结:

针对LLM低位量化性能差的问题,提出CLAQ框架,通过K-Means聚类动态生成量化质心、离群值引导自适应精度搜索及动态离群值保留三种策略,在LLaMA和Yi等模型上取得SOTA结果。

摘要:

大型语言模型(LLMs)的参数量化近期在降低内存成本和提升计算效率方面受到广泛关注。早期方法已被广泛采用。然而,现有方法在低位(如2到3位)场景下表现不佳。本文提出了一种新颖有效的列级自适应权重量化(CLAQ)框架,为LLM量化引入了三种不同的自适应策略。首先,提出了一种基于K-Means聚类的算法,能够为参数矩阵的每一列动态生成量化质心。其次,设计了一种离群值引导的自适应精度搜索策略,可以为不同列动态分配不同的位宽。最后,开发了一种动态离群值保留方案,以保留部分参数的原始浮点精度,从而换取模型性能的提升。在包括LLaMA-1、LLaMA-2和Yi在内的多种主流开源LLMs上的实验表明,我们的方法在不同位设置下均取得了最先进的结果,特别是在极低位场景中。代码可在https://github.com/fayuge/CLAQ获取。

英文摘要:

Parameter quantization for Large Language Models (LLMs) has attracted increasing attentions recently in reducing memory costs and improving computational efficiency. Early approaches have been widely adopted. However, the existing methods suffer from poor performance in low-bit (such as 2 to 3 bits) scenarios. In this paper, we present a novel and effective Column-Level Adaptive weight Quantization (CLAQ) framework by introducing three different types of adaptive strategies for LLM quantization. Firstly, a K-Means clustering based algorithm is proposed that allows dynamic generation of quantization centroids for each column of a parameter matrix. Secondly, we design an outlier-guided adaptive precision search strategy which can dynamically assign varying bit-widths to different columns. Finally, a dynamic outlier reservation scheme is developed to retain some parameters in their original float point precision, in trade off of boosted model performance. Experiments on various mainstream open source LLMs including LLaMA-1, LLaMA-2 and Yi demonstrate that our methods achieve the state-of-the-art results across different bit settings, especially in extremely low-bit scenarios. Code is available at https://github.com/fayuge/CLAQ.

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

↑