Cross-Attention Head Position Patterns Can Align with Human Visual Concepts in Text-to-Image Generative Models

Jungwon Park, Jungmin Ko, Dongnam Byun, Jangwon Suh, Wonjong Rhee
12/3/2024
cs.CVcs.AI

No official code found. Best implementation: SNU-DRL/HRV (12 stars, Apache-2.0, last commit 2025-08-26).

Abstract

Recent text-to-image diffusion models leverage cross-attention layers, which have been effectively utilized to enhance a range of visual generative tasks. However, our understanding of cross-attention layers remains somewhat limited. In this study, we introduce a mechanistic interpretability approach for diffusion models by constructing Head Relevance Vectors (HRVs) that align with human-specified visual concepts. An HRV for a given visual concept has a length equal to the total number of cross-attention heads, with each element representing the importance of the corresponding head for the given visual concept. To validate HRVs as interpretable features, we develop an ordered weakening analysis that demonstrates their effectiveness. Furthermore, we propose concept strengthening and concept adjusting methods and apply them to enhance three visual generative tasks. Our results show that HRVs can reduce misinterpretations of polysemous words in image generation, successfully modify five challenging attributes in image editing, and mitigate catastrophic neglect in multi-concept generation. Overall, our work provides an advancement in understanding cross-attention layers and introduces new approaches for fine-controlling these layers at the head level.

View on arXivView PDF

Code Implementations(1)

SNU-DRL/HRVCommunity100%
Apache-2.0

Official Pytorch Implementation of "Cross-Attention Head Position Patterns Can Align with Human Visual Concepts in Text-to-Image Generative Models" (ICLR 2025)

122Shell, PythonDec 2, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{park2024crossattention,
  title  = {Cross-Attention Head Position Patterns Can Align with Human Visual Concepts in Text-to-Image Generative Models},
  author = {Jungwon Park and Jungmin Ko and Dongnam Byun and Jangwon Suh and Wonjong Rhee},
  year   = {2024},
  eprint = {2412.02237},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2412.02237v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2412.02237.svg)](https://codeofpaper.com/paper/2412.02237)

Discussion