EntiRE: Invariant Learning for Robust Concept Erasure in Text-to-Image Generative Models

Fengyuan Yu, Yuyuan Li, XiaoHua Feng, Li Zhang, Jiaming Zhang, Xiang Liu, Jun Wang, Chaochao ChenNeurIPS 2026

TL;DR

Trying to make text-to-image diffusion models "forget" harmful or copyrighted concepts is like scrubbing a stubborn stain: current methods clean up the obvious spots, but leave microscopic, hidden pockets behind that adversarial prompts easily exploit. By framing concept erasure as an out-of-distribution generalization problem and smoothing out the model's "forgetting" landscape, the authors introduce EntiRE—a framework that wipes out unwanted concepts uniformly across the entire prompt space without ruining the model's artistic talent.

What Problem Does This Paper Address?

Text-to-image diffusion models (like Stable Diffusion) gulp down vast, uncurated swaths of the internet during training. Inevitably, they learn to generate things we’d rather they didn’t: explicit content, private data, or copyrighted artistic styles. Retraining these behemoths from scratch on clean data is prohibitively expensive, and slap-on safety filters are trivial for bad actors to bypass when model weights are public.

Enter post-hoc concept erasure: fine-tuning a pre-trained model to surgically remove specific concepts. While existing erasure methods work against polite, straightforward prompts, they crumble under adversarial prompt attacks—cleverly optimized text or continuous "soft" embeddings that trick the model into regenerating the forbidden concept.

Why do even adversarially-trained erasure methods still fail? By visualizing the prompt embedding space, the authors discovered a fascinating geometric quirk. As erasure methods get more sophisticated, their coverage expands, but not evenly. Instead of wiping a concept out cleanly, they leave behind localized residual holes—tiny, stubborn islands in the continuous prompt space where the concept survives, just waiting for an optimizer to stumble upon them.

Figure 1: Prompt embedding visualization and schematic interpretation of erasure coverage for the nudity concept in the EOS space. (a) shows retain prompts, target-concept prompts, and adversarial prompts against different erased models; colors indicate the attacked model, and marker shapes indicate the attack method. (b)-(d) show the adversarial prompts for ESD, RECE, and STEREO, respectively, together with schematic region annotations summarizing the implied erasure patterns.

Methods

To pave over these residual potholes, the authors propose EntiRE (Entire-space Robust Erasure).

First, what’s standard: EntiRE adopts an existing two-stage "search-then-erase" pipeline (building on prior frameworks like RACE and STEREO) and uses standard negative-guidance noise objectives to push the model away from target concepts while using a "retain loss" to protect unrelated concepts. In Stage 1, the system launches multiple adversarial search trajectories, alternating between erasing a concept and hunting for new continuous adversarial prompts to map out the vulnerable regions of the prompt space.

Now, what’s novel: In Stage 2, instead of just playing whack-a-mole with those discovered prompts, EntiRE treats different regions of the prompt space as distinct "environments" and casts robust erasure as an Out-of-Distribution (OOD) generalization problem.

  • Invariant Risk Minimization (IRM): They introduce a dummy auxiliary task head ($\xi$, fixed at 1 with gradient tracking) to absorb environment-specific variations, forcing the underlying diffusion model to learn erasure behavior that is invariant no matter how a prompt is phrased or embedded.
  • Total Variation (TV) Regularization: Borrowed from classic image denoising—where TV smooths out grainy static while keeping sharp edges—EntiRE applies a TV penalty to the risk landscape itself. By penalizing sharp local fluctuations in erasure difficulty across environments, it forces the erasure to be piecewise-constant, effectively sealing up localized residual holes.
  • Primal-Dual Optimization: Because theory dictates the TV penalty weight should adapt to the current model state, an auxiliary network dynamically tunes the regularization strength via a min-max game during fine-tuning.
Figure 2: Overview of EntiRE, a two-stage framework for robust concept erasure. Stage 1 constructs adversarial prompts to expand target-concept coverage across environments. Stage 2 optimizes the erased model with the IRM objective to achieve more uniform concept erasure across environments.

Datasets

No new benchmarks are introduced; instead, the authors evaluate on standard community benchmarks across three erasure tasks alongside general utility datasets:

  • Nudity Removal: Evaluated on a filtered subset of the Inappropriate Image Prompts (I2P) dataset.
  • Artistic Style Removal: Erasing Van Gogh’s style using the shared prompt set from ESD, evaluated via a WikiArt-trained classifier.
  • Object Removal: Erasing the church class (from Imagenette, a 10-class subset of ImageNet) using the prompt set from UnlearnDiffAtk.
  • Utility & Retain Data: MS-COCO (5,000 captions for CLIP alignment scores, 10,000 image-caption pairs for FID visual quality, and remaining samples for the training retain set).
  • Relearning Tests: DreamBench++ and DiffusionDB are used for benign fine-tuning experiments.

Key Insights and Ideas

  • Erasure difficulty isn't flat: Prompt spaces are heterogeneous. Adversarial prompts don't wander into unrelated semantic territory to sneak past defenses; they camp right inside the original target-concept region, exploiting tiny, high-difficulty pockets left behind by uneven optimization.
  • Denoising the loss landscape: Applying Total Variation regularization not to pixels, but to environment-wise erasure risk, is a remarkably clean conceptual leap. You can't exhaustively sample an infinite continuous prompt space, so forcing the erasure risk to be locally smooth is the next best way to guarantee no hidden spikes remain between your training points.
  • Theoretical alignment: The authors prove mathematically that minimizing average risk plus an adaptive, model-dependent TV penalty is equivalent to solving the intractable worst-case OOD erasure problem across all environments.

Key Results

Tested on Stable Diffusion v1.4 against eight baselines and three red-teaming attacks—Ring-A-Bell (black-box hard prompt), UnlearnDiffAtk (white-box hard prompt), and Circumventing Concept Erasure / CCE (white-box soft prompt)—EntiRE shines brightest against the hardest attacks:

  • Crushing Soft-Prompt Attacks: Existing robust baselines still buckle under CCE, suffering average Attack Success Rates (ASRs) of 49.46% (nudity), 56.00% (Van Gogh), and 77.33% (church). EntiRE slashes the average CCE ASR across all three tasks down to 16.42%—a 73.05% relative reduction. On nudity specifically, CCE ASR drops to just 3.26% (compared to 7.61% for STEREO and ~67–75% for RECE and AdvUnlearn).
  • Better Image Quality: Usually, heavy-handed erasure breaks the model's general capabilities. Yet EntiRE achieves a better average CLIP-5k score (0.3058 vs. 0.2988) and lower (better) FID-10k (17.18 vs. 20.37) than prior adversarially robust baselines.
Comparison table for nudity erasure showing EntiRE achieving the lowest CCE attack success rate alongside strong COCO utility metrics.

Limitations and Future Work

  • Scaling to Multi-Concept Erasure: Because Stage 1 relies on running dedicated adversarial search trajectories for a target concept, erasing many concepts simultaneously gets computationally pricey. Future work will need shared or amortized adversarial search strategies to scale efficiently.
  • Prompt Attacks vs. Fine-Tuning Trade-offs: When subjected to benign fine-tuning (relearning) on datasets like DiffusionDB, EntiRE holds up well (3.26% inappropriate image rate), beating most baselines. However, specialized alignment methods like ResAlign achieve slightly lower post-fine-tuning recovery (1.45%) while remaining much weaker against prompt attacks (26.08% CCE ASR vs. EntiRE's 3.26%)—highlighting an intriguing open trade-off between weight-space resilience and prompt-space robustness.

Summary updated

Abstract

Large-scale text-to-image diffusion models can inadvertently generate harmful or sensitive content learned from uncurated training data, motivating the development of concept erasure methods that remove undesired concepts from pre-trained models. However, recent studies reveal that erased models remain vulnerable to adversarial prompt attacks that recover the supposedly removed concepts, highlighting the need for robust erasure techniques. In this work, we visualize the text embedding distributions of adversarial prompts and find that the difficulty of erasure is non-uniform. Existing methods effectively erase concepts in easier regions but leave localized residual holes in harder regions, which adversarial prompts consistently exploit. Motivated by this finding, we propose Entire-space Robust Erasure (EntiRE), an end-to-end framework that casts robust concept erasure as an out-of-distribution generalization problem. By adopting an invariant learning formulation regularized by total variation, EntiRE enforces more uniform erasure across the continuous prompt space, suppressing the localized residual regions. Extensive experiments on erasing nudity, artistic style, and object concepts demonstrate that EntiRE consistently outperforms state-of-the-art baselines in both robustness against adversarial prompt attacks and utility preservation.
BibTeX
@inproceedings{yu2026entire,
  author = {Fengyuan Yu and Yuyuan Li and XiaoHua Feng and Li Zhang and Jiaming Zhang and Xiang Liu and Jun Wang and Chaochao Chen},
  title = {{EntiRE: Invariant Learning for Robust Concept Erasure in Text-to-Image Generative Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=ch8Vn8e6ZM},
}
Figure