생성모델은 GAN, VAE, Flow-based Model등이 있습니다. 하지만 각각은 장단점이 있습니다.
이 맥락에서 Diffusion model은 non-equilibrium thermodynamic(비평형 열역학)에서 영감을 받은 모델로써, 데이터에 무작위 잡음(random noise, ex: gaussian noise)을 천천히 추가하는 Markov chain diffusion step을 정의하고, noise로부터 원하는 데이터 sample을 generation하기 위해 reverse diffusion steps(process)을 학습합니다. VAE나 Flow-based model과 달리, diffusion model은 고정된 process로 학습되며, latent variable은 원본 데이터와 동일한 high-dimensionality을 가집니다.

Figure 1. Overview of different types of generative models.
최근까지도 여러가지 diffusion-based generative model이 제안되었으며, 이 모델이 만들어지기까지 여러 concept의 모델들이 먼저 공개되었습니다. 여기에는 diffusion probabilistic model(Sohl-Dickstein et al., 2015), noise-conditioned score network(NCSN; Yang & Ermon, 2019), denoising diffusion probabilistic models(DDPM; Ho et al. 2020)이 포함됩니다.
Real data distribution에서 샘플링된 data point($\mathbf{x}_0 \sim q(\mathbf{x})$)을 원본 상태에서 $T$ steps 동안 sample에 small amount of Gaussian noise를 추가하는 과정을 forward diffusion process라고 정의했습니다. 이는 noise가 추가된 일련의 샘플들 $\mathbf{x}_1, \dots, \mathbf{x}T$을 생성합니다. 각 단계의 size(step size)은 variance schedule $\{\beta_t \in (0, 1)\}{t=1}^T$에 의해 제어됩니다.
$$ q(\mathbf{x}t \vert \mathbf{x}{t-1}) = \mathcal{N}(\mathbf{x}t; \sqrt{1 - \beta_t} \mathbf{x}{t-1}, \beta_t\mathbf{I}) \\ p(\mathbf{x}_{1:T} \vert \mathbf{x}0) = \prod^T{t=1} q(\mathbf{x}t \vert \mathbf{x}{t-1}) $$
데이터 샘플 $\mathbf{x}_0$는 단계 $t$가 커질수록 그 구별 가능한 특성(distinguishable features)을 점차 잃어버리게 되고, 결국 $T \rightarrow \infty$일 때, $\mathbf{x}_T$는 등방성 가우시안 분포(isotropic Gaussian distribution)와 동일하게 됩니다.

Figure 2. Noise를 천천히 더하거나 제거하면서 image를 생성하고 있는 Markov chain diffusion process를 도식화한 그림입니다.
위 과정의 좋은 특성 중 하나는 reparametrization trick을 사용하여 임의의 시간 $t$에서 $\mathbf{x}_t$를 닫힌 형식(closed form)으로 샘플링할 수 있다는 것입니다. $\alpha_t = 1 - \beta_t$ 그리고 $\bar{\alpha}t = \prod{i=1}^t \alpha_i$라고 하겠습니다.
$$ \mathbf{x}_t = \sqrt{\bar{\alpha}_t} \mathbf{x}_0 + \sqrt{1 - \bar{\alpha}_t} \epsilon $$
여기서 $\epsilon$은 $\epsilon \sim \mathcal N(0, \bf{I})$입니다.
이렇게 forward step을 정의하게 되면, 여러 step의 Forward process를 한 번에 병합해서 계산할 수 있됩니다. 즉, $\mathbf{x}_t$를 한 번에 구할 수 있게 됩니다.