In plain words: Standard neural networks can handle new combinations of known parts by getting more training data and more neurons, with no special design, as long as training covers the task space. When they succeed, each task part can be read straight from the network's activity.
Abstract · Scaling can lead to compositional generalization
Can neural networks systematically capture discrete, compositional task structure despite their continuous, distributed nature? The impressive capabilities of large-scale neural networks suggest that the answer to this question is yes. However, even for the most capable models, there are still frequent failure cases that raise doubts about their compositionality. Here, we seek to understand what it takes for a standard neural network to generalize over tasks that share compositional structure. We find that simply scaling data and model size leads to compositional generalization. We show that this holds across different task encodings as long as the training distribution sufficiently covers the task space. In line with this finding, we prove that standard multilayer perceptrons can approximate a general class of compositional task families to arbitrary precision using only a linear number of neurons with respect to the number of task modules. Finally, we uncover that if networks successfully compositionally generalize, the constituents of a task can be linearly decoded from their hidden activations. We show that this metric correlates with failures of text-to-image generation models to compose known concepts.
Florian Redhardt, Yassir Akram, Simon Schug
arXiv:2507.07207 · cs.LG, cs.NE · submitted Jul 9, 2025 · updated Oct 23, 2025
abstract · pdf · html · NeurIPS 2025 (Spotlight); Code available at https://github.com/smonsays/scale-compositionality