Manuscript Offprint

arXiv:2609.03629

EraseSAE: Surgical Concept Erasure in Text-to-Video Diffusion Models via Sparse Autoencoders

Xinghao Wang, Dong Li, Wei Yu, Yingwei Pan, Tao Gong, Qi Chu, Nenghai Yu, Ting Yao

Xinghao Wang 1,3∗^{1,3*}, Dong Li 2†^{2\dagger}, Wei Yu 2^{2}, Yingwei Pan 2^{2}, Tao Gong 1,3†^{1,3\dagger}, Qi Chu 1,3^{1,3}, Nenghai Yu 1,3^{1,3}, and Ting Yao 2^{2}

1^{1} University of Science and Technology of China, Hefei, China

2^{2} HiDream.ai Inc.

3^{3} Anhui Province Key Laboratory of Digital Security, China

wxhwxhxh@mail.ustc.edu.cn, {lidong,yuwei,pandy}@hidream.ai,

{tgong,qchu,ynh}@ustc.edu.cn, tiyao@hidream.ai

Abstract. Recent advances in text-to-video (T2V) diffusion models have demonstrated remarkable generative capabilities, yet their reliance on loosely curated training data raises pressing safety and copyright concerns. Concept erasure offers a principled remedy by removing unwanted semantics from pretrained models while preserving remaining concepts. However, existing approaches typically operate at a coarse granularity misaligned with the fine-grained, distributed nature of concept representations, leading to incomplete removal or degraded generation quality. We argue that surgical erasure fundamentally requires intervention at the level of monosemantic features, where each unit encodes a single interpretable concept. To this end, we propose EraseSAE, a novel framework that leverages sparse autoencoders to achieve surgical concept erasure in DiT-based T2V diffusion models via a principled decompose-attribute-erase pipeline. We first introduce the Partitioned Convolutional Sparse Autoencoder, which decomposes dense spatiotemporal activations into disentangled, interpretable sparse features while preserving spatiotemporal coherence. A contrastive attribution mechanism then contrasts activations from paired prompts to isolate concept-specific feature kernels. At inference, timestep-resolved spatiotemporal masks derived from the identified kernels confine erasure to regions where the target concept is active, leaving unrelated content intact. Extensive experiments across diverse diffusion models and concept erasure tasks demonstrate that EraseSAE achieves precise and robust concept removal with minimal quality degradation, substantially outperforming state-of-the-art methods. The code is available at https://github.com/HiDream-ai/EraseSAE.

Keywords: Concept Erasure · Sparse Autoencoders · Diffusion Models

∗^{*} This work was performed at HiDream.ai. †^{\dagger} Corresponding authors.

X. Wang et al.

1 Introduction

The rapid advancement of T2V diffusion models [21,36] has fundamentally transformed video creation, enabling high-fidelity video synthesis from free-form text prompts. However, this powerful generative capability also introduces significant safety and copyright risks [19,30]. Trained on massive and loosely curated datasets, these models can readily generate harmful content such as explicit material or deepfakes of public figures. Mitigating such unsafe outputs has emerged as a critical challenge for responsible deployment of T2V models. While retraining on filtered datasets is a straightforward solution [16], the prohibitive computational cost renders it impractical. Concept erasure [26,34,38] provides a viable alternative by selectively removing target semantics from a pretrained model while preserving its capacity to generate remaining content. However, as illustrated in Fig. 2, achieving surgical erasure that precisely removes target concepts without degrading broader generative capabilities remains an open problem.

Existing concept erasure methods, primarily adapted from the text-to-image (T2I) domain, generally fall into two paradigms: training-free and training-based. Training-free methods steer inference away from target concepts through techniques such as negative prompting [29], text embedding manipulation [25,34,38], or conditional guidance [30,39], without altering model weights. While computationally efficient, they merely suppress concepts at the surface level while leaving internal concept representations intact, rendering them vulnerable to adversarial attacks. Training-based methods seek stronger guarantees by permanently altering model parameters through global fine-tuning [10,12,22,37], closed-form editing [26], or neuron pruning [35]. Although more robust to input manipulation, these methods suffer from a fundamental granularity mismatch: existing methods operate at a coarse granularity that fails to align with the fine-grained, distributed nature of concept representations within these models. In deep neural networks, concepts are distributed across polysemantic representations where individual neurons encode multiple concepts simultaneously. Intervening on such entangled units leads to three distinct failure modes: (i) global weight modifications cause catastrophic forgetting of unrelated concepts; (ii) layer-specific edits targeting only cross-attention projections leave concept traces in other pathways, enabling reconstruction under adversarial probing; and (iii) neuron-level pruning inflicts collateral damage on co-encoded benign concepts. Beyond this granularity mismatch, virtually all existing methods lack spatiotemporal locality: even when a target concept occupies only a local spatial region or temporal segment, current approaches apply erasure globally, unnecessarily degrading unrelated content (Fig. 2). This limitation is particularly acute in video generation, where 3D full-attention in DiT-based T2V models encodes concepts jointly across space and time, making them especially sensitive to coarse-grained intervention.

These limitations converge on a fundamental requirement: surgical concept erasure demands intervention at the level of monosemantic units, where each feature encodes a single, interpretable concept. Sparse autoencoders (SAEs) [28], recently developed for mechanistic interpretability of large language models (LLMs) [8,31], provide exactly such a substrate by decomposing high-dimensional activations into sparse linear combinations of monosemantic features. This property offers three key advantages that directly address the above limitations. First, projecting dense activations into a disentangled sparse space enables isolating specific features without disturbing others, resolving the polysemanticity problem that plagues neuron-level pruning. Second, SAE features capture distributed representations spanning arbitrary network components, overcoming the incomplete coverage of layer-specific editing. Third, because SAE activations naturally vary across spatial positions and frames, suppressing a target feature automatically confines erasure to where the concept is active, thereby achieving spatiotemporal locality that global fine-tuning cannot provide. Despite these advantages, transferring SAEs from LLMs to DiT-based T2V models presents substantial challenges. Conventional linear SAEs neglect local dependencies across neighboring positions and frames, risking degradation of spatiotemporal coherence. Furthermore, whereas LLM activations maintain stable semantics once generated, diffusion features progressively transition from coarse structure to fine detail across denoising timesteps, rendering single-timestep attribution insufficient.

Motivated by these insights, we propose EraseSAE, a novel framework that leverages SAEs to achieve surgical concept erasure in DiT-based T2V diffusion models via a principled decompose-attribute-erase pipeline. In the decompose stage, we introduce the Partitioned Convolutional Sparse Autoencoder (PConvSAE) to address the challenge of spatiotemporal coupling. By employing multi-dimensional convolutions and a partitioned architecture, PConvSAE decomposes coupled spatiotemporal activations into interpretable, concept-specific sparse features while preserving spatial structure and temporal coherence. In the attribute stage, we feed paired prompts that include and exclude the target concept into the frozen diffusion model and contrast the resulting activation distributions within PConvSAE, isolating a compact set of feature kernels highly correlated with the target concept. In the erase stage, we derive spatiotemporal masks from the activation maps of the identified kernels at each denoising timestep, and selectively suppress the target concept by modifying PConvSAE features only within the masked regions. This strategy restricts interventions exclusively to regions where the target concept is active while preserving the original feature evolution elsewhere. By operating in the monosemantic feature space, EraseSAE unifies the strengths of both paradigms: it achieves the robust and permanent erasure of training-based methods while maintaining the surgical precision and minimal side effects that training-free methods aspire to but cannot guarantee. More broadly, our work establishes that mechanistic interpretability tools can serve as a foundation for precise and controllable generation in the video domain.

We summarize our main contributions as follows:

  • We propose EraseSAE, the first framework to leverage SAEs for concept erasure in T2V diffusion models, which surgically removes target concepts through a decompose-attribute-erase pipeline in monosemantic feature space.
  • We introduce PConvSAE, a convolutional sparse autoencoder with a partitioned architecture that decomposes dense visual representations into interpretable sparse features while preserving spatiotemporal coherence.

X. Wang et al.

  • We design a contrastive attribution mechanism that isolates concept-correlated features and derives timestep-resolved spatiotemporal masks, confining erasure to where target concepts are active while preserving non-target content.
  • Extensive experiments across multiple T2V diffusion models and diverse concept erasure tasks demonstrate that EraseSAE achieves state-of-the-art erasure effectiveness while preserving generation quality, outperforming the strongest baseline by 34.5% in erasure accuracy and 8.3% in SSIM.

References (39)