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

Jiahang Tu, Qian Feng, Jiahua Dong, Hanbin Zhao, Chao Zhang, Nicu Sebe, Hui Qian

TL;DR

CE-SDWV is a new framework that "erases" undesirable concepts (like NSFW content or copyrighted styles) from text-to-image diffusion models without ever touching the model's weights. By using an LLM-generated vocabulary to define a "harmful" semantic subspace and then projecting text prompts away from it, the method achieves state-of-the-art erasure in just 28 seconds with near-zero storage overhead.

What Problem Does This Paper Address?

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:

  1. Model-based tuning: These methods retrain the model to forget concepts. While effective, they are computationally expensive, slow, and require storing a new set of heavy model weights for every concept erased.
  2. Text-based suppression: These methods try to filter or modify the input prompt. However, they often fail because information about a "banned" concept can "leak" into seemingly innocent tokens (like the "end of text" token or unrelated words) due to the model's internal attention mechanisms.

The authors aim to create a method that is as effective as model retraining but as efficient as simple text filtering.

Methods

The CE-SDWV (Concept Erasure via a Semantic-Driven Word Vocabulary) framework operates in three distinct stages:

  1. Semantic-Driven Concept Representation: Instead of relying on a single keyword (e.g., "nude"), the authors use GPT-4 to generate a broad vocabulary of related words and synonyms. They encode these into a matrix and use Singular Value Decomposition (SVD) to identify the "principal components" that define 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 even if a concept is hidden in the background of a sentence, it is surgically removed from the embedding space.
  3. Gradient-Orthogonal Token Optimization: Simply removing components can sometimes degrade image quality or make the prompt "unrecognizable" to the model. To fix this, the authors optimize the suppressed tokens to better align with the original image's "benign" features. Crucially, they use gradient-orthogonal projection, ensuring the optimization only improves image quality and never accidentally re-introduces the erased concept.

Datasets

The authors evaluated their method across several standard benchmarks:

  • I2P (Inappropriate Image Prompts): Used to test the erasure of NSFW and sexually explicit content.
  • UnlearnCanvas: A benchmark for erasing specific objects (e.g., "dogs," "cars") and artistic styles (e.g., "Van Gogh," "Monet").
  • MS-COCO: Used to ensure that erasing one concept doesn't break the model's ability to generate normal, unrelated images (general generative quality).

Key Insights and Ideas

  • The "Leakage" Problem: The paper highlights that even if you remove a word like "naked" from a prompt, the model's attention mechanism has already "smeared" that concept across other tokens like "smile" or the "End of Text" (EOT) marker. Effective erasure must be "token-wise" across the entire prompt.
  • Subspace Projection is Key: By treating a concept as a mathematical subspace rather than a single point, the authors can perform a "surgical strike" on the embeddings, removing the harmful bits while leaving the rest of the data intact.
  • Efficiency via Weight-Free Editing: Because the method only modifies the input embeddings (the "instructions" given to the model) and not the model itself, it avoids the massive overhead of fine-tuning.

Key Results

  • Speed and Storage: CE-SDWV completes the erasure process for a concept in roughly 28 seconds, compared to minutes or hours for model-tuning methods. It requires only 0.004 GB of storage, whereas model-tuning methods often require several gigabytes.
  • Effectiveness: On the I2P benchmark, CE-SDWV detected the lowest amount of explicit content (84 instances) compared to other SOTA methods like MACE (111) or ESD (123).
  • Robustness: The method proved highly resistant to "Adversarial Prompt Attacks" (where users try to bypass filters using gibberish or coded language), maintaining a much lower attack success rate than traditional text-based filters.
  • Versatility: The authors successfully applied the method to Stable Diffusion v1.4, v2.1, SD-XL, and even the newer rectified flow-based SD v3.5.

Limitations and Future Work

  • Visual Inconsistencies: The authors note that there are sometimes slight inconsistencies in the "benign" parts of an image before and after erasure (e.g., a person's face might change slightly when their clothes are added via erasure).
  • Single Concept Focus: Currently, the framework is optimized for erasing one concept at a time. The authors suggest that extending this to simultaneously erase multiple, disparate concepts is a primary direction for future research.
  • LLM Dependency: The quality of the initial "concept vocabulary" depends on the LLM used (GPT-4), which might have its own internal biases or safety filters that limit the vocabulary it can generate.

Summary updated

BibTeX
@article{tu2026ce,
  author = {Jiahang Tu and Qian Feng and Jiahua Dong and Hanbin Zhao and Chao Zhang and Nicu Sebe 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},
}

Loading related content...

Figure