Reexamining Intelligence Through Theory: Composability and the Roots of Generalization
Why do deep learning models generalize at all, and when will they fail? This article explores how learning theory answers these questions, covering the limits of shallow universal approximation, why depth matches hierarchical composition, the distinction between parameter count and effective complexity, and the debate between manifold and compositional views of representation. It also examines what neuroscience can and cannot tell us about compositional structure, offering a theoretical framework for anyone designing or evaluating modern AI systems.
Introduction: Why Theory Matters
Current AI systems perform impressively on language, vision, and decision-making tasks, yet our understanding of their internal mechanisms remains limited. Recent progress has come mainly from engineering practice: scaling up data, stacking compute, and repeatedly tuning architectures and hyperparameters. This approach improves performance quickly, but it struggles to answer a few key questions. Why can models learn useful patterns from limited samples? When will they fail? What causes those failures?
Theory exists precisely to answer these questions. It abstracts empirical phenomena into verifiable principles, enabling engineers to predict how models will behave in new settings and to make better design choices early. Without theoretical support, tuning often devolves into trial and error, and teams find it hard to judge whether an improvement generalizes.
1. The Fundamental Questions of Learning Theory
Supervised learning can be summarized as follows: given a set of labeled samples, find a function that produces correct outputs even on unseen data. This involves three interrelated questions.
- Representation: What functions can the model architecture express?
- Optimization: Can the training algorithm find a suitable function among them?
- Generalization: Does the chosen function remain effective on new data?
Of the three, generalization best showcases the value of theory. Training error can be very low while test error remains high; this gap is called the generalization gap. Understanding where this gap comes from is the entry point to understanding learning systems.
A classic perspective is the curse of dimensionality. For general smooth functions, if the input dimensionality is high, achieving the same approximation accuracy requires a sample size that grows rapidly with dimension. This means that without additional structure, high-dimensional tasks cannot be solved simply by adding more data. Every successful learning system therefore relies on some prior structure—an inductive bias. The core work of theoretical research is to identify what these structures are and why they match real-world data.
2. Why Shallow Theory Isn’t Enough
Single-hidden-layer networks have a theoretical universal approximation property: on a compact region, with sufficient width, they can approximate any continuous function to arbitrary precision. This result establishes a lower bound on representational capacity but says nothing about efficiency. The required width can be enormous, making training and storage costs impractical.
Deep architectures offer an alternative. When the target function itself has hierarchical compositional structure, deep networks can reuse intermediate computations, representing complex functions with fewer units. A simple example illustrates the difference.
Suppose the target function combines eight input variables, aggregated layer by layer through pairwise local operations:
# Illustration of hierarchical compositional structureh1_a = g(x1, x2)h1_b = g(x3, x4)h1_c = g(x5, x6)h1_d = g(x7, x8)h2_a = g(h1_a, h1_b)h2_b = g(h1_c, h1_d)output = g(h2_a, h2_b)
Here g is the same small computational unit throughout. A deep network only needs to learn one local pattern and reuse it at different levels. A shallow network must instead fit the entire function directly over the eight-dimensional input space, with no such reuse mechanism.
Theoretical analysis shows that for functions with this kind of local, hierarchical compositional structure, deep representations can—under certain assumptions—avoid the curse of dimensionality. The premise matters. This does not mean depth benefits every function; it means depth’s value depends on whether the target function has a decomposable structure.
The engineering takeaway is direct: model depth should match the compositional structure of the task. If the task lacks hierarchical structure, adding depth may not help and can even make training harder.
3. Why Models with Few Parameters Generalize
Traditional intuition says more parameters lead to more overfitting. Yet modern large-scale models have far more parameters than training samples and still generalize well. Parameter count alone is clearly not the only determinant of generalization.
A more useful perspective distinguishes parameter count from effective complexity. Effective complexity refers to the size of the function space that training actually selects from. Two models with identical parameter counts can have very different effective complexity if their structural biases differ.
The main factors influencing effective complexity include:
- Architectural bias: designs such as local connectivity, weight sharing, and pooling that constrain the form of functions.
- Implicit regularization: optimization algorithms tend to find certain kinds of solutions, such as those with small norms or flat minima.
- Data structure: the distribution of training data determines the range of patterns the model must learn.
- Early stopping: halting training early also limits model complexity.
Going from few parameters to good generalization hinges on whether the model captures the genuinely stable patterns in the data with limited degrees of freedom. A small number of parameters that happen to align with the core structure of the data can work well. Conversely, even with few parameters, generalization fails if the structure does not match the task.
In practice, learning curves can be used to assess a model’s sample efficiency:
for n in [100, 200, 400, 800, 1600]:train_set = sample(full_dataset, n)model = train(architecture, train_set)err = evaluate(model, test_set)record(n, err)plot(log(n), log(err)) # The slope reflects sample efficiency; steeper slopes mean better data utilization
If two architectures show different error-curve slopes at the same data volume, their inductive biases differ in an essential way. This comparison reveals capability boundaries far better than comparing final accuracy alone.
4. Does Composability Exist in Real Neural Systems?
Composability means complex representations are built from reusable parts combined according to definite rules. Language is the classic example: a finite vocabulary plus grammatical rules can generate infinitely many sentences. The visual world has similar structure: objects are made of parts, parts are made of edges and textures, and scenes are made of objects.
Whether biological visual systems exploit this structure is an important question. Early neurophysiological research found hierarchical processing in visual cortex. Neurons in lower areas respond to edges of specific orientations and have small receptive fields; neurons in higher areas respond to more complex shapes and show stronger invariance to changes in position and scale. This evidence broadly fits the hierarchical-composition picture.
But caution is warranted. The existing evidence supports hierarchical processing; it does not directly prove that biological systems are clean compositional machines. There are three main reasons:
- Neural responses are often context-dependent; the same neuron may serve different functions under different conditions.
- Neural representations contain substantial interference and redundancy, making it hard to draw clear boundaries between parts.
- Biological systems reuse parts flexibly and do not necessarily follow fixed compositional rules.
A common way to test composability is compositional generalization experiments: design training and test part combinations so that the test set contains combinations never seen together during training:
train_pairs = {(a, b) : a in A_train, b in B_train, and (a, b) not in the test set}test_pairs = {(a, b) : a in A_test, b in B_test}# The parts appear individually during training, but their combination never does
If a model or neural representation maintains performance on new combinations, it likely contains reusable part structure internally. This experimental framework applies to both artificial systems and neural data analysis, serving as a bridge between theory and empirical work.
5. Manifolds vs. Composition: Dividing the Explanatory Work
Two frameworks commonly appear when explaining representations in deep learning.
The manifold view holds that although natural data lives in high-dimensional space, it is concentrated near a low-dimensional manifold. For example, images of the same object under different poses and lighting form a set describable by a few continuous variables. The learning task is to unroll this curved manifold so that similar samples become easy to separate in representation space.
The compositional view holds that data structure comes mainly from discrete parts and the rules that combine them. A learning system must discover these parts and understand how they fit together.
The two views emphasize different aspects, as summarized below:
| Dimension | Manifold View | Compositional View |
|---|---|---|
| Core assumption | Data lies on a low-dimensional continuous structure | Data is composed of reusable parts |
| Explains well | Continuous variation: pose, brightness, position | Generalization to new combinations; reuse of discrete structure |
| Typical failure | Struggles to extrapolate to new combinations outside the manifold | Struggles to model unclear part boundaries or complex combination rules |
| Test methods | Interpolation and neighborhood-consistency tests | Compositional generalization and part-swap experiments |
The two views are not mutually exclusive. One possible reconciliation: locally, data exhibits continuous manifold structure; globally, these local structures are stitched together according to compositional rules. The next step for theory is a unified framework describing how the two relate.
6. The Evolutionary Perspective
From an evolutionary standpoint, organisms face a hierarchically structured world with limited samples and energy available for learning. Individuals that exploit structure more efficiently gain an advantage in survival competition. This yields a hypothesis: hierarchical composition in the brain may be an adaptation to constraints on sample efficiency and energy consumption.
The hypothesis has merit but remains speculative. It needs more supporting evidence—for example, comparing performance on similar tasks across species, or examining how structure emerges during development—before it can be more than a plausible explanation.
