Introduction
While state-of-the-art text-to-image (T2I) models like Stable Diffusion XL (SDXL) and DALL-E 3 produce visually impressive results, they frequently exhibit "spatial blindness." For instance, a request for "a red ball to the left of a blue cube" often results in incorrect object placement or merged attributes. Existing solutions typically involve complex architectural modifications or unreliable prompt engineering. Researchers from KU Leuven propose a middle ground: StructuredPrompter, a lightweight, "plug-and-play" method that explicitly provides spatial instructions in a machine-readable format.
The StructuredPrompter Approach
The core innovation of StructuredPrompter is a two-step pipeline designed to make spatial relationships explicit without retraining the massive underlying image-generation model.
- Structured Extraction: A fine-tuned T5-small model (60 million parameters) processes a natural language prompt to extract two types of tuples:
- Object Tuples: Identifying attributes like
(color, shape). - Spatial Relation Tuples: Defining the layout as
(subject, relation, object). - Prompt Augmentation: These extracted tuples are appended to the original prompt. For example, "Add a cyan cube at the center" becomes "[Original Text] (cyan, cube) (cyanCylinder, rightOf, cyanCube)..."
- Image Generation: This augmented "super-prompt" is fed into SDXL. By leveraging the model's latent knowledge of structured data, the system reduces the ambiguity inherent in natural language.
Experimental Evaluation
The method was evaluated using the TV-Logic dataset, which features relational text descriptions of colored geometric shapes. The researchers utilized GPT-4o to generate ground-truth tuples for training the T5 model on a small set of 500 samples.
The results demonstrate a clear improvement in spatial accuracy, with SDXL’s performance rising from 0.446 to 0.473. Furthermore, StructuredPrompter outperformed specialized baselines such as RealCompo (0.310) and DPT-T2I (0.465). Beyond spatial alignment, the overall image quality—measured by the Inception Score—improved from 6.71 to 6.94, suggesting that clearer structural instructions lead to cleaner object generation.
Discussion: The Efficiency of Small Models
A significant finding of this research is the superior performance of the lightweight T5-small model compared to much larger Large Language Models (LLMs).
As shown in the table above, T5-small achieved near-perfect BLEU and ROUGE scores on the extraction task, while models like Llama-3-8B struggled. The authors attribute this to the tendency of larger models to overfit when trained on small, highly specialized datasets. In contrast, the 60M-parameter T5 model generalized effectively, producing tuples that matched or exceeded the quality of those manually crafted by humans.
Conclusion
StructuredPrompter offers a portable and efficient solution to the spatial reasoning challenges in T2I models. By using a tiny, specialized language model to "remind" generative models of specific ontologies, the approach achieves better alignment without the computational cost of model retraining. Future work will explore scaling this method to more complex, crowded scenes and a wider variety of real-world objects and spatial relations.
Summary updated