The capacity of feedforward neural networks

Pierre Baldi, Roman Vershynin

Abstract

Understanding the expressive power of neural networks is a fundamental challenge in deep learning theory. This paper establishes a definitive mathematical framework for the "capacity" of feedforward architectures, quantifying the number of bits of information a network can store. By deriving a cubic polynomial formula for capacity based on layer sizes, the authors demonstrate how architectural choices—specifically "bottleneck" layers—impose structural regularization. This work provides a quantitative lens through which to compare architectures and explains why deep networks often generalize well despite having more parameters than training data.

Introduction

Despite the empirical success of deep learning, the field has lacked a robust, quantitative metric to compare different neural architectures. A central paradox remains: deep networks often possess far more parameters than training examples, yet they frequently avoid the pitfalls of overfitting. To resolve this, we must measure the capacity of an architecture—the total number of unique functions it can implement as its weights vary. While capacity was previously understood for individual neurons, its extension to multi-layer, deep networks remained an open problem until this research.

Defining Cardinal Capacity

The authors define cardinal capacity, denoted as $C(A)$, as the binary logarithm of the number of functions a network can compute. The study focuses on networks composed of Linear Threshold Units (LTUs)—neurons that output a binary value (0 or 1) based on a weighted sum of inputs.

The cardinal capacity $C(A)$ is defined as the binary logarithm of the size of the function set $|A|$.

In this framework, the capacity represents the "information budget" of the architecture. The analysis is conducted on the n-dimensional Boolean cube ($H^n = \{0, 1\}^n$), which serves as the fundamental mathematical "playground" for evaluating discrete functions. This setting allows for a rigorous combinatorial approach to counting the possible mappings from inputs to outputs.

Methodology: Multiplexing, Enrichment, and Stacking

To derive a general capacity formula, the authors introduced three key mathematical techniques that allow for the decomposition and analysis of complex networks:

  1. Multiplexing: This technique involves using a small number of input bits as "selectors" to choose which of several hidden functions is passed to the output. This allows the network to effectively partition its resources and compute multiple functions in parallel.
  2. Enrichment: A method to transform a set of inputs into a higher-dimensional representation that maximizes the number of functions the next layer can learn. This is crucial for understanding how information is "prepared" for processing as it moves through the network.
  3. Stacking: The authors demonstrated that deep networks can be viewed as a series of three-layer "modules." By showing that these modules can perform computations independently, they were able to prove that the total capacity of a deep network is approximately the sum of the capacities of its constituent modules.

Key Insights: The Bottleneck Rule and Structural Regularization

One of the most significant findings is the Bottleneck Rule. The capacity of any given layer is fundamentally limited by the smallest preceding layer. For instance, a layer of 1,000 neurons followed by a bottleneck of 10 neurons severely throttles the functional power of all subsequent layers, regardless of their size. This suggests that the "narrowest" part of a network's history dictates its overall expressive potential.

This leads to the concept of Structural Regularization. While a shallow network (one hidden layer) with a fixed budget of $N$ neurons actually has a higher raw capacity than a deep network, the deep network's architecture acts as a filter. It restricts the network to a subset of functions that are more "regular" and less prone to learning chaotic noise. This architectural constraint is a form of implicit regularization that explains why deep models often generalize better than their shallow counterparts.

Results and The Capacity Formula

The core result of the paper is Theorem 3.1, which provides a scaling law for the capacity of a feedforward network with layer sizes $n_1, \dots, n_L$. The capacity $C$ satisfies:

$$C(n_1, \dots, n_L) \asymp \sum_{k=1}^{L-1} \min(n_1, \dots, n_k) n_k n_{k+1}$$

This cubic scaling—specifically the sum of products of adjacent layer sizes, adjusted for bottlenecks—is a significant departure from simpler parameter-counting methods. It highlights that the interaction between adjacent layers, constrained by the "history" of the network's width (the $\min$ term), is what determines functional power.

Further results include:

  • Optimal Connections: To maximize capacity with a fixed number of connections, a "monotonically expansive" network (where each layer is larger than the last) is ideal.
  • Optimal Neurons: For a fixed number of neurons $N$, a shallow network with a specific ratio (approximately $2N/3$ and $N/3$ for two hidden layers) is near-optimal for raw capacity.
  • Set Capacity Lower Bound: The authors proved that for any subset $S$ of the Boolean cube, the capacity is bounded by $C(S) > \frac{1}{16} \log_2^2 |S|$.

Conclusion and Future Directions

This work establishes a rigorous mathematical baseline for neural network capacity. While the current study is limited to Linear Threshold Units, the authors hypothesize that similar scaling laws apply to continuous activations like ReLU and Sigmoid. Future research will aim to refine these estimates to be "asymptotically tight" and extend the analysis to non-fully connected architectures, such as Convolutional Neural Networks (CNNs), where weight sharing and local connectivity introduce additional structural constraints.

Summary updated

BibTeX
@inproceedings{baldi2019capacity,
  author = {Pierre Baldi and Roman Vershynin},
  title = {{The capacity of feedforward neural networks}},
  booktitle = {Neural Networks},
  year = {2019},
  url = {https://openreview.net/forum?id=aa_fRgDmHWN5},
}
Figure