提出线性定理,实现无需数据的高效大模型量化。
Pushing the Limits of Large Language Model Quantization via the Linearity Theorem
- 基于线性定理构建无数据量化方法,利用哈达玛旋转与MSE最优网格。
- 在中比特率下实现非均匀分层量化最优解,压缩性能超越现有方法。
- 适用于Llama和Qwen系列模型,支持高效GPU加速,适合部署优化。
大语言模型量化已成为降低内存与计算成本的标准方法。传统方法通常将问题分解为各层独立子问题,通过最小化逐层误差(如ℓ₂重建误差)来优化,但缺乏理论支撑且度量指标可能次优。本文提出“线性定理”,建立了层间ℓ₂重建误差与模型困惑度增加之间的直接关系。该发现带来两项新应用:(1) 一种无需数据的量化方法HIGGS,采用哈达玛旋转与MSE最优网格,性能优于所有现有无数据方法,包括广泛使用的NF4格式;(2) 在中比特率范围内,针对给定压缩约束,通过转化为动态规划求解非均匀分层量化级别的最优方案。实验显示,该方法在Llama-3.1和3.2系列模型及Qwen系列上均实现更优的精度-压缩权衡。此外,其可在多种批量大小下高效支持GPU内核,显著推进了无数据与非均匀量化在大模型中的应用。
原文摘要 · Abstract (English)
Quantizing large language models has become a standard way to reduce their memory and computational costs. Typically, existing methods focus on breaking down the problem into individual layer-wise sub-problems, and minimizing per-layer error, measured via various metrics. Yet, this approach currently lacks theoretical justification and the metrics employed may be sub-optimal. In this paper, we present a "linearity theorem" establishing a direct relationship between the layer-wise $\ell_2$ reconstruction error and the model perplexity increase due to quantization. This insight enables two novel applications: (1) a simple data-free LLM quantization method using Hadamard rotations and MSE-optimal grids, dubbed HIGGS, which outperforms all prior data-free approaches such as the extremely popular NF4 quantized format, and (2) an optimal solution to the problem of finding non-uniform per-layer quantization levels which match a given compression constraint in the medium-bitwidth regime, obtained by reduction to dynamic programming. On the practical side, we demonstrate improved accuracy-compression trade-offs on Llama-3.1 and 3.2-family models, as well as on Qwen-family models. Further, we show that our method can be efficiently supported in terms of GPU kernels at various batch sizes, advancing both data-free and non-uniform quantization for LLMs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。