arXiv:2501.13987cs.LGcs.AI2025-01ICLR被引 94

提出新量化方法,让大模型在低精度下仍保持高准确率。

OstQuant: Refining Large Language Model Quantization with Orthogonal and Scaling Transformations for Better Distribution Fitting

  • 用正交与缩放变换优化权重和激活分布,提升量化空间利用率。
  • 在W4-only下保持99.5%浮点精度,在W4A4KV4下性能差距缩小32%。
  • 适合追求高效低精度部署的大模型应用开发者。

后训练量化(PTQ)已成为压缩和加速大语言模型(LLMs)的主流技术。然而,不均匀且长尾的数据分布会扩大量化范围,导致多数值的位精度下降。现有方法通过线性变换消除异常值并平衡通道间差异,但多为启发式,常忽略对整个量化空间中数据分布的优化。本文提出量化空间利用率(QSUR)这一新指标,用于评估变换后数据的可量化性,衡量数据在量化空间中的利用程度。结合数学推导分析各类变换的效应与局限,我们提出基于正交与缩放变换的量化方法(OSTQuant)。该方法采用可学习的等效变换,包含正交变换和缩放变换,全局优化权重与激活分布。此外,设计了KL-Top损失函数,在有限校准数据下减少优化噪声,同时保留更丰富的语义信息。OSTQuant在多个LLM和基准上优于现有方法:在仅4位权重(W4-only)设置下,保持99.5%浮点精度;在更具挑战性的W4A4KV4配置下,相比顶尖方法,将LLaMA-3-8B模型的性能差距缩小32%。

原文摘要 · Abstract (English)

Post-training quantization (PTQ) has emerged as a widely adopted technique for compressing and accelerating Large Language Models (LLMs). The major challenge in LLM quantization is that uneven and heavy-tailed data distributions can expand the quantization range, thereby reducing bit precision for most values. Recent methods attempt to eliminate outliers and balance inter-channel differences by employing linear transformations; however, they remain heuristic and are often overlook optimizing the data distribution across the entire quantization space.In this paper, we introduce Quantization Space Utilization Rate (QSUR), a novel metric that effectively assesses the quantizability of transformed data by measuring the space utilization of the data in the quantization space. We complement QSUR with mathematical derivations that examine the effects and limitations of various transformations, guiding our development of Orthogonal and Scaling Transformation-based Quantization (OSTQuant). OSQuant employs a learnable equivalent transformation, consisting of an orthogonal transformation and a scaling transformation, to optimize the distributions of weights and activations across the entire quantization space. Futhermore, we propose the KL-Top loss function, designed to mitigate noise during optimization while retaining richer semantic information within the limited calibration data imposed by PTQ. OSTQuant outperforms existing work on various LLMs and benchmarks. In the W4-only setting, it retains 99.5\% of the floating-point accuracy. In the more challenging W4A4KV4 configuration, OSTQuant reduces the performance gap by 32\% on the LLaMA-3-8B model compared to state-of-the-art methods. \href{https://github.com/BrotherHappy/OSTQuant}{https://github.com/BrotherHappy/OSTQuant}.

大模型量化低精度推理分布优化PTQ

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。