A Theoretical Analysis of Compositional Generalization in Neural Networks: A Necessary and Sufficient Condition
Yuanpeng Li
TL;DR
This work tackles the challenge of compositional generalization in neural networks by deriving a necessary and sufficient condition that ties together architectural structure, representation, and training data properties. The main result asserts that CG is achievable if and only if the model exhibits structural alignment, unambiguous representation, and minimized representation, formalized with graph isomorphisms and mapping properties. The paper provides rigorous proofs, a minimal illustrative example, and discussion on how these conditions can guide pre-training assessment and architectural design. Taken together, the results offer a principled inductive-bias framework for designing models with robust compositional capabilities and for evaluating them prior to extensive training.
Abstract
Compositional generalization is a crucial property in artificial intelligence, enabling models to handle novel combinations of known components. While most deep learning models lack this capability, certain models succeed in specific tasks, suggesting the existence of governing conditions. This paper derives a necessary and sufficient condition for compositional generalization in neural networks. Conceptually, it requires that (i) the computational graph matches the true compositional structure, and (ii) components encode just enough information in training. The condition is supported by mathematical proofs. This criterion combines aspects of architecture design, regularization, and training data properties. A carefully designed minimal example illustrates an intuitive understanding of the condition. We also discuss the potential of the condition for assessing compositional generalization before training. This work is a fundamental theoretical study of compositional generalization in neural networks.
