The Linear Geometry of Interpretable Tokens: Jailbreaking Attacks and Defenses for Unlearned Diffusion Models
Organizations: University of Michigan · Michigan State University
Abstract
Diffusion models excel at generating high-quality images but can memorize and reproduce harmful concepts when prompted. Although fine-tuning methods have been proposed to unlearn a target concept, they struggle to fully erase it while maintaining generation quality on other concepts, leaving models vulnerable to jailbreak attacks. Existing jailbreak methods demonstrate this vulnerability but offer limited insight into how unlearned models retain harmful concepts, limiting progress on effective defenses. In this work, we show that a coherent, interpretable, attack-accessible linear residual of the erased concept can be recovered in the token embedding space, and that both an attack and a defense follow from this structure. We introduce SubAttack, a novel jailbreaking attack that reads out this subspace by learning an orthogonal set of attack token embeddings, each being a linear combination of human-interpretable textual elements, revealing that unlearned models still retain the target concept through related textual components. Furthermore, our attack is also more powerful and transferable across text prompts, initial noises, and unlearned models than prior attacks. Conversely, projecting out the same subspace yields SubDefense, a lightweight plug-and-play defense mechanism that suppresses the residual concept in unlearned models. SubDefense provides stronger robustness than existing defenses while better preserving safe generation quality. Extensive experiments across multiple unlearning methods, concepts, and attack types demonstrate that our approach advances both understanding and mitigation of vulnerabilities in diffusion unlearning.
Figures & tables
| Concept | ESD | FMN | UCE | SPM |
|---|---|---|---|---|
| Van Gogh | 0.61 | 0.61 | 0.74 | 0.67 |
| Church | 0.76 | 0.85 | 0.79 | 0.82 |
| Concepts: | Nudity | Van Gogh | Church | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Victim Models: | FMN | UCE | SPM | FMN | UCE | SPM | FMN | UCE | SPM |
| NoAttack | 90.00 | 23.00 | 22.56 | 21.56 | 71.44 | 43.78 | 51.56 | 6.55 | 43.78 |
| UnlearnDiff | 93.33 | 41.33 | 38.22 | 12.78 | 64.00 | 47.11 | 6.19 | 13.33 | 58.00 |
| CCE | 93.00 | 18.33 | 37.56 | 72.33 | 43.56 | 81.33 | 91.00 | 70.11 | 92.78 |
| SubAttack (Ours) | 96.89 | 77.00 | 80.44 | 72.67 | 88.89 | 86.89 | 92.89 | 83.77 | 92.00 |
| ASR (%) | Time per Data (s) | Interp- retable | Inspire Defense | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Concepts: | Nudity | Van Gogh | Church | ||||||||||||
| Victim Models: | ESD | FMN | UCE | SPM | ESD | FMN | UCE | SPM | ESD | FMN | UCE | SPM | |||
| NoAttack | 18.78 | 90.00 | 23.00 | 22.56 | 5.78 | 21.56 | 71.44 | 43.78 | 9.33 | 51.56 | 6.55 | 43.78 | NA | NA | NA |
| UnlearnDiff | 51.11 | 100.00 | 78.22 | 83.33 | 40.94 | 100.00 | 100.00 | 53.49 | 51.74 | 35.33 | 61.67 | 53.67 | 906.6 | ✗ | ✗ |
| CCE | 85.11 | 98.33 | 77.22 | 78.33 | 75.22 | 93.33 | 95.67 | 81.67 | 82.00 | 97.78 | 81.89 | 76.67 | 11.4 | ✗ | ✗ |
| SubAttack (Ours) | 97.56 | 100.00 | 81.67 | 74.89 | 81.00 | 96.33 | 98.33 | 82.78 | 91.33 | 97.78 | 82.67 | 84.89 | 54.2 | ✓ | ✓ |
| Metrics: | UnlearnDiff ASR | SubAttack ASR | COCO-10k FID | COCO-10k CLIP | ||||
|---|---|---|---|---|---|---|---|---|
| Scenarios: | SubDefense | RECE | SubDefense | RECE | SubDefense | RECE | SubDefense | RECE |
| Nudity | 73.55% | 76.44% | 34.11% | 62.44% | 17.51 | 17.57 | 30.70 | 30.07 |
| Van Gogh | 52.78% | 61.67% | 29.44% | 84.44% | 16.64 | 17.11 | 30.94 | 30.08 |
| Church | 39.78% | 50.78% | 5.22% | 80.33% | 17.41 | 17.41 | 30.86 | 30.07 |
| Metrics: | Nudity ASR | CLIP | FID | |||
|---|---|---|---|---|---|---|
| NoAttack | UnlearnDiff | CCE | SubAttack | |||
| ESD | 18.11% | 51.11% | 85.11% | 97.56% | 30.13 | 18.23 |
| ESD+SubDefense | 0.0% | 4.56% | 75.67% | 42.33% | 29.58 | 19.20 |
| Base unlearned model | Base ASR | + SubDefense | # blocked |
| Standard unlearners | |||
| ESD | 97.56% | 42.33% (-55.23%) | 100 |
| FMN | 100% | 62.89% (-37.11%) | 100 |
| UCE | 81.67% | 28% (-53.67%) | 100 |
| SPM | 74.89% | 50.78% (-24.11%) | 100 |
| Adversarially finetuned unlearner | |||
Appendix figures & tables44 assets
Supplementary material from the paper’s appendix.
Appendix
| Scenarios: | ESD SD | FMN SD | UCE SD | SPM SD |
|---|---|---|---|---|
| Nudity | 97.44% | 97.78% | 95.89% | 86.11% |
| Van Gogh | 86% | 84% | 88.44% | 93.11% |
| Church | 87.22% | 92.56% | 85.56% | 84.33% |
| Attacks: | NoAttack | Ours | ||||||
|---|---|---|---|---|---|---|---|---|
| Victim Model: | ESD | FMN | UCE | SPM | ESD | FMN | UCE | SPM |
| Nudity | 18.78% | 90% | 23% | 22.56% | 97.56% | 100.00% | 81.67% | 74.89% |
| Van Gogh | 5.78% | 21.56% | 71.44% | 43.78% | 81% | 96.33% | 98.33% | 82.78% |
| Church | 9.33% | 51.56% | 6.55% | 43.78% | 91.33% | 97.78% | 82.67% | 84.89% |
| Garbage Truck | 4% | 41.33% | 11.33% | 12.67% | 31.33% | 91.67% | 44% | 77.67% |
| Parachute | 4% | 63.67% | 1.3% | 30.67% | 88.67% | 100% | 67% | 97% |
| Scenarios: | MACE (Nudity) | MACE (Truck) | MACE (Airplane) | MACE (Ship) | SA (Nudity) | AC (Van Gogh) |
|---|---|---|---|---|---|---|
| NoAttack | 6.67% | 10% | 0% | 6.67% | 83.33% | 21.67% |
| SubAttack (Ours) | 98.33% | 85.56% | 96.67% | 100% | 98.33% | 61.67% |
| Scenarios: | Church | Garbage Truck | Parachute | Tench |
|---|---|---|---|---|
| SalUn (NoAttack) | 1.67% | 5% | 5% | 0% |
| SalUn (SubAttack) | 56.67% | 40% | 86.67% | 11.67% |
| EraseDiff (NoAttack) | 6.67% | 6.67% | 3.33% | 0% |
| EraseDiff (SubAttack) | 31.67% | 38.33% | 78.33% | 15% |
| Scenarios: | Nudity | Van Gogh | Church |
|---|---|---|---|
| NoAttack | 3.33% | 16.67% | 3.33% |
| SubAttack | 62.44% | 84.44% | 80.33% |
| Nudity | Van Gogh | Church | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Scenario: | E F | E U | E S | E F | E U | E S | E F | E U | E S |
| NoAttack | 90% | 23% | 22.56% | 21.56% | 71.44% | 43.78% | 51.56% | 6.55% | 43.78% |
| UnlearnDiff | 93.33% | 41.33% | 38.22% | 12.78% | 64% | 47.11% | 6.19% | 13.33% | 58% |
| CCE | 93% | 18.33% | 37.56% | 72.33% | 43.56% | 81.33% | 91% | 70.11% | 92.78% |
| SubAttack (Ours) | 96.89% | 77% | 80.44% | 72.67% | 88.89% | 86.89% | 92.89% | 83.77% | 92% |
| Scenario: | FMN->UCE | UCE->ESD | SPM->UCE | UCE->FMN |
|---|---|---|---|---|
| Nudity | 72% | 81.33% | 86.11% | 93.44% |
| Van Gogh | 91.11% | 48.55% | 80.55% | 62.55% |
| Church | 79.33% | 42.44% | 68.33% | 78.77% |
| Attacks: | UnlearnDiff | SubAttack | ||||
|---|---|---|---|---|---|---|
| Scenarios: | UCE | UCE + SubDefense | RECE | UCE | UCE + SubDefense | RECE |
| Nudity | 78.22% | 73.55% ( -4.67% ) | 76.44% (-1.78%) | 81.67% | 34.11% ( -47.56% ) | 62.44% (-19.23%) |
| Van Gogh | 100% | 52.78% ( -47.22% ) | 61.67% (-38.33%) | 98.33% | 29.44% ( -68.89% ) | 84.44% (-13.89%) |
| Church | 61.67% | 39.78% ( -64.34% ) | 50.78% (-10.89%) | 82.67% | 5.22% ( -77.45% ) | 80.33% (-2.34%) |
| Metrics: | COCO-10k FID ( ) | COCO-10k CLIP ( ) | ||||
|---|---|---|---|---|---|---|
| Scenarios: | UCE | UCE + SubDefense | RECE | UCE | UCE + SubDefense | RECE |
| Nudity | 17.14 | 17.51 | 17.57 | 30.86 | 30.70 | 30.07 |
| Van Gogh | 16.64 | 16.64 | 17.11 | 31.14 | 30.94 | 30.08 |
| Church | 17.84 | 17.41 | 17.41 | 30.95 | 30.86 | 30.07 |
| ESD | FMN | UCE | SPM | |||||
|---|---|---|---|---|---|---|---|---|
| Scenario: | Base | +SubDefense | Base | +SubDefense | Base | +SubDefense | Base | +SubDefense |
| NoAttack | 20.56% | 9.93% (-10.63%) | 87.94% | 37.59% (-50.35%) | 21.98% | 13.47% (-8.51%) | 55.31% | 34.04% (-21.27%) |
| UnlearnDiff | 74.47% | 41.13% (-33.34%) | 97.87% | 45.39% (-52.58%) | 78.72% | 45.39% (-33.33%) | 91.49% | 58.97% (-32.52%) |
| Comparison | Pairs | Projection overlap |
|---|---|---|
| Disjoint subsets, same optimization seed | 9 | |
| Same subset, different optimization seeds | 18 | |
| Disjoint subsets, different optimization seeds | 18 | |
| Independent random rank-100 subspaces | – | (analytic expectation) |
| First directions | 1 | 5 | 10 | 20 | 30 |
|---|---|---|---|---|---|
| Best-of-prefix ASR |
| Prompt group | Rank 20 | Rank 50 |
|---|---|---|
| Cézanne | ||
| Monet | ||
| Picasso | ||
| Rembrandt | ||
| Generic painting | ||
| Van Gogh (target control) |
| Optimization seed | Direct defended ASR | CLIP alignment |
|---|---|---|
| 1024 | 6.67% | 28.362 |
| 2026 | 0.00% | 28.401 |
| 4096 | 3.33% | 28.897 |
| Mean SD | % |
| ESD | FMN | UCE | SPM | |||||
|---|---|---|---|---|---|---|---|---|
| Concept: | Base | +SubDefense | Base | +SubDefense | Base | +SubDefense | Base | +SubDefense |
| Nudity | 97.56% | 42.33% (-55.23%) | 100% | 62.89% (-37.11%) | 81.67% | 28% (-53.67%) | 74.89% | 50.78% (-24.11%) |
| Van Gogh | 81% | 17% (-64%) | 96.33% | 22.78% (-73.55%) | 93.78% | 14.33% (-79.45%) | 82.78% | 12.33% (-70.45%) |
| Church | 91.33% | 40.22% (-51.11%) | 82.67% | 13.78% (-68.89%) | 82.67% | 3.22% (-79.45%) | 84.89% | 23.78% (-61.11%) |
| Scenarios: | MACE | FMN | SPM | ESD |
|---|---|---|---|---|
| Ring-A-Bell ASR | 11.58% | 95.79% | 34.74% | 57.89% |
| + SubDefense | 5.26% (k=10) | 54.75% (k=100) | 14.74% (k=100) | 4.21% (k=100) |
| Scenarios: | SD | K=10 | K=20 | K=50 | K=100 | K=150 | K=200 |
|---|---|---|---|---|---|---|---|
| Ring-A-Bell (Nudity) | 97.89% | 89.47% | 76.84% | 60% | 38.94% | 23.16% | 8.42% |
| SubAttack (Church) | 100% | 80% | 78.33% | 55% | 46.67% | 21.67% | 10% |
| Method | Learned attack | Learning time | Reuse | Application per pair |
|---|---|---|---|---|
| CCE | One global token (500 steps) | 656 s/token | 900 | One diffusion generation |
| SubAttack | Five global directions (500 steps each) | s/direction; 2,551 s total | 900 | Five generations (one/direction) |
| UnlearnDiff | One local prompt per pair | 103–1,351 s/pair in the timing study | None | Included in per-pair optimization |
| Scenarios: | ESD | FMN | UCE | SPM |
|---|---|---|---|---|
| With Orthogonality | 97.56% | 100% | 81.67% | 74.89% |
| Without Orthogonality | 78.33% | 100% | 71.67% | 63.33% |
| Vocabulary size | 50 | 500 | 5000 (default) | 10000 | Full |
|---|---|---|---|---|---|
| ASR | 43.33% | 81.67% | 97.56% | 70% | 28.33% |
| #Blocked Tokens: | 0 | 20 | 50 | 100 | 200 | 300 | 350 |
|---|---|---|---|---|---|---|---|
| CLIP Score ( ) | 30.13 | 30.02 | 29.86 | 29.58 | 28.54 | 26.15 | 24.72 |
| FID ( ) | 18.23 | 19.02 | 19.09 | 19.20 | 20.92 | 26.42 | 30.33 |
| #Blocked Tokens: | 0 | 100 | 230 | 270 | 320 | 350 | 390 |
|---|---|---|---|---|---|---|---|
| CCE ASR | 85.11% | 75.67% | 65.78% | 37.44% | 28.11% | 18.11% | 8.89% |
| Concept: | Nudity | Van Gogh | Church |
|---|---|---|---|
| 1455 | 668 | 547 | |
| # | 1743 | 1023 | 885 |
| #Itrs | 1 | 10 | 30 | 50 | 70 | 100 | 130 | 150 | 170 | 200 |
|---|---|---|---|---|---|---|---|---|---|---|
| 1455 | 1799 | 1905 | 1784 | 1914 | 2062 | 2062 | 2136 | 2155 | 2115 | |
| # | 1743 | 2019 | 2078 | 2009 | 2206 | 2298 | 2328 | 2368 | 2358 | 2326 |