TL;DR
Researchers from NYU propose a more robust way to "sanitize" text-to-image models by using Task Vectors to erase undesirable concepts unconditionally. By shifting from prompt-specific filtering to global weight-space edits and introducing a tuning method called Diverse Inversion, they create models that are significantly harder to "jailbreak" with adversarial prompts while preserving general image-generation quality.
What Problem Does This Paper Address?
Text-to-image (T2I) models like Stable Diffusion are incredibly powerful but can be coaxed into generating "unsafe" content, such as copyrighted art styles, NSFW images, or deepfakes. Current safety methods typically focus on input-dependent erasure. They try to "forget" a concept only when the user explicitly asks for it (e.g., "a painting by Van Gogh").
The authors demonstrate that this creates a false sense of security. Adversaries can use techniques like "Concept Inversion" or "Ring-A-Bell" to find alternative prompt embeddings—often far away from the original concept name in vector space—that still trigger the forbidden generation. Essentially, existing methods poke a small hole in the model's capability, but leave the rest of the "unsafe" landscape untouched.
Methods
The paper introduces a two-pronged approach to achieve unconditional safety:
- Task Vectors (TV): Instead of fine-tuning a model to not generate a concept, the authors first fine-tune a model to only generate the target concept. The difference between these new weights and the original weights is the "Task Vector." By subtracting this vector (scaled by a factor $\alpha$) from the original model, they perform a prompt-agnostic edit in the weight space.
- Diverse Inversion: A major challenge with Task Vectors is knowing how "hard" to edit (the value of $\alpha$). Too low, and the concept remains; too high, and the model's general utility breaks. The authors propose Diverse Inversion, an optimization process that finds a wide variety of "hidden" prompts that all trigger the target concept. This diverse set acts as a robust validation suite to find the optimal $\alpha$ and identify which specific layers of the model (like the first few blocks of the U-Net) are most effective to edit.
Datasets
The researchers evaluated their approach using:
- MNIST: A toy setup to rigorously test the concept of "unconditional safety" in a low-dimensional space.
- Stable Diffusion 1.4: The primary testbed for large-scale T2I erasure.
- Target Concepts: "Van Gogh" (style), "French Horn" (object), "Nudity" (safety), and others like "Brad Pitt" or "garbage truck."
- Control Tasks: To ensure the model still worked for general tasks, they measured performance on unrelated prompts like "art by Picasso" or "Angelina Jolie."
Key Insights and Ideas
- Global vs. Local Erasure: Input-dependent methods are like putting a "Do Not Enter" sign on one specific door. Task Vectors are more like removing the room entirely from the building's blueprint.
- The Vulnerability of Proximity: As shown in Figure 1, methods like Erased Stable Diffusion (ESD) fail as soon as an adversarial prompt moves slightly outside the narrow similarity range used during training.
- Diversity is a Defense: When tuning the erasure strength, relying on a single prompt is insufficient. By forcing the "Diverse Inversion" to find embeddings that are both far from the concept name and far from each other, the researchers create a much harder "stress test" for the model.
- Layer Pruning: They discovered that you don't need to edit the whole model. Pruning the Task Vector to affect only specific U-Net blocks can maintain a better trade-off between erasing the bad stuff and keeping the model useful for everything else.
Key Results
- Adversarial Robustness: In tests against the "Ring-A-Bell" attack—which successfully bypassed seven other leading erasure methods—the Task Vector approach successfully blocked the generation of the erased concepts (see Figure 6 in the paper).
- Quantitative Success: On object erasure tasks, the TV method achieved an average accuracy of near 0% for the erased concept even under attack, whereas methods like ESD saw accuracy jump back up to ~60% when faced with adversarial inputs (Table 2).
- Utility Preservation: By using the trade-off curves generated via Diverse Inversion (Figure 4), the authors could select parameters that erased the target concept (low Erasure Score) while keeping the model's performance on unrelated "Control Tasks" high.
Limitations and Future Work
- No Provable Guarantees: The authors admit that while their method is robust against current attacks, it's impossible to prove it will be safe against all future unknown adversarial methods.
- Performance Trade-offs: High-strength erasure can still degrade the model's ability to follow complex prompts or generate high-quality images in unrelated styles.
- Scalability to Many Concepts: It is currently unclear how the model behaves when you try to erase dozens or hundreds of concepts simultaneously; the cumulative weight edits might eventually lead to catastrophic forgetting of general knowledge.
- Modality Expansion: The current work focuses on T2I; extending these "input-independent" safety concepts to Large Language Models (LLMs) remains an open challenge.
Summary updated