提出新量化训练方法,让模型在分布外数据上更稳定
Quantization Meets OOD: Generalizable Quantization-aware Training from a Flatness Perspective
- 从损失曲面平坦性出发,设计新量化训练策略
- 实验显示传统量化使分布外性能下降,新方法显著改善
- 适合追求模型鲁棒性的研究人员和工业部署场景
当前量化感知训练(QAT)主要提升模型在分布内(I.D)数据上的表现,却忽视了其在分布外(OOD)数据上的性能退化。本文通过严谨实验验证了该问题:QAT会导致显著的OOD泛化性能下降。进一步发现,损失曲面平坦性有助于提升OOD泛化能力,而QAT却使损失曲面变尖锐,二者矛盾是根本原因。为此,我们提出面向平坦性的量化训练方法FQAT:i) 引入逐层冻结机制,缓解双重优化目标(标准QAT与平坦性)间的梯度冲突;ii) 设计基于无序性的自适应冻结算法,动态确定每步冻结哪些层,利用梯度无序度量识别训练中不稳定的层。在多个主流OOD基准测试上,FQAT在I.D与OOD图像分类任务中均优于现有最优基线。
原文摘要 · Abstract (English)
Current quantization-aware training (QAT) methods primarily focus on enhancing the performance of quantized models on in-distribution (I.D) data, while overlooking the potential performance degradation on out-of-distribution (OOD) data. In this paper, we first substantiate this problem through rigorous experiment, showing that QAT can lead to a significant OOD generalization performance degradation. Further, we find the contradiction between the perspective that flatness of loss landscape gives rise to superior OOD generalization and the phenomenon that QAT lead to a sharp loss landscape, can cause the above problem. Therefore, we propose a flatness-oriented QAT method, FQAT, to achieve generalizable QAT. Specifically, i) FQAT introduces a layer-wise freezing mechanism to mitigate the gradient conflict issue between dual optimization objectives (i.e., vanilla QAT and flatness). ii) FQAT proposes an disorder-guided adaptive freezing algorithm to dynamically determines which layers to freeze at each training step, effectively addressing the challenges caused by interference between layers. A gradient disorder metric is designed to help the algorithm identify unstable layers during training. Extensive experiments on influential OOD benchmark demonstrate the superiority of our method over state-of-the-art baselines under both I.D and OOD image classification tasks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。