Disentangled Sparse Representations for Concept-Separated Diffusion Unlearning

Hyeonjin Kim, Hangyeol Jung, Heechan Yun, Sungjun Yun, Dong-Jun Han

TL;DR

Wanting an image generator to "unlearn" a specific concept—like cartoon dogs—usually wreaks havoc on innocent bystanders like ink-art dogs or cartoon flowers. SAEParate solves this collateral damage by combining Sparse Autoencoders with contrastive learning, neatly untangling overlapping concepts in latent space before snipping out the unwanted ones. The result is surgical concept removal that leaves your base diffusion model's weights completely untouched.

What Problem Does This Paper Address?

Text-to-image diffusion models learn everything on the internet—including copyrighted styles, private faces, and explicit content. Teaching them to "forget" specific concepts without retraining from scratch is called machine unlearning.

Rather than editing billions of model weights directly, a clever recent trend hooks a Sparse Autoencoder (SAE) onto an intermediate layer of the diffusion model. Think of an SAE as a prism: it takes dense, messy neural activations and expands them into a wide, sparse dictionary of interpretable features. To erase a concept, you just zero out (or negatively scale) its dictionary entries during generation.

Here is the catch: standard SAEs are only trained to reconstruct activations accurately using as few features as possible. They have zero incentive to keep related concepts separate. Consequently, semantically overlapping concepts end up sharing latent features. If you try to erase "Dogs in Cartoon style" using a standard SAE, you accidentally destroy "Dogs in Ink Art style" and "Flowers in Cartoon style" too.

Figure 1: Qualitative comparison of joint combination unlearning results. Unlearning results for the target style–object combinations Dogs in Cartoon style (left) and Frogs in Watercolor style (right). First column: target combinations to be removed. Other columns: non-target combinations sharing either the same object or style. SAEParate selectively erases the target while preserving non-target concepts, while SAeUron degrades non-target outputs due to latent space interference.

Methods

SAEParate keeps the modular, inference-time steering setup of prior SAE methods (specifically SAeUron), leaving the base diffusion model frozen. Its novelty lies in how the SAE itself is structured and trained:

  • Concept-Aware Contrastive Learning: Alongside the standard reconstruction loss, the authors introduce a supervised contrastive objective in the SAE latent space. It pulls activations of the same concept together into tight clusters while pushing different concepts—even partially matching ones—apart. Instead of relying on random image crops to create "positive pairs" for contrastive learning, they cleverly pair up activations from adjacent denoising timesteps of the same concept.
  • Cross-Attention Spatial Aggregation: A prompt's feature map contains lots of background noise. Before applying the contrastive loss, SAEParate pools spatial features weighted by the diffusion model's cross-attention maps, focusing supervision strictly on pixels relevant to the target text tokens.
  • Nonlinearity-Enhanced Encoder: A standard single-layer linear+ReLU SAE encoder lacks the capacity to untangle heavily knotted features under contrastive pressure. Adding one extra hidden layer with a GeLU activation gives the encoder just enough expressive muscle to carve out clean boundaries, while keeping the decoder linear for easy feature suppression at inference time.

Datasets

The authors do not introduce new benchmarks, relying instead on established datasets:

  • UnlearnCanvas: The primary testbed, featuring 50 artistic styles and 20 object categories (using a fine-tuned Stable Diffusion v1.5 checkpoint). Crucially, the SAE is trained on custom anchor prompts kept strictly disjoint from the evaluation prompts.
  • I2P (Inappropriate Image Prompts): Used to test safety-critical nudity removal (separating "naked woman" from "naked man").

Key Insights and Ideas

  • Sparsity $\neq$ Disentanglement: Just because an autoencoder forces activations to be sparse doesn't mean concepts get dedicated neurons. Without explicit supervision, SAEs happily recycle features across correlated concepts to save space—a fatal flaw when doing targeted interventions.
  • Contrastive Loss Needs Architectural Room to Breathe: An ablation study revealed a fascinating synergy: adding the GeLU layer alone slightly hurt unlearning performance (80.59% average vs. 84.11% baseline), and contrastive loss alone left clusters partially overlapping. Only when combined did cluster separation snap into crystal-clear focus (95.18% average).
Figure 2: Visualization of SAE latent representations. (a) UMAP [33] projections of Vanilla SAE (SAeUron) and SAEParate on UnlearnCanvas [44], with each color representing a different concept. (b) Quantitative comparison of cluster rate and centroid margin, which measure centroid-based class assignment and inter-centroid similarity, respectively. Both results demonstrate that SAEParate produces clearer concept-wise clusters with reduced overlap, indicating improved concept separation.
  • Zero Feature Overlap: When inspecting the top features selected for unlearning different object classes, Vanilla SAEs frequently picked the exact same latents for different animals. SAEParate reduced class-wise feature overlap to literally zero, packing concept identity into just 1 or 2 highly specific latents.

Key Results

SAEParate sets a new state-of-the-art on UnlearnCanvas across 11 baselines:

  • Joint Style–Object Unlearning: This is where existing methods fall apart. SAEParate achieved an average score of 94.52% (across Unlearning Accuracy, Style Consistency, Object Consistency, and Unrelated Prompting), crushing the strongest baseline (SalUn at 65.72%) and Vanilla SAE/SAeUron (56.93%).
  • Single-Attribute Unlearning: Achieved the highest overall average (97.09%) across style and object removal while keeping distributional image quality (FID of 63.98) competitive.
  • Lightweight Footprint: Requires just 3.4 GB of GPU memory to train and 0.2 GB of storage—orders of magnitude lighter than weight-editing methods like SalUn (30.8 GB memory, 4.0 GB storage).
  • Sequential Unlearning: When erasing five objects back-to-back, SAEParate avoided the catastrophic retention collapse seen in standard SAEs.

Limitations and Future Work

  • Supervision Required: Unlike purely unsupervised SAEs, SAEParate needs at least group-level concept labels during training to construct positive and negative contrastive pairs.
  • Steering, Not Lobotomy: Because the base diffusion weights remain untouched, this is technically output suppression, not permanent weight erasure (if someone strips off the SAE module, the knowledge is still there).
  • SAE Quirks & Modality: It still inherits classic SAE headaches like feature splitting and absorption, and has only been tested on static images. Future directions include pairing SAEParate with hierarchical architectures (like Matryoshka SAEs), exploring unsupervised clustering signals, and extending to video generation.

Summary updated

Abstract

Unlearning specific concepts in text-to-image diffusion models has become increasingly important for preventing undesirable content generation. Among prior approaches, sparse autoencoder (SAE)-based methods have attracted attention due to their ability to suppress target concepts through lightweight manipulation of latent features, without modifying model parameters. However, SAEs trained primarily for sparse reconstruction do not explicitly enforce concept-wise separation, allowing semantically related concepts to share latent features. To address this, we propose SAEParate, which explicitly separates semantically overlapping concepts in the SAE latent space through concept-aware contrastive learning, supported by cross-attention-guided spatial aggregation that emphasizes concept-relevant regions. In addition, we enhance the encoder with a nonlinear transformation to increase its expressive capacity under this separation objective, enabling more concept-discriminative latent representations. Experiments on UnlearnCanvas demonstrate state-of-the-art performance, with particularly strong gains in joint style-object unlearning, a challenging setting where existing methods suffer from severe interference between target and non-target concepts.
BibTeX
@inproceedings{kim2026disentangled,
  author = {Hyeonjin Kim and Hangyeol Jung and Heechan Yun and Sungjun Yun and Dong-Jun Han},
  title = {{Disentangled Sparse Representations for Concept-Separated Diffusion Unlearning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=5Ls4MY5nvC},
}
Figure