AI画图时,那些“废话”词才是关键
你给AI一句提示词,它生成一张图。但研究发现,AI真正用来“记住”物体身份的,不是提示词里的内容词(比如“猫”),而是那些看似无意义的模板词(比如“a”、“the”)。这些模板词在生成过程中成了注意力黑洞,间接从图像特征中读回物体信息,而非直接从提示词获取。基于此,研究者剪掉了最关注提示词的注意力头,省了20%算力,效果几乎不变。这不是你明天能用的技巧,但它揭示了AI画图时一个反直觉的内部机制:输入时承载语义的词,未必是生成时维持语义的词。
📄 原文摘要(英文)
Text-to-image diffusion transformers (DiTs) jointly process text and image tokens, yet their internal computation during denoising remains poorly understood. We introduce a causal interpretability framework for modern large-scale DiTs that combines attention decomposition with targeted interventions across token spans, heads, and layers. Using it to separate prompt-content tokens from structural template tokens, we find that the structural 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, with prompt semantics first injected into the image latents and then read back into the template tokens rather than transferred directly from the prompt tokens. Inspired by the above findings, we design a training-free pruning rule for DiTs. Heads that attend most strongly to prompt tokens are dispensable, and pruning them removes 20% of attention FLOPs with only a 1.4-point drop on GenEval. We further reveal how generative computation in DiTs is organized across heads and depth, separating semantic routing from visual synthesis and progressing from identity formation to propagation and refinement. Our work not only reveals that the tokens encoding semantics at input need not be those that maintain it during generation, but also provides a causal view of internal mechanisms in DiTs.