Abstract
Recent advances in text-to-image generative models have raised concerns about their potential to produce harmful content when provided with malicious input text prompts. To address this issue, two main approaches have emerged: (1) fine-tuning the model to unlearn harmful concepts and (2) training-free guidance methods that leverage negative prompts. However, we observe that combining these two orthogonal approaches often leads to marginal or even degraded defense performance. This observation indicates a critical incompatibility between two paradigms, which hinders their combined effectiveness. In this work, we address this issue by proposing a conceptually simple yet experimentally robust method: replacing the negative prompts used in training-free methods with implicit negative embeddings obtained through concept inversion. Our method requires no modification to either approach and can be easily integrated into existing pipelines. We experimentally validate its effectiveness on nudity and violence benchmarks, demonstrating consistent improvements in defense success rate while preserving the core semantics of input prompts.
1. Introduction
As text-to-image (T2I) diffusion models like Stable Diffusion grow in capability, the risk of generating unsafe content—such as nudity or violence—has become a primary concern for the research community. To mitigate this, two dominant strategies have emerged: training-based "unlearning," which fine-tunes models to forget harmful concepts, and training-free "guidance," which uses negative prompts at inference time to steer the model away from unwanted outputs.
While a "belt and suspenders" approach combining both methods seems intuitive, this research identifies a critical failure mode: unlearned models often become "deaf" to explicit negative prompts. This paper introduces a method to recover implicit concept embeddings from unlearned models, restoring the effectiveness of safety guidance and significantly improving defense success rates.
2. The Incompatibility Problem
The authors discovered that once a model is fine-tuned to unlearn a concept (e.g., using the DUO method), it frequently stops responding to the specific text tokens meant to guide it. If a model no longer "understands" the token for "nudity," instructing it to avoid that concept at inference time is ineffective. Paradoxically, these unlearned models can still be manipulated into generating harmful imagery through adversarial prompts, but the standard safety "brakes" provided by negative prompts no longer function. This suggests that unlearning does not delete a concept but rather severs the link between the linguistic token and the visual representation.
3. Methodology: Implicit Concept Embeddings
To bridge this gap, the researchers propose replacing manually selected text-based negative prompts (like "blood" or "violence") with implicit concept embeddings ($c_*$). This is achieved through a process called Concept Inversion:
- Data Collection: A small dataset of harmful images is gathered.
- Inversion: A diffusion-based inversion technique (similar to Textual Inversion) is used to find a specific vector in the model's embedding space that represents the visual concept of those images.
- Integration: This optimized vector is used as the "negative" anchor in existing guidance frameworks like Safe Latent Diffusion (SLD) and SAFREE.
This approach requires no changes to model weights or underlying algorithms; it simply swaps a generic text token for a model-specific "implicit" token that the unlearned model still recognizes in its latent space.
4. Experimental Results
The method was evaluated on the Ring-a-Bell (nudity) and I2P (violence) benchmarks using NudeNet and the Q16 classifier for detection. The results demonstrate that while standard guidance methods often fail to improve the safety of unlearned models, the proposed implicit embeddings provide a significant boost.
In the violence task, adding standard SAFREE guidance to a DUO-unlearned model achieved a Defense Success Rate (DSR) of 0.7867. Utilizing implicit embeddings (DUO+SAFREE+Ours) increased the DSR to 0.9333. Similarly, in the nudity task, standard SLD guidance showed no improvement over a base unlearned model (DSR 0.7158), whereas the proposed method boosted the DSR to 0.9895.
5. Key Insights and Conclusion
The study reveals that unlearning leaves behind a "residual latent space." Even when a model is "deaf" to a word, it retains implicit representations of harmful content. By using Concept Inversion, researchers can rediscover these hidden triggers to build more robust defenses.
While the method currently requires a small dataset of harmful images for inversion and is most effective when tailored to specific checkpoints, it represents a significant step toward synergistic AI safety. Future work will focus on generalizing these implicit embeddings across different architectures and automating the discovery of latent harmful anchors without reference datasets.
Summary updated