CGCE: Classifier-Guided Concept Erasure in Generative Models

Viet Nguyen, Vishal M. Patel
11/8/2025
cs.CVcs.AIcs.CR

No official code found. Best implementation: viettmab/CGCE (5 stars, last commit 2025-11-05).

Abstract

Recent advancements in large-scale generative models have enabled the creation of high-quality images and videos, but have also raised significant safety concerns regarding the generation of unsafe content. To mitigate this, concept erasure methods have been developed to remove undesirable concepts from pre-trained models. However, existing methods remain vulnerable to adversarial attacks that can regenerate the erased content. Moreover, achieving robust erasure often degrades the model's generative quality for safe, unrelated concepts, creating a difficult trade-off between safety and performance. To address this challenge, we introduce Classifier-Guided Concept Erasure (CGCE), an efficient plug-and-play framework that provides robust concept erasure for diverse generative models without altering their original weights. CGCE uses a lightweight classifier operating on text embeddings to first detect and then refine prompts containing undesired concepts. This approach is highly scalable, allowing for multi-concept erasure by aggregating guidance from several classifiers. By modifying only unsafe embeddings at inference time, our method prevents harmful content generation while preserving the model's original quality on benign prompts. Extensive experiments show that CGCE achieves state-of-the-art robustness against a wide range of red-teaming attacks. Our approach also maintains high generative utility, demonstrating a superior balance between safety and performance. We showcase the versatility of CGCE through its successful application to various modern T2I and T2V models, establishing it as a practical and effective solution for safe generative AI.

View on arXivView PDF

Code Implementations(1)

viettmab/CGCECommunity60%

Official PyTorch implementation of "CGCE : Classifier-Guided Concept Erasure in Generative Models"

50Nov 5, 202511 months ago

Similar Papers

Cite this paper

@article{nguyen2025cgce,
  title  = {CGCE: Classifier-Guided Concept Erasure in Generative Models},
  author = {Viet Nguyen and Vishal M. Patel},
  year   = {2025},
  eprint = {2511.05865},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2511.05865v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2511.05865.svg)](https://codeofpaper.com/paper/2511.05865)

Discussion