TL;DR
Current machine unlearning methods for text-to-image diffusion models fail to fully erase targeted concepts, leaving them vulnerable to jailbreak attacks. By constraining attack tokens to be non-negative linear combinations of existing vocabulary words, SubAttack extracts an orthogonal set of interpretable vectors that reveal how models retain hidden associations of "forgotten" concepts. Inverting this insight, SubDefense projects out these residual subspaces from the text embedding space, providing a plug-and-play defense that mitigates jailbreaks while preserving harmless image generation quality.
What Problem Does This Paper Address?
Fine-tuning methods for Machine Unlearning (MU)—such as ESD, FMN, and UCE—are designed to make text-to-image (T2I) diffusion models "forget" copyrighted styles, explicit content (NSFW), or unwanted objects without retraining the entire model from scratch. However, while these models suppress explicit prompts (e.g., "a photo of a nude person"), they remain vulnerable to adversarial jailbreaks that force the model to regenerate the target concept.
Existing jailbreak attacks rely on opaque, non-interpretable prompt optimizations or arbitrary continuous embeddings. Because they operate as black or gray boxes, they fail to explain how or where unlearned models still harbor residual concepts. Furthermore, existing defenses (such as RECE) are narrowly tailored to specific unlearning algorithms and specific attacks, leaving the broader defense landscape largely unaddressed.
Methods
The authors exploit the linear representation hypothesis within the CLIP text embedding space to design both an interpretable attack and a lightweight defense:
- SubAttack (Subspace Jailbreaking Attack):
- Interpretable Token Formulation: Instead of searching an unconstrained embedding space, SubAttack optimizes an attack token embedding $v_{\text{att}}$ as a non-negative linear combination of existing CLIP vocabulary embeddings: $v_{\text{att}} = \sum_{i=1}^N \alpha_i v_i$, where weights $\alpha_i = g_\Theta(v_i) \ge 0$ are generated by a lightweight 2-layer MLP with ReLU activations.
- Orthogonal Deflation: To prevent multiple attack tokens from collapsing into the same semantic vector, the authors sequentially learn $K$ attack embeddings. After learning token $v_{\text{att},k}$, its direction is projected out from the entire vocabulary before learning $v_{\text{att},k+1}$.
- Global Scope: Unlike local attacks that optimize an adversarial prompt per image, SubAttack learns global tokens that generalize across prompts and random noise seeds.
Vocabulary V ──> [MLP g_Θ] ──> Weights α_i ──> Linear Combination v_att
│
Updated Vocabulary V_(k+1) <── Deflation (Orthogonal Projection)
- SubDefense (Subspace Projection Defense):
- Stacking the learned attack directions into a matrix $V_{\text{att}} = [v_{\text{att},1}, \dots, v_{\text{att},K}]$, SubDefense protects the unlearned model by projecting every token embedding in the CLIP vocabulary onto the null space of $V_{\text{att}}$: $$v_{\text{def},i} = v_i - \text{Proj}_{V_{\text{att}}}(v_i)$$
- This plug-and-play approach removes residual concept pathways without requiring further fine-tuning of the diffusion UNet weights.
Datasets
- Base Models: Stable Diffusion v1.4 unlearned via ESD, FMN, UCE, SPM, MACE, SA, AC, SalUn, and EraseDiff.
- Concepts Evaluated: NSFW ("nudity"), artistic styles ("Van Gogh"), and objects ("church", "garbage truck", "parachute", "tench", "airplane", "ship").
- Benchmark Data: A newly constructed evaluation dataset comprising 300 to 900 (prompt, seed) pairs per concept (with $\ge 10$ seeds per prompt to evaluate noise invariance), roughly $6\times$ larger than UnlearnDiff’s benchmark.
- Standard Benchmarks: The I2P (Inappropriate Image Prompts) dataset for NSFW evaluation, and MSCOCO-10k captions for measuring FID and CLIP scores on benign generation quality.
Key Insights and Ideas
- Surface Erasure vs. Deep Association: Inspecting the largest $\alpha_i$ weights reveals that unlearning merely mutes direct keywords (e.g., "nude", "naked"). Models still retain secondary and implicit associations (e.g., "slave", "nip", "babes" for nudity; "dumpster", "bin", "landfill" for garbage truck; "kirk", "abbey" for church; "monet", "munch", "night" for Van Gogh).
- Inherited from the Pretrained Base: Attack embeddings learned on unlearned models transfer back to the base Stable Diffusion model with $>80\%$ success, proving that residual vulnerabilities are inherited from pretraining rather than introduced by unlearning artifacts.
- Orthogonality Unlocks the Residual Subspace: Forcing attack directions to be orthogonal exposes the true dimensionality of the retained concept, yielding significantly higher attack success rates (ASRs) than single unconstrained vectors.
- Surgical Concept Removal: Rather than naively deleting all related tokens (which degrades language capabilities), projecting out the composed subspace preserves benign prompts sharing similar semantic features (e.g., generating "blue" or "star" remains intact when defending against "Van Gogh").
Key Results
- Attack Effectiveness and Efficiency: SubAttack consistently outperforms prior methods like UnlearnDiff and CCE across diverse models. On ESD, SubAttack attains an ASR of 97.56% for nudity, 81.00% for Van Gogh, and 91.33% for church (versus UnlearnDiff's 51.11%, 40.94%, and 51.74%). Moreover, SubAttack requires only 54.2 seconds per image on average, compared to 906.6 seconds for UnlearnDiff.
- Cross-Model Transferability: Embeddings learned on ESD transfer successfully to FMN, UCE, and SPM, achieving ASRs up to 96.89% on nudity and 92.89% on church.
- Superior Defense Performance: When deployed on UCE, SubDefense outperforms the baseline RECE defense across all tested concepts:
- SubAttack ASR on UCE: Drops to 34.11% (nudity) and 5.22% (church) with SubDefense, compared to 62.44% and 80.33% under RECE.
- Utility Preservation: Defended models maintain lower FID (16.64 vs. 17.11 for Van Gogh) and higher CLIP scores (30.94 vs. 30.08) on MSCOCO-10k compared to RECE.
Limitations and Future Work
- Trade-off on Continuous Embedding Attacks (CCE): Completely nullifying unconstrained attacks like CCE requires blocking a large number of directions ($\sim 390$ tokens), which causes notable degradation in FID and CLIP scores on safe prompts.
- Linearity Assumption: The approach relies on linear combinations over a predefined discrete vocabulary; purely nonlinear representations or out-of-vocabulary residual cues cannot be captured.
- Static Direction Selection: The number of blocked directions ($K$) is currently chosen via heuristic grid search; adaptive or attention-weighted selection mechanisms remain an open direction.
- Scope: The evaluation focuses primarily on CLIP-conditioned Stable Diffusion architectures and has not yet been extended to other multimodal text encoders or diffusion backbones (e.g., T5-based architectures).
Summary updated