Rethinking Robust Adversarial Concept Erasure in Diffusion Models

Qinghong Yin, Yu Tian, Yue ZhangarXiv 2025 · DOI

Introduction

Text-to-image diffusion models, such as Stable Diffusion, have revolutionized content creation but also introduced risks regarding the generation of undesirable content, including NSFW imagery and copyrighted artistic styles. Concept erasure has emerged as a critical technique to fine-tune these models so they "forget" specific concepts while maintaining overall generative quality.

While adversarial training is the current state-of-the-art for erasure, existing methods often fail to capture the full "concept space." This leads to either miserasures, where the concept persists under certain prompts, or over-erasure, where the model's general performance degrades. This paper introduces S-GRACE (Semantics-Guided Robust Adversarial Concept Erasure), a framework designed to address these limitations by ensuring adversarial samples accurately represent the target concept's semantic distribution.

The S-GRACE Framework

S-GRACE operates through a two-phase process that leverages semantic guidance to improve both attack robustness and training efficiency.

1. Semantics-Guided Adversarial Attacks

Rather than starting with random noise, S-GRACE uses a Large Language Model (LLM) to generate a diverse set of prompts related to the target concept. These samples are then optimized using a dual-objective loss:

  • Diffusion Loss: Maintains the target image structure.
  • Semantic Loss: Ensures the sample remains within the target concept's hidden space in the text encoder.

2. Semantics-Guided Adversarial Training

Following the identification of robust adversarial samples, the model is fine-tuned. S-GRACE focuses exclusively on the text encoder, which allows for modular, component-level erasure. The training employs a multi-objective loss that maximizes the distance between adversarial samples and the target concept while constraining the erasure to a specific subspace to prevent catastrophic forgetting of unrelated concepts.

Key Insights: Concepts as Distributions

A core finding of this research is that concepts in diffusion models are not single points but rather clusters of related semantic expressions. Existing adversarial methods often attack only a narrow sliver of this cluster, leaving the rest of the concept intact.

PCA visualization of concept distributions across different categories. S-GRACE (blue) demonstrates superior coverage of the target concept space (red crosses) compared to baseline methods, which often cluster too narrowly or drift.

By using semantic guidance, S-GRACE ensures that adversarial samples are "anchored" to the correct distribution, preventing the optimization process from wandering into unrelated territory.

Experimental Evaluation

The researchers evaluated S-GRACE across three categories: NSFW attributes (nudity, violence), artistic styles (Van Gogh, Picasso), and specific objects (e.g., garbage trucks). Performance was measured against the COCO 30K validation set using metrics like FID and CLIP scores to ensure general quality preservation.

Results and Performance

S-GRACE significantly outperforms previous state-of-the-art (SOTA) methods in three key areas:

  • Efficiency: Training time is reduced by 90%. For example, erasing "Nudity" takes approximately 4 minutes with S-GRACE, compared to over an hour for some baselines.
  • Effectiveness: Erasure performance, measured by Attack Success Rate (ASR), improved by at least 26% across various scenarios.
  • Robustness: When subjected to heavy adversarial attacks (e.g., UnlearnDiff), S-GRACE maintained a much lower ASR (12.68%) compared to methods like ESD (80.00%) or R.A.C.E (47.00%).
Comparison of ASR, training time, and image quality (FID) across different erasure methods. S-GRACE (represented by the star) achieves the lowest ASR and training time while maintaining competitive image quality.

Limitations and Future Work

Despite its success, S-GRACE relies on the ability of an LLM to accurately describe the target concept space. If the initial keywords are sub-optimal, the erasure may be less effective. Furthermore, extremely broad concepts like "violence" remain challenging due to their vast semantic diversity. Future research will explore finding the optimal number of adversarial samples for different concept types and further refining the modularity of text-encoder-based erasure.

Summary updated

BibTeX
@misc{yin2025rethinking,
  author = {Qinghong Yin and Yu Tian and Yue Zhang},
  title = {{Rethinking Robust Adversarial Concept Erasure in Diffusion Models}},
  year = {2025},
  eprint = {2510.27285},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.27285},
}
Figure