Fast ODE-based Sampling for Diffusion Models in Around 5 Steps

Zhenyu Zhou,Defang Chen,Can Wang,Chun Chen
2024-09-27
Abstract:Sampling from diffusion models can be treated as solving the corresponding ordinary differential equations (ODEs), with the aim of obtaining an accurate solution with as few number of function evaluations (NFE) as possible. Recently, various fast samplers utilizing higher-order ODE solvers have emerged and achieved better performance than the initial first-order one. However, these numerical methods inherently result in certain approximation errors, which significantly degrades sample quality with extremely small NFE (e.g., around 5). In contrast, based on the geometric observation that each sampling trajectory almost lies in a two-dimensional subspace embedded in the ambient space, we propose Approximate MEan-Direction Solver (AMED-Solver) that eliminates truncation errors by directly learning the mean direction for fast diffusion sampling. Besides, our method can be easily used as a plugin to further improve existing ODE-based samplers. Extensive experiments on image synthesis with the resolution ranging from 32 to 512 demonstrate the effectiveness of our method. With only 5 NFE, we achieve 6.61 FID on CIFAR-10, 10.74 FID on ImageNet 64$\times$64, and 13.20 FID on LSUN Bedroom. Our code is available at <a class="link-external link-https" href="https://github.com/zju-pi/diff-sampler" rel="external noopener nofollow">this https URL</a>.
Computer Vision and Pattern Recognition,Artificial Intelligence
What problem does this paper attempt to address?
The problem that this paper attempts to solve is to achieve fast and high - quality sample generation in diffusion models, especially to reduce the number of function evaluations (NFE) required in the generation process, so as to improve the sampling speed without sacrificing sample quality. Traditional methods will significantly reduce sample quality at extremely low NFE (for example, about 5 times), because the approximation errors inherent in numerical methods will affect the results. This paper proposes a new single - step ODE solver - Approximate MEan - Direction Solver (AMED - Solver), which eliminates truncation errors by directly learning the average direction in each sampling step, thereby achieving high - quality sample generation with very few NFE. In addition, the author also proposes a plug - in method - AMED - Plugin, which can be applied to any existing ODE solver to further improve its performance. Specifically, the main contributions of the paper include: 1. **Introduction of AMED - Solver**: This is a new single - step ODE solver designed to eliminate truncation errors. 2. **Proposal of AMED - Plugin**: This is a small - training - overhead plug - in that can be applied to any ODE solver, hardly increasing the sampling overhead. 3. **Extensive experimental verification**: The experimental results on multiple datasets prove the effectiveness of this method in fast image generation. These contributions aim to solve the problem of sample quality degradation of existing methods at extremely low NFE, especially to achieve efficient and high - quality sample generation in diffusion models.