[论文解读] Diversifying Sample Generation for Accurate Data-Free Quantization
本文提出了一种新颖的数据生成方法——多样化样本生成(DSG),用于数据无关量化,以缓解合成数据中因同质化导致的性能下降问题。通过放松批归一化统计量对齐约束并应用逐层样本增强,DSG 显著提升了量化模型的准确率,在 W4A4 量化设置下最高实现 22% 的准确率增益,并优于使用真实数据校准的方法以及先前的最先进方法。
Quantization has emerged as one of the most prevalent approaches to compress and accelerate neural networks. Recently, data-free quantization has been widely studied as a practical and promising solution. It synthesizes data for calibrating the quantized model according to the batch normalization (BN) statistics of FP32 ones and significantly relieves the heavy dependency on real training data in traditional quantization methods. Unfortunately, we find that in practice, the synthetic data identically constrained by BN statistics suffers serious homogenization at both distribution level and sample level and further causes a significant performance drop of the quantized model. We propose Diverse Sample Generation (DSG) scheme to mitigate the adverse effects caused by homogenization. Specifically, we slack the alignment of feature statistics in the BN layer to relax the constraint at the distribution level and design a layerwise enhancement to reinforce specific layers for different data samples. Our DSG scheme is versatile and even able to be applied to the state-of-the-art post-training quantization method like AdaRound. We evaluate the DSG scheme on the large-scale image classification task and consistently obtain significant improvements over various network architectures and quantization methods, especially when quantized to lower bits (e.g., up to 22% improvement on W4A4). Moreover, benefiting from the enhanced diversity, models calibrated by synthetic data perform close to those calibrated by real data and even outperform them on W4A4.
研究动机与目标
- 解决数据无关量化中因合成数据在分布和样本层面同质化而导致的性能下降问题。
- 在不依赖真实训练数据的前提下,提升生成的合成数据的多样性。
- 开发一种与多种后训练量化技术兼容的通用方法,包括 AdaRound。
- 仅使用合成数据,在低比特量化(如 W4A4)中实现更高的准确率。
- 证明多样化合成数据可超越使用真实数据校准的模型在准确率上的表现。
提出的方法
- 提出松弛分布对齐(SDA),以放松批归一化统计量匹配的约束,减少分布层面的同质化。
- 提出逐层样本增强(LSE),通过为不同数据样本强化特定网络层,减少样本层面的同质化。
- 通过优化包含 SDA 和 LSE 的损失函数生成合成数据,实现在不同样本间多样化特征分布。
- 将 DSG 生成的数据应用于校准量化模型,无需微调,直接使用标准的后训练量化流程。
- 通过提供多样化且高质量的合成数据,支持与 AdaRound 等先进量化方法的集成,用于权重量化。
- 结合图像先验和标签引导,与 DSG 配合使用,以提升样本的真实感和性能。
实验结果
研究问题
- RQ1通过数据无关量化生成的合成数据是否在分布层面存在同质化现象,从而损害模型准确率?
- RQ2合成数据中的样本层面同质化是否限制了量化模型的性能?
- RQ3提升合成数据的多样性是否能带来更好的量化模型准确率,甚至超越真实数据校准?
- RQ4DSG 方法在不同网络架构和低比特量化设置下是否均有效?
- RQ5DSG 是否能与最先进的后训练量化方法(如 AdaRound)无缝集成?
主要发现
- 在 ResNet-18 的 W4A4 量化设置下,DSG 实现了 34.53% 的 top-1 准确率,相较于 ZeroQ 提升 22.89%,相较于真实数据校准提升 2.67%。
- 在 InceptionV3 上的 W4A4 量化中,DSG 达到 34.89% 的准确率,相较于 ZeroQ 提升 22.89%,相较于真实数据提升 11.66%。
- 当与 AdaRound 结合时,DSG 在 ResNet-18 上实现 3-bit 权重量化下的 61.32% top-1 准确率,相较于 ZeroQ 在相同条件下提升 11.43%。
- DSG 在多个架构(ResNet-18、ResNet-50、ShuffleNet、SqueezeNet、InceptionV3)和多种量化方法(Percentile、EMA、MSE、AdaRound)中均表现出持续的性能提升。
- DSG 的性能增益在超低比特宽度设置下最为显著,证实了数据多样性在低精度量化中的关键作用。
- 在 W4A4 设置下,DSG 生成的数据实现的准确率高于真实数据校准的模型,证明在该设置下多样性优于数据保真度。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。