Neural networks
Depth, Composition, and Representation Hierarchies
Understand what depth contributes, why universal approximation is not a training guarantee, and how hidden layers build reusable representations.
By the end you can
- Explain how function composition gives depth its modeling power
- Describe representation hierarchies without claiming that every unit has one semantic label
- Interpret universal approximation theorems cautiously
- Compare adding depth with adding width under practical constraints
Example
Some problems are naturally built from smaller problems
Many tasks contain reusable intermediate structure. A network can exploit that structure when later layers operate on features constructed earlier.
For vision, that hierarchy is not a teaching metaphor. It was reconstructed, and then it was counted. In 2013 Zeiler and Fergus projected the activations of a trained convolutional network back into pixel space and read off what each layer responds to. Layer 2 fired on “corners and other edge/color conjunctions”. Layer 3 on textures. Layer 4 on class-specific parts: dog faces, bird's legs. Layer 5 on “entire objects with significant pose variation”. Their summary of the figure is one sentence: “The projections from each layer show the hierarchical nature of the features in the network.”
Four years later Bau and four colleagues stopped looking and started measuring. They scored 1,197 segmentation concepts against individual units across every convolutional layer of AlexNet, and reported that the method “reveals detectors for higher-level concepts at higher layers and lower-level concepts at lower layers”. The ladder below is the same argument in other coordinates. An intermediate object is worth building when more than one later computation uses it.
- Vision: local edges combine into textures, parts, and object-level evidence — layer 2 to layer 5 in Zeiler and Fergus's reconstruction.
- Speech: short acoustic patterns support phonetic and word-level representations.
- Language: token interactions contribute to phrases, relations, and task-specific summaries.
- Tabular data: ratios, thresholds, and interactions can be constructed before the final risk estimate.
- Control: state features can be transformed before a policy selects an action.
Visual
Depth as repeated change of coordinates
Each layer maps one representation into another. The final task may become simpler in the later coordinate system.
How much a change of coordinates buys has been counted, not argued. In 2014 Montúfar and three co-authors proved a lower bound on it. A rectifier network with n0 inputs and L hidden layers of width n ≥ n0 can compute functions with Ω((n/n0)^((L−1)n0) · n^n0) linear regions. Regions are the pieces on which the network is affine — a direct count of how finely the input space can be carved. Their own reading of the corollary: “Thus we see that the number of linear regions of deep models grows exponentially in L and polynomially in n, which is much faster than that of shallow models with nL hidden units.”
The bound has since been both sharpened and fenced. In 2018 Serra and two colleagues gave tighter upper and lower bounds, exact for one-dimensional inputs. They also attached the condition under which the advantage exists at all: a deep rectifier network beats every shallow counterpart with the same number of neurons only when that number exceeds the input dimension. Composition multiplies regions. Not at every scale, and not for free.
- 1
Raw input
Coordinates reflect sensors, pixels, tokens, or engineered fields.
- 2
Early features
Local or simple combinations become easier to access.
- 3
Middle representation
Features interact and summarize broader context.
- 4
Task representation
The remaining distinction is shaped for the output head.
- 5
Decision head
A simple final map produces scores, values, or actions.
Comparison
Width and depth solve different design pressures
Both can increase capacity. They allocate that computation differently.
The trade is not symmetric, and the asymmetry was proved rather than argued. Telgarsky showed in 2016 that “for any positive integer k, there exist neural networks with Θ(k^3) layers, Θ(1) nodes per layer, and Θ(1) distinct parameters which can not be approximated by networks with O(k) layers unless they are exponentially large — they must possess Ω(2^k) nodes”. The result holds for a class of “semi-algebraic gates” that includes ReLU, maximum, indicator and piecewise polynomial functions. Width can buy back what depth provides. The exchange rate can be exponential.
The exchange has also been attempted in the laboratory, twice, with opposite-looking results. In 2014 Ba and Caruana trained shallow networks to mimic deep ones. On TIMIT and CIFAR-10 the mimics “perform similarly to complex, well-engineered, deeper convolutional models”, in some cases with the same number of parameters. On CIFAR-10 the parity was partial. Their best mimic, SNN-ECNN-MIMIC-30k, itself still contained one convolution and one max-pooling layer, and it reached 14.2% error against 12.0% for its teacher CNN and 11.0% for the four-CNN ensemble — on roughly 70M parameters against ~210k and ~840k.
Two years later a second group re-ran the test on CIFAR-10. Nine authors, Caruana among them, asked in their title whether deep convolutional nets really need to be deep and convolutional, and found that the student models cannot reach comparable accuracy unless they contain multiple layers of convolution. Their abstract answers the title in three words, then explains them: “Yes, they do. This paper provides the first empirical demonstration that deep convolutional models really need to be both deep and convolutional, even when trained with methods such as distillation that allow small or shallow models of high accuracy to be trained.”
More width
Adds parallel features within a layer.
- Larger activation tensors
- More simultaneous basis functions
- Often easier parallel compute
- May increase parameters sharply
More depth
Adds sequential transformations.
- Supports repeated composition
- Increases path length
- May reuse intermediate abstractions
- Can complicate optimization
Key idea
What universal approximation does—and does not—say
Classical universal approximation results show that certain neural networks can approximate broad classes of functions under stated conditions. They are existence statements about representational capacity.
They do not promise a small network, feasible data requirements, successful optimization, numerical stability, or good behavior outside the observed domain.
What such a theorem does say is narrower, and stranger, than the slogan. In 2017 Lu and four colleagues stated it as a threshold: “We show a universal approximation theorem for width-bounded ReLU networks: width-(n + 4) ReLU networks, where n is the input dimension, are universal approximators.” The same paper proves that, except on a set of measure zero, width-n ReLU networks are not. Four extra units separate everything from almost nothing.
The conditions were still being pinned down decades after the classical results. In 2020 Park and three co-authors fixed the exact minimum width for L^p universal approximation with ReLU at max{d_x+1, d_y}, and showed that the same conclusion fails for uniform approximation with ReLU alone. Universal approximation is usually cited as a blanket permission slip. Its own threshold moved in 2020, and its truth depends on which norm you approximate in.
Being able to represent a function is different from finding it, validating it, and using it safely.
Case
Standard image networks fit random labels and pure noise
How wide the gap between representable and useful can be has been measured directly. Give a standard image classifier a random labeling of its training data, and it fits it. Five researchers reported exactly that in 2017: “state-of-the-art convolutional networks for image classification trained with stochastic gradient methods easily fit a random labeling of the training data”.
Two details make it worse. The behavior “is qualitatively unaffected by explicit regularization and occurs even if we replace the true images by completely unstructured random noise”. And the capacity for it arrives early, because “simple depth two neural networks already have perfect finite sample expressivity as soon as the number of parameters exceeds the number of data points as it usually does in practice”.
The paper appeared at ICLR 2017 and was republished, with an added section, in Communications of the ACM in March 2021. A network that can memorize noise can represent nearly anything you ask of it. That is precisely why the ability to represent predicts so little.
Features are often distributed across units
A hidden concept may be encoded by a pattern across many coordinates rather than one dedicated neuron. Conversely, one unit may participate in several contexts.
This has been tested rather than assumed. Szegedy and six co-authors reported in 2014 that “there is no distinction between individual high level units and random linear combinations of high level units”. Bau and colleagues re-tested that sentence in 2017 with an experiment easy to state and hard to argue with. Take the 256 units of AlexNet conv5. Apply a random orthogonal rotation drawn from SO(256). Score the units again. The rotated representation had 80% fewer unique detectors — and yet “[e]ach rotated representation has exactly the same discriminative power as the original layer”. Interpretability was destroyed and accuracy was untouched. Whatever the individual units were carrying, it was not the network's performance.
The reason one unit can serve several contexts has a name and a demonstration. Elhage and colleagues at Anthropic and Harvard published Toy Models of Superposition on 14 September 2022: “In this paper, we use toy models — small ReLU networks trained on synthetic data with sparse input features — to investigate how and when models represent more features than they have dimensions. We call this phenomenon superposition.” In 2023 Cunningham and four colleagues recovered such overcomplete feature directions from a real language model, using sparse autoencoders. Their first line names the obstacle they were working against: “Polysemanticity prevents us from identifying concise, human-understandable explanations for what neural networks are doing internally.”
Visualizing one activation can be useful. Assigning a permanent human label to that unit may overstate the evidence, since representations are shaped jointly by architecture and objective — and, as the rotation shows, by a choice of basis the network never committed to.
Representation hierarchy does not imply a tidy dictionary of one neuron per concept.
Bottlenecks force selective compression
A narrow hidden layer limits how much information can pass forward in its explicit representation, and that constraint can encourage useful compression, though it may also discard details that are required later.
Deliberately narrow layers are a documented engineering device with numbers attached. GoogLeNet inserted 1×1 convolutions for exactly this purpose: “they are used mainly as dimension reduction modules to remove computational bottlenecks, that would otherwise limit the size of our networks”. The narrowing is what paid for the depth. Its nine authors describe the design as a fixed-budget trade: “we increased the depth and width of the network while keeping the computational budget constant”.
What came out of that budget: a network 22 layers deep, a top-5 error of 6.67% on ILSVRC 2014 validation and test data, and “12 times fewer parameters than the winning architecture of Krizhevsky et al” from 2012. The ImageNet challenge's own 2014 results page lists GoogLeNet first in classification, with an error of 0.06656, ahead of VGG at 0.07325.
Whether a bottleneck helps depends on the task, loss, noise, and downstream use. Smaller dimensionality is not automatically a better representation. It was a better representation there, under that budget, measured against that benchmark.
Analogy
An assembly line of specialized transformations
Each station on an assembly line performs a limited operation and passes a modified object onward. Complex products emerge because later stations reuse work completed earlier.
Real layers differ from workshop stations because they are trained jointly rather than assigned fixed crafts. Their division of labor can change throughout training.
Depth organizes reusable transformations, not a fixed hierarchy of human-designed subtasks.
Steps
How to justify another layer
Depth should answer a modeling need rather than a fashion preference.
Extra layers can make a model worse, and that has been measured with the parameter count held fixed. In 2016 He and three co-authors stated the failure plainly: “When deeper networks are able to start converging, a degradation problem has been exposed: with the network depth increasing, accuracy gets saturated (which might be unsurprising) and then degrades rapidly.” On ImageNet, under 10-crop testing on the validation set, a 34-layer plain network scored 28.54% top-1 error. An 18-layer plain network scored 27.94%. Sixteen extra layers, worse accuracy.
Adding residual paths — which carry “no extra parameter compared to their plain counterparts” — took the same 34-layer design to 25.03%. Residual nets up to 152 layers then reached 3.57% error and 1st place in the ILSVRC 2015 classification task, where the challenge results list MSRA's classification error as 0.03567. Srivastava and two colleagues had reported the same barrier independently in 2015 — “training becomes more difficult as depth increases, and training of very deep networks remains an open problem” — and removed it with gated shortcut paths. That is what step 3 below is for. Depth that will not train is a training problem before it is a capacity problem.
Matched budgets are what turned scaling from folklore into a stated rule. Tan and Le reported on the balance itself in 2019. Their finding was that “carefully balancing network depth, width, and resolution can lead to better performance”. The resulting EfficientNet-B7 reached state-of-the-art ImageNet accuracy. It did so “while being 8.4x smaller and 6.1x faster on inference than the best existing ConvNet”. Depth did not win that comparison. The balance did.
1. Establish a baseline
Measure a shallower model with comparable data and evaluation.
2. Inspect representation limits
Look for interactions or context the baseline cannot express.
3. Add a stable block
Use normalization or residual paths when depth makes training fragile.
4. Compare matched budgets
Control parameter count, compute, and training effort.
5. Keep only demonstrated value
Prefer the simpler design when deeper composition adds no reliable gain.
Key takeaways
- Depth enables repeated function composition, and the gain is countable: linear regions grow exponentially in depth and only polynomially in width.
- Width adds parallel features while depth adds sequential transformations. Ba and Caruana matched deep accuracy with shallow mimics; a second group found on CIFAR-10 that the students still needed multiple layers of convolution.
- Universal approximation is a capacity statement, not a guarantee of training or generalization. Its own threshold was still moving in 2020, from width n+4 to max{d_x+1, d_y}.
- Hidden representations are often distributed: rotating AlexNet conv5 cost 80% of its unique detectors and none of its discriminative power.
- Bottlenecks can encourage compression while also removing task-relevant information. GoogLeNet's 1×1 dimension-reduction modules bought 22 layers at 6.67% top-5 error, with 12 times fewer parameters than the 2012 winner.
- Additional depth should be justified under matched budgets: sixteen extra plain layers moved ImageNet top-1 error from 27.94% to 28.54%, and residual paths with no extra parameters reached 25.03%.