LLM-grounded Diffusion: Enhancing Prompt Understanding of Text-to-Image Diffusion Models with Large Language Models

Long Lian, Boyi Li, Adam Yala, Trevor Darrell · DOI

Abstract

Text-to-image diffusion models have achieved remarkable visual quality but frequently struggle with complex prompts involving spatial reasoning, numeracy, and attribute binding. We present LLM-grounded Diffusion (LMD), a training-free framework that leverages Large Language Models (LLMs) as layout planners. By decoupling high-level semantic reasoning from low-level image synthesis, LMD significantly improves prompt adherence. Our method doubles the generation accuracy on complex benchmarks compared to base models and outperforms larger models like SDXL without requiring additional training.

Introduction

Despite the impressive capabilities of models such as Stable Diffusion and SDXL, they often fail to follow nuanced instructions. Common issues include "color bleeding" (where attributes of one object leak into another), incorrect object counts, and a failure to respect spatial relationships or negative constraints. These limitations stem largely from the text encoders (e.g., CLIP), which excel at concept association but lack the structured reasoning required for complex scene composition.

LMD successfully performs attribute binding, correctly rendering a man in red and a woman in blue without color leakage.

Methodology

LMD addresses these challenges through a novel two-stage, training-free process:

  1. LLM as Layout Generator: The system utilizes a frozen LLM (such as GPT-4) to interpret the user's prompt. Through in-context learning, the LLM generates a structured scene layout consisting of a background description and captioned bounding boxes for foreground objects.
  2. Layout-grounded Controller: This stage renders the image using the LLM-provided layout. LMD employs per-box masked latents to generate objects individually within their designated regions before composing them into a unified denoising process. This ensures that specific attributes remain bound to the correct objects.

Because LMD uses off-the-shelf models, it is inherently modular and can be upgraded as more powerful LLMs or diffusion models become available.

Results and Evaluation

The authors evaluated LMD using a new comprehensive benchmark focusing on negation, numeracy, attribute binding, and spatial relationships. LMD increased average generation accuracy from 37% (base Stable Diffusion) to 77%.

LMD demonstrates precise numeracy and attribute binding, generating exactly three cats with specific color assignments.

Key findings include:

  • Superior Prompt Adherence: LMD running on Stable Diffusion v1.5 outperformed the much larger SDXL in following complex spatial and numerical instructions.
  • Interactive Editing: The LLM's dialogue capabilities allow for multi-round, instruction-based editing, such as adding or replacing objects while maintaining scene consistency.
  • Cross-lingual Support: LMD can process prompts in languages not natively supported by the underlying diffusion model by using the LLM as an intermediary translator and planner.

Discussion and Limitations

While LMD represents a significant step forward, it is not without limitations. The quality of the final image is strictly dependent on the LLM's ability to generate a logical layout; physically awkward or ambiguous layouts can lead to unrealistic perspectives. Additionally, the multi-pass denoising process required for individual object boxes increases computational overhead compared to single-pass models. Future work will focus on optimizing inference speed and refining the LLM's spatial reasoning for more complex 3D perspectives.

Summary updated

BibTeX
@article{lian2024llm,
  author = {Long Lian and Boyi Li and Adam Yala and Trevor Darrell},
  title = {{LLM-grounded Diffusion: Enhancing Prompt Understanding of Text-to-Image Diffusion Models with Large Language Models}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2024},
  url = {https://openreview.net/forum?id=p5L4blJ5iv},
}
Figure