2025-02-11 · 专家 · 机器学习 · 数据科学

Matryoshka Quantization

该论文提出了一种名为Matryoshka Quantization(MatQuant)的多尺度量化技术,能够在一个模型中同时优化不同精度的模型权重量化,从而提高低精度量化模型的准确性。

更新于 2025-02-11。作者:Pranav Nair、Puranjay Datta、Jeff Dean、Prateek Jain、Aditya Kusupati。

中文摘要

量化模型权重对于降低大型模型的通信和推理成本至关重要。然而,量化模型——尤其是像int4或int2这样的低精度量化——需要在模型质量上进行权衡;特别是int2,已知会严重降低模型质量。因此,实践者通常被迫维护多个不同量化级别的模型,或者只提供一个在质量-延迟权衡中表现最佳的单一模型。另一方面,整数数据类型,如int8,天生具有嵌套(套娃)结构,其中较小的位宽整数,如int4或int2,嵌套在最高有效位中。本文提出了一种名为Matryoshka Quantization(MatQuant)的新型多尺度量化技术,该技术旨在解决需要多个量化模型的问题。它允许仅训练和维护一个模型,然后可以在不同的精度级别上提供服务。此外,由于MatQuant提供的联合训练和联合蒸馏正则化,MatQuant提取的int2精度模型可以比标准int2量化(使用QAT或OmniQuant等技术)提高多达10%的准确性。这代表了模型量化方面的重大进步,这一点通过以下事实得到了证明:使用相同的配方,int2 FFN-quantized Gemma-2 9B模型的准确性比int8 FFN-quantized Gemma-2 2B模型更高。

英文摘要

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. This paper proposes Matryoshka Quantization (MatQuant), a novel multi-scale quantization technique that addresses the challenge of needing multiple quantized models. It allows training and maintaining just one model, which can then be served at different precision levels. Furthermore, due to the co-training and co-distillation regularization provided by MatQuant, the int2 precision models extracted by MatQuant can be up to 10% more accurate than standard int2 quantization (using techniques like QAT or OmniQuant). This represents significant progress in model quantization, demonstrated by the fact that, with the same recipe, an int2 FFN-quantized Gemma-2 9B model is more accurate than an int8 FFN-quantized Gemma-2 2B model.

解读

一句话总结

该论文提出了一种名为Matryoshka Quantization(MatQuant)的多尺度量化技术,能够在一个模型中同时优化不同精度的模型权重量化,从而提高低精度量化模型的准确性。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源

机器可读索引:llms.txt