用稀疏编码器实现生成模型的实时可控内容调整,无需重训练。
Concept Steerers: Leveraging K-Sparse Autoencoders for Test-Time Controllable Generations
- 通过k-稀疏自编码器识别潜在空间中的可解释概念。
- 测试时提升20.01%的不安全内容移除效果,速度比现有方法快5倍。
- 无需微调模型,适合需要快速响应的生成系统应用。
尽管文本到图像生成模型取得了显著进展,但其容易受到对抗性攻击,并可能生成不安全或不道德的内容。现有方法通常依赖微调模型以移除特定概念,但计算成本高、缺乏可扩展性且影响生成质量。本文提出一种新框架,利用k-稀疏自编码器(k-SAEs)在扩散模型中实现高效且可解释的概念操控。我们首先在文本嵌入的潜在空间中识别出可解释的单义概念,并利用它们在测试时精确地引导生成远离或偏向某一概念(如裸露),或引入新概念(如摄影风格)。大量实验表明,该方法极为简单,无需重新训练基础模型或使用LoRA适配器,不损害生成质量,且对对抗性提示扰动具有鲁棒性。相比当前最优方法,本方法在不安全概念去除上提升20.01%,在风格操控中表现有效,速度约快5倍。代码已公开于:https://github.com/kim-dahye/steerers。
原文摘要 · Abstract (English)
Despite the remarkable progress in text-to-image generative models, they are prone to adversarial attacks and inadvertently generate unsafe, unethical content. Existing approaches often rely on fine-tuning models to remove specific concepts, which is computationally expensive, lacks scalability, and/or compromises generation quality. In this work, we propose a novel framework leveraging k-sparse autoencoders (k-SAEs) to enable efficient and interpretable concept manipulation in diffusion models. Specifically, we first identify interpretable monosemantic concepts in the latent space of text embeddings and leverage them to precisely steer the generation away or towards a given concept (e.g., nudity) or to introduce a new concept (e.g., photographic style) -- all during test time. Through extensive experiments, we demonstrate that our approach is very simple, requires no retraining of the base model nor LoRA adapters, does not compromise the generation quality, and is robust to adversarial prompt manipulations. Our method yields an improvement of $\mathbf{20.01\%}$ in unsafe concept removal, is effective in style manipulation, and is $\mathbf{\sim5}$x faster than the current state-of-the-art. Code is available at: https://github.com/kim-dahye/steerers
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。