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

Matryoshka 量化

Matryoshka Quantization

Google DeepMind(谷歌DeepMind)

Pranav Nair, Puranjay Datta, Jeff Dean, Prateek Jain, Aditya Kusupati

AI总结:

提出 Matryoshka Quantization (MatQuant) 多尺度量化技术,利用整数数据类型的嵌套结构训练单一模型以适应不同部署精度,通过协同训练和协同蒸馏正则化显著提升低精度量化模型质量。

摘要:

量化模型权重对于降低大模型的通信和推理成本至关重要。然而,对模型进行量化——尤其是量化到 int4 或 int2 等低精度——需要在模型质量上进行权衡;特别是 int2,已知会严重降低模型质量。因此,从业者通常被迫维护多个具有不同量化级别的模型,或者部署一个最能满足质量-延迟权衡的单一模型。另一方面,整数数据类型(如 int8)本身具有嵌套(Matryoshka)结构,其中较小位宽的整数(如 int4 或 int2)嵌套在最高有效位中。利用这一见解,在本文中,我们提出了 Matryoshka Quantization(MatQuant),这是一种新颖的多尺度量化技术,可缓解上述挑战。该技术允许我们训练和维护单个量化模型,但以部署所需的精度来部署它。此外,利用 MatQuant 的协同训练和协同蒸馏正则化,以 OmniQuant 和 QAT 作为基础算法时,MatQuant 提取的 int2 精度模型分别比标准 int2 量化高出 4% 和 7%。最后,我们证明通过使用额外的一位来表示异常值,一个有效精度为 2.05-bit 的模型在以 OmniQuant 作为基础算法时获得了额外的 6% 的提升。

英文摘要:

Quantizing model weights is critical for reducing the communication and inference costs of large models. However, quantizing models -- especially to low precisions like int4 or int2 -- requires a trade-off in model quality; int2, in particular, is known to severely degrade model quality. Consequently, practitioners are often forced to maintain multiple models with different quantization levels or serve a single model that best satisfies the quality-latency trade-off. On the other hand, integer data types, such as int8, inherently possess a nested (Matryoshka) structure where smaller bit-width integers, like int4 or int2, are nested within the most significant bits. Leveraging this insight, in this paper, we propose Matryoshka Quantization (MatQuant), a novel multi-scale quantization technique that alleviates the aforementioned challenge. This technique allows us to train and maintain a single quantized model but serve it with the precision demanded by the deployment. Furthermore, leveraging MatQuant's co-training and co-distillation regularization, int2 precision models extracted by MatQuant outperform standard int2 quantization by up to to 4% and 7% with OmniQuant and QAT as base algorithms respectively. Finally, we demonstrate that by using an extra bit to represent outliers, a model with an effective precision of 2.05-bit gives an additional 6% improvement with OmniQuant as the base algorithm.

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

↑