Understanding DDPM Latent Codes Through Optimal Transport
Valentin Khrulkov, Gleb Ryzhakov, Andrei Chertkov, Ivan Oseledets
TL;DR
The paper tackles the fundamental question of what structure the DDPM encoder induces on data by examining its connection to optimal transport. It proves analytically that the encoder coincides with the Monge OT map to $\mathcal{N}(0,I)$ in the Gaussian (Gaussian diffeo) case and provides extensive numerical evidence via solving the Fokker-Planck equation with a tensor-train solver for synthetic distributions, showing near-perfect OT equivalence. It further validates the hypothesis on real image datasets by demonstrating consistent texture-level correspondences across multiple DDPMs and by comparing OT costs to the encoder-based transport costs, including a conditional ImageNet setting. The results offer a principled lens to understand latent codes in diffusion models, suggesting that pixel-space quadratic costs may be suboptimal for visual data and opening avenues for feature-based OT formulations and future theoretical proofs.
Abstract
Diffusion models have recently outperformed alternative approaches to model the distribution of natural images, such as GANs. Such diffusion models allow for deterministic sampling via the probability flow ODE, giving rise to a latent space and an encoder map. While having important practical applications, such as estimation of the likelihood, the theoretical properties of this map are not yet fully understood. In the present work, we partially address this question for the popular case of the VP SDE (DDPM) approach. We show that, perhaps surprisingly, the DDPM encoder map coincides with the optimal transport map for common distributions; we support this claim theoretically and by extensive numerical experiments.
