Deeper or Wider: A Perspective from Optimal Generalization Error with Sobolev Loss

Yahong Yang, Juncai He

Abstract

Constructing the architecture of a neural network is a challenging pursuit for the machine learning community, and the dilemma of whether to go deeper or wider remains a persistent question. This paper explores a comparison between deeper neural networks (DeNNs) with a flexible number of layers and wider neural networks (WeNNs) with limited hidden layers, focusing on their optimal generalization error in Sobolev losses. Analytical investigations reveal that the architecture of a neural network can be significantly influenced by various factors, including the number of sample points, parameters within the neural networks, and the regularity of the loss function. Specifically, a higher number of parameters tends to favor WeNNs, while an increased number of sample points and greater regularity in the loss function lean towards the adoption of DeNNs. We ultimately apply this theory to address partial differential equations using deep Ritz and physics-informed neural network (PINN) methods, guiding the design of neural networks.

Introduction

The architectural design of neural networks—specifically the trade-off between depth and width—is a fundamental question in deep learning. While depth is often associated with the ability to represent complex hierarchical features, it introduces challenges in training and a higher risk of overfitting. Most theoretical frameworks comparing these architectures focus on standard $L^2$ loss. However, in the burgeoning field of scientific machine learning, where neural networks are used to solve Partial Differential Equations (PDEs), the focus shifts to Sobolev loss. Sobolev losses incorporate not just the function values but also their derivatives, which are essential for methods like the Deep Ritz method ($H^1$ loss) and Physics-Informed Neural Networks (PINNs, $H^2$ loss). This paper provides a rigorous theoretical analysis of the optimal generalization error for Deeper Neural Networks (DeNNs) versus Wider Neural Networks (WeNNs) within this Sobolev landscape.

Theoretical Framework: Approximation and Sampling

The generalization error of a neural network can be decomposed into two primary components:

  1. Approximation Error: The theoretical limit of how well a network architecture can represent a target function.
  2. Sampling Error: The error arising from learning from a finite set of $M$ data points.

To analyze these errors for higher-order derivatives, the authors utilize Deep Super ReLU Networks (DSRNs), which employ squared ReLU activations to ensure that derivatives are well-defined and continuous. By applying statistical tools such as covering numbers and Rademacher complexity, the study establishes upper bounds on the complexity of these models, allowing for a direct comparison of how depth and width scale with respect to the number of parameters ($W$) and samples ($M$).

The Phase Diagram of Architecture Selection

A key contribution of this work is the identification of a "phase diagram" that dictates the optimal architecture. The choice between depth and width is not static but depends on the relationship between the parameter budget and the available data.

Phase diagram illustrating the optimal choice between Deeper Neural Networks (DeNNs) and Wider Neural Networks (WeNNs) based on sample size (M), parameter count (W), and loss function regularity.

As shown in the figure above, a clear boundary exists. When the number of sample points $M$ is large relative to the number of parameters $W$, DeNNs are superior. Conversely, when data is scarce or the parameter budget is high, WeNNs tend to perform better. Crucially, as the regularity of the loss function increases (moving from $L^2$ to $H^1$ and $H^2$), the region where DeNNs outperform WeNNs expands. This suggests that "smooth" problems involving higher-order derivatives are particularly well-suited for deeper architectures, provided sufficient data is available.

Experimental Validation

The theoretical findings were validated through experiments comparing a shallow network (Depth 1, Width 20) and a deep network (Depth 4, Width 10). The results confirm the existence of different regimes based on data availability.

Experimental comparison of shallow and deep architectures across different data regimes, validating the theoretical phase transition.

In the "Small Data Regime" (1,000 points), the shallow network achieved a lower mean error, as the deep network's high complexity led to greater sampling error. However, in the "Large Data Regime" (10,000 points), the deep network's superior approximation capabilities allowed it to significantly outperform the shallow counterpart. This empirical evidence supports the claim that deeper networks require more data to "pin down" their complex representations without overfitting.

Implications for Scientific Computing

This research offers practical guidance for practitioners using neural networks to solve PDEs. For methods like PINNs, which rely on $H^2$ loss, the theory suggests that increasing depth is generally more beneficial for accuracy than increasing width, assuming a sufficient number of collocation points can be sampled. The established generalization bounds for DeNNs scale approximately with $O(W^{-4(n-k)/d} + W^2/M \log M)$, providing a roadmap for balancing model size and sample density.

Conclusion and Future Directions

This paper provides a comprehensive analysis of the deeper vs. wider dilemma through the lens of Sobolev loss. While deeper networks offer "super-convergence" in approximation, they carry a higher complexity penalty that necessitates larger datasets. Future work will aim to extend this analysis to the "overparameterized" regime, where models have more parameters than data points, and to other architectures such as Convolutional Neural Networks (CNNs). Additionally, exploring specialized function spaces like Barron or Korobov spaces may help mitigate the curse of dimensionality in high-dimensional problems.

Summary updated

BibTeX
@inproceedings{yang2024deeper,
  author = {Yahong Yang and Juncai He},
  title = {{Deeper or Wider: A Perspective from Optimal Generalization Error with Sobolev Loss}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=IWi6iLZeRG},
}
Figure