[Paper Review] The Nonlinearity Coefficient - Predicting Generalization in Deep Neural Networks
This paper introduces the Nonlinearity Coefficient (NLC), a gradient-based metric computed from a network's randomly initialized weights that predicts generalization performance in fully-connected feedforward networks. The NLC quantifies the degree of nonlinearity by combining input and output covariance matrices with the input-output Jacobian, and empirically shows that achieving a right-sized NLC correlates strongly with low test error, enabling early rejection of poor architectures before training.
For a long time, designing neural architectures that exhibit high performance was considered a dark art that required expert hand-tuning. One of the few well-known guidelines for architecture design is the avoidance of exploding gradients, though even this guideline has remained relatively vague and circumstantial. We introduce the nonlinearity coefficient (NLC), a measurement of the complexity of the function computed by a neural network that is based on the magnitude of the gradient. Via an extensive empirical study, we show that the NLC is a powerful predictor of test error and that attaining a right-sized NLC is essential for optimal performance. The NLC exhibits a range of intriguing and important properties. It is closely tied to the amount of information gained from computing a single network gradient. It is tied to the error incurred when replacing the nonlinearity operations in the network with linear operations. It is not susceptible to the confounders of multiplicative scaling, additive bias and layer width. It is stable from layer to layer. Hence, we argue that the NLC is the first robust predictor of overfitting in deep networks.
Motivation & Objective
- To address the lack of reliable, pre-training metrics for predicting generalization performance in deep neural networks.
- To develop a gradient-based metric that is invariant to common architectural confounders such as input scale, bias, and dimensionality.
- To identify a single scalar metric that captures the degree of nonlinearity and correlates strongly with test error in fully-connected networks.
- To enable early detection of poor architectures by predicting poor training outcomes before any training is performed.
Proposed method
- The Nonlinearity Coefficient (NLC) is defined as the trace of the product of the output covariance matrix and the input-output Jacobian's covariance, normalized by the input covariance trace.
- The NLC is computed using a two-pass stochastic estimator: first computing the mean output and output covariance over mini-batches, then estimating the Jacobian trace via backpropagation of random Gaussian vectors.
- The method uses batch normalization to stabilize output bias and ensure numerical stability during computation, especially in low-precision settings.
- The NLC is derived from the relative diameter of input regions approximated by linear functions, linking it to the network's intrinsic nonlinearity.
- The NLC is computed in the randomly initialized state, making it applicable before any training or hyperparameter tuning.
- The approach is robust to changes in input scale, input bias, and input dimensionality, unlike many prior gradient-based metrics.
Experimental results
Research questions
- RQ1Can a gradient-based metric computed at network initialization predict generalization performance in deep neural networks?
- RQ2Is there a single scalar metric that captures the degree of nonlinearity and correlates strongly with test error?
- RQ3How robust is the proposed metric to confounders such as input scale, input bias, and input dimensionality?
- RQ4Does achieving a 'right-sized' NLC lead to optimal test error in fully-connected feedforward networks?
Key findings
- The NLC computed at random initialization is a strong predictor of final test error across a wide range of fully-connected feedforward networks.
- Networks with sub-optimal NLC values consistently exhibit higher test error, indicating that NLC is a reliable indicator of poor generalization.
- The NLC is robust to changes in input scale, input bias, and input dimensionality, making it more reliable than many existing gradient-based metrics.
- The NLC is conceptually simple, computationally cheap, and can be used to discard poor architectures before training, saving significant computational resources.
- The NLC correlates with the relative diameter of input regions that can be well-approximated by linear functions, linking it to the network's intrinsic nonlinearity.
- The NLC remains stable and accurate even in low-precision floating-point arithmetic when computed with proper batch normalization and two-pass estimation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.