ChatPaper.aiChatPaper

拡散モデルにおけるテキスト生成のための精密なパラメータ局所化

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

PDF122February 17, 2025