Abstract
Modern text-to-image (T2I) models often struggle with "attribute binding," failing to correctly associate descriptors with specific objects in complex prompts. LLM4GEN addresses this by integrating the semantic reasoning of Large Language Models (LLMs) into the diffusion process. By utilizing a Cross-Adapter Module (CAM) to fuse LLM and CLIP embeddings and an Entity-Guided Regularization Loss to enforce attribute-object consistency, LLM4GEN achieves state-of-the-art performance. Notably, it requires significantly less training data and compute—only 10M images and 50 GPU days—compared to existing alignment-based methods.
Introduction
Generating a simple image of "a cat" is trivial for current diffusion models. However, as prompts grow in complexity—for example, "a blue sheep standing next to a brown vase"—models frequently suffer from semantic blunders, such as swapping colors between objects. This "attribute binding" problem stems from the limitations of the CLIP text encoder, which often treats prompts as a "bag-of-words" rather than a structured linguistic description.
The Challenge of LLM Integration
To overcome CLIP's limitations, researchers have previously explored two main strategies:
- LLM-Guidance: Using an LLM to generate a layout or refined prompt first. This approach is computationally slow and introduces architectural redundancy.
- LLM-Alignment: Training a model from scratch to align with LLM features. While effective, this is prohibitively expensive, often requiring hundreds of millions of images and months of GPU time.
Proposed Method: LLM4GEN
LLM4GEN introduces a plug-and-play framework that efficiently injects LLM knowledge into existing diffusion models like Stable Diffusion.
Cross-Adapter Module (CAM)
Rather than replacing the CLIP encoder, LLM4GEN employs a Cross-Adapter Module. This module takes hidden states from an LLM (e.g., T5-XL or Llama-2) as the "Query" in a cross-attention mechanism, while CLIP features serve as the "Key" and "Value." This allows the model to leverage the LLM’s superior linguistic structure to enrich CLIP embeddings before they influence the U-Net.
Entity-Guided Regularization Loss ($L_{reg}$)
To ensure attributes remain bound to their respective entities, a specialized loss function was developed. By parsing (attribute, entity) pairs from the prompt, $L_{reg}$ forces the model’s internal attention maps for the attribute and the entity to overlap. This penalty prevents "attribute leakage," where a descriptor for one object erroneously influences the generation of another.
Experimental Results
The model was trained on a relatively small dataset of 10 million text-image pairs. Despite this efficiency, LLM4GEN demonstrated significant improvements across multiple benchmarks.
Quantitative Performance
On T2I-CompBench, which specifically evaluates attribute binding and spatial relationships, LLM4GEN improved SDXL's color alignment by 12.90% and texture alignment by 14.49%. Furthermore, on the newly introduced DensePrompts benchmark—consisting of over 7,000 complex prompts averaging over 40 words—LLM4GEN outperformed established models like SDXL and PixArt-\alpha in both image-text alignment and aesthetic quality.
Human Evaluation
In a user preference study, LLM4GEN was preferred over SDXL 66.5% of the time for semantic accuracy and 60.3% for aesthetic quality, confirming that the architectural improvements translate to perceptibly better images.
Conclusion
LLM4GEN demonstrates that the deep reasoning capabilities of LLMs can be harnessed for T2I generation without the need for massive datasets or extreme compute budgets. By treating LLMs as semantic anchors and applying targeted regularization, the framework effectively solves the attribute binding problem, paving the way for more controllable and semantically accurate image synthesis.
Summary updated