Unlearn in Context: Contrastive Alignment via Diversified Supervision for Diffusion Models
Abstract
Concept unlearning has emerged as a promising direction for reducing the risks of harmful content generation in text-to-image diffusion models by selectively erasing undesirable concepts from a model's parameters.
Existing approaches typically rely on keywords to identify the target concept to be unlearned.
However, we show that this keyword-based formulation is inherently limited: a visual concept is multi-dimensional, can be expressed in diverse textual forms, and often overlaps with related concepts in the latent space.
We therefore adopt a contextual view: a concept should be unlearned through the company it keeps.
Under this view, keyword-based unlearning approaches, which imprecisely indicate the target concept via a fixed representation, are brittle against prompt-rephrasing jailbreaks and highly prone to collateral over-forgetting.
To address these limitations, we propose Diversified Unlearning, a framework that exposes the erasure objective to natural context-dependent embedding variations.
Rather than relying on simple prompt augmentation, we construct paired contextual formulations that introduce implicit contrastive supervision directly into the forgetting process, encouraging the model to isolate the target concept while keeping surrounding contexts invariant.
Through extensive experiments across multiple benchmarks and state-of-the-art baselines, we demonstrate that integrating our framework as a lightweight add-on into existing unlearning pipelines yields notable improvements in both erasure effectiveness and concept retention, while significantly hardening models against adversarial recovery attacks.
All experimental results and detailed implementations can be found at this https URL.