arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2405.01008cs.CV
收藏

文本到图像生成模型中的机制性知识定位

On Mechanistic Knowledge Localization in Text-to-Image Generative Models

University of Maryland(马里兰大学);Adobe Research(奥多比研究中心)

Samyadeep Basu, Keivan Rezaei, Priyatham Kattakinda, Ryan Rossi, Cherry Zhao, Vlad Morariu, Varun Manjunatha, Soheil Feizi

AI总结:

本文针对近期文生图模型中因果追踪难以定位知识的问题,提出 LocoGen 通过干预 UNet 交叉注意力层实现机制性知识定位,并结合闭式编辑方法 LocoEdit 支持高效及神经元级编辑。

摘要:

识别文本到图像模型中控制视觉属性的层,可通过闭式更新实现高效模型编辑。近期利用因果追踪的工作表明,早期 Stable-Diffusion 变体主要将知识限定在 CLIP 文本编码器的第一层,而知识会在整个 UNet 中扩散。扩展该框架后,我们观察到对于近期模型(例如 SD-XL、DeepFloyd),因果追踪无法准确定位局部化知识,这凸显了模型编辑中的挑战。为解决这一问题,我们引入文本到图像模型中的机制性定位概念:关于各种视觉属性(例如“风格”“物体”“事实”)的知识可在机制上定位到 UNet 中的一小部分层,从而促进高效模型编辑。我们使用所提方法 LocoGen 定位知识,该方法通过在 UNet 的交叉注意力层中执行干预,测量中间层对输出生成的直接影响。随后,我们采用 LocoEdit——一种快速的闭式编辑方法,将其用于流行的开源文本到图像模型(包括最新的 SD-XL),并探索神经元级模型编辑的可能性。借助机制性定位,我们的工作更好地揭示了基于定位的文本到图像模型编辑的成功与失败。代码将发布于 https://github.com/samyadeepbasu/LocoGen。

英文摘要:

Identifying layers within text-to-image models which control visual attributes can facilitate efficient model editing through closed-form updates. Recent work, leveraging causal tracing show that early Stable-Diffusion variants confine knowledge primarily to the first layer of the CLIP text-encoder, while it diffuses throughout the UNet.Extending this framework, we observe that for recent models (e.g., SD-XL, DeepFloyd), causal tracing fails in pinpointing localized knowledge, highlighting challenges in model editing. To address this issue, we introduce the concept of Mechanistic Localization in text-to-image models, where knowledge about various visual attributes (e.g., "style", "objects", "facts") can be mechanistically localized to a small fraction of layers in the UNet, thus facilitating efficient model editing. We localize knowledge using our method LocoGen which measures the direct effect of intermediate layers to output generation by performing interventions in the cross-attention layers of the UNet. We then employ LocoEdit, a fast closed-form editing method across popular open-source text-to-image models (including the latest SD-XL)and explore the possibilities of neuron-level model editing. Using Mechanistic Localization, our work offers a better view of successes and failures in localization-based text-to-image model editing. Code will be available at https://github.com/samyadeepbasu/LocoGen.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑