본문 바로가기
Paper Review/2D Diffusion Model

[논문 리뷰] VDM survey: Understanding diffusion models: A Unified Perspective (1)

by kongshin 2025. 3. 16.
  • Diffusion model 공부를 시작할 때, 관련 논문을 먼저 보는 것보다 해당 survey논문을 보는 것이 이해하기 편했음
  • 해당 논문은 Class conditional diffusion model까지 수식적으로 잘 정리되어 있는 논문
  • 해당 논문의 DDPM의 부분만 3가지 post로 나누어 정리할 예정
  • (1) - Intro, ELBO, VAE, HVAE

 

  • (2) - Diffusion model(VDM), Maximizing ELBO 2가지

[논문 리뷰] VDM survey: Understanding diffusion models: A Unified Perspective (2)

 

[논문 리뷰] VDM survey: Understanding diffusion models: A Unified Perspective (2)

Diffusion model 공부를 시작할 때, 관련 논문을 먼저 보는 것보다 해당 survey논문을 보는 것이 이해하기 편했음해당 논문은 Class conditional diffusion model까지 수식적으로 잘 정리되어 있는 논문해당 논

kongshin00.tistory.com

 

  • (3) - ELBO의 3가지 term - Reconstruction term, Prior matching term, Denoising matching term 의미 파악

[논문 리뷰] VDM survey: Understanding diffusion models: A Unified Perspective (3)

 

[논문 리뷰] VDM survey: Understanding diffusion models: A Unified Perspective (3)

Diffusion model 공부를 시작할 때, 관련 논문을 먼저 보는 것보다 해당 survey논문을 보는 것이 이해하기 편했음해당 논문은 Class conditional diffusion model까지 수식적으로 잘 정리되어 있는 논문해당 논

kongshin00.tistory.com

 

 

[논문]


Introduction: Generative Models

  • Generative Models: data x를 통해 p(x)를 학습하는 model
    • generate new samples & observed(sampled)된 data의 likelihood 추정 o
  • GAN - learn model in adversarial manner
  • Likelihood-based - 모든 observed data에 high likelihood를 할당하는 dist 학습
    • Autoregressive models, normalizing flows, VAEs
  • Energy-based - arbitrarily flexible energy function로 학습된 dist
  • Score-based - score of the energy-based model 학습 (Using NN)

 

Background: ELBO, VAE, and Hierarchical VAE

  • Allegory와 반대로 lower-dim latent representations을 학습
  • 강한 priors 없이 higher-dim 학습하는 것 무의미
  • lower-dim latent representations
    • 중요 정보 압축된 form으로 볼 수 o
    • 학습을 통해 관측된 data에 대한 의미있는 structure 찾을 수 o

 

ELBO

  • Likelihood-based: 모든 x의 likelihood를 maximize하는 model 학습
  • p(x)를 2가지 방법으로 manipulate

1) Using marginalize out the latent variable z

2) Using chain rule of probability

  • p(x)의 likelihood를 computing & maxmizing 어려움
    • 모든 latent variable z에 대한 적분 X or true posterior인 $p(z|x)$ 알 수 X
  • ELBO 사용(proxy obejective)

 

  • ELBO: A lower bound of the evidence // evidence = $logp(x)$

  • $q_\phi(z|x)$: A flexible approximate variational distribution with parameters $\phi$
    • latent variable model optimize ⇒ evidence = ELBO, $D_{KL} = 0$               
  • ⇒ $q_\phi(z|x)$를 $p(z|x)$에 approximate하는 $\phi$찾기 // p(z|x): true posterior
  • VAE: $\phi$ tunning → ELBO maximizing
  • ⇒ Learn true data dist → Leaning a generative model

 

  • Evidence = ELBO + KL Divergence(approximate posterior $q_\phi(z|x)$ & true posterior $p(z|x)$)
    • ELBO is indeed a lower bound (KL ≥ 0)
    • Maximize ELBO = Minimize $D_{KL}$ (Evidence는 $\phi$와 관계없는 constant(fixed)이기 때문)
      • $p(Z|X)$ 알 수 X ⇒ $D_{KL}$ directly minimize X
      $log(X)$                                                                                       
  • ⇒ Maximized ELBO = Proxy for leanring how to perfectly model the true latent posterior dist, $p(z|x)$
  • closer한 approximate posterior를 통해 observed or generated data의 likelihood 추정 o

 

Variational Autoencoders

  • Variantional: $\phi$로 parametrerized된 여러 potential posterior dist의 family 중 best $q_{\phi}(z|x)$ optimize
  • Autoencoder: intermediate bottlenecking representation step(z)를 거쳐 itself 학습 구조
    • Encoder: intermediate bottlenecking dist $q_{\phi}(z|x)$ 학습
    • Decoder: z→x convert하는 $p_{\theta}(x|z)$ 학습
    • ⇒ Simultaneously!

  • ELBO maximize ⇒ first term maximize & second term minimize
    • Reconstruction term: $q_{\phi}(z|x)$ 로부터 decoder의 reconstruction likelihood
      • maximize ⇒ original data로 재생성할 수 있는 effective latent variables modeling가능
    • Prior matching term: z의 prior belief와 $q_{\phi}(z|x)$ 의 dist 차이
      • minimize ⇒ encoder에서 $q_{\phi}(z|x)$ 가 Dirac delta ft에 collapse되지 않고 dist를 학습 o
        • first term에서 $p_{\theta}(x|z)$가 각각의 $q_{\phi}(z|x_i)$로부터 학습할 때, $x_i$에 집중된 형태의 분포를 배우게 됨 ⇒ $p_{\theta}(x|z)$는 Dirac delta dist를 따라가는 경향 발생
        • 부적절한 z를 학습했지만 first term $\infty$ ⇒ second term 또한 $\infty$가 되어 ELBO maximize X ⇒ collapse 방지 효과
        • Dirac delta ft - bayesian에서 posterior를 point estimation함수로 하고 싶을 때 많이 사용  
        •  

 

 

  • VAE - optimize the ELBO jointly over $\phi$ and $\theta$
    • Commonly encoder - multivariate Gaussian & Often prior - standard multivariate Gaussian'
    • How to optimize ELBO
    1. Monte Carlo estimate: $z^{l}$ - stochastic sampling procedure ⇒ non-differentiable, Expectation form
    2. Reparameterization trick: random variable → deterministic function of a noise variable
      •   z → input x의 deterministic ft와 auxiliary noise variable $\epsilon$
      •   기존 z를 바로 gradient descent 불가능 ⇒ tric을 통해 $\mu_{\phi}(x)$, $\sigma_{\phi}(x)$ gradient descent 가능
      •   element-wise product
      •   Reparameterization trick 

[개념 설명] Reparameterization Trick

 

[개념 설명] Reparameterization Trick

Diffusion model에서 사용되는 Reparameterization trick에 대해 수식적으로 알아볼 예정Reparameterization trick: deterministic한 부분으로 backpropagation을 하기 위해 사용되는 방법출처 : https://gaussian37.github.io/dl-conce

kongshin00.tistory.com

 

 

 

After training VAE

  • p(z)에서 z를 directly sampling 후 decoder에 input // prior z가 아님
  • input x보다 z의 dimensionality가 작을수록 interesting ⇒ learning compact, useful representations
  • latent vectors를 edit하여 decoder 통과 ⇒ more precisely control the data generated

 

Hierarchical Variational Autoencoders

  • HVAE: generalization of a VAE that extends to multiple hierarchies over latent variables
    • = Recursive VAE
    • latent variables ⇒ generated from other higher-level, more abstract latents
  • General HVAE with T - each latent가 all previous latents에 condition

 

  • MHVAE: Markovian HVAE - Markov chain를 generative process로 사용
    • Markov property: each latent $z_t$ 오로지 이전 latent $z_{t+1}$에 condition
    • $P(X_{t+1} | X_t, X_{t-1}, X_{t-2}, … ) = P(X_{t+1} | X_T)$
    • $P(X_1, X_2, … , X_n) = P(X_1)P(X_2|X_1)P(X_3|X_2)….$$P(X_n|X_{n-1})$
  • $X, Z_{1:T}$의 joint distribution → like back process                       
  • MHVAE의 posterior → like forward process                                     
  • ELBO(extended)                                                                                                             
  • ELBO에 joint distribution & posterior 대입

  • ⇒ Variational Diffusion Model에서 추가적인 decomposition 후 interpretable components 예정