I have read several papers about diffusion models in the context of deep learning. especially this one

As explained in the paper, by learning the score function $(\nabla \log(p_t(x)))$, following probability flow ode trajectory one can uniquely map any data point in data distribution (X(0),let's say an image) to a point in multivariate gaussian distribution (Prior or X(T)) of the same dimension, as shown in Figure 2 in the paper(attached here as well).

I have several questions:

  1. We know that we can draw a random a sample from the gaussian distribution ($P_T(x)$ in the middle of the figure) and the reverse SDE would generate sample from the data distribution $P_0(x)$, in this case a realistic image. Is that also true for the reverse ODE? I.e. any point in the gaussian would be mapped to a realistic image if we follow the probability flow ODE (white in the figure) path?

  2. Can we say ODE trajectory is a bijective mapping from the data distribution to the gaussian distribution?

  3. Can we say in such gaussian distribution every element (dimension) is independent of the others? please note that in the figure, the dimension is shown to be only one for simplicity, however in general it should have the same dimension as our data.

The motivation for my questions is, I want to find a mapping or a new representation of my data, in which every element is independent of the others (some sort of disentangled representation, but interpretability doesn't matter for me). Can the proposed mapping replace the ICA algorithm?

enter image description here


1 Answer 1


One advantage of the probability flow ODE approach is that it guarantees the generative model is identifiable, thus if the score matching neural network can recover the true score function of the data generating process, after training any given data point will map to a unique point in latent space and semantic interpolation can be meaningfully and interpretably performed in the latent space to generate images with properties that are in between two arbitrary input examples.

Of course in practice score function can only be approximated with errors, but reverse ODE proposed by Song et al could still generate realistic images as confirmed in Karras et al's “Elucidating the Design Space of Diffusion-Based Generative Models”, though they may have worse quality compared to SDE or DDPM models.

Deterministic sampling offers many benefits, e.g., the ability to turn real images into their corresponding latent representations by inverting the ODE. However, it tends to lead to worse output quality than stochastic sampling that injects fresh noise into the image in each step. Given that ODEs and SDEs recover the same distributions in theory, what exactly is the role of stochasticity?

One key insight is that both the forwards and backwards SDEs are a sum of the probability flow ODE and a time-varying Langevin diffusion SDE, through which the cited reference explains why ironically injecting noise in the reverse denoising process is helpful.

The Langevin term can further be seen as a combination of a deterministic score-based denoising term and a stochastic noise injection term, whose net noise level contributions cancel out... This perspective reveals why stochasticity is helpful in practice: The implicit Langevin diffusion drives the sample towards the desired marginal distribution at a given time, actively correcting for any errors made in earlier sampling steps.

In summary the stochastic nature of SDEs and DDPMs allows for continuous correction of errors during the generation process. In probability flow ODEs, once an error is made, it can propagate through subsequent steps potentially leading to lower quality results.

Finally in the context of normalizing flows, an ODE-based trajectory can indeed be seen as a bijective mapping from the data distribution to a (multivariate) Gaussian distribution (or vice versa) due to the invertibility of the continuous flow defined by the ODE and the fact that all intermediate latent variables $\mathbf{x_t}$ share the same dimension as the input $\mathbf{x_0}$. And in the same context, when we transform a complex data distribution into a multivariate Gaussian distribution, we often assume the target Gaussian distribution has independent dimensions with a diagonal covariance matrix for model simplicity and training tractability, and the series of invertible transformations applied by the normalizing flow can capture complex dependencies in the original data distribution. By contrast, ICA typically assumes a linear mixture of non-Gaussian components in the source signal and is designed for linear transformations, thus it's more limited in applicable scope.

  • $\begingroup$ Thanks a lot @cinch for your reply. so you confirm the validity of the assumptions that such a mapping would enable us to find a disentangled representation of any data point sampled from the source distribution. I.e there is no dependence between the elements of the representation in the mapped representation. $\endgroup$
    – saleh
    Commented Jul 15 at 9:19
  • $\begingroup$ You have multiple questions here and please note SE question should focus on one single question. I've answered your question 3 in my last section about the diagonal covariance assumption for $\mathbf{x}(T)$ in DDPM, which is typical for most hierarchical Bayesian models with continuous input features (DDPM could be viewed as a special genre of hierarchical VAEs). However, unlike normalizing flows, due to the stochastic nature of diffusion process and forward sampling for training and score function error, the actual $\mathbf{x}(T)$ represented by samplings won't be exactly disentangled. $\endgroup$
    – cinch
    Commented Jul 16 at 6:03
  • $\begingroup$ The data sample gradually loses its distinguishable features as the step $t$ becomes larger, even in theory only when $T$ approaches infinity $\mathbf{x}(T)$ is equivalent to an isotropic disentangled Gaussian distribution at the end of the forward diffusion process. $\endgroup$
    – cinch
    Commented Jul 16 at 22:34
  • $\begingroup$ Thanks for your reply. I have a follow up question which I will ask as new question. $\endgroup$
    – saleh
    Commented Jul 17 at 7:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .