Skip to main content
QUICK REVIEW

[Paper Review] Understanding DDPM Latent Codes Through Optimal Transport

Valentin Khrulkov, Ryzhakov, Gleb|arXiv (Cornell University)|Feb 14, 2022
Generative Adversarial Networks and Image SynthesisComputer Science12 citations
TL;DR

This paper demonstrates that the DDPM encoder map in the VP-SDE (DDPM) framework coincides with the Monge optimal transport map between the data distribution and the standard normal distribution, both theoretically for multivariate normals and numerically for synthetic and real image data. The result reveals that DDPM latent codes encode structure via optimal transport, enabling high-level feature transfer across models.

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.

Motivation & Objective

  • To understand the mathematical properties of the DDPM encoder map, which maps data to a standard normal latent space via probability flow ODE.
  • To investigate whether the DDPM encoder map corresponds to the optimal transport map between data and noise distributions.
  • To provide theoretical and empirical evidence for this correspondence in both synthetic and real image distributions.

Proposed method

  • Theoretical analysis is conducted for multivariate normal distributions, proving that the DDPM encoder map equals the optimal transport map.
  • Numerical experiments solve the Fokker-Planck equation using a tensor train solver to compute the probability flow ODE and validate the optimal transport correspondence.
  • Empirical validation uses DDIM sampling to invert real images (FFHQ, MetFaces, AFHQ, ImageNet) and computes optimal transport costs between original images and their latent codes.
  • Optimal transport costs are compared between the DDIM-induced map and the true optimal transport map using the POT library.
  • The method evaluates similarity of generated samples from shared latent codes across different models, observing high-level feature transfer.
  • Conditional experiments on ImageNet models test whether texture and style are preserved across classes under shared latent codes.

Experimental results

Research questions

  • RQ1Does the DDPM encoder map induced by the probability flow ODE coincide with the optimal transport map between the data distribution and the standard normal distribution?
  • RQ2How accurately does the DDPM encoder approximate the optimal transport map for non-Gaussian and real image distributions?
  • RQ3What is the empirical behavior of latent codes when shared across different diffusion models trained on different datasets?
  • RQ4Can high-level visual features such as texture, pose, and gender be transferred via shared latent codes due to the optimal transport structure?
  • RQ5Is the observed correspondence specific to DDPMs or a general property of score-based generative models?

Key findings

  • For multivariate normal distributions, the DDPM encoder map exactly coincides with the Monge optimal transport map, as proven theoretically.
  • On synthetic distributions, the DDPM encoder map matches the optimal transport map up to machine precision, as confirmed by solving the Fokker-Planck equation numerically.
  • On real image datasets (FFHQ, MetFaces, AFHQ), shared latent codes across different models produce images with aligned high-level features such as gender, pose, and texture.
  • The optimal transport cost between original images and their DDIM-encoded latent codes matches the cost induced by the probability flow ODE to within machine precision on the AFHQ validation set.
  • Conditional ImageNet models show that shared latent codes transfer texture and style across classes (e.g., rooster and pizza), suggesting the latent space encodes perceptual similarity.
  • Experiments with BigGAN show no such transfer, indicating that the observed feature alignment is specific to DDPMs and not a general effect of conditional generation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.