Scale leads to compositional generalization

Florian Redhardt, Yassir Akram, Simon Schug · DOI

Abstract

Compositional generalization—the ability to understand and produce novel combinations of known concepts—is a hallmark of human intelligence. While it has long been argued that standard neural networks require specialized modular architectures to achieve this, this paper demonstrates that scaling model size and training data is sufficient for monolithic multi-layer perceptrons (MLPs) to exhibit systematic reasoning. We show that successful generalization is fundamentally tied to the model's ability to form linear internal representations of task components, a phenomenon we call the "Linearity Hypothesis."

Introduction: The Challenge of Systematicity

A core debate in artificial intelligence centers on whether standard neural networks can achieve "systematicity." For example, if a model understands "brown dog" and "bicycle," can it zero-shot understand "brown dog on a bicycle"? Historically, researchers suggested that monolithic networks merely memorize patterns, necessitating modular designs. This work challenges that notion, investigating whether "scale" alone can bridge the gap between pattern matching and true compositionality.

Methods: Formalizing Compositional Task Families

To study this systematically, the authors introduce Compositional Task Families. These are sets of tasks where a composition operator $C$ combines $K$ modules from a total pool of $M$ to create a specific function $f$.

The experimental setup involves:

  • Hyperteachers: A synthetic framework where a hypernetwork generates weights for a task network, providing a ground-truth compositional structure.
  • Scaling Analysis: Systematic variation of training task volume (data scale) and model parameters (model scale).
  • Linear Probing: Using linear decoders to determine if individual task modules are represented linearly within the model's hidden activations.
Overview of compositional task families and scaling of generalization performance.

Key Insights: Scale and the Linearity Hypothesis

The research yields two primary conceptual breakthroughs:

  1. Scale as an Inductive Bias: As MLPs increase in size and encounter more data combinations, they naturally prefer generalizing solutions over memorization. Generalizing solutions are algorithmically simpler—linear in the number of modules $M$—whereas memorization scales exponentially.
  2. The Linearity Hypothesis: Successful generalization is perfectly correlated with the emergence of linear representations. Regardless of the input encoding's complexity, a model that generalizes "flattens" concepts into a linearly decodable format in its deeper layers. This serves as a high-fidelity diagnostic for model performance.

Experimental Results

The authors provide both theoretical and empirical evidence for the power of scale:

  • Theoretical Efficiency: They prove that an MLP can approximate a compositional task family using only $O(M)$ neurons, a significant efficiency gain over the exponential task space.
  • Scaling Laws: On synthetic tasks, the data required for near-perfect generalization scales sub-exponentially relative to the total task space.
  • Complexity Scaling: Generalization performance improves significantly as the number of task modules and components increases, provided the model is sufficiently large.
Generalization performance across varying numbers of task modules and components.
  • Image Generation: In text-to-image models like FLUX.1 and Stable Diffusion 3, there is a clear correlation between the linear decodability of individual concepts (e.g., "panda," "melon") and the model's ability to compose them correctly in a generated image. This was validated using a new Image Composition Benchmark consisting of 27 task families.

Limitations and Future Directions

While scale is a powerful driver of compositionality, several challenges remain. The existence of a generalizing solution does not guarantee that Stochastic Gradient Descent (SGD) will always find it. Furthermore, generalization requires "compositional support"—the training data must cover the individual modules adequately. Future work will explore these insights in the context of the "wild" distributions found in internet-scale data and address how models handle ambiguous task descriptions.

Summary updated

BibTeX
@inproceedings{redhardt2025scale,
  author = {Florian Redhardt and Yassir Akram and Simon Schug},
  title = {{Scale leads to compositional generalization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=hZt0daVIZi},
}
Figure