Abstract
Standard diffusion models often fail to generate images based on complex logical prompts—such as "a digit 4 that is NOT red"—because they learn spurious correlations between attributes during training. We present CoInD (Conditional Independence in Diffusion), a novel training objective that explicitly enforces statistical independence between attribute marginals. This approach enables robust, zero-shot generation of attribute combinations never seen during training, significantly outperforming existing inference-time composition methods.
Introduction
In an ideal generative framework, a model trained on "red circles" and "blue squares" should inherently understand how to generate a "red square." This ability, known as logical compositionality, is a cornerstone of human-like reasoning. However, standard conditional diffusion models struggle with this task, particularly when the training data is non-uniform or lacks certain combinations (partial support).
The core issue lies in how these models learn. Even when attributes are statistically independent in reality, diffusion models trained via standard maximum likelihood tend to learn non-existent dependencies induced by "confounding factors" in the training set. For example, if a model primarily sees "green 4s," it struggles to decouple the digit from the color, making it difficult to generate a "pink 4" or handle a negation like "NOT green." While existing solutions attempt to compose these attributes at inference time, the underlying "leaky" marginals often result in low-quality or logically inconsistent images.
The CoInD Method
The CoInD framework introduces a training objective designed to penalize the model when its learned conditional distributions are not independent. This is achieved through several key innovations:
- Causal Modeling: The authors treat the data generation process as a set of independent causal mechanisms, providing a theoretical foundation for why the joint distribution should factorize into independent marginals.
- Independence Loss ($L_{CI}$): The model incorporates a loss term based on Fisher Divergence. This term measures the disparity between the score of the joint distribution and the sum of the scores of the individual attribute marginals, forcing the model to maintain independence in the score space.
- Scalable Approximation: To maintain computational efficiency, the authors approximate mutual conditional independence using pairwise conditional independence. This reduces the evaluation burden from $O(n)$ to a constant number of evaluations per training step.
- Precise Control: The framework introduces a hyperparameter $\gamma$, allowing users to modulate the intensity of specific attributes (e.g., the prominence of a smile) during sampling without unintended side effects on other independent traits.
Experimental Setup and Datasets
CoInD was evaluated across three distinct settings to test its limits in handling partial support and scalability:
- Colored MNIST: A synthetic dataset of digits and colors used to simulate missing combinations (e.g., no red 4s in training).
- Shapes3D: A dataset featuring six independent attributes (floor color, wall color, object color, scale, shape, and orientation) to test scalability as the attribute count increases.
- CelebA: A real-world dataset of celebrity faces. The authors specifically withheld the "smiling male" combination during training to evaluate zero-shot generalization on complex, high-dimensional data.
Key Insights and Results
The Independence Gap
A surprising finding of this research is that standard models violate conditional independence even when the training data is perfectly uniform. This suggests that standard score-matching objectives lack the necessary inductive bias for true compositionality, a gap that CoInD effectively bridges.
Performance Metrics
- Zero-Shot Composition: On Colored MNIST with partial support, CoInD achieved a Conformity Score (CS) of ~52% for unseen combinations, while standard baselines like Composed GLIDE and LACE hovered between 7% and 10%.
- Logical Negation: CoInD significantly outperformed baselines on "NOT" operations. On Shapes3D, it maintained high accuracy (~91% CS) for complex logical queries where baselines dropped to approximately 51%.
- Real-World Generalization: On CelebA, CoInD successfully generated "smiling males" (the unseen combination) with an FID of 43.76, nearly doubling the accuracy of the best baseline while maintaining superior image realism.
Diversity and Interpolation
By breaking spurious correlations (e.g., the common training bias associating "smiling" with "long hair"), CoInD naturally produces more diverse samples. When prompted for a "smiling male," the model does not accidentally introduce feminine traits. Additionally, the model demonstrated an ability to interpolate between discrete attribute values, such as object orientation, even when trained only on fixed angles.
Limitations and Future Directions
Despite its success, CoInD currently operates within a closed-set attribute framework, requiring predefined labels and retraining if the attribute space changes. It cannot yet handle "open-set" compositions or arbitrary text descriptions without explicit training data for those categories.
Future work aims to extend this framework to large-scale text-to-image models like Stable Diffusion. By fine-tuning these models with the $L_{CI}$ loss, researchers hope to improve their logical reasoning and compositional capabilities without the need for massive, perfectly balanced datasets.
Summary updated