Removing Concepts from Text-to-Image Models with Only Negative Samples

Hanwen Liu, Yadong MuNeurIPS 2025

TL;DR

Clipout is a remarkably efficient "machine unlearning" method that scrubs specific concepts (like private faces, copyrighted styles, or harmful content) from text-to-image models without expensive retraining. By focusing solely on the text encoder and using a "negative-only" contrastive loss, it effectively scrambles target embeddings in seconds, outperforming state-of-the-art methods in both speed and precision.

The Challenge of Machine Unlearning

Large-scale text-to-image (T2I) models like Stable Diffusion are double-edged swords. While they are creative powerhouses, they often memorize sensitive data from their massive, unfiltered training sets. This can lead to the generation of deepfakes, copyrighted artwork, or harmful imagery.

The core challenge is Machine Unlearning: how do we make a model "forget" a specific concept (e.g., a specific person's face) without breaking everything else it knows? Traditional solutions are either too slow (requiring full model fine-tuning), too imprecise (accidentally erasing related but benign concepts), or require "anchor" concepts (positive samples) to guide the forgetting process, which isn't always practical.

The Clipout Method

To address these inefficiencies, the authors introduce Clipout, which shifts the focus from the entire diffusion process to just the text encoder (like CLIP). Their approach is built on two clever pillars:

  1. Decoupling: Instead of fine-tuning the massive U-Net (the part that draws the image), Clipout only updates the text encoder that provides the instructions. If the encoder can no longer produce a coherent embedding for a harmful prompt like "children with guns," the generator won't know what to draw.
  2. Negative-Only Contrastive Loss: Standard contrastive learning usually tries to bring "positive" pairs together and push "negative" pairs apart. Clipout does something counter-intuitive: it takes the embedding of the target concept, creates multiple versions of it by randomly "clipping" (masking) parts of the vector, and treats all of them as negative samples.
Clipout Method Overview

As illustrated above, by forcing the model to maximize the distance between these masked variants ($z_1, z_2, ..., z_N$) of the same concept, the embedding space for that concept becomes scattered and incoherent. The model essentially "loses its mind" regarding that specific prompt, while leaving other parts of the embedding space untouched.

Datasets and Evaluation

The researchers evaluated Clipout across several domains to ensure robust unlearning:

  • Personal Concepts: Used VGGFace2 and CelebA-HQ to simulate removing specific individuals, a crucial task for deepfake defense.
  • Built-in Concepts: Used subsets of LAION-5B to target harmful concepts.
  • General Quality: Used MS-COCO to ensure that unlearning one concept didn't degrade the model's ability to generate unrelated images.
  • Inappropriate Prompts: Tested against the I2P (Inappropriate Image Prompts) benchmark.

Key Insights and Results

  • The "Negative-Only" Advantage: Most unlearning requires a "positive" anchor (e.g., "erase 'Monet' by making it look like 'Art'"). Clipout requires zero prior knowledge of what the output should look like; it only needs to know what to destroy.
  • Text Encoder as the Bottleneck: The study proves that the text encoder is a highly effective point of intervention. Scrambling the "concept vector" is often more precise than trying to steer the diffusion generation process itself.
  • Unmatched Efficiency: Clipout is incredibly fast. It takes roughly 40 seconds to unlearn a concept, compared to ~900 seconds for baselines like Erasing Concepts from Diffusion Models (ESD) or Ablating Concepts (ASD).
  • Low Memory Footprint: It requires significantly less VRAM (~10GB vs. ~37GB), making it accessible on consumer-grade GPUs.
  • High Precision: In face-erasure tests, Clipout achieved a much higher Face Detection Failure Rate (FDFR) for the target person while maintaining high fidelity for similar but non-target concepts (e.g., erasing a specific man but still being able to draw "a photo of a male person"). It also successfully prevented the imitation of specific artists (like Claude Monet) even when the prompt was only partially matched.

Limitations and Future Work

Despite its success, the authors note a few hurdles:

  • Unpredictable Outputs: Because the method simply scrambles the embedding, the resulting images for the forbidden prompt often look like random landscapes or texture patterns. Future work could focus on making these "forgotten" outputs more controllable (e.g., turning them into solid black images).
  • Hyperparameter Sensitivity: The choice of learning rate is critical. If set too high, the "ripple effects" can start to damage unrelated concepts.
  • Black-Box Models: This method requires access to the model's weights (specifically the text encoder), meaning it cannot be applied to closed-source API-only models.

Summary updated

BibTeX
@inproceedings{liu2025removing,
  author = {Hanwen Liu and Yadong MU},
  title = {{Removing Concepts from Text-to-Image Models with Only Negative Samples}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=voHNTOO5CG},
}
Figure