Summary (Overview)

  • Attention sinks in structural tokens: Chat-template tokens (system, user, assistant delimiters) in diffusion transformers (DiTs) become dominant image-to-text (I2T) attention sinks, absorbing 4–7× more attention per token than prompt-content tokens, robust across models, timesteps, prompt complexity, and language.
  • Implicit semantic registers: Despite carrying negligible prompt-specific semantics at the encoder output, these structural tokens causally maintain object identity during denoising. Semantics enter them indirectly: first injected into image latents, then read back into the template tokens.
  • Training-free head pruning: Heads with high image-to-semantic attention (mSm_S) are causally inert. Pruning the top ~18% of such heads removes 20% of attention FLOPs with only a 1.4-point drop on GenEval.
  • Organized generative mechanism: The DiT separates semantic routing (register heads) from visual synthesis (rendering heads) at the head level, and progresses through early identity commitment, middle propagation, and late refinement across layers.

Introduction and Theoretical Foundation

Modern text-to-image generation has shifted from U-Net backbones with cross-attention to diffusion transformers (DiTs) where text and image tokens interact through joint attention (MMDiT) [11, 37]. The text conditioning now often comes from large language models (LLMs) rather than CLIP/T5 encoders. The user prompt is serialized into a chat template containing system, user, assistant, and delimiter tokens (e.g., <|im_start|>, <|im_end|>). These structural tokens are typically considered formatting residue, not part of the semantic request.

However, in joint-attention DiTs, all conditioning tokens compete as keys for the image stream. A token carrying little explicit content can become a privileged computational site if the model learns to route attention through it—similar to attention sinks in LLMs [57] and register tokens in vision transformers [9]. The open question: do chat-template structural tokens remain inert, act as transparent conditioning, or acquire a deeper role in generative computation?

The authors propose a causal interpretability framework combining attention decomposition with span interventions, head transplantation, and layer-wise masking to trace where conditioning information is read, routed, and stored during denoising.

Methodology

Models and Conditioning

The primary model is the Qwen-Image family (MMDiT with 60 blocks, 24 heads per block = 1440 heads). Text conditioning cRncond×dc \in \mathbb{R}^{n_{\text{cond}} \times d} comes from Qwen2.5-VL applied to a chat-formatted prompt. The retained sequence splits into:

  • Semantic span SS: prompt-content tokens
  • Structural span RR: trailing chat-template tokens (e.g., <|im_end|>\n<|im_start|>assistant\n)

Attention Decomposition

Within each MMDiT block, joint attention over concatenated text and image tokens [c;z][c; z] yields four blocks: T2T, T2I, I2T, I2I. The I2T block is the cross-modal pathway. For a query group QQ and key span KK, the attention mass on KK from QQ is:

mK(l,h)(Q)=1QiQjKAi,j(l,h),mj(l,h)(Q):=m{j}(l,h)(Q)m^{(l,h)}_K(Q) = \frac{1}{|Q|} \sum_{i \in Q} \sum_{j \in K} A^{(l,h)}_{i,j}, \quad m^{(l,h)}_j(Q) := m^{(l,h)}_{\{j\}}(Q)

where A(l,h)A^{(l,h)} is the post-softmax joint attention matrix. Focus is on image queries Q=IQ=I, so mR(l,h)m^{(l,h)}_R and mS(l,h)m^{(l,h)}_S are the I2T mass absorbed by structural and semantic spans.

Causal Interventions

  • Cross-prompt swap: Replace RR of prompt A with RR of prompt B ([SA;RB][S_A; R_B]) to test semantic content.
  • Structural-token averaging: Replace RR with a prompt-agnostic average Rˉ\bar{R} (over 100 GenEval prompts) to test if semantics reside in RR.
  • Progressive head transplantation: Copy per-head projections (q,k,v)(q,k,v) from one trajectory to another, ordered by mSm_S, to identify causal heads for object identity.
  • Attention masking: Mask attention from register queries RR to either semantic tokens SS or image latents II to trace how semantics enter the registers.
  • Head pruning: Rank heads by descending mˉS\bar{m}_S (mean I2T mass on semantic span) and silence the top-KK heads over the last 80% of denoising steps.

Empirical Validation / Results

Structural Tokens Are Dominant Attention Sinks

For the minimal prompt "An apple" (S=2|S|=2, R=5|R|=5), image queries place 11–13× more attention on the content-free template span than on prompt content. At scale:

BenchmarkModelmˉR\bar{m}_RmˉS\bar{m}_SmRmR+mS\frac{m_R}{m_R+m_S}mRtokmStok\frac{m^{\text{tok}}_R}{m^{\text{tok}}_S}Pr[mR>mS]\Pr[m_R > m_S]
GenEvalQwen-Image0.1930.0460.7616.40.892
GenEvalQwen-Image-25120.1870.0420.7766.90.899
DPG-BenchQwen-Image0.0760.1690.2927.20.123
DPG-BenchQwen-Image-25120.0810.1720.2917.50.122
Qwen-Image-Bench (Chinese)Qwen-Image0.0920.1490.3616.20.221
Qwen-Image-Bench (Chinese)Qwen-Image-25120.0950.1490.3606.50.223

Table 1: Attention statistics across benchmarks. The per-token ratio mRtok/mStokm^{\text{tok}}_R / m^{\text{tok}}_S is stable (6.2–7.5×) across prompt complexity and language, confirming the structural sink is robust.

Template Tokens Carry Little Semantics

  • Cross-prompt swap ([SA;RB][S_A; R_B]): The object of prompt A is preserved (DINOv3 similarity >0.95 for most pairs), showing RR carries negligible prompt-specific semantics.
  • Structural-token averaging ([S;Rˉ][S; \bar{R}]): A single prompt-agnostic Rˉ\bar{R} suffices to render any object (median similarity 0.99). Rare failures collapse to a generic human portrait (the model's unconditional default), but these are resolved with higher classifier-free guidance.

Semantics Reside in Template Registers Implicitly

  • Progressive head swap: Swapping heads ordered by increasing mSm_S (i.e., heads that barely attend to SS) flips object identity after only ~18% of heads (270/1440). Swapping decreasing mSm_S (top semantic readers) fails to transfer identity and collapses to unconditional default. Thus, reading SS and carrying the object are decoupled.
  • Attention masking: Masking RSR \to S attention leaves the object unchanged; masking RIR \to I attention erases identity within the first two blocks. Semantics enter the registers by attending to the image stream, not the prompt tokens.

Training-Free Head Pruning

Pruning heads with high mˉS\bar{m}_S (causally inert) over late denoising steps:

KK (heads silenced)GenEvalLPIPSHPSv3FLOP ↓
076.19.560%
21675.80.219.4712.0%
28875.50.299.2916.0%
36074.70.398.7620.0%
40074.00.408.4422.2%

Table 2: Head pruning results on Qwen-Image-2512. Pruning 360/1440 heads (20% FLOPs) drops GenEval only 1.4 points. The ranking matters: at K=288K=288, mˉS\bar{m}_S ranking gives 75.5, structural-sink ranking (mˉR\bar{m}_R) gives 69.6, random gives 51.3.

Distinct Mechanisms Across Heads and Depth

  • Register heads (high mˉS\bar{m}_S): hold object identity, attend strongly to structural tokens.
  • Rendering heads (high I2I attention): synthesize spatial coherence; ablating even a few collapses output.
  • Depth organization: Early layers (L1–10) commit identity, middle layers (L11–50) propagate, late layers (L51–60) refine. The top-270 identity-driving heads are bimodally distributed (89 early, 85 late, 96 middle).

Theoretical and Practical Implications

  • Theoretical: Revises the conventional picture of text conditioning in DiTs. Prompt semantics do not remain attached to the tokens that encode them; instead, structural tokens act as implicit semantic registers that acquire content indirectly from the evolving image latents. This reveals a decoupling between input encoding and internal maintenance of semantics.
  • Practical: The training-free head-pruning rule provides a simple, prompt-independent acceleration method (20% FLOP reduction with minimal quality loss). The finding that heads reading prompt tokens are causally inert suggests future pruning or sparse-attention designs can aggressively target those heads. The identification of register vs. rendering heads and the three-stage depth organization can inform architectural improvements and efficient inference strategies.
  • Generality: The sink-register phenomenon extends to other models (FLUX.2, Krea-2-Turbo), few-step distilled variants, and instruction-based editing models, indicating it is intrinsic to chat-templated DiTs.

Conclusion

The paper introduces a causal interpretability framework for text-to-image DiTs and discovers that chat-template structural tokens act as implicit semantic registers. Despite carrying little prompt-specific semantics at the encoder output, these tokens become dominant I2T attention sinks and causally maintain object identity during generation. Semantics enter them indirectly via the image stream, not directly from prompt tokens. This insight yields a training-free head-pruning rule that removes 20% of attention FLOPs with a 1.4-point GenEval drop. The work also reveals how DiTs organize generative computation across heads (register vs. rendering) and depth (early commit, middle propagate, late refine). Future directions include more sophisticated sink-aware sparse attention designs and investigating why these structural tokens come to serve as registers in the first place.

Related papers