Circuit Mechanisms for Spatial Relation Generation in Diffusion Transformers

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Wang, Binxu, Fan, Jingxuan, Pan, Xu
Formato: Preprint
Publicado: 2026
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866913003417370624
author Wang, Binxu
Fan, Jingxuan
Pan, Xu
author_facet Wang, Binxu
Fan, Jingxuan
Pan, Xu
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2601_06338
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Circuit Mechanisms for Spatial Relation Generation in Diffusion Transformers
Wang, Binxu
Fan, Jingxuan
Pan, Xu
Artificial Intelligence
Computer Vision and Pattern Recognition
Machine Learning
I.2.10; I.4.9; I.2.6
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.
title Circuit Mechanisms for Spatial Relation Generation in Diffusion Transformers
topic Artificial Intelligence
Computer Vision and Pattern Recognition
Machine Learning
I.2.10; I.4.9; I.2.6
url https://arxiv.org/abs/2601.06338