텍스트-이미지 확산 모델에서 교차 주의력은 추론 과정을 번거롭게 만든다
Cross-Attention Makes Inference Cumbersome in Text-to-Image Diffusion Models
April 3, 2024
저자: Wentian Zhang, Haozhe Liu, Jinheng Xie, Francesco Faccio, Mike Zheng Shou, Jürgen Schmidhuber
cs.AI
초록
본 연구는 텍스트 조건부 확산 모델에서 추론 과정 중 교차 주의(cross-attention)의 역할을 탐구합니다. 우리는 교차 주의 출력이 몇 번의 추론 단계 후에 고정점으로 수렴한다는 것을 발견했습니다. 이에 따라, 수렴 시점은 전체 추론 과정을 자연스럽게 두 단계로 나눕니다: 첫 번째는 초기 의미 계획 단계로, 모델이 교차 주의를 활용하여 텍스트 지향적인 시각적 의미를 계획하고, 두 번째는 충실도 향상 단계로, 모델이 이전에 계획된 의미로부터 이미지를 생성하려고 시도합니다. 흥미롭게도, 충실도 향상 단계에서 텍스트 조건을 무시하는 것은 계산 복잡성을 줄일 뿐만 아니라 모델 성능도 유지합니다. 이는 TGATE라는 간단하고 학습이 필요 없는 효율적 생성 방법을 제안하며, 이 방법은 교차 주의 출력이 수렴하면 이를 캐시하고 나머지 추론 단계 동안 고정된 상태로 유지합니다. MS-COCO 검증 세트에 대한 실험 연구는 이 방법의 효과를 확인합니다. TGATE의 소스 코드는 https://github.com/HaozheLiu-ST/T-GATE에서 확인할 수 있습니다.
English
This study explores the role of cross-attention during inference in
text-conditional diffusion models. We find that cross-attention outputs
converge to a fixed point after few inference steps. Accordingly, the time
point of convergence naturally divides the entire inference process into two
stages: an initial semantics-planning stage, during which, the model relies on
cross-attention to plan text-oriented visual semantics, and a subsequent
fidelity-improving stage, during which the model tries to generate images from
previously planned semantics. Surprisingly, ignoring text conditions in the
fidelity-improving stage not only reduces computation complexity, but also
maintains model performance. This yields a simple and training-free method
called TGATE for efficient generation, which caches the cross-attention output
once it converges and keeps it fixed during the remaining inference steps. Our
empirical study on the MS-COCO validation set confirms its effectiveness. The
source code of TGATE is available at https://github.com/HaozheLiu-ST/T-GATE.Summary
AI-Generated Summary