LLaMA3-70B系列在逐通道量化下的独特性
The Uniqueness of LLaMA3-70B Series with Per-Channel Quantization
AI总结:
本文发现LLaMA3-70B系列在W8A8逐通道量化下具有独特的精度退化现象,并揭示其根因在于权重分布,进而提出混合逐组量化与双平滑两种策略,在保持量化效率的同时恢复模型精度。
摘要:
我们在LLaMA3/3.1-70B模型中观察到一个独特的量化相关行为,该行为在LLaMA2-70B以及LLaMA3/3.1/3.2-1B/3B/8B/405B模型中均不存在。量化是高效部署大语言模型(LLMs)的关键技术。W8A8训练后量化对模型精度的影响,尤其是对最近发布的LLaMA3/3.1模型系列的影响,仍然存在争议。在本文中,我们探讨三个关键问题:是什么使LLaMA3-70B模型系列对量化具有独特的脆弱性?为什么会这样?以及如何解决该问题?我们对开放LLM排行榜上的多个LLM进行了实证研究,发现LLaMA3-70B模型系列在W8A8逐通道训练后量化下具有独特的精度退化行为。相比之下,其他模型系列如LLaMA2、LLaMA3/3.1-8B、LLaMA3.2、Qwen、Mixtral、Mistral、Phi-3和Falcon在W8A8下表现出稳健的性能。与先前将退化归因于激活值大动态范围的论断相反,我们的研究结果表明,LLaMA3-70B的权重分布是造成脆弱性的主要因素。通过仔细分析Transformer各模块中权重分布的独特特征,我们提出了两种在硬件/软件开销上做出不同权衡的解决方案。首先,我们提出一种混合策略,即少于3%的层采用更细粒度的逐组W8A8量化粒度。其次,我们引入一种双平滑策略,在保持全程逐通道量化的同时,平衡权重与激活值之间的量化误差。实验结果表明,两种策略均能在W8A8量化下有效保持整个LLaMA3-70B模型系列的精度,达到与其FP16对应版本相当的性能。
英文摘要:
We have observed a distinctive quantization-related behavior in the LLaMA3/3.1-70B models that is absent in both the LLaMA2-70B and LLaMA3/3.1/3.2-1B/3B/8B/405B models. Quantization is a crucial technique for deploying large language models (LLMs) efficiently. The impact of W8A8 post-training quantization on model accuracy, especially on the recently released LLaMA3/3.1 model series, remains contentious. In this paper, we explore three key questions: What makes the LLaMA3-70B model series uniquely vulnerable to quantization? Why is this the case? And how can the issue be addressed? We empirically investigate multiple LLMs featured on an open LLM leaderboard, discovering that the LLaMA3-70B model series have a unique accuracy degradation behavior with W8A8 per-channel post-training quantization. In contrast, other model series such as LLaMA2, LLaMA3/3.1-8B, LLaMA3.2, Qwen, Mixtral, Mistral, Phi-3, and Falcon demonstrate robust performance with W8A8. Contrary to previous assertions attributing degradation to the large dynamic range of activations, our findings indicate that the weight distribution of the LLaMA3-70B is the primary factor behind the vulnerability. By meticulously analyzing the distinct characteristics of weight distributions across Transformer blocks, we propose two solutions that make different tradeoffs in hardware/software overhead. First, we propose a mixed strategy where less than 3\% of the layers employ finer per-group W8A8 quantization granularity. Second, we introduce a bi-smoothing strategy that balances quantization errors between weights and activations while maintaining per-channel quantization throughout. Experimental results demonstrate that both strategies effectively preserve the accuracy of the entire LLaMA3-70B model series under W8A8 quantization, achieving performance on par with their FP16 counterparts.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。