Abstract
Diffusion probabilistic models (DPMs) have been shown to generate high-quality images without the need for delicate adversarial training. The sampling process of DPMs is mathematically similar to Stochastic Gradient Descent (SGD), with both being iteratively updated with a function increment. Building on this, we present a novel reverse sampler for DPMs in this paper, drawing inspiration from the widely-used Adam optimizer. Our proposed sampler can be readily applied to a pre-trained diffusion model, utilizing momentum mechanisms and adaptive updating to enhance the generated image's quality. By effectively reusing update directions from early steps, our proposed sampler achieves a better balance between high-level semantics and low-level details. Additionally, this sampler is flexible and can be easily integrated into pre-trained DPMs regardless of the sampler used during training. Our experimental results on multiple benchmarks demonstrate that our proposed reverse sampler yields remarkable improvements over different baselines.
Introduction
While Diffusion Probabilistic Models (DPMs) generate stunning images, their "reverse sampling" process—the mechanism that transforms noise into a coherent image—is often inefficient. Mathematically, this process mirrors Stochastic Gradient Descent (SGD). Just as basic SGD can become trapped in "narrow valleys" or oscillate wildly during neural network training, standard diffusion samplers often struggle to balance high-level structural integrity (e.g., the shape of a face) with low-level textural fidelity (e.g., skin pores).
Existing samplers frequently treat each step in isolation or rely on simple first-order approximations. This can lead to "trembling" in the generation path, resulting in images that are either excessively noisy or overly smoothed. To address this, we introduce the Adaptive Momentum (AM) Sampler, a training-free upgrade for pre-trained diffusion models.
Methodology
The Adaptive Momentum (AM) Sampler draws a direct parallel between image sampling and modern deep learning optimization, specifically the Adam optimizer.
1. Momentum Sampler
Instead of relying solely on the current step's direction to denoise, the AM sampler maintains a "velocity" vector. By reusing directions from previous steps (momentum), the model maintains a more consistent path and effectively navigates local "bumps" in the probability landscape.
2. Adaptive Updating
Inspired by RMSProp and Adam, the sampler tracks a moving average of the squared increments for every pixel. This allows for a per-pixel "step size" adjustment:
- High-frequency details: Pixels representing textures have their pacing magnified to capture fine details.
- Low-frequency information: Pixels representing broad shapes remain stable to preserve structural integrity.
3. Training-Free Integration
As an inference-algorithm modification rather than an architectural change, the AM Sampler can be integrated into existing pre-trained models (such as DDPM, DDIM, or Latent Diffusion Models) without any additional training.
Experimental Evaluation
We evaluated the AM Sampler across several standard benchmarks, including low-resolution datasets (CIFAR-10, ImageNet, CelebA) and high-resolution datasets (CelebA-HQ, LSUN Church, and LSUN Bedroom).
The AM sampler consistently outperformed baseline samplers in terms of Fréchet Inception Distance (FID):
- Quality Gains: On the CelebA dataset, the FID improved from 5.78 (standard DDPM) to 2.50 (DDPM + AM).
- Efficiency: The sampler is particularly robust at low step counts. On CIFAR-10 with only 25 steps, the AM sampler achieved an FID of 7.19, nearly doubling the performance of the standard DDPM sampler (14.44).
- Versatility: The method demonstrated consistent improvements when applied to Latent Diffusion Models (LDM), confirming its general-purpose utility.
Key Insights
The "Two-Stage" Balance
Diffusion models typically learn high-level concepts first and fine details later. The AM sampler uses momentum to bridge these stages, utilizing the "trend" of early structural steps to guide the subsequent refinement of textures.
Second-Order Approximation
While standard samplers are first-order solvers (like Euler integration), the momentum approach acts as a second-order approximation. This leads to a more stable and accurate convergence. Visualizations on toy 1D data confirm that while standard samplers exhibit "wild swings" and "ineffective vibrations," the AM sampler follows a precise, smooth trajectory.
Limitations and Future Work
The sampler introduces two primary hyperparameters: $b$ (momentum strength) and $c$ (decay rate for adaptivity). While suggested ranges are provided, optimal values may vary by dataset. Furthermore, while this work focuses on discrete-time sampling, extending the adaptive momentum framework to continuous-time Stochastic Differential Equations (SDEs) remains a promising area for future theoretical research. Finally, maintaining moving averages for momentum adds a minor memory overhead during the sampling process.
Summary updated