arXiv:2601.06338cs.AIcs.CV2026-01中稿 · CVPR被引 3

揭秘扩散Transformer生成物体空间关系的内部机制差异

Circuit Mechanisms for Spatial Relation Generation in Diffusion Transformers

  • 通过机制可解释性分析发现,不同文本编码器触发两种不同信息传递路径
  • 随机嵌入下依赖双注意力头分步传递关系与属性信息,预训练编码器则融合读取单一文本标记
  • 预训练编码器虽表现相似但对域外扰动更脆弱,提示真实场景中关系生成挑战大

扩散Transformer(DiTs)在文本到图像生成中取得显著进展,但模型仍难以准确生成文本提示中指定的物体间空间关系。本研究采用机制可解释性方法,探究DiT如何生成正确的物体空间关系。我们从头训练了不同规模的DiT模型,使用不同文本编码器,学习生成包含两个物体及其属性与空间关系的图像。结果发现,尽管所有模型均能达到接近完美的任务准确率,但底层机制因文本编码器选择而显著不同:使用随机文本嵌入时,空间关系信息通过两阶段电路传递,由两个交叉注意力头分别读取空间关系和单个物体属性;而使用预训练文本编码器(T5)时,模型采用不同电路,利用文本标记中的信息融合,从单一文本标记中联合读取空间关系与物体属性信息。进一步实验表明,尽管两种设置在域内性能相近,但其对域外扰动的鲁棒性存在差异,可能暗示真实场景中生成正确关系的困难。

原文摘要 · Abstract (English)

Diffusion Transformers (DiTs) have greatly advanced text-to-image generation, but models still struggle to generate the correct spatial relations between objects as specified in the text prompt. In this study, we adopt a mechanistic interpretability approach to investigate how a DiT can generate correct spatial relations between objects. We train, from scratch, DiTs of different sizes with different text encoders to learn to generate images containing two objects whose attributes and spatial relations are specified in the text prompt. We find that, although all the models can learn this task to near-perfect accuracy, the underlying mechanisms differ drastically depending on the choice of text encoder. When using random text embeddings, we find that the spatial-relation information is passed to image tokens through a two-stage circuit, involving two cross-attention heads that separately read the spatial relation and single-object attributes in the text prompt. When using a pretrained text encoder (T5), we find that the DiT uses a different circuit that leverages information fusion in the text tokens, reading spatial-relation and single-object information together from a single text token. We further show that, although the in-domain performance is similar for the two settings, their robustness to out-of-domain perturbations differs, potentially suggesting the difficulty of generating correct relations in real-world scenarios.

扩散模型空间关系可解释性

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。