Text Template Tokens Are Implicit Semantic Registers in Diffusion Transformers
Reading guide · Based on sections of the original paper
Why read this
Useful for practitioners interpreting, editing or accelerating joint-attention text-to-image DiTs, especially those that want a training-free head-pruning heuristic.
What the authors found
- On Qwen-Image-2512, evaluated on GenEval, the authors pruned the K heads with the highest image-to-prompt attention over the last 80% of denoising steps. At K=360 of 1,440 heads, they estimate an analytic 20% cut in joint-attention FLOPs, while GenEval fell from 76.1 to 74.7 and HPSv3 from 9.56 to 8.76. Because perceptual quality degrades faster, they recommend K=216, which gives 12% FLOPs and 75.8 GenEval. At K=288, their ranking scored 75.5, against 69.6 for ranking by template attention and 51.3 for random selection. 4.5 Semantic Registers Guide Training-Free Head Pruning
- The authors transplanted per-head q/k/v from an 'A banana' run into an 'An apple' run, using a 2-step distilled LoRA run for a single step. Swapping the heads that read the prompt most heavily first failed to transfer identity. The reverse order flipped apple to banana after about 18% of the 1,440 heads. Template tokens are semantic registers.
- Template tokens dominate per-token image-to-text attention. On GenEval, they receive 76% of that attention, 6.4x the per-token share of prompt tokens. On long DPG-Bench prompts, span-level mass inverts: the template span exceeds the prompt span at only 12% of sites. Even so, the per-token ratio rises to 7.2x. Chinese prompts show a similar pattern. At scale across prompts.
Main limitation
The causal evidence relies mainly on a single apple/banana pair in a single-step distilled setting. In the authors' per-span swap, replacing only the template tokens' q/k/v disrupted the apple without producing a banana. They conclude that semantics are also carried by prompt and image tokens, not by the registers alone. 10.8 Per-Span Progressive Swap
Where to start
Semantics enter the registers implicitly. · Read this section for the cumulative attention-masking evidence behind the claimed prompt→image→template circuit and its block-1 and block-2 timing.
Abstract
Modern text-to-image diffusion transformers (DiTs) generate images through joint attention, in which text and image tokens interact directly within a single sequence. In large-scale DiTs, the conditioning input contains not only the user prompt but also chat-template tokens introduced by LLM-based text encoders. Yet how these tokens participate in the denoising computation remains poorly understood. To probe this, we introduce a causal interpretability framework. Using it to separate prompt-content tokens from chat-template tokens, we find that the template tokens carry little prompt-specific information at the encoder output. Yet surprisingly, they emerge as dominant image-to-text attention sinks and causally maintain object identity inside the DiT, acting as implicit semantic registers. We show that they acquire this identity indirectly. Rather than reading the prompt tokens, they draw the identity from the image latents into which the prompt semantics have already been injected at the very first layer. We further reveal a division of labor across heads and depth in DiTs, where distinct heads route semantics or render visual structure, and identity is committed in early blocks, carried by middle blocks, and refined in late ones. As a practical payoff, this analysis yields a training-free pruning rule that removes the causally inert prompt-reading heads and cuts $20\%$ of joint-attention FLOPs at a $1.4$-point cost in GenEval accuracy. Overall, our work not only reveals that the tokens encoding semantics at the input need not be those that maintain them during generation, but also provides a causal view of internal mechanisms in diffusion transformers.