Abstract
Machine learning models frequently struggle to combine known concepts into novel configurations, a capability termed compositional generalization. While humans perform this task intuitively, deep learning architectures often remain brittle when faced with out-of-distribution (OOD) scenarios. This paper introduces a rigorous mathematical framework to address this gap, proving that compositional generalization is guaranteed when the model architecture mirrors the underlying data-generating process and the training distribution ensures sufficient visibility of all components.
Introduction
The ability to recognize a "red square" after seeing "blue squares" and "red circles" is a hallmark of human intelligence. In machine learning, this is known as compositional generalization. Despite the proliferation of object-centric and disentangled representation models, a fundamental understanding of why and when these models succeed or fail has remained elusive.
This research shifts the focus from compositionality as a property of static data to a property of the functional data-generating process. By treating composition as a structured interaction between independent components, the authors derive the necessary conditions for a model to generalize to the entire latent space of possible combinations.
Theoretical Framework: The Compositional Representation
The authors define a compositional representation through a two-stage generative model:
- Component Functions ($\phi_i$): These are individual "renderers" that map specific latent factors (e.g., the color or position of a single object) to an intermediate representation (e.g., a sprite).
- Composition Function ($C$): This function aggregates the intermediate outputs into a final observation (e.g., layering sprites via addition or alpha-blending).
The model's task is to learn an estimate $\hat{f}$ that approximates the ground-truth process $f = C(\phi_1, \dots, \phi_n)$.
Theorem 1: Sufficient Conditions for Generalization
The core contribution is Theorem 1, which identifies four conditions that guarantee a model trained on a subset of data ($P$) will generalize to all possible combinations ($Q$):
- Shared Architecture: The model must utilize the same composition function $C$ as the ground-truth process.
- Compositional Support: The training set must include the full range of values for each individual component's attributes, even if it does not include every possible global combination.
- Sufficient Support: In cases where components overlap (such as occlusion), the training data must be diverse enough that every part of a component is visible in at least some samples. This is mathematically formalized by requiring the Jacobian of the composition function to have full rank over the training set.
- Initial Point: A technical requirement where the model must be correctly anchored to the ground truth at at least one point.
Experimental Methodology
The theory was validated using a Multi-sprite dataset, where two sprites are defined by five latent factors: x-position, y-position, shape, size, and color. The researchers compared a compositional model (which follows the prescribed architecture) against a "monolithic" black-box neural network.
Two primary training distributions were tested:
- Orthogonal Support: One sprite remains in a fixed base configuration while the other varies across its entire attribute range.
- Diagonal Support: Sprites move in tandem, often resulting in heavy occlusion, to test the "Sufficient Support" condition.
Performance was measured using Mean Squared Error (MSE) and $R^2$ scores on both in-domain test sets and the full latent space of all possible sprite combinations.
Key Results and Insights
The empirical results strongly support the theoretical framework. In the "Orthogonal" setup, the compositional model achieved an $R^2$ of 0.951 on novel combinations, whereas the monolithic model failed entirely, yielding an $R^2$ of -0.500. This confirms that standard neural networks struggle to learn independent components when they are only exposed to a fraction of the joint distribution.
The Role of the Jacobian
The "Sufficient Support" condition proved vital for handling occlusions. By ensuring the Jacobian of the composition function is full-rank, the model can "see" how the output changes when a latent factor is nudged, even if that factor belongs to a partially hidden object. If the training data is broad enough to satisfy this condition, the model successfully learns to reconstruct background objects.
Verification of Gaps
The authors also tested the "Compositional Support" condition by introducing gaps in the training data (e.g., never showing a sprite in a specific screen region). As predicted, the model failed only within those specific regions while maintaining high performance elsewhere, demonstrating that the model's failures are localized to areas where the support conditions are violated.
Discussion and Limitations
This work provides a "first principles" look at compositionality, emphasizing that the functional path from latents to pixels is more important than the visual appearance of the data. However, several limitations remain for future exploration:
- Supervision: The current proof assumes access to ground-truth latent factors during training.
- Known Composition: The model requires prior knowledge of the composition function $C$. In domains like natural language, $C$ is likely unknown and must be learned alongside the component functions.
- Perfect Fit: The theorem assumes the model fits the training data perfectly. Real-world applications must account for bounded errors and noise.
Conclusion
By formalizing compositional generalization through the lens of the data-generating process, this research provides a roadmap for building more robust AI. The findings suggest that moving away from monolithic architectures toward those that reflect the compositional nature of the world—supported by diverse training data—is essential for achieving human-like generalization.
Summary updated