Concept Steerers: Leveraging K-Sparse Autoencoders for Test-Time Controllable Generations

Dahye Kim, Deepti Ghadiyaram
1/31/2025
cs.CV

Official code: kim-dahye/steerers (19 stars, last commit 2025-05-19).

Abstract

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

View on arXivView PDF

Code Implementations(1)

kim-dahye/steerersOfficial100%
191Shell, PythonJan 31, 20251 years ago

Similar Papers

Cite this paper

@article{kim2025concept,
  title  = {Concept Steerers: Leveraging K-Sparse Autoencoders for Test-Time Controllable Generations},
  author = {Dahye Kim and Deepti Ghadiyaram},
  year   = {2025},
  eprint = {2501.19066},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.19066v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.19066.svg)](https://codeofpaper.com/paper/2501.19066)

Discussion