Skip to main content
QUICK REVIEW

[논문 리뷰] Transfusion: Predict the Next Token and Diffuse Images with One Multi-Modal Model

Chunting Zhou, Lili Yu|arXiv (Cornell University)|2024. 08. 20.
Brain Tumor Detection and Classification인용 수 6
한 줄 요약

Transfusion은 텍스트(이산)와 이미지(연속) 데이터를 모두 처리하도록 단일 트랜스포머를 학습시키며, 텍스트의 다음 토큰 예측과 이미지의 확산을 공동 최적화함으로써 이산화된 이미지 기준선에 비해 강력한 다중 모달 확장성 및 효율성을 달성한다.

ABSTRACT

We introduce Transfusion, a recipe for training a multi-modal model over discrete and continuous data. Transfusion combines the language modeling loss function (next token prediction) with diffusion to train a single transformer over mixed-modality sequences. We pretrain multiple Transfusion models up to 7B parameters from scratch on a mixture of text and image data, establishing scaling laws with respect to a variety of uni- and cross-modal benchmarks. Our experiments show that Transfusion scales significantly better than quantizing images and training a language model over discrete image tokens. By introducing modality-specific encoding and decoding layers, we can further improve the performance of Transfusion models, and even compress each image to just 16 patches. We further demonstrate that scaling our Transfusion recipe to 7B parameters and 2T multi-modal tokens produces a model that can generate images and text on a par with similar scale diffusion models and language models, reaping the benefits of both worlds.

연구 동기 및 목표

  • 정보 손실 없이 이산(텍스트)과 연속(이미지) 모달리티를 모두 처리하고 생성할 수 있는 통합 모델의 필요성을 제시한다.
  • 하나의 트랜스포머에서 언어 모델링 손실과 확산 손실을 결합하는 것이 이미지를 이산화하는 것보다 스케일링에 더 유리하다는 것을 보여준다.
  • 모달리티 특화 인코딩/디코딩 계층과 패치를 통한 이미지 압축이 성능과 효율성을 향상시킬 수 있음을 보여준다.
  • 다중 모달 성능을 주도하는 핵심 구성요소를 식별하기 위한 확장 법칙과 제거 실험을 제공한다.]
  • method:[
  • 텍스트를 이산 토큰으로, 이미지를 VAE의 잠재 패치로 표현한다.
  • 하나의 트랜스포머를 두 가지 손실로 학습시키며, 텍스트에 대한 LM 손실과 이미지 패치에 대한 DDPM 확산 손실의 두 가지 손실을 가지는 형식으로 L.Transfusion = L_LM + λ·L_DDPM를 사용한다.
  • 모달리티 특화 임베딩/디코딩 계층을 사용하며, 이미지에는 선형 인코더/디코더 또는 U-Net 블록 중 하나를 사용한다.
  • 시퀀스 전체에 걸친 인과적 어텐션을 적용하고, 패치 간의 패치-대-패치 커뮤니케이션을 가능하게 하기 위해 이미지 내에서 양방향 주의(intra-image bidirectional attention)를 사용한다.
  • 추론 시 BOI/EOI 토큰을 만났을 때 텍스트 생성을 (LM 모드)와 이미지 확산을 (확산 모드) 간 전환한다.

제안 방법

  • Represent text as discrete tokens and images as latent patches from a VAE.
  • Train a single Transformer with two losses: LM loss for text and DDPM diffusion loss for image patches, combined as L.Transfusion = L_LM + λ·L_DDPM.
  • Use modality-specific embedding/decoding layers, with either a linear encoder/decoder or U-Net blocks for images.
  • Apply causal attention across the sequence with intra-image bidirectional attention among patches to enable patch-to-patch communication.
  • During inference, switch between text generation (LM mode) and image diffusion (diffusion mode) when BOI/EOI tokens are encountered.
Figure 1 : A high-level illustration of Transfusion. A single transformer perceives, processes, and produces data of every modality. Discrete (text) tokens are processed autoregressively and trained on the next token prediction objective. Continuous (image) vectors are processed together in parallel
Figure 1 : A high-level illustration of Transfusion. A single transformer perceives, processes, and produces data of every modality. Discrete (text) tokens are processed autoregressively and trained on the next token prediction objective. Continuous (image) vectors are processed together in parallel

실험 결과

연구 질문

  • RQ1하나의 트랜스포머가 이미지의 이산 양자화 없이 텍스트와 이미지를 모두 모델링하고 생성하는 것을 학습할 수 있는가?
  • RQ2통합 다중 모달 모델에서 LM와 확산 목표가 어떻게 상호작용하며, 모델 크기에 따른 확장성은 어떠한가?
  • RQ3패치 인코딩, 이미지 내 주의, 이미지 노이징 등 어떤 아키텍처 선택이 다중 모달 성능에 가장 큰 영향을 미치는가?
  • RQ4Transfusion이 Chameleon 스타일의 이산화 기준선과 비교하여 텍스트와 이미지 작업에서의 효율성과 품질 측면에서 어떤 차이가 있는가?

주요 결과

모델C4 PPLWiki PPLLlama 평가 정확도MS-COCO CIDErMS-COCO FIDCLIP
Transfusion (7B)7.724.2861.527.216.825.5
Chameleon (7B)8.414.6959.118.029.624.3
  • Transfusion은 텍스트 전용 및 이미지 관련 작업 모두에서 Chameleon보다 데이터 및 계산이 비슷한 조건에서 스케일링이 더 잘 된다.
  • 텍스트-이미지 생성에서, Transfusion은 FLOPs를 제어했을 때 약 1/3의 계산으로 Chameleon과 동등한 성능을 달성하고 FID는 대략 2× 낮다.
  • 이미지-대-텍스트 및 텍스트-대-텍스트 작업에서 Transfusion은 강력한 결과를 얻고 크게 줄어든 FLOPs로 기준선의 성능에 다가가거나 일치할 수 있다(예: 텍스트-대-텍스트의 FLOPs는 21.8%).
  • 제거 실험은 이미지 내 양방향 주의가 유익하고, 이미지 인코딩/디코딩을 위한 U-Net 하강/상승 블록이 더 큰 이미지 패치 압축을 가능하게 하되 약간의 손실을 유발한다는 것을 보여준다.
  • 7B 매개변수 및 2T 다중 모달 토큰으로 확장하면, 유사 규모의 현대 확산 및 언어 모델과 견줄 만한 이미지 및 텍스트 생성 능력을 얻는다.
Figure 3 : We convert images to and from latent representations using a pretrained VAE, and then into patch representations with either a simple linear layer or U-Net down blocks.
Figure 3 : We convert images to and from latent representations using a pretrained VAE, and then into patch representations with either a simple linear layer or U-Net down blocks.

더 나은 연구,지금 바로 시작하세요

연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.