2024-11-02 · 进阶 · 机器学习 · 计算机视觉

Unpacking SDXL Turbo: Interpreting Text-to-Image Models with Sparse Autoencoders

该论文通过使用稀疏自动编码器(SAEs)来分析文本到图像模型SDXL Turbo的内部机制,揭示了模型中不同Transformer块在图像生成过程中的具体作用。

更新于 2024-11-09。作者:Viacheslav Surkov、Chris Wendler、Mikhail Terekhov、Justin Deschenaux、Robert West、Caglar Gulcehre。

中文摘要

稀疏自编码器(SAEs)已经成为大型语言模型(LLMs)逆向工程的核心要素。对于LLMs,它们已被证明可以将通常难以直接理解的中间表示分解为可解释特征的稀疏和,从而有助于更好地控制和后续分析。然而,类似的分析和方法在文本到图像模型中却缺乏。我们研究了使用SAEs学习少数步骤文本到图像扩散模型(如SDXL Turbo)可解释特征的可能性。为此,我们在SDXL Turbo去噪U网中由变换器块执行的更新上训练SAEs。我们发现,它们学习到的特征是可解释的,因果影响生成过程,并揭示了块之间的专业化。特别是,我们发现一个主要处理图像构图,一个主要负责添加局部细节,一个负责颜色、光照和风格。因此,我们的工作是朝着更好地理解像SDXL Turbo这样的生成文本到图像模型内部的重要第一步,并展示了SAEs学习到的特征在视觉领域的潜力。代码可在https://github.com/surkovv/sdxl-unbox获取。

英文摘要

Sparse autoencoders (SAEs) have become a core ingredient in the reverse engineering of large-language models (LLMs). For LLMs, they have been shown to decompose intermediate representations that often are not interpretable directly into sparse sums of interpretable features, facilitating better control and subsequent analysis. However, similar analyses and approaches have been lacking for text-to-image models. We investigated the possibility of using SAEs to learn interpretable features for a few-step text-to-image diffusion models, such as SDXL Turbo. To this end, we train SAEs on the updates performed by transformer blocks within SDXL Turbo's denoising U-net. We find that their learned features are interpretable, causally influence the generation process, and reveal specialization among the blocks. In particular, we find one block that deals mainly with image composition, one that is mainly responsible for adding local details, and one for color, illumination, and style. Therefore, our work is an important first step towards better understanding the internals of generative text-to-image models like SDXL Turbo and showcases the potential of features learned by SAEs for the visual domain. Code is available at https://github.com/surkovv/sdxl-unbox

解读

一句话总结

该论文通过使用稀疏自动编码器(SAEs)来分析文本到图像模型SDXL Turbo的内部机制,揭示了模型中不同Transformer块在图像生成过程中的具体作用。

问题1:这篇论文想要解决什么具体问题?

• 问题背景:文本到图像模型(如SDXL Turbo)的内部工作机制不透明,缺乏可解释性。 • 现有方案不足:现有的文本到图像模型缺乏有效的可解释性分析方法。 • 研究目标:利用稀疏自动编码器(SAEs)来分析SDXL Turbo的内部机制,揭示其不同Transformer块在图像生成过程中的作用。

问题2:论文的核心创新点是什么?

• 技术创新:将稀疏自动编码器应用于文本到图像模型的可解释性分析。 • 方法改进:开发了一个名为SDLens的库,用于缓存和操作SDXL Turbo的前向传播的中间结果。 • 优势:与现有方法相比,SAEs能够学习到高度可解释的特征,并且能够揭示模型内部不同模块的作用。

问题3:实验结果如何验证了方法的有效性?

• 关键实验:在SDXL Turbo的U-net内部的不同Transformer块上训练SAEs。 • 性能提升:实验结果表明,SAEs能够学习到具有因果影响的可解释特征。 • 对比结果:与基线方法相比,SAEs学习到的特征在可解释性和因果性方面都有显著提升。

问题4:这个研究的实际应用价值是什么?

• 应用场景:为文本到图像模型的可解释性和控制提供新的方法。 • 实施建议:开发基于SAEs的可解释性分析工具,用于理解和其他文本到图像模型。 • 局限与展望:目前的研究主要针对SDXL Turbo,未来需要将其扩展到其他模型,并探索更高级的可解释性技术。

来源

机器可读索引:llms.txt