Concept Unlearning via Cross-Attention Activation Subspaces in Diffusion Models

CASE constructs forget and retain subspaces from cross-attention activations during denoising and folds a closed-form edit into the model weights, with no gradient-based fine-tuning or additional inference-time computation.

1CSE, POSTECH · 2GSAI, POSTECH
Comparison between shared text-space and layer-specific activation-space bases
FIG. 01 Text-derived edits use a shared basis from fixed anchor embeddings. CASE collects cross-attention activations across timesteps and initial latents to construct layer-specific forget and retain bases.
01

Overview

Concept unlearning aims to suppress a target concept in a pretrained text-to-image diffusion model while preserving non-target concepts. Existing closed-form methods typically derive editing directions from fixed text embeddings. These representations may not fully capture how the conditioning signal is expressed across latent states, timesteps, and layers.

CASE (Cross-Attention Subspace Erasure) constructs layer-specific forget and retain subspaces from cross-attention activations observed during denoising. A retain-constrained linear operator is then incorporated directly into the key and value projection weights. Across ten concepts in four HUB categories, CASE achieves the highest H-Mean among the evaluated baselines. Further experiments examine joint unlearning of up to 100 artistic styles, recovery under diverse attacks, and activation-derived editing on SDXL and FLUX.1-dev.

02

Why activation-space bases?

We construct text and activation bases from the same six forget anchors, using singular value decomposition (SVD) with the same cumulative-variance threshold. A binary logistic-regression probe uses forget-anchor features as positives and in-category retain-anchor features as negatives. Both probes are evaluated on the same held-out natural target-concept prompts.

The activation basis achieves approximately five times the average recall of the text basis across Style, IP, and Celebrity. This comparison measures how well an anchor-derived basis transfers to unseen prompt formulations.

Controlling for sample count gives the same pattern: with only six feature vectors, average recall is 0.643 for the activation basis versus 0.120 for the text basis. Increasing the activation-vector count to 600 raises recall to 0.658.

Recall of text and activation basis probes on held-out target-concept prompts
FIG. 02 Recall on held-out natural target-concept prompts (↑).
03

Cross-Attention Subspace Erasure

At cross-attention layer \(\ell\), image features form queries \(Q^\ell\), while the text representation \(e\) is mapped to keys and values by \(W_K^\ell\) and \(W_V^\ell\). The post-attention activation is

$$h^\ell = \mathrm{softmax}\!\left(\frac{Q^\ell {K^\ell}^{\!\top}}{\sqrt{d^\ell}}\right) V^\ell.$$

For a fixed prompt, the text representation and its keys and values remain fixed during denoising. The activation also depends on image-side queries, which vary with the latent state, timestep, and layer. CASE uses a forget anchor set \(\mathcal{A}_f\) describing the target and a retain anchor set \(\mathcal{A}_r\) describing concepts to preserve.

STEP
01
ACTIVATION COLLECTION

Collect activations during denoising

For each anchor, run \(n_{\mathrm{lat}}\) independently initialized denoising trajectories of \(T\) steps. At each layer and timestep, spatially mean-pool the post-attention activations to obtain one vector per anchor, latent, and step.

Stack these vectors as rows of the layer-specific matrices \(H_F^\ell\) and \(H_R^\ell\) for forget and retain anchors.

STEP
02
SUBSPACE ESTIMATION

Construct forget and retain subspaces

Apply SVD to each activation matrix and select the leading right singular vectors up to cumulative-variance thresholds \(\tau_F\) and \(\tau_R\). The resulting bases \(V_F^\ell\) and \(V_R^\ell\) define the projectors

$$P_F^\ell = V_F^\ell {V_F^\ell}^{\!\top}, \qquad P_R^\ell = V_R^\ell {V_R^\ell}^{\!\top}.$$
STEP
03
CLOSED-FORM EDIT

Apply a retain-constrained linear operator

The forget-only operator \(E_0^\ell = I - P_F^\ell\) can alter retain directions. CASE finds the closest operator that acts as the identity on the estimated retain subspace:

$$E^\ell = \underset{M}{\arg\min}\;\frac{1}{2}\|M-E_0^\ell\|_F^2 \quad \text{subject to}\quad M P_R^\ell = P_R^\ell.$$

The unique solution is

$$E^\ell = P_R^\ell + E_0^\ell(I-P_R^\ell) = I - P_F^\ell(I-P_R^\ell).$$

Incorporate it into the existing key and value projection weights once:

$$W_K^\ell \leftarrow E^\ell W_K^\ell, \qquad W_V^\ell \leftarrow E^\ell W_V^\ell.$$

The correction \(P_F^\ell(I-P_R^\ell)x\) projects the component of \(x\) orthogonal to the retain subspace onto the forget subspace. Subtracting it leaves every vector in the estimated retain subspace unchanged. Folding the operator into the weights requires no gradient-based fine-tuning and adds no inference-time computation.

Relationship to CURE. Both methods combine forget and retain subspaces in a closed-form edit. CASE constructs those subspaces from layer-specific cross-attention activations collected during denoising.

04

Overall unlearning performance

We evaluate Stable Diffusion v1.5 on ten concepts across Style, intellectual property (IP), Celebrity, and NSFW in the Holistic Unlearning Benchmark (HUB). H-Mean summarizes the trade-off between target suppression, retention, adversarial robustness, and generation quality.

CASE achieves the highest H-Mean in all four categories among the evaluated training-based, inference-time, and closed-form methods.

Method Method type Style IP Celebrity NSFW Average
SD (no edit) Original model 0.462 0.331 0.469 0.449 0.428
ESD Training-based 0.599 0.551 0.640 0.313 0.526
Receler Training-based 0.525 0.377 0.610 0.519 0.508
MACE Training-based 0.614 0.577 0.584 0.315 0.523
SAFREE Inference-time 0.484 0.498 0.473 0.542 0.499
AdaVD Inference-time 0.552 0.655 0.624 0.460 0.573
UCE Closed-form 0.329 0.654 0.657 0.593 0.558
CURE Closed-form 0.565 0.571 0.572 0.530 0.560
CASE Closed-form 0.655 0.683 0.693 0.608 0.660
Table 1. H-Mean on HUB (higher is better). Average is the arithmetic mean of the four category scores.
Qualitative comparison of CASE and eight baselines on HUB prompts
FIG. 03 Qualitative comparison on HUB prompts. In each panel, the main image is generated from a forget prompt and the lower-right inset from a corresponding retain prompt. CASE suppresses the target while preserving neighboring concepts across Celebrity, IP, and Style.
05

Effect of forget and retain anchors

Forget anchors. For Pikachu, we replace the six template-based anchors with 6, 15, 30, or 50 natural prompts from HUB, keeping \(|\mathcal{A}_r|=54\). Natural prompts improve target suppression for both representations. As more forget anchors are added, text-derived editing loses retention; activation-derived editing maintains strong suppression while retention improves.

Retain anchors. We vary \(|\mathcal{A}_r|\) over 0, 36, 54, 120, and 180 prompts, while evaluating retention on the same nine in-category concepts. Without retain anchors, both edits suppress the target at the cost of retention. Adding retain anchors improves preservation, which largely plateaus near 54 prompts. Target suppression weakens with both bases, but more gradually with the activation basis.

Forget anchor scaling
FIG. 04(a) Forget-anchor sweep with a fixed retain set. “Simple” denotes template-based anchors; the other settings use natural prompts.
Retain anchor scaling
FIG. 04(b) Retain-anchor sweep with a fixed forget set. Dashed lines in both plots show the original SD model.
Qualitative comparison as forget anchor set size grows
FIG. 05 Qualitative comparison as \(|\mathcal{A}_f|\) increases. Text-derived editing increasingly alters Mario in the retain images; activation-derived editing better preserves this concept.
Qualitative comparison as retain anchor set size grows
FIG. 06 Qualitative comparison as \(|\mathcal{A}_r|\) increases. Pikachu reappears in the text-derived results as the retain set grows. The activation-derived examples maintain suppression while retaining Snoopy.
06

Scalability, robustness, and generalization

Multi-concept unlearning

Following the artistic-style evaluation protocol of MACE, we jointly erase \(N\in\{1,10,50,100\}\) styles without retain anchors. Retention is evaluated on a fixed set of non-target styles. \(\mathrm{CLIP}_E\) and \(\mathrm{CLIP}_R\) measure average image–prompt similarity for erased and retained styles, respectively.

CASE achieves the highest \(\mathrm{CLIP}_R-\mathrm{CLIP}_E\) at every evaluated concept count. At 100 styles, the gap is 3.31, compared with 1.53 for MACE, 1.20 for UCE, 1.07 for AdaVD, and −0.69 for CURE. CASE’s corresponding \(\mathrm{CLIP}_E\) and \(\mathrm{CLIP}_R\) are 16.28 and 19.59.

CLIP retention minus erasure scores for CASE and four baselines as 1, 10, 50, and 100 styles are jointly erased
FIG. 07 Multi-concept style unlearning. Higher \(\mathrm{CLIP}_R-\mathrm{CLIP}_E\) indicates a better suppression-retention trade-off.

Robustness under diverse attacks

Beyond Ring-A-Bell, we test recovery of the nudity concept through prompt, embedding, and sampling interventions. UnlearnDiffAtk (UDA) and MMA-Diffusion search for adversarial prompts; CCE optimizes a textual-inversion embedding; Noise-Based Probing (NBP) injects noise during denoising with the prompt fixed. Success is measured by NudeNet detection on generated images.

CASE has the lowest attack success rates under UDA (34.7%) and MMA-Diffusion (4.0%), ties MACE under NBP (3.3%), and is second to SAFREE under CCE (23.2% versus 22.5%). Recovery remains possible, with the success rate depending on the attack.

Attack ESD Receler MACE SAFREE AdaVD UCE CURE CASE
UDA 95.893.283.183.1100.099.298.334.7
MMA 62.056.08.086.016.094.098.04.0
CCE 64.159.278.922.576.151.432.423.2
NBP 43.346.73.323.370.043.360.03.3
Table 2. NSFW attack success rates (%) under four recovery attacks. Lower is better; bold entries mark the lowest rate for each attack, including ties.

Generalization across architectures

We compare text-derived and activation-derived edits on the IP category for FLUX.1-dev and SDXL. Both experiments vary the forget threshold \(\tau_F\) without retain anchors, generating 1,000 images per target and retain concept.

On FLUX.1-dev, the activation basis produces substantially lower target proportions across the evaluated thresholds. On SDXL, target suppression becomes progressively stronger as \(\tau_F\) increases. Retention remains comparatively high on both models. Text-derived edits leave target proportions near those of the original models over much of the evaluated range.

FLUX.1-dev target proportion and within-category retention as the forget threshold varies from 0.50 to 0.99
FIG. 08(a) FLUX.1-dev. Activation-derived editing maintains lower target proportions throughout the threshold sweep.
SDXL target proportion and within-category retention as the forget threshold varies from 0.95 to 0.99
FIG. 08(b) SDXL. Increasing \(\tau_F\) strengthens activation-derived suppression while retaining neighboring concepts.
07

Citation

If you find this work useful, please cite:

@misc{moon2026case,
  title         = {Concept Unlearning via Cross-Attention Activation Projection for Diffusion Models},
  author        = {Saemi Moon and Suhyeon Jun and Seoyeon Lee and Dongwoo Kim},
  year          = {2026},
  eprint        = {2605.25765},
  archivePrefix = {arXiv}
}