NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Training-Free Structured Diffusion Guidance for Compositional Text-to-Image Synthesis

Weixi Feng, Xuehai He, Tsu-Jui Fu, Varun Jampani, Arjun Reddy Akula, Pradyumna Narayana, Sugato Basu, Xin Eric Wang, William Yang Wang

Introduction

StructureDiffusion is a training-free approach that significantly improves the ability of text-to-image models to correctly pair attributes with objects (e.g., ensuring a "red car" stays red and a "white sheep" stays white). By incorporating linguistic structures—like noun phrases—directly into the cross-attention layers of diffusion models, the authors achieve a 5-8% improvement in image-text alignment without requiring any additional training data or fine-tuning.

What Problem Does This Paper Address?

Despite the breathtaking quality of modern text-to-image (T2I) models like Stable Diffusion, they frequently stumble on "compositional" tasks. When a prompt contains multiple objects with specific attributes, the models often suffer from three main issues:

  1. Attribute Leakage: The color of one object bleeds into another.
  2. Interchanged Attributes: The model swaps descriptions (e.g., "a brown bench in front of a white building" becomes a white bench in front of a brown building).
  3. Missing Objects: The model simply ignores one of the requested entities.
Comparison of Stable Diffusion and StructureDiffusion on complex attribute binding.

The authors identify a primary culprit: the CLIP text encoder. Because CLIP uses causal attention, tokens later in a sequence are "contaminated" by the semantics of tokens before them. Furthermore, the global encoding of a long prompt often "blends" distinct concepts together, making it difficult for the diffusion process to disentangle which color belongs to which noun.

Methods

The authors propose Structured Diffusion Guidance (StructureDiffusion), which leverages the inherent linguistic structure of a prompt to guide the image generation process. The method follows a few key steps:

The StructureDiffusion pipeline, illustrating how linguistic parsing guides cross-attention.
  1. Linguistic Parsing: The input prompt is passed through an external parser (either a constituency tree or a scene graph) to extract individual noun phrases (NPs) and entities (e.g., "a red car," "a white sheep").
  2. Independent Encoding: Instead of just encoding the full prompt, each extracted NP is encoded separately using the CLIP text encoder. This prevents the "semantic blending" that occurs in the full-sentence encoding.
  3. Sequence Re-alignment: These individual NP encodings are re-aligned to match the positions of the tokens in the original full prompt.
  4. Structured Cross-Attention: In the diffusion model's U-Net, the cross-attention layers normally use a single set of "Values" derived from the full prompt. StructureDiffusion instead computes the output as an average of the cross-attention results from the full prompt and all the individual NP encodings.

Essentially, the full prompt provides the global layout (the "where"), while the individual NP encodings provide precise semantic guidance for specific regions (the "what").

Key Insights and Ideas

  • Linguistic Structure is "Free" Guidance: We don't need to retrain models to understand composition; we just need to feed them the linguistic hierarchy that already exists in the text.
  • Disentangling Layout and Content: The authors observe that the Attention Maps in the cross-attention layers control the spatial layout, while the Values contain the rich semantic content. By keeping the layout based on the full prompt but enriching the content with isolated noun phrases, they can "fix" attributes without breaking the overall scene structure.
  • The Importance of Padding: A surprising finding in their ablation study was that CLIP's padding tokens are not just "empty space." They actually contain high-level contextual information about the prompt. Removing them or using only the "nearest" padding tokens significantly degrades image quality.

Datasets and Key Results

The researchers evaluated their method using Stable Diffusion v1.4 as the base model. They introduced a new benchmark, ABC-6K (Attribute Binding Contrast set), consisting of 6.4K captions from MSCOCO with swapped color attributes to test model distinction. They also used CC-500 (Concept Conjunction 500) and 10K randomly sampled MSCOCO captions.

  • Human Evaluation: In head-to-head comparisons on the ABC-6K dataset, human annotators preferred StructureDiffusion over standard Stable Diffusion by a margin of 42.2% to 35.6% in terms of image-text alignment.
  • Fidelity Gains: The method also showed a significant lead in "image fidelity" (how realistic the image looks), winning 48.3% of the time compared to 39.1% for the base model.
  • Better than Composable Diffusion: On the CC-500 dataset, StructureDiffusion outperformed "Composable Diffusion" (a previous SOTA) by over 16% in alignment win rates.
  • Zero Training: All these gains were achieved without a single gradient update to the underlying Stable Diffusion model, making it a highly effective "plug-and-play" enhancement.

Limitations and Future Work

While highly effective, StructureDiffusion introduces some computational overhead. Because the model must perform cross-attention for the full prompt plus every extracted noun phrase, the computational cost increases linearly with the number of NPs. Furthermore, the quality of the output is tethered to the accuracy of the external parser; if the parser fails, the guidance will be flawed. Finally, while the model excels at attribute binding (colors/materials), it still struggles with complex spatial logic (e.g., "to the left of" vs "to the right of"), which remains a primary direction for future research.

Summary updated

BibTeX
@inproceedings{feng2023training,
  author = {Weixi Feng and Xuehai He and Tsu-Jui Fu and Varun Jampani and Arjun Reddy Akula and Pradyumna Narayana and Sugato Basu and Xin Eric Wang and William Yang Wang},
  title = {{Training-Free Structured Diffusion Guidance for Compositional Text-to-Image Synthesis}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=PUIqjT4rzq7},
}
Figure