확산 모델에서 텍스트 생성 정확한 매개변수 지역화
Precise Parameter Localization for Textual Generation in Diffusion Models
February 14, 2025
저자: Łukasz Staniszewski, Bartosz Cywiński, Franziska Boenisch, Kamil Deja, Adam Dziedzic
cs.AI
초록
새로운 디퓨전 모델은 고품질의 텍스트가 통합된 사실적인 이미지를 합성할 수 있습니다. 놀랍게도, 우리는 어텐션 활성화 패칭을 통해 디퓨전 모델의 매개변수 중 1% 미만, 즉 모두 어텐션 레이어에 포함된 부분만이 이미지 내 텍스트 콘텐츠 생성에 영향을 미친다는 것을 입증했습니다. 이 관찰을 바탕으로, 우리는 디퓨전 모델의 크로스 및 조인트 어텐션 레이어를 대상으로 텍스트 생성 효율성과 성능을 개선했습니다. 텍스트 콘텐츠 생성에 책임이 있는 레이어를 지역화함으로써 이점을 얻는 여러 애플리케이션을 소개합니다. 먼저, 지역화된 레이어만을 LoRA 기반 미세 조정함으로써 대형 디퓨전 모델의 일반적인 텍스트 생성 능력을 더욱 향상시키면서도 디퓨전 모델 생성물의 품질과 다양성을 유지할 수 있음을 보여줍니다. 그런 다음, 생성된 이미지의 텍스트 콘텐츠를 편집하는 데 지역화된 레이어를 어떻게 사용할 수 있는지 시연합니다. 마지막으로, 이 아이디어를 확장하여 비용 없이 유해한 텍스트 생성을 방지하는 실용적인 사용 사례를 제시합니다. 기존 연구와 달리, 우리의 지역화 접근 방식은 U-Net(예: LDM 및 SDXL) 및 트랜스포머 기반(예: DeepFloyd IF 및 Stable Diffusion 3)을 포함한 다양한 디퓨전 모델 아키텍처에 광범위하게 적용 가능하며, CLIP부터 T5와 같은 대형 언어 모델에 이르기까지 다양한 텍스트 인코더를 활용합니다. 프로젝트 페이지는 https://t2i-text-loc.github.io/에서 확인할 수 있습니다.
English
Novel diffusion models can synthesize photo-realistic images with integrated
high-quality text. Surprisingly, we demonstrate through attention activation
patching that only less than 1% of diffusion models' parameters, all contained
in attention layers, influence the generation of textual content within the
images. Building on this observation, we improve textual generation efficiency
and performance by targeting cross and joint attention layers of diffusion
models. We introduce several applications that benefit from localizing the
layers responsible for textual content generation. We first show that a
LoRA-based fine-tuning solely of the localized layers enhances, even more, the
general text-generation capabilities of large diffusion models while preserving
the quality and diversity of the diffusion models' generations. Then, we
demonstrate how we can use the localized layers to edit textual content in
generated images. Finally, we extend this idea to the practical use case of
preventing the generation of toxic text in a cost-free manner. In contrast to
prior work, our localization approach is broadly applicable across various
diffusion model architectures, including U-Net (e.g., LDM and SDXL) and
transformer-based (e.g., DeepFloyd IF and Stable Diffusion 3), utilizing
diverse text encoders (e.g., from CLIP to the large language models like T5).
Project page available at https://t2i-text-loc.github.io/.Summary
AI-Generated Summary