arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.25880cs.LG
收藏

无残差Transformer的量化优势

The Quantization Benefits of Residual-Free Transformers

Australian Institute for Machine Learning, Adelaide University(澳大利亚机器学习研究所,阿德莱德大学);DATA61, CSIRO(DATA61,CSIRO)

Yiping Ji, Mahalakshmi Sabanayagam, Peyman Moghadam, Hemanth Saratchandran, Simon Lucey

AI总结:

本文通过对比残差与无残差Transformer,发现残差连接导致激活值非高斯性增强,从而增加量化误差;而无残差Transformer通过正交初始化等技术保持近高斯激活值,显著提升低比特量化鲁棒性,揭示了精度与可压缩性之间的权衡。

摘要:

大规模Transformer的训练和部署日益受到跨加速器传输激活值、梯度和优化器状态的限制。低比特量化提供了一种自然的补救措施,但Transformer的激活值通常具有重尾和异常值主导的特点,使得简单量化损失严重。我们表明,这种困难不仅是量化器的属性,也是架构的属性。具体来说,残差连接在训练过程中可能使Transformer激活值偏离高斯性。通过残差和无残差Transformer之间的受控比较,我们证明这种效应导致残差模型在低精度下量化误差和精度下降显著更高。我们通过超额峰度分析解释这一现象,表明残差混合可以放大非高斯性,而无残差中的密集混合则压缩非高斯性。然后我们展示,使用正交初始化、谱或二阶优化以及注意力温度的深度感知缩放,可以使无残差Transformer可训练。在语言任务中,虽然全精度性能略有下降,但这些模型保持近高斯激活值,并对低比特量化表现出显著改善的鲁棒性。我们的结果揭示了Transformer设计中的精度-可压缩性权衡,并激发了面向量化的基础模型的架构级方法。

英文摘要:

Large-scale transformer training and deployment are increasingly constrained by the transfer of activations, gradients, and optimizer states across accelerators. Low-bit quantization offers a natural remedy, but transformer activations are often heavy-tailed and outlier-dominated, making simple quantization highly lossy. We show that this difficulty is not only a property of the quantizer, but also of the architecture. Specifically, residual connections can drive transformer activations away from Gaussianity during training. Using controlled comparisons between residual and residual-free transformers, we demonstrate that this effect leads to substantially higher quantization error and accuracy degradation at low precision in residual models. We explain the phenomenon through an excess kurtosis analysis, showing that residual mixing can amplify non-Gaussianity, whereas dense mixing in residual-free models contracts non-Gaussianity. We then show that residual-free transformers can be made trainable using orthogonal initialization, spectral or second-order optimization, and depth-aware scaling of attention temperature. In language tasks, while there is a small drop in full precision performance, these models retain near-Gaussian activations and exhibit significantly improved robustness to low-bit quantization. Our results identify an accuracy--compressibility trade-off in transformer design and motivate architecture-level approaches to quantization-friendly foundation models.

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

↑