Attention sinks vary across text to image transformer models

Exploring Attention Sinks in Text-to-Image Transformers from Diffusion and Autoregressive Models

Computer Vision and Pattern RecognitionComputation and Language

Summary

Some words or image parts in text-to-image AI models get a lot more attention than others, even if their meaning doesn't seem that important. This paper looks at these so-called 'attention sinks' in two kinds of AI models that create images from text. The authors find that these attention sinks appear in different places depending on the model type, like near the beginning of the text or at edges in the image. They also show that changing these attention sinks can affect how the AI generates images, which helps understand how these models work internally.

What this means in practice

  • For machine learning engineers: Improve text-to-image model design by targeting attention sinks to enhance image generation quality and efficiency.
  • For ai system integrators: Optimize model attention patterns during inference to better allocate computational resources in production text-to-image pipelines.

Authors

Binglei Li, Mengping Yang, Zhiyu Tan, Wenxu Qian, Junping Zhang, Hao Li

Abstract

Attention sinks are tokens or positions that consistently receive disproportionate attention mass, often beyond what their semantic content would suggest. Despite extensive study in large language models, their behavior and functional relevance in text-to-image (T2I) Transformers remain largely unexplored. To fill this gap and better understand how text-to-image Transformers allocate and route attention, we explore this phenomenon of text-to-image transformers across bidirectional diffusion models and causal autoregressive models. Specifically, we explore whether attention sinks exist, where they emerge, and how they functionally influence generation. Through systematic attention analysis and targeted interventions, we identify that attention sinks emerge in both bidirectional diffusion and autoregressive models but exhibit distinct patterns. The autoregressive model concentrates attention on the first and global-scale tokens, whereas the bidirectional models develop sinks near modality boundaries, within text regions, and at spatial corners. Moreover, these patterns vary across generation stages and are localized to a sparse subset of layers and heads. To assess their functional relevance, we perturb sink-related heads and token positions. It turns out that perturbing sink-ranked heads produces larger average changes than non-sink comparisons, while some sink-position perturbations have limited effects on bidirectional model scores. We further introduce register tokens to redistribute attention sinks and find that several configurations preserve or modestly improve generation performance. Overall, attention sinks are architecture-, inference-stage-, and component-dependent phenomena, providing a basis for mechanistic analysis and principled attention design in text-to-image transformers.