Abstract
Although unlearning-based defenses claim to purge Not-Safe-For-Work (NSFW) concepts from diffusion models (DMs), this research reveals that this "forgetting" is largely an illusion. Unlearning partially disrupts the mapping between linguistic symbols and the underlying knowledge, which remains intact as dormant memories. We find that the distributional discrepancy in the denoising process serves as a measurable indicator of how much of the mapping is retained. Inspired by this, we propose IVO (Initial Latent Variable Optimization), a concise and powerful attack framework that reactivates these dormant memories by reconstructing the broken mappings. Through Image Inversion, Adversarial Optimization, and Reused Attack, IVO optimizes initial latent variables to realign the noise distribution of unlearned models with their original unsafe states. Extensive experiments across 8 widely used unlearning techniques demonstrate that IVO achieves superior attack success rates and strong semantic consistency, exposing fundamental flaws in current defenses. The code is available at anonymous.4open.science/r/IVO/.
Warning: This paper discusses and demonstrates the generation of unsafe images that may be offensive.
Introduction: The Myth of Erased Knowledge
As Diffusion Models (DMs) like Stable Diffusion become increasingly capable, the risk of generating harmful, explicit, or copyrighted content grows. To mitigate this, developers employ "unlearning"—a process intended to purge specific concepts from a model's parameters without the cost of full retraining.
However, we argue that current unlearning techniques are superficial. Instead of truly erasing knowledge, they merely disrupt the mapping between linguistic symbols (prompts) and the underlying visual concepts. The core knowledge remains intact but "dormant" within the model's weights. Existing attacks usually focus on "jailbreaking" prompts, but these are easily blocked by string filters. This paper investigates whether the model's internal noise-to-image pathways can be exploited to bypass these internal defenses entirely.
Methodology: Initial Latent Variable Optimization (IVO)
We propose IVO (Initial Latent Variable Optimization), a three-stage framework designed to reconstruct the broken links between prompts and dormant memories:
- Image Inversion: Instead of starting with random Gaussian noise, IVO uses DDIM inversion to map an existing NSFW image into the model's latent space. This provides a "warm start" that is already directionally aligned with the target concept.
- Adversarial Optimization: The initial latent is refined using a dual-loss objective:
- Distribution Matching Loss (DML): Aligns the noise distribution of the unlearned model with that of a standard, undefended model.
- Direction Calibration Loss (DCL): Steers the generation specifically toward the target NSFW content to ensure semantic fidelity.
- Reused Attack: Successful optimized latents are stored in a "latent pool." These can be sampled and reused to attack different models or prompts, significantly reducing the computational cost of repeated attacks.
Unlike prompt-based attacks, IVO operates directly in the continuous latent space, which offers a much larger and more effective search area for finding "forgotten" concepts.
Experimental Evaluation
The study utilizes several benchmarks to evaluate attack performance:
- I2P & Nude-118: Standard datasets for NSFW and nudity prompts.
- NSFW-High: A large-scale dataset (6,688 prompts) curated to test complex NSFW scenarios.
- STOB & Violence-40: Datasets targeting Style/Object removal and violent imagery.
Results and Discussion
IVO significantly outperforms existing prompt-based jailbreak methods (like Sneaky, Ring, or UDiff) across 8 different unlearning defenses, including ESD, MACE, and SPM.
Key Findings:
- Superior Success Rates: IVO achieved an average Attack Success Rate (ASR) of ~80% on the NSFW-High dataset, while the best baseline (UDiff) struggled at ~54%.
- Semantic Consistency: IVO maintains high semantic alignment with original descriptions, avoiding the garbled outputs common in prompt-based attacks.
- Model Generalization: The attack proved effective on newer architectures like SDv3 and Flux, achieving ASRs of 82% and 90%, respectively.
- Unlearning as a Local Optimum: Unlearning doesn't destroy knowledge; it pushes the model into a state where standard prompts can't reach it. The knowledge is "suppressed" rather than "removed."
- MMD as a Metric: Maximum Mean Discrepancy (MMD) correlates with unlearning strength; higher MMD indicates a more "successful" (though still bypassable) defense.
- Cross-Category Transfer: Interestingly, a latent optimized to trigger "sexual" content can sometimes be reused to trigger "violent" content, suggesting shared pathways in the latent space.
Conclusion
The "forgetting" promised by current unlearning methods is an illusion. Dormant memories persist and can be reactivated by optimizing latent variables. To truly secure diffusion models, developers must move beyond superficial mapping disruption toward fundamental weight-level erasure. IVO serves as a critical red-teaming tool to help build these more robust defenses.
Summary updated