arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2509.09679cs.LGcs.AIcs.CL
收藏

ButterflyQuant: 通过可学习的正交蝴蝶变换实现超低比特LLM量化

ButterflyQuant: Ultra-low-bit LLM Quantization through Learnable Orthogonal Butterfly Transforms

Bingxin Xu;Zhen Dong;Oussama Elachqar;Yuzhang Shang

Bingxin Xu, Zhen Dong, Oussama Elachqar, Yuzhang Shang

AI总结:

ButterflyQuant通过可学习的正交蝴蝶变换实现超低比特LLM量化,有效抑制异常值并提升量化性能。

摘要:

大型语言模型需要巨大的内存占用,严重限制了在消费级硬件上的部署。量化通过降低数值精度来减少内存,但极端的2比特量化由于激活中的异常值导致性能损失惨重。基于旋转的方法,如QuIP和QuaRot,在量化前应用正交变换以消除异常值,利用计算不变性:y=Wx=(WQ^T)(Qx)对于正交的Q。然而,这些方法使用固定的变换——哈达玛矩阵,实现最优的最坏情况相干性μ=1/√n——无法适应特定的权重分布。我们发现不同的Transformer层表现出不同的异常值模式,这促使我们采用分层自适应旋转而不是一刀切的方法。在本工作中,我们提出了ButterflyQuant,它用可学习的蝴蝶变换取代哈达玛旋转,参数化为连续的Givens旋转角度。与哈达玛的离散{+1, -1}条目不可微,因此禁止基于梯度的学习不同,蝴蝶变换的连续参数化使优化平滑,同时通过构造保证正交性。这种正交约束在异常值抑制方面提供了理论保证,同时仅使用n log n / 2个可学习参数就实现了O(n log n)的计算复杂度。我们进一步引入了后变换激活的均匀性正则化,以促进更平滑的分布,使其适合量化。学习仅需128个校准样本,并在单个GPU上几分钟内收敛。

英文摘要:

Large language models require massive memory footprints, severely limiting deployment on consumer hardware. Quantization reduces memory through lower numerical precision, but extreme 2-bit quantization suffers from catastrophic performance loss due to outliers in activations. Rotation-based methods such as QuIP and QuaRot apply orthogonal transforms to eliminate outliers before quantization, using computational invariance: $\mathbf{y} = \mathbf{Wx} = (\mathbf{WQ}^T)(\mathbf{Qx})$ for orthogonal $\mathbf{Q}$. However, these methods use fixed transforms--Hadamard matrices achieving optimal worst-case coherence $μ= 1/\sqrt{n}$--that cannot adapt to specific weight distributions. We identify that different transformer layers exhibit distinct outlier patterns, motivating layer-adaptive rotations rather than one-size-fits-all approaches. In this work, we propose ButterflyQuant, which replaces Hadamard rotations with learnable butterfly transforms parameterized by continuous Givens rotation angles. Unlike Hadamard's discrete $\{+1, -1\}$ entries that are non-differentiable and thus prohibit gradient-based learning, butterfly transforms' continuous parameterization enables smooth optimization while guaranteeing orthogonality by construction. This orthogonal constraint ensures theoretical guarantees in outlier suppression while achieving $O(n \log n)$ computational complexity with only $\frac{n \log n}{2}$ learnable parameters. We further introduce a uniformity regularization on post-transformation activations to promote smoother distributions amenable to quantization. Learning requires only 128 calibration samples and converges in minutes on a single GPU.

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

↑