AI바라기의 인공지능

TFG: Unified Training-Free Guidance for Diffusion Models 본문

카테고리 없음

TFG: Unified Training-Free Guidance for Diffusion Models

AI바라기 2024. 11. 28. 15:09

Abstract

주어진 unconditional diffusion model과 target property에 대한 predictor (e.g., classifier)를 가지고, training-free guidance의 목표는 추가적인 training 없이 desirable target property를 가진 sample을 생성하는 것입니다. 기존의 방법들은 다양한 개별적인 application에서 효과적이지만, theoretical grounding과 광범위한 benchmark에 대한 엄격한 테스트가 부족한 경우가 많습니다. 결과적으로, 간단한 task에서도 실패할 수 있으며, 새로운 문제에 적용하는 것이 불가피하게 어려워집니다. 본 논문에서는 기존 방법들을 special case로 포괄하는 새로운 algorithmic framework을 도입하여 training-free guidance 연구를 algorithm-agnostic design space 분석으로 통합합니다. theoretical 및 empirical 연구를 통해 모든 downstream task에 쉽게 적용할 수 있는 효율적이고 효과적인 hyper-parameter searching strategy를 제안합니다. 40개의 target을 가진 16개의 task에 대해 7개의 diffusion model을 체계적으로 benchmark하여 평균적으로 performance를 8.5% 향상시킵니다. 본 framework과 benchmark는 training-free 방식으로 conditional generation을 위한 solid foundation을 제공합니다.

 

 

Training-Free Guidance 정리 노트

목표:

  • Unconditional diffusion model과 target property predictor (예: classifier)를 사용하여 추가적인 학습 없이 원하는 target property를 가진 샘플을 생성하는 것
  • 즉, 기존 모델을 활용하여 새로운 task에 맞는 샘플을 생성할 수 있도록 하는 것

기존 방법의 문제점:

  • 이론적 근거 부족
  • 광범위한 benchmark에서 엄격한 테스트 부족
  • 간단한 task에서 실패 가능성
  • 새로운 문제 적용의 어려움

본 논문의 제안:

  • 기존 방법들을 special case로 포함하는 새로운 알고리즘 framework 제시
  • Algorithm-agnostic design space 분석을 통한 training-free guidance 연구 통합
  • 모든 downstream task에 적용 가능한 효율적인 hyper-parameter searching strategy 제안

결과:

  • 7개의 diffusion model, 16개의 task, 40개의 target에 대한 benchmark 실시
  • 평균 8.5%의 성능 향상 달성

의의:

  • Training-free 방식의 conditional generation을 위한 solid foundation 제공

 

1 Introduction

 

최근 generative model, 특히 diffusion model의 발전은 vision, small molecules, proteins, audio, 3D objects 등 다양한 분야에서 놀라운 효과를 보여주었습니다. Diffusion model은 denoising learning objective를 통해 데이터 분포의 log density gradient (i.e., Stein score)를 추정하고, iterative denoising process를 통해 새로운 샘플을 생성할 수 있습니다. 수십억 개의 데이터까지 확장 가능한 impressive scalability를 통해 미래의 diffusion model은 광범위한 application에서 foundational generative model 역할을 할 잠재력이 있습니다. 결과적으로, 이러한 모델을 기반으로 하는 conditional generation, 즉 label, attribute, energies, spatial-temporal information과 같은 사용자 정의 기준을 충족하도록 output을 조정하는 문제가 점점 더 중요해지고 있습니다.

Classifier-based guidance 및 classifier-free guidance와 같은 Conditional generation method는 일반적으로 각 conditioning signal (예: noise-conditional classifier 또는 text-conditional denoiser)에 대해 specialized model을 training해야 합니다. 이러한 resource-intensive 및 time-consuming process는 적용 가능성을 크게 제한합니다. 반대로 training-free guidance는 추가적인 training 없이 off-the-shelf differentiable target predictor를 통해 지정된 특정 target과 align되는 샘플을 생성하는 것을 목표로 합니다. 여기서 target predictor는 생성된 샘플의 quality를 평가하는 데 사용되는 classifier, loss function, probability function 또는 energy function이 될 수 있습니다.

Classifier-based guidance에서 noise-conditional classifier는 clean sample과 noisy sample 모두에서 target property를 예측하도록 특별히 학습되므로, diffusion process에 guidance를 통합하는 것은 classifier의 gradient가 unbiased driving term이기 때문에 간단합니다. 그러나 training-free guidance는 근본적으로 더 어렵습니다. 주요 challenge는 clean sample에서만 학습된 target predictor를 활용하여 noisy sample에 대한 guidance를 제공하는 데 있습니다. 다양한 접근 방식이 제안되었지만, 일부 개별 task에 효과적이지만 theoretical grounding과 comprehensive benchmark는 여전히 부족합니다. 실제로 기존 method는 CIFAR10 (Figure 1)과 같은 간단한 dataset에서도 label guidance에 대한 만족스러운 샘플을 생성하지 못합니다. 또한 이러한 method 간의 quantitative comparison이 부족하여 실무자가 새로운 application scenario에 적합한 알고리즘을 식별하기 어렵습니다.

본 논문에서는 Training Free Guidance (TFG)라는 새롭고 일반적인 algorithmic framework을 제안합니다 (및 명명). 기존 접근 방식은 unified space에서 특정 hyper-parameter subspace에 해당하므로 TFG의 special case임을 보여줍니다. 즉, TFG는 training-free guidance 연구와 기존 method 간의 비교를 unified design space에서 hyper-parameter 선택 분석으로 자연스럽게 단순화하고 줄입니다. framework 내에서 각 hyper-parameter의 기본 theoretical motivation을 분석하고 comprehensive experiment를 수행하여 영향을 식별합니다. 체계적인 연구는 training-free guidance 이면의 principle에 대한 새로운 insight를 제공하여 문제에 대한 transparent하고 효율적인 survey를 가능하게 합니다. framework를 기반으로 general downstream task에 대한 hyper-parameter searching strategy를 제안합니다. 16개의 task (image에서 molecule까지)와 40개의 target에 대해 TFG와 기존 알고리즘을 포괄적으로 benchmark합니다. TFG는 모든 dataset에서 뛰어난 성능을 달성하여 기존 method보다 평균 8.5% 뛰어납니다. 특히 target과 dataset의 complexity에 관계없이 다양한 scenario에서 사용자 필요 샘플을 생성하는 데 탁월합니다.

요약하자면,

(1) 기존 알고리즘을 design space로 통합하는 TFG를 제안하고,

(2) 이론적으로 그리고 경험적으로 space를 분석하여 general problem에 대한 효과적인 space-searching strategy를 제안하고,

(3) 수많은 qualitatively different task에서 모든 method를 benchmark하여 TFG의 우수성과 training-free conditional generation 알고리즘에 대한 미래 연구 guideline을 제시합니다. 이러한 발전은 TFG의 효능을 보여주고 미래의 training-free conditional generation 알고리즘 연구를 위한 robust하고 comprehensive benchmark를 구축합니다.

 

 

(a) 제안된 TFG의 통합 검색 공간: 높이(색상)는 성능을 나타냅니다. 기존 알고리즘은 하위 다양체를 따라 검색하는 반면 TFG는 확장된 검색 공간 덕분에 향상된 안내를 제공합니다.

(b) CIFAR10에서 레이블 안내 작업에 대한 다양한 방법의 레이블 정확도(높을수록 좋음) 및 프레셰 시작 거리(FID, 낮을수록 좋음), 10개 레이블에 대한 평균: Ours(TFG-4)는 학습 기반 방법에 훨씬 더 가깝게 수행됩니다.

(c~h) 비전, 오디오 및 기하학 도메인의 다양한 작업에서 TFG가 생성한 샘플.

 
 
 
 

 

 

Generative Model과 Training-Free Guidance 정리 노트

최근 동향:

  • Diffusion model이 generative model 분야에서 엄청난 발전을 이루고 있음.
    • 이미지, 분자, 단백질, 오디오, 3D 객체 등 다양한 분야에 적용 중.
    • Denoising learning objective를 통해 데이터 분포를 학습하고 새로운 샘플 생성.
    • 엄청난 양의 데이터 학습 가능 (impressive scalability).
    • 미래에는 다양한 분야의 기본 generative model이 될 잠재력이 있음.

Conditional Generation의 중요성:

  • 사용자가 원하는 조건 (label, attribute, energy 등)에 맞는 샘플을 생성하는 conditional generation 기술이 중요해지고 있음.

기존 Conditional Generation 방법의 한계:

  • Classifier-based guidance, Classifier-free guidance: 각 조건에 맞는 specialized model (classifier, denoiser)을 학습해야 함.
    • 많은 자원과 시간 소모 (resource-intensive & time-consuming).
    • 적용 가능성이 제한적.

Training-Free Guidance의 등장:

  • 추가 학습 없이 기존 모델과 target predictor를 활용하여 원하는 샘플 생성.
  • Target predictor: 생성된 샘플의 quality를 평가하는 도구 (classifier, loss function 등).

Training-Free Guidance의 어려움:

  • Clean sample로 학습된 target predictor를 noisy sample에 적용해야 함.
  • 기존 연구들은 이론적 근거와 comprehensive benchmark가 부족.
  • 간단한 dataset에서도 제대로 작동하지 못하는 경우 발생.
  • 새로운 task에 적합한 알고리즘 선택 어려움.

본 논문의 제안 (Training-Free Guidance - TFG):

  • 새롭고 일반적인 training-free guidance framework 제시.
  • 기존 방법들을 special case로 통합 (unified design space).
  • Hyper-parameter 분석을 통해 효율적인 알고리즘 탐색 가능.
  • 다양한 task에서 뛰어난 성능 입증.

기대 효과:

  • Training-free conditional generation 연구의 발전에 기여.
  • 효율적이고 강력한 샘플 생성 기술 제공.

 

 

 

2 Background

Generative diffusion model. Generative diffusion model은 continuous sample space X에서 unconditional distribution p0(x) 를 sampling하는 데 사용할 수 있는 neural network입니다. 예를 들어, X는 d × d image의 RGB color를 나타내는 [-1, 1]d×d×3 이거나, d개의 atom을 가진 molecule의 3D 좌표를 나타내는 Rd3d 일 수 있습니다. p0(x) 에서 sampling된 data x0 와 time step t ∈ [T] ≜ {1, · · · , T}, 그리고 noise level을 제어하는 데 사용되는 pre-defined monotonically decreasing parameter set {α¯t}Tt=1 이 주어지면, corresponding noisy datapoint는 xt = √α¯tx0 + √1 − α¯tϵ (ϵ ∼ N(0, I)) 로 구성됩니다. t>1 에 대해 αt = ¯αt/α¯t−1 그리고 α1 = ¯α1 로 정의합니다. θ 로 parameterize된 diffusion model ϵθ : X × [T] 7→ X 는 p.d.f pt(xt) = R x0 p0(x0)pt|0(xt|x0)dx02 를 사용하여 xt 에 추가된 noise ϵ 을 예측하도록 학습됩니다.

이론적으로 이는 pt(x) 의 score를 학습하는 것에 해당합니다. 즉,

arg min_{ϵθ} Σ_{t=1}^{T} E_{x0∼p0(x0),ϵ∼N(0,I)}∥ϵθ(xt, t) − ϵ∥ = −√(1 − α¯t)∇ log pt 

Sampling을 위해 xT ∼ N (0, I) 에서 시작하여 점진적으로 xt−1 ∼ pt−1|t(xt−1|xt) 를 sampling합니다. 이 conditional probability는 직접 계산할 수 없으며, 실제로 DDIM은 다음을 통해 xt−1 을 sampling합니다.

xt−1 = √α¯t−1x0|t + √(1 − α¯t−1 − σ^2_t) * (xt − √α¯tx0|t)/√(1 − α¯t) + σtϵ

여기서 {σt}Tt=1 는 DDIM parameter이고, ϵ ∼ N (0, I) 이며,

x0|t = m(xt) ≜ (xt − √(1 − α¯t)ϵθ(xt, t))/√α¯t

는 xt 가 주어졌을 때 예측된 sample입니다. Tweedie's formula에 따르면, x0|t 는 위의 수식에서 ϵθ 의 perfect optimization 하에서 conditional expectation E[x0|xt] 와 같습니다. 위의 sampling process는 특정 가정 하에서 x0 ∼ p(x) 를 생성한다는 것이 이론적으로 확립되었습니다.

 

 

Target predictor.

사용자 필요 target c에 대해, sample x가 target과 얼마나 잘 align되는지 (높을수록 좋음) 나타내기 위해 predictor 를 사용합니다. 여기서 는 label c에 대한 conditional probability [62, 14], pre-defined energy function 에 대한 Boltzmann distribution [31, 63, 38], 두 feature의 similarity [47], 또는 이들의 combination이 될 수 있습니다. 목표는 conditional distribution

p_0(x|c) \triangleq \frac{p_0(x) f_c(x)}{\int_{\tilde{x}} p_0(\tilde{x}) f_c(\tilde{x}) d\tilde{x}} 

에서 sampling하는 것입니다. (4)

Training-based guidance for diffusion models.

[66]은 에 맞도록 time-dependent classifier를 학습할 것을 제안합니다. 이는 noisy sample에 대한 predictor로 간주될 수 있습니다.

\nabla_{x_t} \log p_t(x_t | c) = \nabla_{x_t} \log \int_{x_0} p_{t|0}(x_t | x_0) p_0(x_0 | c) dx_0 
= \nabla_{x_t} \log \int_{x_0} p_t(x_t) p_{0|t}(x_0 | x_t) f_c(x_0) dx_0
= \nabla_{x_t} \log p_t(x_t) + \nabla_{x_t} \log f_c(x_t, t)

이므로 (5), 학습된 classifier를 (이는 암시적으로 c와 model parameter에 의존) 로 나타내면, sampling 시 Equation (3)에서

로 바꿔 unbiased sample 를 얻을 수 있습니다. 반면에 [23]은 classifier-free diffusion guidance approach를 제안합니다. Time-dependent predictor f를 학습하는 대신, condition c를 diffusion model에 로 직접 encode하고 sample-condition pair를 사용하여 이 condition-aware diffusion model을 학습시킵니다. 두 방법 모두 training resource를 사용할 수 있는 경우 효과적인 것으로 입증되었습니다.

본 논문은 대조적으로 training-free 방식의 conditional generation에 중점을 둡니다. diffusion model 와 off-the-shelf target predictor (아래에서 subscript c는 생략) 가 주어지면, 추가적인 training 없이 에서 sample을 생성하는 것을 목표로 합니다. 를 정확하게 estimate할 수 있는 training-based method와 달리, training-free guidance는 clean data space에 대해 정의된 를 사용하여 noisy data 를 guide해야 하기 때문에 훨씬 더 어렵습니다.