Skip to main content
QUICK REVIEW

[論文レビュー] Pruning vs Quantization: Which is Better?

Andrey N. Kuzmin, Markus Nagel|arXiv (Cornell University)|Jul 6, 2023
Advanced Neural Network Applications被引用数 23
ひとこと要約

この論文は pruning と quantization の比較を広範に行い、量子化が一般に pruning を上回ることを示す。とくに中程度の圧縮でそうした傾向が顕著である。非常に高い圧縮比では prune が役立つ場合がある。

ABSTRACT

Neural network pruning and quantization techniques are almost as old as neural networks themselves. However, to date only ad-hoc comparisons between the two have been published. In this paper, we set out to answer the question on which is better: neural network quantization or pruning? By answering this question, we hope to inform design decisions made on neural network hardware going forward. We provide an extensive comparison between the two techniques for compressing deep neural networks. First, we give an analytical comparison of expected quantization and pruning error for general data distributions. Then, we provide lower bounds for the per-layer pruning and quantization error in trained networks, and compare these to empirical error after optimization. Finally, we provide an extensive experimental comparison for training 8 large-scale models on 3 tasks. Our results show that in most cases quantization outperforms pruning. Only in some scenarios with very high compression ratio, pruning might be beneficial from an accuracy standpoint.

研究の動機と目的

  • ハードウェアのバイアスなしにモデル圧縮の公正な比較を pruning と quantization で促すこと。
  • 等圧縮比の下で pruning と quantization から生じる誤差を分析・経験ベースのベンチマークを開発すること。
  • 理論境界と実際のネットワークでの per-layer および全モデルの評価を提供すること。

提案手法

  • 対称一様量子化を用いた量子化による重み誤差とその MSE/ SNR の挙動をモデル化すること。
  • Magnitude pruning をプルーニング手法として定義し、量子化におけるクリッピングと誤差の類似性を導出すること。
  • PTQ のレイヤー出力誤差の下界を求める混合整数二次計画問題を導出すること。
  • 希少性マスクを用いた分枝限定法による中程度の次元性に対する正確な pruning 解を提供すること。
  • 複数のアーキテクチャで分布、単一レイヤ PTQ、全モデルファインチューニングに渡る大規模な実験を実施すること。
Figure 1: Comparison for a standard normal distribution. (left) Distributions after pruning and quantization for INT4 and 75% pruning. (middle) The squared error weighted by probability. (right) SNR for different compression ratios.
Figure 1: Comparison for a standard normal distribution. (left) Distributions after pruning and quantization for INT4 and 75% pruning. (middle) The squared error weighted by probability. (right) SNR for different compression ratios.

実験結果

リサーチクエスチョン

  • RQ1等しい圧縮比の下で、どちらの技術—pruning または quantization—が高い出力精度と低い誤差をもたらすか。
  • RQ2データ分布(ガウス分布 vs ヘビーターン分布)は pruning と quantization の相対性能にどのように影響するか。
  • RQ3レイヤーごとの量子化および pruning 誤差の厳密な理論境界は何で、経験的結果とどう比較されるか。
  • RQ4 pruning または quantization 後のファインチューニングは学習表現を逆転させるか、あるいは維持するか、そしてこれが性能にどう影響するか。
  • RQ5ストレージと計算の観点から pruning と quantization の実装ハードウェア影響はどうなるか。

主な発見

モデル元の値量子化 8-bit量子化 7-bit量子化 6-bit量子化 5-bit量子化 4-bit量子化 3-bit量子化 2-bitプルーニング 8-bitプルーニング 7-bitプルーニング 6-bitプルーニング 5-bitプルーニング 4-bitプルーニング 3-bitプルーニング 2-bit
Resnet-1869.770.570.570.670.370.068.967.370.370.169.969.569.368.366.8
Resnet-5076.176.476.476.476.376.275.572.376.676.476.276.175.975.474.3
MobileNet-V271.771.972.071.771.670.968.659.168.165.661.956.348.034.021.2
EfficientNet75.475.275.375.074.674.071.560.972.570.968.163.656.444.527.1
MobileNet-V367.467.767.667.166.364.760.850.565.664.462.460.256.131.70.0
ViT81.381.581.481.481.080.478.472.276.676.676.273.172.471.569.4
DeepLab-V372.972.372.372.471.970.863.217.665.262.856.847.732.918.610.0
EfficientDet40.239.639.639.639.237.833.515.534.533.030.927.924.217.98.0
  • 中程度の圧縮において、重量分布と実モデルのテンソルに対して、量子化は pruning より一般に高い SNR をもたらす。
  • 極めて高い圧縮(おおよそ値あたり 2–3 ビット)および極端なスパース性の下でのみ pruning が量子化に有利となる。
  • 46モデルの実モデルテンソル全体で、重量分布の尖度(kurtosis)が pruning が量子化を上回る可能性と関連している;高い尖度は通常量子化を有利にするが、極端な圧縮では別。
  • 競合的な QAT と pruning 手法を用いた全モデルファインチューニングにおいて、等圧縮率で量子化対応の訓練(QAT)は通常、Magnitude pruning よりも精度を維持・向上させる。
  • 非構造化 pruning は pruning の性能に対する上限を提供する。ハードウェア上の考慮事項は実用的な gains をしばしば削減し、量子化の利点を強化する。
Figure 2: Comparing the error of pruning and quantization for a student-t distribution, simulating the presence of significant outliers. We plot the results for different magnitudes of the outliers, as per the kurtosis on the x-axis. (left) the pruning error, which does not change under the presence
Figure 2: Comparing the error of pruning and quantization for a student-t distribution, simulating the presence of significant outliers. We plot the results for different magnitudes of the outliers, as per the kurtosis on the x-axis. (left) the pruning error, which does not change under the presence

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。