CE-SDWV: Effective and Efficient Concept Erasure for Text-to-Image Diffusion Models via a Semantic-Driven Word Vocabulary

Jiahang Tu, Qian Feng, Chufan Chen, Jiahua Dong, Hanbin Zhao, Chao Zhang, Hui Qian · OpenReview

Abstract

Large-scale text-to-image (T2I) diffusion models have achieved remarkable generative performance about various concepts. With the limitation of privacy and safety in practice, the generative capability concerning NSFW (Not Safe For Work) concepts is undesirable, e.g., producing sexually explicit photos, and licensed images. The concept erasure task for T2I diffusion models has attracted considerable attention and requires an effective and efficient method. To achieve this goal, we propose a CE-SDWV framework, which removes the target concepts (e.g., NSFW concepts) of T2I diffusion models in the text semantic space by only adjusting the text condition tokens and does not need to re-train the original T2I diffusion model's weights. Specifically, our framework first builds a target concept-related word vocabulary to enhance the representation of the target concepts within the text semantic space, and then utilizes an adaptive semantic component suppression strategy to ablate the target concept-related semantic information in the text condition tokens. To further adapt the above text condition tokens to the original image semantic space, we propose an end-to-end gradient-orthogonal token optimization strategy. Extensive experiments on I2P and UnlearnCanvas benchmarks demonstrate the effectiveness and efficiency of our method.

Introduction

Large-scale text-to-image (T2I) models like Stable Diffusion are trained on massive, often uncurated internet datasets. Consequently, they can easily generate "Not Safe For Work" (NSFW) content, sexually explicit images, or mimic copyrighted artistic styles. Existing solutions generally fall into two camps: model-based tuning, which is computationally expensive and requires storing heavy model weights, and text-based suppression, which often fails due to internal model dynamics.

The "Leakage" Problem

A primary challenge in concept erasure is that information about a "banned" concept can "leak" into seemingly innocent tokens. For example, even if the word "naked" is removed from a prompt, the model's internal attention mechanisms may have already smeared that concept across other tokens like "smile" or the "End of Text" (EOT) marker. This leakage allows the model to reconstruct the forbidden concept even when the explicit keyword is absent.

Visualization of semantic leakage where concept information spreads across seemingly unrelated tokens.

Methodology: The CE-SDWV Framework

The CE-SDWV (Concept Erasure via a Semantic-Driven Word Vocabulary) framework operates in three distinct stages to achieve effective erasure without modifying model weights:

  1. Semantic-Driven Concept Representation: Instead of relying on a single keyword, the framework uses an LLM (like GPT-4) to generate a broad vocabulary of related words and synonyms. These are encoded into a matrix, and Singular Value Decomposition (SVD) is applied to identify the "principal components" defining the target concept's semantic subspace.
  2. Adaptive Component Suppression: The framework identifies and removes these "harmful" principal components from every token in a user's prompt. This ensures that the concept is surgically removed from the entire embedding space, addressing the leakage problem.
  3. Gradient-Orthogonal Token Optimization: To prevent image quality degradation, the suppressed tokens are optimized to align with the original image's "benign" features. Crucially, a gradient-orthogonal projection ensures this optimization never accidentally re-introduces the erased concept.

Evaluation and Results

The authors evaluated CE-SDWV across several standard benchmarks, including I2P (Inappropriate Image Prompts) for NSFW content and UnlearnCanvas for specific objects and artistic styles.

Effectiveness and Efficiency

CE-SDWV achieves state-of-the-art erasure performance with significantly lower overhead. On the I2P benchmark, it detected the lowest amount of explicit content compared to other SOTA methods. Furthermore, the process is remarkably fast, completing in roughly 28 seconds and requiring only 0.004 GB of storage—a fraction of the gigabytes required by model-tuning methods.

Visual results of NSFW concept erasure, showing the transformation from explicit to benign content.

Robustness and Versatility

The method proved highly resistant to "Adversarial Prompt Attacks," where users attempt to bypass filters using coded language. It has been successfully applied to a wide range of models, including Stable Diffusion v1.4, v2.1, SD-XL, and the newer rectified flow-based SD v3.5.

Conclusion

CE-SDWV provides a highly efficient, weight-free alternative to traditional concept erasure. By treating concepts as mathematical subspaces and performing token-wise suppression, it effectively blocks undesirable content while maintaining high generative quality. Future work will focus on simultaneous multi-concept erasure and reducing dependency on specific LLMs for vocabulary generation.

Summary updated

BibTeX
@article{tu2026ce,
  author = {Jiahang Tu and Qian Feng and Chufan Chen and Jiahua Dong and Hanbin Zhao and Chao Zhang and Hui Qian},
  title = {{CE-SDWV: Effective and Efficient Concept Erasure for Text-to-Image Diffusion Models via a Semantic-Driven Word Vocabulary}},
  journal = {Int. J. Comput. Vis.},
  year = {2026},
  doi = {10.1007/s11263-026-02897-x},
}
Figure