基于旋转傅里叶代理的全量化方案
Quantization Everywhere with Rotated Fourier Surrogate
AI总结:
该研究针对量化优化中直通估计器的结构丢失问题,提出旋转傅里叶代理(RFS)框架,经多类模型与任务验证,其性能优于现有最先进量化基线,具备广泛适用性。
摘要:
量化对于高效部署神经网络至关重要,但其优化大多依赖直通估计器(STE)。然而,STE通过将量化算子的导数替换为恒等映射,丢弃了量化算子的结构,导致前向传播与反向传播之间存在不匹配,从根本上限制了量化模型可达到的质量。为解决这一局限,我们引入旋转傅里叶代理(Rotated Fourier Surrogate, RFS),这一统一框架为STE扩展了有原则的梯度估计器。RFS可解析地反映量化结构,同时保持稳定性与计算效率。我们还为RFS提供了严格的理论保证,证明其梯度条件良好且具备优异的优化特性。此外,RFS即插即用,经优化内核后仅产生可忽略的计算开销。我们在多种量化范式中对RFS进行了广泛评估,涵盖整数与浮点量化、权重与激活量化,以及量化感知训练、量化感知知识蒸馏和训练后量化。实验涉及多种架构,包括大语言模型、扩散语言模型、视觉Transformer和卷积神经网络,以及生成式推荐、图像分类、预训练和训练后推理等多样应用。在这些不同设置中,RFS始终优于强大的最先进量化基线,展现出其在量化范式、模型架构和应用中的广泛适用性。
英文摘要:
Quantization is essential for efficient neural network deployment, whereas its optimization overwhelmingly relies on the Straight-Through Estimator (STE). However, STE discards the structure of the quantization operator by replacing its derivative with an identity mapping, resulting in a mismatch between the forward and backward passes that can fundamentally limit the achievable quality of quantized models. To address this limitation, we introduce Rotated Fourier Surrogate (RFS), a unified framework that extends STE with a principled gradient estimator. RFS analytically reflects the structure of quantization while remaining stable and computationally efficient. We further provide rigorous theoretical guarantees for RFS, demonstrating well-conditioned gradients and favorable optimization properties. Moreover, RFS is plug-and-play and incurs negligible computational overhead with our optimized kernel. We extensively evaluate RFS across diverse quantization paradigms, spanning integer and floating-point quantization, weight and activation quantization, as well as quantization-aware training, quantization-aware distillation, and post-training quantization. Our experiments cover a broad spectrum of architectures, including large language models, diffusion language models, vision transformers, and convolutional neural networks, as well as diverse applications including generative recommendation, image classification, pre-training, and reasoning post-training. Across these diverse settings, RFS consistently improves upon strong state-of-the-art quantization baselines, demonstrating its broad applicability across quantization paradigms, model architectures, and applications.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。