在文本到图像生成模型中定位与编辑知识
Localizing and Editing Knowledge in Text-to-Image Generative Models
AI总结:
本文研究文本到图像扩散模型中知识的存储位置,利用因果中介分析发现知识在UNet中分布式存储,而在CLIP文本编码器中仅存在单一因果状态,并据此提出快速且无需数据的模型编辑方法Diff-QuickFix,实现1000倍加速。
摘要:
诸如Stable-Diffusion和Imagen等文本到图像扩散模型在MS-COCO和其他生成基准上取得了最先进的FID分数,实现了前所未有的照片级真实感质量。给定一段说明文字,图像生成需要关于对象结构、风格和视点等属性的细粒度知识。这些信息究竟存储在文本到图像生成模型的什么位置?在本文中,我们探讨这一问题,并理解大规模文本到图像扩散模型中对应于不同视觉属性的知识是如何存储的。我们将因果中介分析适配于文本到图像模型。我们将关于不同视觉属性的知识追踪到扩散模型中(i)UNet和(ii)文本编码器的各种(因果)组件。特别地,我们表明,与生成式大语言模型不同,关于不同属性的知识并未孤立地定位在单独的组件中,而是分布在条件UNet中的一组组件里。这些组件集合对于不同的视觉属性通常是不同的。引人注目的是,我们发现诸如Stable-Diffusion等公开文本到图像模型中的CLIP文本编码器在不同视觉属性间仅包含一个因果状态,这就是说明文字中该属性最后一个主语词元对应的第一自注意力层。这与其他语言模型中的因果状态通常为中间MLP层形成了鲜明对比。基于文本编码器中仅存在这一个因果状态的观察,我们引入了一种快速、无需数据的模型编辑方法Diff-QuickFix,能够有效编辑文本到图像模型中的概念。DiffQuickFix可以通过闭式更新在一秒钟内编辑(消融)模型中的概念,在具有与现有基于微调的方法相当的编辑性能下,提供了显著的1000倍加速。
英文摘要:
Text-to-Image Diffusion Models such as Stable-Diffusion and Imagen have achieved unprecedented quality of photorealism with state-of-the-art FID scores on MS-COCO and other generation benchmarks. Given a caption, image generation requires fine-grained knowledge about attributes such as object structure, style, and viewpoint amongst others. Where does this information reside in text-to-image generative models? In our paper, we tackle this question and understand how knowledge corresponding to distinct visual attributes is stored in large-scale text-to-image diffusion models. We adapt Causal Mediation Analysis for text-to-image models and trace knowledge about distinct visual attributes to various (causal) components in the (i) UNet and (ii) text-encoder of the diffusion model. In particular, we show that unlike generative large-language models, knowledge about different attributes is not localized in isolated components, but is instead distributed amongst a set of components in the conditional UNet. These sets of components are often distinct for different visual attributes. Remarkably, we find that the CLIP text-encoder in public text-to-image models such as Stable-Diffusion contains only one causal state across different visual attributes, and this is the first self-attention layer corresponding to the last subject token of the attribute in the caption. This is in stark contrast to the causal states in other language models which are often the mid-MLP layers. Based on this observation of only one causal state in the text-encoder, we introduce a fast, data-free model editing method Diff-QuickFix which can effectively edit concepts in text-to-image models. DiffQuickFix can edit (ablate) concepts in under a second with a closed-form update, providing a significant 1000x speedup and comparable editing performance to existing fine-tuning based editing methods.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。