arXiv:2502.09935cs.CV2025-02ICLR被引 6

只用不到1%的参数就能控制扩散模型生成文字内容。

Precise Parameter Localization for Textual Generation in Diffusion Models

  • 定位文本生成相关参数,仅需修改注意力层中的极小部分。
  • 局部微调使大模型文本生成能力更强,且保持图像质量多样。
  • 可低成本实现文字编辑与有害文本过滤,适配多种模型架构。

新型扩散模型能合成含高质量文字的逼真图像。我们通过注意力激活补丁实验发现,仅约1%的模型参数(全部位于注意力层)影响图像中文字的生成。基于此,我们聚焦于扩散模型中的交叉注意力与联合注意力层,提升文本生成效率与性能。提出多项应用:仅对定位到的层进行LoRA微调,即可显著增强大型扩散模型的通用文本生成能力,同时保持生成图像的质量与多样性;利用这些层实现生成图像中文本内容的编辑;进一步将该方法扩展至无成本地防止有害文本生成。相比以往工作,我们的定位方法适用于多种架构(如U-Net和基于Transformer的模型,包括SDXL、DeepFloyd IF、Stable Diffusion 3),并兼容不同文本编码器(如CLIP、T5等)。项目页面见https://t2i-text-loc.github.io/。

原文摘要 · Abstract (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., SDXL and DeepFloyd IF) and transformer-based (e.g., 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/.

扩散模型文本生成参数定位LoRA

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。