Circuit Mechanisms for Spatial Relation Generation in Diffusion Transformers
Binxu Wang, Jingxuan Fan, Xu Pan

TL;DR
This paper investigates how diffusion transformers generate spatial relations in images, revealing different underlying mechanisms depending on the text encoder used, with implications for robustness.
Contribution
It uncovers distinct circuit mechanisms in diffusion transformers for spatial relation generation based on text encoder choice, advancing mechanistic interpretability.
Findings
Two-stage circuit with separate attention heads when using random embeddings.
Single-text-token fusion circuit when using pretrained T5 encoder.
Different robustness to out-of-domain perturbations based on encoder choice.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
