Skip to main content
QUICK REVIEW

[论文解读] Quantization Variation: A New Perspective on Training Transformers with Low-Bit Precision

Xijie Huang, Zhiqiang Shen|arXiv (Cornell University)|Jul 1, 2023
CCD and CMOS Imaging Sensors被引用 4
一句话总结

本文提出了一种针对视觉变换器(ViTs)的变异性感知量化框架,解决了低比特量化的量化感知训练(QAT)过程中因参数波动(变异性)引起的训练不稳定性问题。通过采用多裁剪知识蒸馏、模块依赖性缩放以及振荡感知的桶正则化方法,该方法稳定了训练过程,并在 ImageNet-1K 上以 2-bit Swin-T 达到了 77.66% 的 Top-1 准确率,优于先前最先进方法 3.35%。

ABSTRACT

Despite the outstanding performance of transformers in both language and vision tasks, the expanding computation and model size have increased the demand for efficient deployment. To address the heavy computation and parameter drawbacks, quantization is frequently studied in the community as a representative model compression technique and has seen extensive use on ConvNets. However, due to the unique properties of transformers, the low-bit quantization applications are still limited and underexplored. In this paper, we identify the difficulty of transformer low-bit quantization-aware training on its unique variation behaviors, which significantly differ from ConvNets. Based on comprehensive quantitative analysis, we observe variation in three hierarchies: various module quantization sensitivities, outliers in static weight and activation distribution, and oscillation in dynamic parameter fluctuations. These variations of transformers bring instability to the quantization-aware training (QAT) and negatively influence the performance. We explore the best practices to alleviate the variation's influence during low-bit transformer QAT and propose a variation-aware quantization scheme for both vision and language transformers. We extensively verify and show our scheme can alleviate the variation and improve the performance of transformers across various models and tasks. Our solution substantially improves the 2-bit Swin-T and binary BERT-base, achieving a 3.35% and 1.4% accuracy improvement over previous state-of-the-art methods on ImageNet-1K and GLUE. Codes and models are available at https://github.com/HuangOwen/Quantization-Variation.

研究动机与目标

  • 识别并解决低比特量化视觉变换器中训练不稳定的根源原因。
  • 分析 ViTs 中与 CNN 不同的特异性变异性行为,这些行为会阻碍量化性能。
  • 提升在极低比特宽度(2–4 比特)下视觉变换器量化感知训练(QAT)的效率与稳定性。
  • 开发一种模块感知、抗变异性干扰的量化框架,以增强收敛性与准确率。
  • 在 ImageNet-1K 上展示 2-bit ViT 模型的最先进性能。

提出的方法

  • 引入一种多裁剪知识蒸馏方案,以减少小批量内的数据方差,从而稳定并加速 QAT。
  • 提出一种模块依赖性缩放策略,为每个模块应用不同的缩放因子,以适应不同的权重分布方差。
  • 设计一种振荡感知的桶正则化(OBR),通过余弦调度动态调整正则化系数,以减少权重振荡。
  • 采用一种变异性感知的正则化项,以抑制 QAT 过程中不稳定的权重更新,提升收敛性。
  • 使用可微分量化方案,以 LSQ+ 为基础,通过梯度缩放与分布感知归一化进行增强。
  • 通过可视化注意力图,验证量化模型在 2 比特精度下仍保持强大的表征能力。

实验结果

研究问题

  • RQ1为何视觉变换器在低比特量化下性能劣于 CNN?
  • RQ2视觉变换器在量化感知训练中为何出现训练不稳定性?
  • RQ3ViTs 中的参数波动如何影响 QAT 过程中的权重振荡与收敛性?
  • RQ4知识蒸馏与模块特定缩放能否提升低比特 ViT 量化过程的稳定性与准确率?
  • RQ5振荡感知正则化在多大程度上可抑制低比特 ViT 训练中的权重振荡并提升模型准确率?

主要发现

  • 所提方法在 ImageNet-1K 上以 2-bit Swin-T 达到 77.66% 的 Top-1 准确率,优于先前最先进方法 3.35%。
  • 振荡感知桶正则化(OBR)将训练结束时振荡权重的比例从基线的 7.33% 降低至 0.23%,该改善与准确率提升密切相关。
  • 多裁剪知识蒸馏稳定了训练过程,减少了数据方差,有助于更快收敛与更高准确率。
  • 所提方法的损失曲面比基线更平滑且更集中,表明训练稳定性得到提升。
  • 注意力图可视化结果表明,2 比特量化后的 Swin-T 仍能对显著物体保持强注意力,而基线模型则表现出均匀注意力。
  • 该方法在多种 ViT 架构(DeiT-T、SReT-T、Swin-T)上均实现了 2–4 比特精度下的最先进性能,展现出良好的泛化能力。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。