Skip to main content
QUICK REVIEW

[論文レビュー] DeepCache: Accelerating Diffusion Models for Free

Xinyin Ma, Gongfan Fang|arXiv (Cornell University)|Dec 1, 2023
Generative Adversarial Networks and Image Synthesis被引用数 6
ひとこと要約

DeepCacheは、U-Netアーキテクチャ内の連続的なノイズ除去ステップ間で高レベル特徴をキャッシュすることで、推論時の拡散モデルの高速化を実現し、再計算を回避して冗長な計算を削減する。再トレーニングやモデルのファインチューニングを必要とせず、Stable Diffusion v1.5では2.3倍の高速化を達成し、CLIPスコアは0.05低下にとどまる。LDM-4-Gでは4.1倍の高速化を達成し、FIDスコアは0.22上昇する。

ABSTRACT

Diffusion models have recently gained unprecedented attention in the field of image synthesis due to their remarkable generative capabilities. Notwithstanding their prowess, these models often incur substantial computational costs, primarily attributed to the sequential denoising process and cumbersome model size. Traditional methods for compressing diffusion models typically involve extensive retraining, presenting cost and feasibility challenges. In this paper, we introduce DeepCache, a novel training-free paradigm that accelerates diffusion models from the perspective of model architecture. DeepCache capitalizes on the inherent temporal redundancy observed in the sequential denoising steps of diffusion models, which caches and retrieves features across adjacent denoising stages, thereby curtailing redundant computations. Utilizing the property of the U-Net, we reuse the high-level features while updating the low-level features in a very cheap way. This innovative strategy, in turn, enables a speedup factor of 2.3$ imes$ for Stable Diffusion v1.5 with only a 0.05 decline in CLIP Score, and 4.1$ imes$ for LDM-4-G with a slight decrease of 0.22 in FID on ImageNet. Our experiments also demonstrate DeepCache's superiority over existing pruning and distillation methods that necessitate retraining and its compatibility with current sampling techniques. Furthermore, we find that under the same throughput, DeepCache effectively achieves comparable or even marginally improved results with DDIM or PLMS. The code is available at https://github.com/horseee/DeepCache

研究の動機と目的

  • 拡散モデル推論における高い計算コスト、特に逐次的なノイズ除去と大規模なモデルサイズに起因する問題に対処すること。
  • Pruning や知識蒸留などの再トレーニングを必要とする既存の圧縮手法の制限を克服すること。
  • 高レベル特徴の時間的冗長性を活用することで、トレーニングフリーの高速化を実現すること。
  • 再トレーニングなしで顕著な高速化を達成するとともに、DDIM や PLMS などの高速サンプリング手法と比較して品質を維持またはわずかに向上させること。

提案手法

  • U-Netアーキテクチャ内で、以前のノイズ除去ステップから得た高レベル特徴をキャッシュし、その後続ステップでの再計算を回避する。
  • U-Netのスキップ接続を活用して、各ステップで低レベル特徴のみを更新し、高レベル特徴はキャッシュから再利用する。
  • 完全なモデル推論ステップ間の間隔を長くできる非一様な1:Nキャッシュ戦略を導入し、効率性を最適化する。
  • 事前学習済みモデルの重みを変更せず、ファインチューニングを必要とせず、推論中に動的にキャッシュ機構を適用する。
  • キャッシュされた特徴に対して軽量な推論を実行する浅いU-Netヘッドを用い、追加計算を最小限に抑える。
  • DDIM や PLMS などの既存のサンプリング手法とシームレスに統合され、補完的な高速化レイヤーとして機能する。
Figure 2 : (a) Examples of feature maps in the up-sampling block $U_{2}$ in Stable Diffusion. We present a comparison from two adjacently paired steps, emphasizing the invariance inherent in the denoising process. (b) Heatmap of similarity between $U_{2}$ ’s features in all steps on three typical di
Figure 2 : (a) Examples of feature maps in the up-sampling block $U_{2}$ in Stable Diffusion. We present a comparison from two adjacently paired steps, emphasizing the invariance inherent in the denoising process. (b) Heatmap of similarity between $U_{2}$ ’s features in all steps on three typical di

実験結果

リサーチクエスチョン

  • RQ1ノイズ除去ステップ間の高レベル特徴における時間的冗長性を活用することで、再トレーニングを伴わず拡散モデル推論を高速化できるか?
  • RQ2特徴キャッシュは、拡散モデルにおける計算オーバーヘッドを低減しつつ、生成品質を維持するのにどの程度有効か?
  • RQ3速度向上と画像品質の劣化のバランスを最適化するための最適なキャッシュ間隔(N)は何か?
  • RQ4Pruning や蒸留などの再トレーニングベースの圧縮手法と比較して、DeepCacheは速度と品質の面でどの程度優れているか?
  • RQ5DDIM や PLMS などの高速サンプリング手法と組み合わせることで、DeepCacheはさらなるスループット向上と品質向上を実現できるか?

主な発見

  • Stable Diffusion v1.5では、CLIPスコアが0.05低下するのみで2.3倍の高速化を達成し、品質の低下が最小限であることが示された。
  • ImageNetにおけるLDM-4-Gでは、4.1倍の高速化を達成し、FIDスコアは0.22上昇した。これは再トレーニングベースの圧縮手法を上回る性能を示した。
  • 同じスループット下でDDIM や PLMS と比較して、生成品質を維持またはわずかに向上させたことが、FIDおよびsFID指標で確認された。
  • アブレーションスタディにより、キャッシュされた特徴が極めて重要であることが確認された。それらを削除すると性能が著しく低下し、Cifar10ではFIDが4.35から192.98に上昇した。
  • キャッシュされた特徴に対して浅いネットワークによる推論を実施した結果、ベースラインのDDIMよりも性能が向上し、10ステップ推論でFIDが2.98低下した。
  • 大きなキャッシュ間隔(例:N=20)では性能が劣化する傾向にあり、特徴のドリフトに起因する速度向上の上限が存在することが示された。
Figure 3 : Illustration of DeepCache. At the $t-1$ step, $x_{t-1}$ is generated by reusing the features cached at the $t$ step, and the blocks ${D_{2},D_{3},U_{2},U_{3}}$ are not executed for more efficient inference.
Figure 3 : Illustration of DeepCache. At the $t-1$ step, $x_{t-1}$ is generated by reusing the features cached at the $t$ step, and the blocks ${D_{2},D_{3},U_{2},U_{3}}$ are not executed for more efficient inference.

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

論文の読解から最終レビューまで、研究時間を劇的に削減しましょう。

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

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