Solving Prior Distribution Mismatch in Diffusion Models via Optimal Transport

Zhanpeng Wang, Shenghao Li, Jiameng Che, Chen Wang, Shangling Jui, Na Lei, Zhongxuan LuoarXiv 2024

TL;DR

This paper introduces an Optimal Transport (OT) framework to eliminate "prior error" in diffusion models—the persistent mismatch between the forward process's terminal noisy state and the reverse process's assumed Gaussian prior. By constructing an OT map to precisely align these distributions, the authors achieve theoretically perfect prior matching, enabling higher-quality image generation and significantly faster sampling with fewer diffusion steps.

What Problem Does This Paper Address?

Diffusion Models (DMs) rely on a critical theoretical assumption: the forward process must transform data into a perfect standard Gaussian distribution $\mathcal{N}(0, I)$, which then serves as the starting point for the reverse (generative) process.

In practice, this is rarely true. At any finite termination time $T$, the forward terminal distribution $p_T$ is close to, but not exactly, a standard Gaussian. It often retains "low-frequency signals" from the original data, a phenomenon known as the non-zero Signal-to-Noise Ratio (SNR) problem. When the reverse process starts from a pure Gaussian $q_T = \mathcal{N}(0, I)$, this discrepancy—the prior error—creates a training-inference gap. This gap leads to accumulated denoising errors, reduced image fidelity, and mode mixture, forcing researchers to use excessively long diffusion chains to minimize the error.

Variation of Prior Error and its impact on generative distribution

Methods

The authors propose a Prior Error Elimination Framework based on Optimal Transport. Instead of forcing the forward process to reach a perfect Gaussian, they accept the mismatch and fix it at the start of the reverse process.

  1. OT Map Construction: They compute an OT map $\nabla u_T^\leftarrow$ that transforms the assumed prior (standard Gaussian) into the actual terminal distribution of the forward process ($p_T$). This ensures the reverse process starts from a distribution that perfectly matches where the forward process ended.
  2. Geometric Variational Principle: To compute this map efficiently, they use a semi-discrete OT approach based on the Monge-Ampère equation. They solve for a convex Brenier potential $u$ using a geometric variational method.
  3. Controllable Smoothing: Recognizing that a pure discrete OT map might limit generative diversity, they introduce a smoothing technique with a coefficient $\tau$. This allows for a tunable balance between perfect error elimination and the model's ability to generalize to new samples.
  4. OT Accelerator: The resulting framework allows for "accelerated generation." By terminating the diffusion process early (at a smaller $T'$) and using the OT map to bridge the gap, they can bypass many expensive denoising steps.

Datasets

The method was evaluated on four standard image synthesis benchmarks:

  • CIFAR-10 ($32 \times 32$)
  • CelebA ($64 \times 64$)
  • FFHQ ($256 \times 256$)
  • AFHQ ($512 \times 512$)

Key Insights and Ideas

  • Equivalence of Problems: The paper proves that the prior distribution mismatch is mathematically equivalent to the non-zero SNR problem. Solving one inherently solves the other.
  • The Theoretical Gap: A major "aha moment" is the proof that even if a DM perfectly learns the score function, prior error will still cause the sampling trajectory to deviate from the true data distribution. The error is irreducible without a prior correction.
  • Intrinsic Compatibility: The authors derive the asymptotic consistency between dynamic OT and probability flow. This reveals that OT is not just an external "patch" but is deeply compatible with the underlying physics of diffusion processes.
  • Mode Mixture Mitigation: Prior error is identified as a primary driver of "mode mixture"—where the model generates blurry images that blend features from different classes. Unsmoothed OT is shown to be the most effective way to minimize this compared to other generative priors like GANs or VAEs.
Figure 4. MMR in (22) quantifies the degree of mode mixture, based on that mixed and unmixed images exhibit distinct behav- iors under a classifier. Subfigure (b) illustrates the variation of MMR (λ = 0.2) with respect to T for different truncated models. A lower MMR indicates that generated images are more class- discriminative and well-separated.

Key Results

  • Zero Prior Error: Quantitatively, the proposed method achieves a Wasserstein distance ($W_2$) of 0.0000 between the forward terminal and reverse initial distributions, whereas all other baseline generators (GANs, VAEs, Flow-based) only mitigate the error to non-zero values.
  • Efficiency Gains: The "OT Accelerator" allows the model to achieve superior FID (Fréchet Inception Distance) scores with significantly fewer Number of Function Evaluations (NFEs). For example, on CelebA, their method at 50 steps outperforms standard DDPM at 1000 steps.
  • Visual Quality: Qualitative results show that the OT-based approach produces sharper, more class-distinct images, especially when diffusion time $T$ is short.
Figure 3. Generated images on four datasets with OT accelerator.

Limitations and Future Work

  • Generalization Trade-off: While unsmoothed OT perfectly eliminates prior error, it can sometimes lead to lower generative diversity. The smoothing parameter $\tau$ helps, but finding the optimal balance remains an empirical task.
  • Computational Overhead: Although it speeds up sampling, the method requires an additional offline step to compute the OT map for a specific dataset and termination time.
  • Future Directions: The authors suggest exploring the in-depth correlation between OT and DMs in more complex, non-image scenarios, such as text-to-3D or cross-domain translation, where distribution mismatches are even more pronounced.

Summary updated

BibTeX
@misc{wang2024solving,
  author = {Zhanpeng Wang and Shenghao Li and Jiameng Che and Chen Wang and Shangling Jui and Na Lei and Zhongxuan Luo},
  title = {{Solving Prior Distribution Mismatch in Diffusion Models via Optimal Transport}},
  year = {2024},
  eprint = {2410.13431},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.13431},
}
Figure