arXiv reaDer
極小値を飛び越える: ビジョントランスフォーマーの損失状況における量子化
Jumping through Local Minima: Quantization in the Loss Landscape of Vision Transformers
量子化スケールとビット幅は、ニューラル ネットワークの量子化方法を検討する際に最も重要なパラメータです。これまでの研究は、勾配法 (勾配降下法およびヘシアン解析) を通じて、グローバルな方法で量子化スケールを最適化することに焦点を当てていました。しかし、量子化スケールに摂動を適用すると、非常にギザギザで非常に滑らかではないテスト損失の状況が観察されます。実際、量子化スケールの小さな変動は精度に大きな影響を与える可能性があり、4 ビット量子化ビジョン トランスフォーマー (ViT) では 0.5 ~ 0.8% の精度向上が得られます。この状況では、勾配法は極小値に確実に到達できないため機能しません。 Evol-Q と呼ばれる私たちの仕事では、進化的探索を使用して、滑らかではない地形を効果的に横断します。さらに、infoNCE 損失を使用することを提案します。これは、小さなキャリブレーション データセット (1,000 枚の画像) でのオーバーフィッティングに対処するのに役立つだけでなく、そのような非常に滑らかでない表面の横断も容易にします。 Evol-Q は、完全に量子化された ViT-Base のトップ 1 精度を、3 ビット、4 ビット、および 8 ビットの重み量子化レベルで 10.30%、0.78%、および 0.15% 向上させます。さまざまな CNN および ViT アーキテクチャに関する広範な実験により、極端な量子化シナリオにおける堅牢性がさらに実証されました。私たちのコードは https://github.com/enyac-group/evol-q で入手できます。
Quantization scale and bit-width are the most important parameters when considering how to quantize a neural network. Prior work focuses on optimizing quantization scales in a global manner through gradient methods (gradient descent \& Hessian analysis). Yet, when applying perturbations to quantization scales, we observe a very jagged, highly non-smooth test loss landscape. In fact, small perturbations in quantization scale can greatly affect accuracy, yielding a 0.5-0.8% accuracy boost in 4-bit quantized vision transformers (ViTs). In this regime, gradient methods break down, since they cannot reliably reach local minima. In our work, dubbed Evol-Q, we use evolutionary search to effectively traverse the non-smooth landscape. Additionally, we propose using an infoNCE loss, which not only helps combat overfitting on the small calibration dataset (1,000 images) but also makes traversing such a highly non-smooth surface easier. Evol-Q improves the top-1 accuracy of a fully quantized ViT-Base by 10.30%, 0.78%, and 0.15% for 3-bit, 4-bit, and 8-bit weight quantization levels. Extensive experiments on a variety of CNN and ViT architectures further demonstrate its robustness in extreme quantization scenarios. Our code is available at https://github.com/enyac-group/evol-q
updated: Mon Aug 21 2023 16:03:35 GMT+0000 (UTC)
published: Mon Aug 21 2023 16:03:35 GMT+0000 (UTC)
参考文献 (このサイトで利用可能なもの) / References (only if available on this site)
被参照文献 (このサイトで利用可能なものを新しい順に) / Citations (only if available on this site, in order of most recent)
Amazon.co.jpアソシエイト