提出单步量化框架SingleQuant,显著加速大模型量化并提升性能。
Outlier Smoothing with Closed-Form Rotations for W4A4 Large Language Model Quantization
- 通过闭式旋转分解消除梯度噪声和非光滑性,实现高效量化
- 量化速度提升1400倍,13B模型任务性能提升0.57%
- 适合需要快速部署高保真量化模型的研究与工业场景
大语言模型(LLMs)量化有助于在资源受限环境下部署,但现有方法因梯度优化与量化截断不兼容,导致严重收敛病态,延长量化时间并降低任务性能。研究发现,流形上的直通估计器(STE)引入非光滑性和梯度噪声,阻碍优化收敛,阻碍高质量量化LLM的发展。为此,我们提出SingleQuant——一种单步量化框架,摆脱量化截断依赖,消除上述非光滑性与梯度噪声。具体地,构建对齐旋转变换(ART)和均匀化旋转变换(URT),分别针对不同激活异常值,通过闭式最优旋转平滑异常值,利用几何映射重塑分布。两者均由预定义维度与角度的格文斯旋转构成,可在短时间内实现优异的任务性能。实验表明,在7B至70B LLM上,SingleQuant优于多个基线。例如,对LLaMA-2-13B进行量化时,实现1400倍速度提升,平均任务性能提高0.57%。
原文摘要 · Abstract (English)
Large Language Models (LLMs) quantization facilitates deploying LLMs in resource-limited settings, but existing methods that combine incompatible gradient optimization and quantization truncation lead to serious convergence pathology. This prolongs quantization time and degrades LLMs' task performance. Our studies confirm that Straight-Through Estimator (STE) on Stiefel manifolds introduce non-smoothness and gradient noise, obstructing optimization convergence and blocking high-fidelity quantized LLM development despite extensive training. To tackle the above limitations, we propose SingleQuant, a single-pass quantization framework that decouples from quantization truncation, thereby eliminating the above non-smoothness and gradient noise factors. Specifically, SingleQuant constructs Alignment Rotation Transformation (ART) and Uniformity Rotation Transformation (URT) targeting distinct activation outliers, where ART achieves smoothing of outlier values via closed-form optimal rotations, and URT reshapes distributions through geometric mapping. Both matrices comprise strictly formulated Givens rotations with predetermined dimensions and rotation angles, enabling promising LLMs task performance within a short time. Experimental results demonstrate SingleQuant's superiority over the selected baselines across diverse tasks on 7B-70B LLMs. To be more precise, SingleQuant enables quantized LLMs to achieve higher task performance while necessitating less time for quantization. For example, when quantizing LLaMA-2-13B, SingleQuant achieves 1,400$\times$ quantization speedup and increases +0.57\% average task performance compared to the selected best baseline.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。