Jun-Hyun Bae, Wonyong Jo, Jaehyup Lee, Heechul Jung
Kyungpook National University
Presentation
Abstract
Text-to-image diffusion models utilize cross-attention to integrate textual information into the visual latent space, yet the transformation from text embeddings to latent features remains largely unexplored. We provide a mechanistic analysis of the output-value (OV) circuits within cross-attention layers through spectral analysis via singular value decomposition. Our analysis demonstrates that semantic concepts are encoded in low-dimensional subspaces spanned by singular vectors in OV circuits across cross-attention heads. To verify this, we intervene on concept-related components in the diffusion process, demonstrating that intervention on identified spectral components affects conceptual changes. We further validate these findings by examining visual outputs of isolated subspaces and their alignment with text embedding space. Through this mechanistic understanding, we demonstrate that simply nullifying these spectral components can achieve targeted concept removal with performance comparable to existing methods while providing interpretability.
Overview
Cross-attention์ OV circuit์ด ํ ์คํธ๋ฅผ ์ด๋ป๊ฒ ์๊ฐ ํน์ง์ผ๋ก ๋ณํํ๋์ง ๋ฐํ๊ณ , ์ด๋ฅผ ํ์ฉํด ์ฌํ์ต ์์ด ๊ฐ๋ ์ ์ ๊ฑฐํ๋ ๋ฐฉ๋ฒ์ ์ ์ํ๋ค.
- Spectral Decomposition โ \(\mathbf{W}_{\text{OV}}\) ๋ฅผ SVD๋ก ๋ถํดํ์ฌ ๋ ๋ฆฝ์ ์ธ text-to-visual ๋ณํ ๊ฒฝ๋ก๋ฅผ ์ถ์ถํ๋ค.
- Concept Localization โ “๊ณ ํ ์คํ์ผ”, “nudity” ๋ฑ์ ์๋ฏธ ๊ฐ๋ ์ด ์ ์ฒด spectrum ์ค ์์์ spectral component์ ์ง์ค๋์ด ์์์ ๋ฐ๊ฒฌํ๋ค.
- Spectral Nullification โ ํด๋น component๋ง ์ ๊ฑฐํ๋ฉด ์ฌํ์ต ์์ด๋ ๊ธฐ์กด ๋ฐฉ๋ฒ๊ณผ ๋น์ทํ ์์ค์ targeted concept removal์ด ๊ฐ๋ฅํ๋ค.

๊ฐ ๊ฐ๋ ์ spectral component๋ง ํ์ฑํํ ๊ฒฐ๊ณผ. ์คํ์ผ์ ์ง๊ฐ๋ง, ์กฐ๋ช ์ ํ๊ด๋ง, ์ฝํ ์ธ ๋ ์ธ์ฒด ํํ๊น์ง ๋จ๋๋ค.
Method
Cross-attention์์ ํ ์คํธ๋ฅผ ์๊ฐ ํน์ง์ผ๋ก ๋ณํํ๋ ํต์ฌ์ \(\mathbf{W}_{\text{OV}}\) ํ๋ ฌ์ด๋ค. Text embedding์ ์๋ฏธ ์ ๋ณด๋ฅผ ๊ณ ์ ํ ์ถ(semantic axes)์ ๋ฐ๋ผ ์กฐ์งํ๋๋ฐ, \(\mathbf{W}_{\text{OV}}\) ๋ ์ด ์ถ์ ์ ๋ ฌ๋ ์ ์ฐจ์ subspace๋ฅผ ํตํด ๊ฐ๋ ๋ณ ๋ณํ์ ์ํํ๋ค. ์ด ํ๋ ฌ์ SVD๋ก ๋ถํดํ๋ฉด ๊ฐ spectral component๊ฐ text-to-visual์ ๋ ๋ฆฝ๋ ๋ณํ ๊ฒฝ๋ก๊ฐ ๋๋ฉฐ, “๊ณ ํ ์คํ์ผ"์ด๋ “nudity” ๊ฐ์ ์๋ฏธ ๊ฐ๋ ์ ์ ์ฒด spectrum ์ค ์์์ component์ ์ง์ค๋์ด ์๋ค.
ํน์ ๊ฐ๋ ์ ๋ํด high-contribution head๋ ์ ์ฒด์ ์ฝ 10%์ ๋ถ๊ณผํ๋ฉฐ, ํด๋น head์ ์ถ๋ ฅ์ ์ค์ผ์ผ๋งํ๋ฉด ๊ฐ๋ ์ ๊ฐ๋๋ฅผ ์กฐ์ ํ ์ ์๋ค.

"Van Gogh" ๊ฐ๋ ์ high-contribution head(์ ์ฒด์ ~10%) ์ถ๋ ฅ์ $\alpha$๋ก ์ค์ผ์ผ๋ง.
Head ์์ค์ด ์๋ spectral component ๋จ์๋ก ์กฐ์ํ๋ฉด, ์คํ์ผ๊ณผ ์ฝํ ์ธ ๊ฐ์ ์๋ก ๋ค๋ฅธ ๊ฐ๋ ์ฐจ์์ ๋ถ๋ฆฌํ์ฌ ์กฐ์ ํ ์ ์๋ค.

Spectral modulation (์) vs head-level modulation (์๋). Spectral component ๋จ์๋ก ์กฐ์ํ๋ฉด ์คํ์ผ๋ง ๋ถ๋ฆฌํ์ฌ ์กฐ์ ํ ์ ์๋ค.
์๋ ๊ทธ๋ฆผ์ ์ ์ฒด head์ ๊ฑธ์น concept contribution์ ๋ถํฌ๋ฅผ ๋ณด์ฌ์ค๋ค. ๋๋ถ๋ถ์ head๋ ํน์ ๊ฐ๋ ์ ๊ฑฐ์ ๊ธฐ์ฌํ์ง ์์ผ๋ฉฐ, ์์์ head๋ง์ด ๋์ ๊ธฐ์ฌ๋ฅผ ๋ณด์ธ๋ค.

Head๋ณ concept contribution ๋ถํฌ. ์์์ high-contribution head์ ๊ฐ๋ ์ ๋ณด๊ฐ ์ง์ค๋์ด ์๋ค.
Results
Quantitative
Spectral Nullification(SN)์ ์ฌํ์ต ๊ธฐ๋ฐ ๋ฐฉ๋ฒ๋ค๊ณผ ๋น๊ตํ์ ๋, ์์ฑ ํ์ง(CLIP score)์ ์ ์งํ๋ฉด์ concept removal ์ฑ๋ฅ์์ ๋น์ทํ ์์ค์ ๋ฌ์ฑํ๋ค.

Concept removal ์ฑ๋ฅ vs ์์ฑ ํ์ง(CLIP score). Spectral Nullification(SN)์ ์ฌํ์ต ์์ด ๊ธฐ์กด ๋ฐฉ๋ฒ๊ณผ ๋น์ทํ ์ฑ๋ฅ์ ๋ฌ์ฑํ๋ค.
Concept-specific spectral component๊ฐ ์ค์ ๋ก ํด๋น ๊ฐ๋ ์ ์๋ฏธ๋ฅผ ํฌ์ฐฉํ๋์ง ๊ฒ์ฆํ๊ธฐ ์ํด, spectral component๋ก ํ ์คํธ ์ฐจ์ด๋ฅผ reconstructionํ ๋ค CLIP ์ดํ์์ ์ ๋ ฌ์ ํ์ธํ๋ค.

Concept-specific spectral component๋ก ํ ์คํธ ์ฐจ์ด๋ฅผ reconstructionํ ๋ค CLIP ์ดํ 49,408๊ฐ์ ๋น๊ต. Nudity ๊ด๋ จ ํ ํฐ์ด ์์์ ์ ๋ ฌ๋๋ค.
์๋ก ๋ค๋ฅธ head์ concept subspace๊ฐ ์ผ๊ด๋ ๊ตฌ์กฐ๋ฅผ ๊ณต์ ํ๋์ง t-SNE์ Jaccard similarity๋ก ๋ถ์ํ๋ค.

Head ๊ฐ concept subspace์ t-SNE ์๊ฐํ ๋ฐ Jaccard similarity. ๋์ผ ๊ฐ๋ ์ subspace๋ค์ด head ๊ฐ์๋ ์ ์ฌํ ๊ตฌ์กฐ๋ฅผ ๋ณด์ธ๋ค.
Qualitative
I2P benchmark์ adversarial prompt์ ๋ํด SN์ ์ ์ฉํ ๊ฒฐ๊ณผ, ๋ถ์ ์ ํ ์ฝํ ์ธ ๊ฐ ํจ๊ณผ์ ์ผ๋ก ์ ๊ฑฐ๋๋ค.

I2P benchmark adversarial prompt ๊ฒฐ๊ณผ. ์ผ์ชฝ: SD v1.4 (SN ์ ์ฉ ์ ), ์ค๋ฅธ์ชฝ: SN ์ ์ฉ ํ.
BibTeX
@inproceedings{bae2026mechanistic,
title={Mechanistic Dissection of Cross-Attention Subspaces
in Text-to-Image Diffusion Models},
author={Bae, Jun-Hyun and Jo, Wonyong and Lee, Jaehyup
and Jung, Heechul},
booktitle={Proceedings of the AAAI Conference
on Artificial Intelligence},
year={2026}
}