高效地训练一个平坦的神经网络在它被量化之前
Efficiently Training A Flat Neural Network Before It has been Quantizated
AI总结:
针对ViT训练后量化中忽略原模型与量化模型关系导致误差的问题,提出通过将激活和权重量化误差建模为独立高斯噪声并注入优化以获得平坦最小值的框架,有效提升了低比特PTQ性能。
摘要:
视觉Transformer(ViT)的训练后量化(PTQ)因其在压缩模型方面的效率而备受关注。然而,现有方法通常忽略了训练良好的NN与量化模型之间的关系,导致PTQ产生相当大的量化误差。此外,如何高效地训练一个与模型无关且针对预定精度低比特模型量身定制的神经网络尚不清楚。在本文中,我们首先发现平坦的全精度神经网络对于低比特量化至关重要。为了实现这一点,我们提出了一个框架,通过测量和解开误差源来主动预调节模型。具体而言,激活量化误差(AQE)和权重量化误差(WQE)都被统计建模为独立的高斯噪声。我们研究了几种噪声注入优化方法以获得平坦的最小值。实验结果证明了我们方法的有效性。这些结果为获得低比特PTQ模型开辟了新途径。
英文摘要:
Post-training quantization (PTQ) for vision transformers (ViTs) has garnered significant attention due to its efficiency in compressing models. However, existing methods typically overlook the relationship between a well-trained NN and the quantized model, leading to considerable quantization error for PTQ. However, it is unclear how to efficiently train a model-agnostic neural network which is tailored for a predefined precision low-bit model. In this paper, we firstly discover that a flat full precision neural network is crucial for low-bit quantization. To achieve this, we propose a framework that proactively pre-conditions the model by measuring and disentangling the error sources. Specifically, both the Activation Quantization Error (AQE) and the Weight Quantization Error (WQE) are statistically modeled as independent Gaussian noises. We study several noise injection optimization methods to obtain a flat minimum. Experimental results attest to the effectiveness of our approach. These results open novel pathways for obtaining low-bit PTQ models.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。