Z-Erase: Enabling Concept Erasure in Single-Stream Diffusion Transformers
Organizations: Beijing Advanced Innovation Center for Future Blockchain and Privacy Computing, School of Artificial Intelligence, Beihang University. · University of Science and Technology of China · Shanghai University · Tencent ·
Abstract
Concept erasure serves as a vital safety mechanism for removing unwanted concepts from text-to-image (T2I) models. While extensively studied in U-Net and dual-stream architectures (e.g., Flux), this task remains under-explored in the recent emerging paradigm of single-stream diffusion transformers (e.g., Z-Image). In this new paradigm, text and image tokens are processed as a single unified sequence via shared parameters. Consequently, directly applying prior erasure methods typically leads to generation collapse. To bridge this gap, we introduce Z-Erase, the first concept erasure method tailored for single-stream T2I models. To guarantee stable image generation, Z-Erase first proposes a Stream Disentangled Concept Erasure Framework that decouples updates and enables existing methods on single-stream models. Subsequently, within this framework, we introduce Lagrangian-Guided Adaptive Erasure Modulation, a constrained algorithm that further balances the sensitive erasure-preservation trade-off. Moreover, we provide a rigorous convergence analysis proving that Z-Erase can converge to a Pareto stationary point. Experiments demonstrate that Z-Erase successfully overcomes the generation collapse issue, achieving state-of-the-art performance across a wide range of tasks.
Figures & tables
| Detected Nudity | MS-COCO 10K | MS-COCO 10K | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Method | Common | Female | Male | Total | FID | CLIP | Detected Violence | FID | CLIP |
| AC (Model-Based) ( Kumari et al., 2023 ) | 245 | 35 | 53 | 333 | 29.30 | 29.05 | 402 | 32.47 | 29.89 |
| AC (Noise-Based) ( Kumari et al., 2023 ) | 270 | 38 | 55 | 363 | 30.07 | 28.16 | 496 | 33.12 | 28.73 |
| ESD-x ( Gandikota et al., 2023 ) | 279 | 42 | 60 | 381 | 31.44 | 27.65 | 777 | 33.79 | 27.48 |
| ESD-u ( Gandikota et al., 2023 ) | 260 | 41 | 61 | 362 | 31.96 | 27.13 | 668 | 34.22 | 26.80 |
| EAP ( Bui et al., 2024 ) | 190 | 29 | 49 | 268 | 27.32 | 30.71 | 447 | 28.30 | 30.15 |
| Method | Acc e | Acc ir | H a | FID | CLIP |
|---|---|---|---|---|---|
| AC (Model-Based) | 27.95 | 27.10 | -0.85 | 31.85 | 28.22 |
| AC (Noise-Based) | 27.34 | 26.88 | -0.46 | 32.46 | 27.93 |
| ESD-x | 27.66 | 27.20 | -0.46 | 33.15 | 27.41 |
| ESD-u | 25.13 | 26.68 | 1.55 | 34.06 | 26.95 |
| MACE | 24.06 | 28.52 | 4.46 | 30.79 | 30.17 |
| UCE | 21.91 | 25.70 | 3.79 | 52.28 | 23.70 |
| Entity | Art Style | Abstraction | ||||
|---|---|---|---|---|---|---|
| Method | Acc e | H a | Acc e | H a | Acc e | H a |
| AC (Model-Based) | 24.6 | 2.0 | 28.6 | -4.2 | 26.9 | -1.1 |
| AC (Noise-Based) | 25.5 | 0.9 | 29.3 | -5.5 | 27.3 | -1.1 |
| ESD-x | 23.3 | 5.3 | 28.5 | -3.8 | 26.5 | -0.8 |
| ESD-u | 21.8 | 6.0 | 27.8 | -3.3 | 25.7 | -0.4 |
| MACE | 23.2 | 4.3 | 26.6 | -0.8 | 25.1 | 3 .4 |
| UnlearnDiffAtk | |||||
| Method | w/o Attack | R-A-B | ReFlux | Step = 0 | Steps = 0,1,2 |
| DiT-Localization | 57.89 | 58.94 | 74.73 | 59.64 | 6 0.35 |
| EraseAnything | 1 4.38 | 2 6.67 | 4 3.85 | 23.50 | 25.61 |
| Token-Zeroing | 21.75 | 82.81 | 92.85 | 72.50 | 76.49 |
| Ours | 10.52 | 24.91 | 42.81 | 2 4.56 | 25.61 |
| Z-Image Turbo | 83.15 | 92.63 | 96.84 | 82.45 | 85.96 |
| Config | Detected Nudity | FID | CLIP |
|---|---|---|---|
| 206 | 29.65 | 29.86 | |
| 148 | 30.04 | 29.12 | |
| 235 | 26.42 | 31.28 | |
| 314 | 27.15 | 31.16 | |
| Full | 161 | 26.46 | 31.25 |
| Z-Image Turbo | 649 | 26.33 | 31.47 |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Experiment / Setting | Recommended | Rationale |
|---|---|---|
| Nudity, Violence | Sensitive concepts, require tight preservation | |
| Artistic Style | Global style is easy to remove, require tight preservation | |
| Entity | Concrete objects harder to disentangle | |
| Abstract Concepts | Abstract priors harder to disentangle | |
| Celebrity Identity | Identity preservation more robust to slack | |
| Downstream editability / utility (post-erase LoRA use) | Maintain editability & style generalization |
| Category | # Number | Prompt template | Concepts |
|---|---|---|---|
| Entity | 10 | ‘A photo of [ Entity ]’ | ‘ Church ’, ‘ Soccer ’, ‘ Car ’, ‘ Airplane ’, ‘ Tower ’, ‘ Pencil ’, ‘ Pizza ’, ‘ Shoes ’, ‘ Cat ’, ‘ Clownfish ’ |
| Artistic Style | 10 | ‘An art in the style of [ Artistic Style ]’ | ‘ Pablo Picasso ’, ‘ Salvador Dali ’, ‘ Claude Monet ’, ‘ Vincent Van Gogh ’, ‘ Rembrandt van Rijn ’, ‘ Frida Kahlo ’, ‘ Edvard Munch ’, ‘ Leonardo da Vinci ’, ‘ Nicholas Roerich ’, ‘ Gustave Dore ’ |
| Abstraction | 10 | ‘A close scene of [ Abstraction ]’ | ‘ Shake Hand ’, ‘ Kiss ’, ‘ Hug ’, ‘ Time ’, ‘ Explosion ’, ‘ Green ’, ‘ Origami ’, ‘ Fried ’, ‘ Amidst ’, ‘ Sad ’ |
| Entity | Artistic Style | Abstraction | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Method | Acc e | Acc ir | H a | Acc e | Acc ir | H a | Acc e | Acc ir | H a |
| AC (Model-Based) | 24.6 | 26.6 | 2.0 | 28.6 | 24.4 | -4.2 | 26.9 | 25.8 | -1.1 |
| AC (Noise-Based) | 25.5 | 26.4 | 0.9 | 29.3 | 23.8 | -5.5 | 27.3 | 26.2 | -1.1 |
| ESD-x | 23.3 | 28.6 | 5.3 | 28.5 | 24.7 | -3.8 | 26.5 | 25.7 | -0.8 |
| ESD-u | 21.8 | 27.8 | 6.0 | 27.8 | 24.5 | -3.3 | 25.7 | 25.3 | -0.4 |
| MACE | 23.2 | 27.5 | 4.3 | 26.6 | 25.8 | -0.8 | 25.1 | 2 8.5 | 3 .4 |
| Category | # Number | Mapping Concept | Celebrities |
|---|---|---|---|
| Erasure Group | 50 | ‘ A person ’ | ‘ Adele ’, ‘ Albert Camus ’, ‘ Angelina Jolie ’, ‘ Arnold Schwarzenegger ’, ‘ Audrey Hepburn ’, ‘ Barack Obama ’, ‘ Beyoncé ’, ‘ Brad Pitt ’, ‘ Bruce Lee ’, ‘ Chris Evans ’, ‘ Christiano Ronaldo ’, ‘ David Beckham ’, ‘ Dr Dre ’, ‘ Drake ’, ‘ Elizabeth Taylor ’, ‘ Eminem ’, ‘ Elon Musk ’, ‘ Emma Watson ’, ‘ Frida Kahlo ’, ‘ Hugh Jackman ’, ‘ Hillary Clinton ’, ‘ Isaac Newton ’, ‘ Jay-Z ’, ‘ Justin Bieber ’, ‘ John Lennon ’, ‘ Keanu Reeves ’, ‘ Leonardo Dicaprio ’, ‘ Mariah Carey ’, ‘ Madonna ’, ‘ Marlon Brando ’, ‘ Mahatma Gandhi ’, ‘ Mark Zuckerberg ’, ‘ Michael Jordan ’, ‘ Muhammad Ali ’, ‘ Nancy Pelosi ’,‘ Neil Armstrong ’, ‘ Nelson Mandela ’, ‘ Oprah Winfrey ’, ‘ Rihanna ’, ‘ Roger Federer ’, ‘ Robert De Niro ’, ‘ Ryan Gosling ’, ‘ Scarlett Johansson ’, ‘ Stan Lee ’, ‘ Tiger Woods ’, ‘ Timothee Chalamet ’, ‘ Taylor Swift ’, ‘ Tom Hardy ’, ‘ William Shakespeare ’, ‘ Zac Efron ’ |
| Retention Group | 50 | - | ‘ Angela Merkel ’, ‘ Albert Einstein ’, ‘ Al Pacino ’, ‘ Batman ’, ‘ Babe Ruth Jr ’, ‘ Ben Affleck ’, ‘ Bette Midler ’, ‘ Benedict Cumberbatch ’, ‘ Bruce Willis ’, ‘ Bruno Mars ’, ‘ Donald Trump ’, ‘ Doraemon ’, ‘ Denzel Washington ’, ‘ Ed Sheeran ’, ‘ Emmanuel Macron ’, ‘ Elvis Presley ’, ‘ Gal Gadot ’, ‘ George Clooney ’, ‘ Goku ’,‘ Jake Gyllenhaal ’, ‘ Johnny Depp ’, ‘ Karl Marx ’, ‘ Kanye West ’, ‘ Kim Jong Un ’, ‘ Kim Kardashian ’, ‘ Kung Fu Panda ’, ‘ Lionel Messi ’, ‘ Lady Gaga ’, ‘ Martin Luther King Jr. ’, ‘ Matthew McConaughey ’, ‘ Morgan Freeman ’, ‘ Monkey D. Luffy ’, ‘ Michael Jackson ’, ‘ Michael Fassbender ’, ‘ Marilyn Monroe ’, ‘ Naruto Uzumaki ’, ‘ Nicolas Cage ’, ‘ Nikola Tesla ’, ‘ Optimus Prime ’, ‘ Robert Downey Jr. ’, ‘ Saitama ’, ‘ Serena Williams ’, ‘ Snow White ’, ‘ Superman ’, ‘ The Hulk ’, ‘ Tom Cruise ’, ‘ Vladimir Putin ’, ‘ Warren Buffett ’, ‘ Will Smith ’, ‘ Wonderwoman ’ |
| Nudity | Entity | Artistic Style | Abstraction | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Method | Total | FID | CLIP | Acc e | Acc ir | H a | Acc e | Acc ir | H a | Acc e | Acc ir | H a |
| DiT-Localization ( Zarei et al., 2025 ) | 306 | 36.7 | 26.3 | 16.8 | 23.4 | 6.6 | 30.7 | 23.1 | - 7.6 | 27.9 | 26.4 | -1.5 |
| EraseAnything ( Gao et al., 2025a ) | 2 31 | 2 4.0 | 2 9.9 | 24.6 | 2 7.5 | 2.9 | 25.6 | 2 6.4 | 0.8 | 2 5.3 | 28.9 | 3 .6 |
| Ours | 145 | 23.6 | 30.8 | 2 4.3 | 27.9 | 3 .6 | 2 6.2 | 27.0 | 0.8 | 24.9 | 2 8.8 | 3.9 |
| HunyuanImage-3.0 | 628 | 23.1 | 31.2 | 28.6 | 31.5 | - | 32.1 | 28.3 | - | 29.6 | 29.8 | - |
Concept Erasure
Concept erasure removes specified knowledge or attributes from models while preserving their ability to perform unrelated tasks.
See all 61 papers