TL;DR
This paper investigates how the "complexity" of a neural network, specifically its effective nonlinearity, evolves during training, both across its layers (depth) and over time. They introduce a novel method using "partly linear" models to reveal a "wave-like" pattern of complexity development, starting from deeper layers and moving towards shallower ones. This offers a new lens for understanding the interplay between network architecture, training dynamics, and generalization.
What Problem Does This Paper Address?
Deep neural networks are known for their ability to learn complex functions, largely attributed to the nonlinear activation functions (like ReLU) used in their layers. While it's often assumed these functions are inherently nonlinear, recent research suggests that at the beginning of training, the network as a whole behaves surprisingly linearly. As training progresses, the network's function becomes more complex. However, a key question remained: how does this complexity develop across the different layers of the network over time? Understanding this evolution is crucial for grasping why deep networks generalize well and how their internal representations change. This paper aims to bridge this gap by systematically analyzing the effective nonlinearity of individual layers throughout the training process.
Methods
The core of the paper's methodology revolves around the concept of partly linear models. For a given fully nonlinear neural network, the authors create several variants where specific layers are forced to behave linearly (by replacing their nonlinear activation functions with linear ones).
- Partly Linear Models: They train multiple versions of the original network, each with an increasing number of initial layers set to linear. For example, in an 18-layer network, they might create models with the first 3, 5, 7, ..., 15 layers acting linearly, in addition to a fully linear model.
- Divergence Point Analysis: By comparing the test accuracy of these partly linear models to the original fully nonlinear model, they identify the point in training (number of batches) where the partly linear model's performance significantly drops below that of the full model. This "divergence point" indicates when the layers that were forced to be linear in the partial model start to behave differently from their counterparts in the fully nonlinear network, suggesting they have become effectively nonlinear.
- Mean of Preactivations: As a computationally efficient alternative and complementary metric, they analyze the mean of the "preactivations" (inputs to the activation functions) for each layer. They hypothesize that a mean close to zero indicates an effectively linear layer, while deviations suggest nonlinearity.
Datasets
- ImageNet (ILSVRC 2012): Used for training and evaluating the 18-layer BaseNet18 and the 50-layer ResNet50 architectures. This is a large-scale, complex dataset with 1000 classes.
- MNIST and CIFAR-10: Mentioned in the introduction as simpler datasets used in prior work for comparison.
Key Insights and Ideas
- Complexity as a "Wave": The development of effective nonlinearity doesn't happen uniformly across all layers simultaneously. Instead, it progresses in a distinct "wave-like" pattern, moving from deeper layers towards shallower ones over the course of training.
- Early Layers Remain Linear Longer: The initial layers of the network tend to stay in an "effective linear regime" for a considerable amount of training time. This suggests that early layers might be learning more general features, while later layers are responsible for more complex, discriminative ones.
- Preactivations as a Proxy for Linearity: The mean of preactivations serves as a surprisingly effective and computationally cheap indicator of a layer's effective linearity. A mean close to zero suggests linear behavior, which is valuable for analyzing large networks without the full computational cost of the partly linear model approach.
- Architecture Matters: The specific pattern of complexity evolution can be influenced by the network architecture, including the presence of residual connections (as seen when comparing BaseNet18 to ResNet50).
Key Results
- BaseNet18 (18-layer CNN):
- Most layers start in a linear-like regime.
- Layers become effectively nonlinear in a deep-to-shallow wave.
- The first 3-5 layers appear to remain in the linear-like regime throughout training, showing no significant performance difference even when forced to be linear.
- ResNet50 (50-layer CNN):
- Setting the first 20 or a selected subset of layers to linear had minimal impact on performance, suggesting these layers were already operating linearly or their linearity didn't hinder overall performance.
- Forcing the first 40 layers to be linear significantly degraded performance, indicating these layers are crucial for developing complexity.
- The "wavefront" of complexity development was observed to be influenced by residual connections.
Limitations and Future Work
- Resolution of Time: The authors note that increasing the time resolution (i.e., examining more checkpoints earlier in training) might reveal more about the very initial steps of complexity evolution.
- Metric Precision: While the mean of preactivations is computationally efficient, they acknowledge that more precise metrics for assessing nonlinearity likely exist and are an area for future exploration.
- Dataset Influence: The study primarily uses ImageNet. The authors hypothesize that the complexity evolution might also depend on the dataset and plan to investigate this in future work.
- Architecture Dependence: They plan to examine whether different architectures yield the same complexity evolution pattern.
Summary updated