重新啟動取樣以改善生成過程。
Restart Sampling for Improving Generative Processes
June 26, 2023
作者: Yilun Xu, Mingyang Deng, Xiang Cheng, Yonglong Tian, Ziming Liu, Tommi Jaakkola
cs.AI
摘要
涉及解決微分方程的生成過程,例如擴散模型,通常需要在速度和質量之間取得平衡。基於常微分方程(ODE)的取樣器速度快,但性能達到瓶頸,而基於隨機微分方程(SDE)的取樣器在提高樣本質量的同時增加了取樣時間。我們將這種差異歸因於取樣誤差:ODE取樣器涉及較小的離散化誤差,而SDE中的隨機性會收縮累積的誤差。基於這些發現,我們提出了一種名為“重新啟動”的新型取樣算法,以更好地平衡離散化誤差和收縮。該取樣方法交替於額外的前向步驟中添加大量噪聲,並嚴格遵循反向ODE。從實證來看,“重新啟動”取樣器在速度和準確性方面均超越了先前的SDE和ODE取樣器。在CIFAR-10 / ImageNet 64x64上,“重新啟動”不僅優於先前最佳的SDE結果,還將取樣速度提高了10倍/2倍。此外,在可比的取樣時間內,“重新啟動”取得了比ODE取樣器更好得多的樣本質量。此外,“重新啟動”在大規模文本到圖像Stable Diffusion模型上的文本-圖像對齊/視覺質量與多樣性平衡方面優於先前的取樣器,該模型在LAION 512x512上預先訓練。代碼可在https://github.com/Newbeeer/diffusion_restart_sampling找到。
English
Generative processes that involve solving differential equations, such as
diffusion models, frequently necessitate balancing speed and quality. ODE-based
samplers are fast but plateau in performance while SDE-based samplers deliver
higher sample quality at the cost of increased sampling time. We attribute this
difference to sampling errors: ODE-samplers involve smaller discretization
errors while stochasticity in SDE contracts accumulated errors. Based on these
findings, we propose a novel sampling algorithm called Restart in order to
better balance discretization errors and contraction. The sampling method
alternates between adding substantial noise in additional forward steps and
strictly following a backward ODE. Empirically, Restart sampler surpasses
previous SDE and ODE samplers in both speed and accuracy. Restart not only
outperforms the previous best SDE results, but also accelerates the sampling
speed by 10-fold / 2-fold on CIFAR-10 / ImageNet 64 times 64. In addition,
it attains significantly better sample quality than ODE samplers within
comparable sampling times. Moreover, Restart better balances text-image
alignment/visual quality versus diversity than previous samplers in the
large-scale text-to-image Stable Diffusion model pre-trained on LAION 512
times 512. Code is available at
https://github.com/Newbeeer/diffusion_restart_sampling