Abstract
Text-to-image diffusion models often struggle with precise alignment between user prompts and generated content, frequently failing to capture complex object behaviors or relationships. While Direct Preference Optimization (DPO) has been proposed to address this, its performance is limited by the visual inconsistency of training pairs, where preferred and non-preferred images differ in ways unrelated to the prompt. We introduce D-Fusion, a framework that generates visually consistent preference pairs by injecting features from well-aligned reference images into poorly-aligned base images during the denoising process. This method preserves the denoising trajectory required for Reinforcement Learning (RL) while isolating the alignment variable. Our experiments with Stable Diffusion 2.1-base show that D-Fusion significantly improves alignment across various tasks, outperforming standard DPO in both human preference and quantitative metrics.
Introduction
The emergence of text-to-image diffusion models has transformed the landscape of generative AI. Despite their impressive capabilities, these models often exhibit "misalignment"—a failure to accurately reflect the nuances of a text prompt. For example, a request for "a monkey eating a sandwich" might result in an image of a monkey merely sitting near a sandwich.
To mitigate this, researchers have applied Reinforcement Learning (RL) and Direct Preference Optimization (DPO). However, these methods typically rely on preference pairs that are visually inconsistent. This paper argues that such inconsistency introduces significant noise into the training signal, hindering the model's ability to learn specific concepts.
The Problem: Visual Inconsistency in DPO
In a standard DPO setup, the model is trained on pairs consisting of a "preferred" (high-alignment) image and a "non-preferred" (low-alignment) image. Typically, these images are generated from different random noise seeds, leading to variations in background, lighting, and overall composition.
This lack of control makes it difficult for the model to discern which specific pixels or features contribute to the improved alignment. It might mistakenly learn to prefer a certain artistic style or background rather than the intended object interaction. Furthermore, while image editing tools can create consistent pairs, they often operate on final pixel values and discard the denoising trajectory—the step-by-step mathematical path taken by the model. This trajectory is crucial for RL-based fine-tuning.
The D-Fusion Framework
D-Fusion addresses these challenges by constructing RL-trainable, visually consistent samples. The framework operates in two primary stages:
- Mask-Guided Cross-Attention Extraction: The system identifies the spatial location of prompt-related objects in a well-aligned "reference" image by analyzing the model's internal cross-attention maps. This acts as a built-in segmentor, avoiding the need for external models like SAM.
- Self-Attention Fusion: To create a "target" image, the model starts with the same initial noise as a poorly-aligned "base" image. During the denoising process, it uses the extracted mask to "inject" the features of the object from the reference image into the target image.
The resulting target image retains the background and style of the base image but incorporates the correctly aligned object from the reference. Because this fusion occurs during the denoising process, the full trajectory is preserved for training.
Experimental Evaluation
The authors evaluated D-Fusion using Stable Diffusion 2.1-base across three specialized prompt templates designed to test different facets of alignment:
- Object Behavior: (e.g., "a zebra playing basketball")
- Object Attributes: (e.g., "a green and metallic table")
- Positional Relationships: (e.g., "the dog on the right of the vase")
The model was trained on 40 prompts per template and tested on another 40 to evaluate its ability to generalize to unseen concepts.
Results and Key Insights
The inclusion of visual consistency proved to be a decisive factor in training effectiveness. By keeping the background and style identical between preferred and non-preferred images, D-Fusion effectively isolates the "alignment" variable, leading to cleaner gradient updates.
As illustrated in Figure 5, D-Fusion (DPO+D-Fusion) consistently achieves superior alignment compared to both the base model and standard DPO.
Key findings include: * Human Preference: Human raters preferred D-Fusion outputs over standard DPO by a staggering margin (e.g., 94.7% vs 4.5% for animal activity prompts). * Quantitative Performance: D-Fusion achieved higher CLIPScores across all test templates, indicating stronger prompt-image similarity. * Generalization: The model demonstrated an improved ability to handle unseen prompts, suggesting it learned underlying conceptual relationships rather than just memorizing training data.
Conclusion
D-Fusion highlights the importance of "clean" training data in the alignment of diffusion models. By leveraging the model's own attention mechanisms to create visually consistent preference pairs, D-Fusion provides a robust framework for improving text-to-image alignment without the need for external segmentation models. Future research could extend this methodology to video generation, where maintaining visual consistency is even more critical.
Summary updated