AI바라기의 인공지능
Attention : 논문리뷰 : ConceptAttention: Diffusion Transformers Learn Highly Interpretable Features 본문
Attention : 논문리뷰 : ConceptAttention: Diffusion Transformers Learn Highly Interpretable Features
AI바라기 2025. 3. 6. 18:28Overall Summary
ConceptAttention은 multi-modal DiTs의 interpretability를 향상시키는 새로운 method. DiT attention layers를 repurpose하여 high-quality saliency maps를 생성하고, zero-shot segmentation benchmarks에서 state-of-the-art performance를 달성. DiT representations의 transferability를 입증하고, generative AI systems의 transparency, controllability, and trust를 증진하는 데 기여.
쉬운 설명: ConceptAttention은 마치 "숨은 그림 찾기"와 같습니다. Diffusion Transformer라는 그림 생성 모델에게 "고양이를 찾아줘!"라고 말하면, ConceptAttention은 그림 속에서 고양이가 있는 부분을 밝게 표시해주는 "형광펜" 역할을 합니다. 이 형광펜은 모델이 그림을 어떻게 "이해"하는지 보여주기 때문에, 모델의 속마음을 들여다보는 것과 같습니다.
ConceptAttention: Diffusion Transformers Learn Highly Interpretable Features 학습 노트
Purpose of the Paper
- 기존 연구의 한계: UNet-based diffusion models에 대한 interpretability 연구는 활발했지만, 최근 state-of-the-art image generation architecture로 부상한 multi-modal Diffusion Transformers (DiTs)에 대한 interpretability 연구는 부족했음.
- 새로운 접근 방식 제시: DiTs의 attention layers를 활용하여 image 내 textual concepts의 위치를 정확하게 나타내는 high-quality saliency maps를 생성하는 새로운 method인 ConceptAttention을 제안.
- 'Why': DiT-based models의 interpretability, transparency, and safety를 개선하고, generative AI systems의 controllability와 trust를 증진하기 위함.
Key Contributions
- ConceptAttention: DiT attention layers의 parameters를 repurpose하여 additional training 없이 image 내 arbitrary textual concepts의 presence를 나타내는 highly interpretable saliency maps 생성.
- Novelty: DiT attention layers의 output vectors가 cross attentions보다 더 high-quality saliency maps를 생성한다는 새로운 발견.
- Concept Embeddings: DiT attention layers를 활용, 다양한 concepts에 해당하는 rich textual embeddings set을 생성.
- Novelty: Multi-modal DiT architectures에서만 가능한, linear projections between concept embeddings and image patch representations in the attention output space를 이용, 고품질 saliency maps 생성.
- State-of-the-art Zero-shot Segmentation: ImageNet Segmentation and Pascal VOC benchmarks에서 state-of-the-art performance 달성.
- Novelty: CLIP, DINO, and UNet-based diffusion models 등 다양한 foundation models 기반의 zero-shot interpretability methods보다 우수한 성능. DiT representations의 transferability 입증.
Experimental Highlights
- Datasets: ImageNet-Segmentation, PascalVOC (single class and multi-class splits).
- Metrics: Accuracy (Acc), mean Intersection over Union (mIoU), mean Average Precision (mAP).
- Baselines:
- CLIP-based: GradCAM, Layerwise-Relevance Propagation (LRP), Partial-LRP, Rollout, ViT Attention, TextSpan, TransInterp.
- DINO-based: DINO Attention.
- UNet-based diffusion models: DAAM (with SDXL and SD2).
- Flux-based: Flux Cross Attention.
- Key Results:
- ConceptAttention이 모든 baselines을 significantly outperform (Table 1).
- DiT attention layers의 output space가 cross attentions보다 더 transferable representations를 생성 (Table 2).
- Cross attention과 self attention을 모두 활용하는 것이 가장 좋은 성능을 보임 (Table 3).
- PascalVOC multi-class split에서도 ConceptAttention이 가장 우수한 성능 (Table 4).
- Later MMATTN layers일수록, 그리고 combining all layers할수록 zero-shot segmentation performance 향상 (Figure 6).
- Middle diffusion timesteps에서 가장 좋은 성능 (Figure 7).
Limitations and Future Work
- Limitations:
- ConceptAttention은 multi-modal DiT models에 specific. UNet-based models에는 적용 불가.
- Future Work:
- ConceptAttention을 image editing과 같은 downstream tasks에 적용하여 interpretability와 controllability를 개선하는 연구.
- Concept embeddings을 활용해서 다양한 task를 연구
Abstract
Multi-modal diffusion transformers (DiTs)의 풍부한 representations은 interpretability를 향상시키는 고유한 특성을 나타내는가? 우리는 CONCEPTATTENTION을 소개한다. 이것은 DiT attention layers의 표현력을 활용하여 이미지 내에서 textual concepts의 위치를 정확하게 찾아내는 고품질 saliency maps을 생성하는 새로운 방법이다.
추가적인 training 없이, CONCEPTATTENTION은 DiT attention layers의 parameters를 재사용하여 고도로 문맥화된 concept embeddings를 생성한다. DiT attention layers의 output 공간에서 linear projections를 수행하면 일반적으로 사용되는 cross-attention 메커니즘에 비해 훨씬 더 선명한 saliency maps을 얻을 수 있다는 주요 발견에 기여한다.
특히, CONCEPTATTENTION은 zero-shot image segmentation 벤치마크에서 state-of-the-art 성능을 달성하며, ImageNet-Segmentation dataset과 PascalVOC의 single-class subset에서 11개의 다른 zero-shot interpretability 방법보다 우수한 성능을 보였다.
우리의 연구는 Flux와 같은 multi-modal DiT models의 representations이 segmentation과 같은 vision tasks에 매우 잘 transfer될 수 있으며, 심지어 CLIP과 같은 multi-modal foundation models보다도 우수한 성능을 보인다는 최초의 증거를 제공한다.

CONCEPTATTENTION은 이미지 내 textual concepts의 존재를 정확하게 지역화하는 saliency maps을 생성한다. 우리는 Flux raw cross attention, SDXL을 사용한 DAAM, 그리고 CLIP을 위한 TextSpan을 비교한다.

CONCEPTATTENTION은 여러 concepts에 대한 high-quality saliency maps을 동시에 생성할 수 있다. 또한, 우리의 approach는 prompt vocabulary에 있는 concepts에만 국한되지 않는다.
1. Introduction
Diffusion models은 최근 다양한 generative tasks, 특히 text-to-image synthesis 분야에서 state-of-the-art approach로 부상하며 널리 인기를 얻고 있다. 이러한 models은 random noise를 textual descriptions에 따라 photorealistic images로 변환하여 전례 없는 fidelity와 detail을 달성한다.
Diffusion models의 인상적인 generative capabilities에도 불구하고, 내부 메커니즘에 대한 우리의 이해는 여전히 제한적이다. Diffusion models은 black boxes처럼 작동하며, input prompts와 generated outputs 사이의 관계는 볼 수 있지만, 이를 연결하는 의사 결정 과정은 사람의 이해로부터 숨겨져 있다.
T2I models을 interpretating하는 기존 작업은 주로 prompt embeddings와 image patch representations 사이의 얕은 cross-attention 메커니즘을 활용하는 UNet-based architectures에 초점을 맞추었다. UNet cross attention maps은 textual concepts의 위치를 예측하는 high-fidelity saliency maps을 생성할 수 있으며 image editing과 같은 tasks에서 수많은 applications을 발견했다.
그러나, 더 최근의 multi-modal diffusion transformers (DiTs)의 interpretability는 아직 충분히 탐구되지 않았다. DiT-based models은 최근 image generation을 위한 state-of-the-art architecture로서 UNets를 대체했으며, Flux 및 SD3와 같은 models은 text-to-image generation에서 breakthroughs를 달성했다. DiT-based models의 급속한 발전과 향상된 capabilities는 interpretability, transparency, 그리고 safety를 향상시키는 methods의 중요성을 강조한다.
본 연구에서는, multi-modal DiTs의 representations을 활용하여 이미지 내에서 textual concepts를 localize하는 high-fidelity saliency maps을 생성하는 새로운 method인 CONCEPTATTENTION을 제안한다. 우리의 method는 DiT representations의 풍부한 semantics에 대한 insight를 제공한다. CONCEPTATTENTION은 lightweight하며 추가 training이 필요하지 않으며, 대신 DiT attention layers의 기존 parameters를 재사용한다.
CONCEPTATTENTION은 각각 visual concepts (예: "dragon", "sun")에 해당하는 풍부하고 문맥화된 text embeddings 집합을 생성하여 작동한다. 이러한 concept embeddings와 image를 linearly projecting함으로써, 일반적으로 사용되는 cross attention maps보다 훨씬 더 높은 quality의 풍부한 saliency maps을 생성할 수 있다.
우리는 real world images에 대한 zero-shot semantic segmentation task에서 CONCEPTATTENTION의 효능을 평가한다. 우리는 우리의 method에 의해 생성된 attributions의 accuracy와 relevance를 측정하기 위해 우리의 interpretative maps을 annotated segmentations와 비교한다. 우리의 experiments와 광범위한 comparisons는 CONCEPTATTENTION이 복잡한 black-box models의 내부 작동에 대한 valuable insights를 제공한다는 것을 보여준다. Generative models의 representations의 의미를 설명함으로써, 우리의 method는 generative AI systems의 interpretability, controllability, 그리고 trust를 향상시키는 길을 열어준다.
요약하자면, 우리는 다음을 제공한다:
- CONCEPTATTENTION: text-to-image diffusion transformers를 interpreting하기 위한 method. 우리의 method는 추가 training이 필요 없으며, multi-modal DiTs의 representations을 활용하여 이미지에서 임의의 textual concepts (예: "dragon", "sky" 등)의 존재를 나타내는 highly interpretable saliency maps을 생성한다 (Figure 1 참조).
- Attention operations의 output vectors가 cross attentions보다 higher-quality saliency maps을 생성한다는 새로운 발견. CONCEPTATTENTION은 DiT attention layers의 parameters를 재사용하여 서로 다른 concepts에 해당하는 풍부한 textual embeddings 집합을 생성하며, 이는 multi-modal DiT architectures에 의해서만 가능하게 되는 것이다. 이러한 concept embeddings와 attention output space에서의 image patch representations 사이의 linear projections을 수행함으로써 high quality saliency maps을 생성할 수 있다.
- CONCEPTATTENTION은 ImageNet Segmentation 및 Pascal VOC와 같은 benchmarks에서 zero-shot segmentation에서 state-of-the-art performance를 달성하도록 generalize된다. 우리는 CLIP, DINO, 그리고 UNet-based diffusion models과 같은 다양한 foundation models를 기반으로 하는 다양한 zero-shot interpretability methods보다 우수한 performance를 달성한다. 이것은 DiTs의 representations이 segmentation과 같은 중요한 downstream vision tasks로 transfer될 수 있는 potential을 강조한다.
- 우리는 researchers와 practitioners가 text-to-image diffusion transformers의 복잡한 dynamics를 interpret하고 explore할 수 있도록 CONCEPTATTENTION을 제공한다. 코드는 다음에서 확인할 수 있다: https://github.com/helblazer811/ConceptAttention.
1. Introduction 정리 노트 (AI 연구자 대상)
핵심
- 문제 제기:
- 최근 Diffusion models (text-to-image)이 state-of-the-art 성능을 보이지만, "black box" 모델이라 내부 작동 원리 이해가 부족함.
- 기존 interpretability 연구는 주로 UNet-based architectures에 집중되었고, 최신 multi-modal diffusion transformers (DiTs)에 대한 연구는 부족함. (Flux, SD3)
- 제안 (CONCEPTATTENTION):
- Multi-modal DiTs의 representations을 활용하여 textual concepts를 localize하는 high-fidelity saliency maps 생성.
- No additional training: DiT attention layers의 parameters를 재사용.
- 핵심 아이디어: DiT attention layers의 output space에서 linear projections를 수행하여 concept embeddings를 만들고, 이를 통해 cross-attention보다 선명한 saliency maps 생성.
- 결과:
- Zero-shot semantic segmentation에서 state-of-the-art 성능 (ImageNet Segmentation, Pascal VOC).
- DiTs representations의 transferability를 vision tasks (segmentation)로 입증 (CLIP 등 foundation models보다 우수).
- 기여:
- Text-to-image DiTs interpretability method (CONCEPTATTENTION) 제공.
- Attention output vectors가 cross attentions보다 우수한 saliency maps 생성 가능성 발견.
- DiTs의 downstream tasks (segmentation) 활용 가능성 제시.
- Code 공개.
쉬운 설명 :
최근 그림 그려주는 AI (Diffusion models)가 엄청난 성능을 보여주고 있는데, 솔직히 얘네가 어떻게 그림을 그리는지 속은 잘 몰라. 기존 연구들은 주로 예전 방식(UNet)에만 집중되어 있었고, 요즘 뜨는 새로운 방식(DiTs, Flux, SD3)은 어떻게 돌아가는지 잘 몰랐어.
그래서 이 논문에서는 CONCEPTATTENTION이라는 걸 제안해. 핵심은 "새로운 AI(DiTs)가 그림 그릴 때 집중하는 부분을 시각적으로 보여주자!" 야.
- 따로 학습 안 시켜도 돼: 이미 학습된 AI의 부품(attention layers)을 재활용해.
- 핵심 기술: AI가 집중하는 부분(attention)에서 나오는 정보를 잘 조합(linear projections)해서, 그림에서 어떤 부분이 특정 단어(예: "고양이", "하늘")랑 관련 있는지 보여주는 지도(saliency map)를 만드는 거야.
- 신기하게도, 기존에 많이 쓰던 방식(cross attention)보다 더 좋은 지도를 만들 수 있다는 걸 발견했어.
- 그래서 뭐가 좋냐?:
- AI가 그림 그릴 때 어디에 집중하는지 알 수 있어 (interpretability).
- 그림에서 특정 부분을 찾는 데에도 엄청 잘해 (segmentation). 다른 AI들보다 더!
- 결국, 이 AI를 더 잘 이해하고, 더 잘 써먹을 수 있게 되는 거지.
쉽게 비유하자면, 그림을 보고 있는 사람의 시선 추적(eye tracking)과 비슷합니다. 사람이 그림의 어느 부분에 집중하는지 보여주면서, 그림에 대한 이해를 돕는 것이죠. CONCEPTATTENTION은 AI의 "시선"을 보여줌으로써, AI의 "생각"을 이해하도록 돕는 기술이라고 할 수 있습니다.
2. Related Work
Diffusion Model Interpretability
Diffusion models을 interpret하려는 기존 연구가 상당수 존재한다. 일부 연구는 diffusion models을 analytic lens를 통해 조사하여, diffusion models이 어떻게 데이터의 manifold를 geometrically model하는지 이해하려고 시도한다. 다른 연구는 models이 이미지를 어떻게 memorize하는지 이해하려고 시도한다.
Diffusion models의 representations을 classification, segmentation, 심지어 robotic control과 같은 다양한 tasks에 재사용하려는 연구가 늘어나고 있다. 그러나 우리 연구와 가장 관련이 있는 것은 diffusion을 뒷받침하는 neural network architectures의 representations이 이러한 models의 작동 방식을 파악하고, 동작을 제어하며, safety를 개선하는 데 어떻게 사용될 수 있는지 조사하는 상당한 양의 methods이다.
많은 논문에서 Stable Diffusion 및 SDXL과 같은 UNet-based diffusion models의 cross attention 메커니즘이 textual concepts의 interpretable saliency maps을 생성할 수 있음을 관찰했다. Cross attention maps은 관심 objects를 localize하여 편집할 masks를 생성하거나, 이미지의 layout을 제어하거나, 이미지의 appearance는 변경하지만 layout은 유지하거나, instruction based editing models을 train하기 위한 synthetic data를 생성하는 등 다양한 image editing tasks에 사용된다.
다른 연구에서는 cross attention maps에 interventions을 수행하면 attributes가 올바른 objects에 할당되도록 보장하여 이미지의 faithfulness를 향상시킬 수 있음을 관찰한다. 또한, diffusion models의 self-attention layers가 이미지의 layout에 대한 유용한 정보를 encode한다는 것이 관찰되었다.
Zero-shot Image Segmentation
본 연구에서는 zero-shot image segmentation task에서 CONCEPTATTENTION을 평가한다. 이는 우리 saliency maps의 accuracy와 multi-modal DiT architectures의 representations의 downstream vision tasks로의 transferability를 평가하는 자연스러운 방법이다. 이 task는 또한 CLIP, DINO, 그리고 diffusion models과 같은 다양한 foundation model architectures에 대한 다양한 interpretability methods와 비교할 수 있는 좋은 환경을 제공한다.
다양한 연구에서 image segmentation task를 위해 diffusion models을 scratch부터 train하거나 pre-trained models을 fine-tuning하려고 시도한다. 또 다른 연구는 diffusion models을 활용하여 새로운 classes로 zero-shot transfer되는 segmentation models을 train하는 데 사용할 수 있는 synthetic data를 생성한다. 효과적이긴 하지만, 이러한 methods는 training-based이므로 기존 text-to-image generation models의 representations에 대한 insight를 많이 제공하지 않으며, 이것이 CONCEPTATTENTION의 핵심 motivation이다.
CLIP vision transformers (ViTs)의 interpretability를 향상시키려는 상당한 양의 연구가 있다. ViT models에 대한 saliency maps을 생성하는 method를 개발하고, 이러한 saliency maps의 effectiveness를 평가하기 위한 evaluation protocol을 도입한다. 이 evaluation protocol은 ImageNet-Segmentation dataset을 중심으로 하며, 우리는 이 evaluation을 PascalVOC dataset으로 확장한다.
그들은 GradCAM, Layerwise-Relevance Propagation, raw attentions, 그리고 Rollout method와 같은 다양한 zero-shot interpretability methods와 비교한다. 이미지 patches를 textual concepts으로 표현하는 approach를 보여준다. 우리는 또한 우리의 approach를 zero-shot diffusion based methods 및 DINO ViT models의 self-attention maps와 비교한다.
또 다른 연구는 models의 embeddings의 clustering을 수행하여 class 또는 text conditioning 없이 unsupervised segmentation을 수행하려고 시도한다. Class predictions를 생성하지 않음에도 불구하고, 이러한 models은 종종 unlabeled segmentation predictions을 multi-class semantic segmentation dataset에서 가장 잘 matching되는 것과 짝을 이루기 위해 Hungarian matching과 같은 approaches를 사용하여 semantic segmentation datasets에서 평가된다.
이와 대조적으로, CONCEPTATTENTION은 text conditioning을 가능하게 하므로 이 methods family와는 비교하지 않는다. 우리는 또한 large scale dataset에서 trained되기 때문에 SAM과 같은 models와는 비교하지 않는다.
2. Related Work 정리 노트 (AI 연구자 대상)
핵심
- Diffusion Model Interpretability:
- 기존 연구 동향:
- Analytic lens (기하학적 모델링 방식 이해).
- Memorization (이미지 기억 방식 이해).
- Representations 재활용 (classification, segmentation, robotic control 등).
- Cross attention (UNet) 중심 연구 활발: saliency maps 생성, image editing 활용.
- 본 연구와의 차별성:
- DiTs의 interpretability 연구 (cross attention 중심 연구에서 벗어남).
- Attention output 활용 (새로운 접근).
- 기존 연구 동향:
- Zero-shot Image Segmentation:
- 기존 연구 동향:
- Diffusion models 학습/fine-tuning (segmentation 목적).
- Synthetic data 생성 후 활용.
- CLIP, DINO 등 foundation models interpretability 연구 (saliency maps 생성).
- Unsupervised segmentation (clustering 기반, text conditioning 없음).
- 본 연구와의 차별성/비교:
- Training-based methods가 아닌, 기존 text-to-image generation models의 representations에 대한 insight 제공 (CONCEPTATTENTION의 주 목적).
- CLIP, DINO, diffusion-based methods 등 다양한 zero-shot interpretability methods와 비교 수행.
- Text conditioning 활용 (unsupervised methods와 차별점).
- Large-scale dataset으로 학습된 모델(SAM)과는 비교하지 않음.
- 기존 연구 동향:
- 한줄 요약 : 기존 Diffusion Model 해석 연구는 UNet의 cross-attention에 집중되었지만, 본 연구는 DiT의 attention output을 활용하여 zero-shot segmentation에서 SOTA를 달성하고 representation의 전이 가능성을 제시.
쉬운 설명 :
Diffusion Model Interpretability:
- 기존 연구:
- "얘네(Diffusion models)가 어떻게 그림을 그리는 걸까?"
- "어떻게 이미지를 기억하는 걸까?"
- "얘네 능력을 다른 데 써먹을 수 없을까?" (분류, 분할, 로봇 제어 등)
- 특히, "얘네(UNet 기반)가 집중하는 부분(cross attention)을 보면 뭔가 알 수 있지 않을까?" -> 이미지 편집 등에 많이 활용.
- 이 논문:
- "요즘 뜨는 애들(DiTs)은 어떻게 돌아가는 거지?"
- "얘네가 집중하는 부분(attention)에서 나오는 정보(output)를 써보자!" (새로운 아이디어)
Zero-shot Image Segmentation:
- 기존 연구:
- "그림 분할(segmentation)하는 AI를 만들자!" (처음부터 학습 or 기존 모델 튜닝)
- "가짜 그림(synthetic data) 만들어서 학습시키면 더 잘 되지 않을까?"
- "다른 AI(CLIP, DINO)가 집중하는 부분(saliency map)을 보자!"
- "아예 (사람 도움 없이) 혼자서 그림 분할하게 해보자!" (clustering)
- 이 논문:
- "우리는 이미 있는 그림 생성 AI(text-to-image)가 뭘 보고 그리는지 알고 싶어!"
- "다른 AI들이랑 비교해 봤더니, 우리가 더 잘하더라!"
- "우리는 (사람이) '고양이 그려줘'처럼 명령(text conditioning)할 수 있어!"
- "(엄청 큰 데이터로 학습한) SAM 같은 애들이랑은 비교 안 할래."
핵심: 기존에는 AI가 그림 그릴 때 "눈" 역할(cross attention, UNet)만 봤다면, 이 논문은 "뇌"(attention output, DiTs)를 들여다봐서 더 잘 이해하고 활용하겠다는 것!
3. Preliminaries
3.1. Rectified-Flow Models for Image Generation
Flux 및 Stable Diffusion 3는 rectified flow models을 parameterize하기 위해 trained된 multi-modal DiTs를 활용한다. 이 논문 전체에서 편의를 위해 rectified flow models을 diffusion models이라고 지칭할 수 있다. 이러한 models은 주어진 text prompts에 해당하는 noise로부터 realistic images를 generate하려고 시도한다.
Flow based models는 noise distribution p<sub>1</sub> (일반적으로 p<sub>1</sub> ∼ N(0, I))로부터의 sample x<sub>1</sub>을 data distribution의 sample x<sub>0</sub>으로 mapping하려고 시도한다. Rectified flows는 p<sub>0</sub>와 p<sub>1</sub> 사이의 straight paths를 따르는 ODEs를 learn하려고 시도한다. 즉,
z<sub>t</sub> = (1 - t)x<sub>0</sub> + tε, ε ∼ N(0, 1). (1)
Flux와 SD3는 conditional flow matching objective를 사용하여 trained되며, 이는 다음과 같이 편리하게 표현될 수 있다.
-1/2 E<sub>t∼U(t),ε∼N(0,I)</sub>[ w<sub>t</sub>λ'<sub>t</sub> ||*ε***<sub>Θ</sub>(z<sub>t</sub>, t) - ***ε***||<sup>2</sup> ] (2)
여기서 λ'<sub>t</sub>는 signal-to-noise ratio에 해당하고 w<sub>t</sub>는 time-dependent-weighting factor이다. 위에서 ε<sub>Θ</sub>(z<sub>t</sub>, t)는 multi-modal diffusion transformer network에 의해 parameterized된다. 이 model의 architecture와 그 properties는 본 연구에서 주요 관심사이다.
3.2. The Anatomy of a Multi-modal DiT Layer
Flux 및 Stable Diffusion 3와 같은 multi-modal DiTs는 textual tokens와 image patches의 조합을 process하는 multi-modal attention layers (MMATTN)를 활용한다. 두 가지 주요 classes의 layers가 있다: 각 modality에 대해 separate residual streams를 유지하는 layer와 single stream을 사용하는 layer. 본 연구에서는 multi-modal attention layers (MMATTNs)라고 하는 이러한 dual stream layers의 properties를 활용한다.
주어진 layer에 대한 input은 image patch representations x ∈ ℝ<sup>h×w×d</sup>와 prompt token embeddings p ∈ ℝ<sup>l×d</sup>의 sequence이다. Network 시작 부분의 initial prompt embeddings는 prompt tokens의 T5 embeddings를 취하여 형성된다.
(Peebles & Xie, 2023)에 따라, 각 MMATTN layer는 time-step 및 global CLIP vector에 conditioned된 adaptive layer norm modulation layers (Xu et al., 2019) 집합을 활용한다. Adaptive layernorm operation은 input image 및 text embeddings에 적용된다. Final modulated outputs는 original input에 residually added된다. 특히, image와 text modalities는 separate residual streams에 유지된다. 이 operation의 정확한 details는 간결성을 위해 생략한다.
MMATTN layers의 핵심 workhorse는 친숙한 multi-head self attention operation이다. Prompt 및 image embeddings는 images에 대해 K<sub>x</sub>, Q<sub>x</sub>, V<sub>x</sub>로, text에 대해 K<sub>p</sub>, Q<sub>p</sub>, V<sub>p</sub>로 지칭되는 별도의 learned key, value, 그리고 query projection matrices를 갖는다. 두 modalities에 대한 keys, queries, 그리고 values는 집합적으로 q<sub>xp</sub>, k<sub>xp</sub>, 그리고 v<sub>xp</sub>로 표시되며, 예를 들어 k<sub>xp</sub> = [K<sub>x</sub>x<sub>1</sub>, ..., K<sub>p</sub>p<sub>1</sub>...]이다. 그런 다음 self attention operation이 수행된다.
o<sub>x</sub>, o<sub>p</sub> = softmax(q<sub>xp</sub>k<sup>T</sup><sub>xp</sub>)v<sub>xp</sub> (3)
여기서 o<sub>x</sub>와 o<sub>p</sub>를 attention output vectors라고 한다. 그런 다음 another linear layer가 이러한 outputs에 적용되고 modulation layer의 output에 따라 weighted된 separate residual streams에 added된다. 이것은 다음 layer에 input으로 주어지는 updated embeddings x<sup>L+1</sup> 및 p<sup>L+1</sup>을 제공한다.
3. Preliminaries 정리 노트 (AI 연구자 대상)
핵심
- 3.1 Rectified-Flow Models:
- Flux, SD3는 rectified flow models (diffusion models의 일종) 기반.
- Noise → Image 생성 (text prompt guidance).
- 핵심 방정식:
- zt = (1 - t)x0 + tϵ, ϵ ∼ N(0, 1) : Straight path ODE.
- Conditional flow matching objective (loss function).
- ϵΘ(zt, t): Multi-modal DiT network.
- 이 논문의 주요 관심사: ϵΘ(zt, t) (multi-modal DiT)의 architecture와 properties.
- 3.2 Multi-modal DiT Layer (MMATTN):
- Input: Image patch representations (x), prompt token embeddings (p).
- Dual stream: Image와 text modalities를 separate residual streams로 처리.
- 핵심 구성 요소:
- Adaptive layer norm modulation (time-step, global CLIP vector conditioning).
- Multi-head self-attention:
- Separate learned key, value, query projection matrices (Kx, Qx, Vx, Kp, Qp, Vp).
- Attention output vectors (ox, op) - 이 논문의 핵심 활용 대상.
- ox, op = softmax(qxp * kxp^T) * vxp
- Updated embeddings (xL+1, pL+1) 생성 (다음 layer의 input).
- 이 논문과의 연관성: MMATTN layer의 attention output vectors (ox, op)를 활용하여 CONCEPTATTENTION 구현.
쉬운 설명 :
3.1 Rectified-Flow Models:
- Flux, SD3는 "선을 잘 긋는" 방식(rectified flow)으로 그림을 그리는 AI.
- Noise에서 출발해서, text prompt ("고양이 그려줘")에 맞는 그림을 짠! 하고 만들어냄.
- 핵심은 "직선 경로"(straight path ODE)를 따라 noise를 그림으로 바꾸는 것.
- 이 과정에서 Multi-modal DiT network (ϵΘ)가 중요한 역할 (그림을 어떻게 그릴지 결정).
- 이 논문은 이 DiT network가 어떻게 작동하는지, 특히 "어디에 집중"하는지에 관심!
3.2 Multi-modal DiT Layer (MMATTN):
- DiT network 안에는 여러 층(layers)이 있는데, 그 중 MMATTN이라는 특별한 층이 있음.
- MMATTN의 역할:
- 그림 조각들(image patches)과 텍스트 설명(prompt tokens)을 입력으로 받음.
- 그림 정보와 텍스트 정보를 따로따로 처리 (dual stream).
- "시간"(time-step)과 "전체적인 그림 내용"(global CLIP vector)을 고려해서 좀 더 똑똑하게 처리 (adaptive layer norm modulation).
- 그림 조각들과 텍스트 설명 각각에 대해 "어디에 집중할지" 계산 (multi-head self-attention).
- 이때 계산되는 attention output vectors (ox, op)가 이 논문의 핵심!
- 처리된 정보(updated embeddings)를 다음 층으로 넘겨줌.
핵심: 이 논문은 MMATTN 층에서 나오는 attention output vectors (ox, op)를 가지고 "AI가 그림의 어디에 집중하고 있는지" 보여주는 지도(saliency map)를 만들겠다는 것!
