On the linearity of large non-linear models: when and why the tangent kernel is constant
Chaoyue Liu, Libin Zhu, Mikhail Belkin
Introduction
As the width of certain non-linear neural networks increases, they become linear functions of their parameters. This remarkable property of large models was first identified in jacot2018neural (12) where it was stated in terms of the constancy of the (neural) tangent kernel during the training process. More precisely, consider a neural network or, generally, a machine learning model , which takes as input and has as its (trainable) parameters. Its tangent kernel is defined as follows:
The key finding of jacot2018neural (12) was the fact that for some wide neural networks the kernel is a constant function of the weight during training. While in the literature, including jacot2018neural (12), this phenomenon is described in terms of the (linear) training dynamics, it is important to note that the tangent kernel is associated to the model itself. As such, it does not depend on the optimization algorithm or the choice of a loss function, which are parts of the training process.
The goal of this work is to clarify a number of issues related to the constancy of the tangent kernel, to provide specific conditions when the kernel is constant, i.e., when non-linear models in the limit, as their width approach infinity, become linear, and also to explicate the regimes when they do not. One important conclusion of our analysis is that the “transition to linearity” phenomenon discussed in this work (equivalent to constancy of tangent kernel) cannot be explained by “lazy training” chizat2019lazy (6) associated to small change of parameters from the initialization point or model rescaling, which is widely held to be the reason for constancy of the tangent kernel, e.g., sun2019optimization (20, 2, 10) (see Section 1.1 for a detailed discussion). The transition to linearity is neither due to a choice of a scaling of the model, nor is a universal property of large models including infinitely wide neural networks. In particular, the models shown to transition to linearity in this paper become linear in a Euclidean ball of an arbitrary fixed radius, not just in a small vicinity of the initialization point, where higher order terms of the Taylor series can be ignored.
Our first observationWhile it is a known mathematical fact (see 868044 (9, 19)), we have not seen it in the neural network literature, possibly due to the discussion typically concerned with the dynamics of optimization. As a special case, note that while clearly implies that is linear, it is not a priori obvious that the weaker condition is also sufficient. is that a function has a constant tangent kernel if and only if it is linear in , that is
for some “feature map” and function . Thus the constancy of the tangent kernel is directly linked to the linearity of the underlying model.
So what is the underlying reason that some large models transition to linearity as a function of the parameters and when do we expect it to be the case? As known from the mathematical analysis, the deviation from the linearity is controlled by the second derivative, which is represented, for a multivariate function , by the Hessian matrix . If its spectral norm is small compared to the gradient in a ball of a certain radius, the function will be close to linear and will have near-constant tangent kernel in that ball. Crucially, the spectral norm depends not just on the magnitude of its entries, but also on the structure of the matrix . This simple idea underlies the analysis in this paper. Note that throughout this paper we consider the Hessian of the model , not of any related loss function.
Constant tangent kernel for neural networks with linear output layer. In what follows we analyze the class of neural networks with linear output layer, which includes networks that have been found to have constant tangent kernel in jacot2018neural (12, 16, 8) and other works. We show that while the gradient norm is (omitting log factors) of the order w.r.t. the network width , the spectral norm of the Hessian matrix scales with as . In the infinite width limit, this implies a vanishing Hessian and hence transition to linearity of the model in a ball of an arbitrary fixed radius. A consequence of this analysis is the constancy of the tangent kernel, providing a different perspective on the results in jacot2018neural (12) and the follow-up works.
We proceed to expose the underlying reason why the Hessian matrix scales differently from the gradient and delimit the regimes where this phenomenon exists. As we show, the scaling of the Hessian spectral norm is controlled by both the -norms of the vectors , where is the (vector) value of the -th hidden layer, and the norms of layer-wise derivatives (specifically, the -norm of the corresponding order tensors). On the other hand, the scaling of the gradient and the tangent kernel is controlled by the -norms (i.e., Euclidean norms) of . As the network width (i.e., minimal width of hidden layers) is sufficiently large, the discrepancy between the the -norm and -norm increases, while the -norms remain of the same order. Hence we obtain the discrepancy between the scaling behaviors of the Hessian and gradient.
Non-constancy of tangent kernels. We proceed to demonstrate, both theoretically (Section 4) and experimentally (Section 6), that the constancy of tangent kernel is not a general property of large models, including wide networks, even in the “lazy” training regime. In particular, if the output layer of a network is nonlinear, e.g., if there is a non-linear activation on the output, the Hessian norm does not tend to zero as , and constancy of tangent kernel will not hold in any fixed neighborhood and along the optimization path, although each individual parameter may undergo only a small change. This demonstrates that the constancy of the tangent kernel relies on specific structural properties of the models. Similarly, we show that inserting a narrow “bottleneck” layer, even if it is linear, will generally result in the loss of near-linearity, as the Hessian norm becomes large compared to the gradient of the model.
Importantly, as we discuss in Section 5, non-constancy of the tangent kernel does not preclude efficient optimization. We construct examples of wide networks which can be provably optimized by gradient descent, yet with tangent kernel provably far from constant along the optimization path and with Hessian norm , same as the gradient.
We proceed to make a number of remarks in the context of some recent work on the subject.
Is the weight change from the initialization to convergence small? In the recent literature (e.g.,sun2019optimization (20, 2, 10)) it is sometimes asserted that the constancy of tangent kernel is explained by small change of weight vector during training, a property related to “lazy training” introduced in chizat2019lazy (6). It is important to point out that the notion “small” depends crucially on the measurement. Indeed, as we discuss below, when measured correctly in relation to the tangent kernel, the change from initialization is not small.
Let and be the weight vectors at initialization and at convergence respectively. For example, consider a one hidden layer network of width . Each component of the weight vector is updated by under gradient descent, as shown in jacot2018neural (12), and hence for wide networks , a quantity that vanishes with the increasing width. In contrast, the change of the Euclidean norm is not small in training, . Thus convergence happens within a Euclidean ball with radius independent of the network width.
In fact, the Euclidean norm of the change of the weight vector cannot be small for Lipschitz continuous models, even in the limit of infinite parameters. This is because
where is is the label at . Note that the difference , between the initial prediction and the ground truth label , is of the same order as . Thus, we see that , no matter how many parameters the model has.
We note that the (approximate) linearity of a model in a certain region (and hence the constancy of the tangent kernel) is predicated on the second-order term of the Taylor expansion . That term depends on the Euclidean distance from the initialization (and the spectral norm of the Hessian), instead of the -norm . Since, as we discussed above, these norms are different by a factor of , an argument based on small change of individual parameters from initialization cannot explain the remarkable phenomenon of constant tangent kernel.
In contrast to these interpretations, we show that certain large networks have near constant tangent kernel in a ball of fixed radius due to the vanishing Hessian norm, as their widths approach infinity. Indeed, that is the case for networks analyzed in the NTK literature jacot2018neural (12, 16, 8, 7).
Can the transition to linearity be explained by model rescaling? The work chizat2019lazy (6) introduced the term “lazy training” and proposed a mechanism for the constancy of the tangent kernel based on rescaling the model. While, as shown in chizat2019lazy (6), model rescaling can lead to lazy training, as we discuss below, it does not explain the phenomenon of constant tangent kernel in the setting of the original paper jacot2018neural (12) and consequent works.
Specifically, chizat2019lazy (6) provides the following criterion for the near constancy of the tangent kernel (using their notation):
Here is the ground truth label, is the Hessian of the model at initialization and is the norm of the gradient, i.e., a diagonal entry of the tangent kernel.
Assuming that and choosing a large , forces , by rescaling the factor to be small, while keeping unchanged.
While rescaling the model, together with the important assumption of , leads to a lazy training regime, we point out that it is not the same regime as observed in the original work jacot2018neural (12) and followup papers such as lee2019wide (16, 8) and also different from practical neural network training, since we usually have in these settings. Specifically:
The assumption of is necessary for the rescaled models in chizat2019lazy (6) to have . Yet, the networks, such as those analyzed in jacot2018neural (12), are initialized so that .
From Eq.(4), we see that rescaling the model by is equivalent to rescaling the ground truth label by without changing the model (this can also be seen from the loss function, cf. Eq.(2) of chizat2019lazy (6)). When is large, the rescaled label is close to zero. However, no such rescaling happens in practice or in works, such as jacot2018neural (12, 16, 8). The training dynamics of the model with the label does not generally match the dynamics of the original problem with the label and will result in a different solution.
Since , in the NTK setting and many practical settings, to satisfy the criterion in Eq.(3), the model needs to have . In fact, we note that the analysis of 2-layer networks in chizat2019lazy (6) uses a different argument, not based on model rescaling. Indeed, as we show in this work, is small for a broad class of wide neural networks with linear output layer, due to a vanishing norm of the Hessian as the width of the network increases.
In summary, the rescaled models satisfy the criterion, , by scaling the factor to be small, while the neural networks, such as the ones considered in the original work jacot2018neural (12), satisfy this criterion by having , while .
Is near-linearity necessary for optimization? In this work we concentrate on understanding the phenomenon of constant tangent kernel, when large non-linear systems transition to linearity with increasing number of parameters. The linearity implies convergence of gradient descent assuming that the tangent kernel is non-degenerate at initialization. However, it is important to emphasize that the linearity or near-linearity is not a necessary condition for convergence. Instead, convergence is implied by uniform conditioning of the tangent kernel in a neighborhood of a certain radius, while the linearity is controlled by the norm of the Hessian. These are conceptually and practically different phenomena as we show on an example of a wide shallow network with a non-linear output layer in Section 5. See also our paper liu2020toward (17) for an in-depth discussion of optimization.
Notation and Basic Results on Tangent Kernel and Hessian
We use to represent the derivative of with respect to . For (vector-valued) functions, we use the following definition of its Lipschitz continuity:
For an order tensor, we define its -norm:
We will later need the following proposition which is essentially a special case of the the Holder inequality.
Consider a matrix with components , where is a component of the order tensor and is a component of vector . Then the spectral norm of satisfies
Note that spectral norm is defined as . Then
2 Tangent kernel and the Hessian
As discovered in jacot2018neural (12) and analyzed in the consequent works lee2019wide (16, 8) the tangent kernel is constant for certain infinitely wide networks during training by gradient descent methods. First, we observe that the constancy of the tangent kernel is equivalent to the linearity of the model. While the mathematical result is not new (see 868044 (9, 19)), we have not seen this stated in the machine learning literature (the proof can be found in Appendix C).
The tangent kernel of a differentiable function is constant if and only if is linear in .
Of course for a model to be linear it is necessary and sufficient for the Hessian to vanish. The following proposition extends this result by showing that small Hessian norm is a sufficient condition for near-constant tangent kernel. The proof can be found in Appendix D.
As we shall see in Section 3, all neural networks that are proven in jacot2018neural (12, 8, 7) to have (near) constant tangent kernel during training, have small (zero, in the limit of ) spectral norms of the corresponding Hessian matrices.
Transition to linearity: non-linear neural networks with linear output layer
In this section, we analyze the class of neural networks with linear output layer, i.e., there is no non-linear activation on the final output. We show that the spectral norm of the Hessian matrix becomes small, when the width of each hidden layer increases. In the limit of infinite width, these spectral norms vanish and the models become linear, with constant tangent kernels. We point out that the neural networks that are already shown to have constant tangent kernels in jacot2018neural (12, 16, 8) fall in this category.
As a warm-up for the more complex setting of deep networks, we start by considering the simple case of a shallow fully-connected neural network with a fixed output layer, defined as follows:
This definition of a shallow neural network (i.e., with the presence of a factor and and of order ) is consistent with the NTK parameterization used to show constancy of tangent kernel in jacot2018neural (12, 16).
Hessian matrix. We observe that the Hessian matrix of the neural network is sparse, specifically, diagonal:
Consequently, if the input is bounded, say , the spectral norm of the Hessian is
In the limit of , the spectral norm converges to 0.
Tangent kernel and gradient. On the other hand, the magnitude of the norm of the tangent kernel of is of order in terms of . Specifically, for each diagonal entry we have
Therefore, from Eq. (9) and Eq. (10) we observe that the tangent kernel scales as while the norm of the Hessian scales as with the size of the neural network . Furthermore, as , the norm of the Hessian converges to zero and, by Proposition 2.3, the tangent kernel becomes constant.
So why should there be a discrepancy between the scaling of the Hessian spectral norm and the norm of the gradient? This is not a trivial question. There is no intrinsic reason why second and first order derivatives should scale differently with the size of an arbitrary model. In the rest of this subsection we analyze the source of that phenomenon in wide neural networks, connecting it to disparity of different norms in high dimension.
Specifically, we show that the Hessian spectral norm is controlled by -norm of the vector . In contrast, the tangent kernel and the norm of the gradient are controlled by its Euclidean norm . The disparity between these norms is the underlying reason for the transition to linearity in the limit of infinite width.
Hessian is controlled by . Given a model in Eq. (8), its Hessian matrix is defined as
where are the components of the order 3 tensor of partial derivatives . When there is no ambiguity, we suppress the argument and denote the Hessian matrix by . By Proposition 2.1 (essentially the Holder’s inequality: ), we have
For this -hidden layer network, the tensor is given by
Thus, we conclude that the Hessian spectral norm .
Tangent kernel and the gradient are controlled by . Note that the norm of the tangent kernel is lower bounded by the average of diagonal entries: , where is the size of the dataset. Consider an arbitrary diagonal entry of the tangent kernel matrix.
Note that, is a diagonal matrix with . By the Lipschitz continuity of , is finite. Therefore, the tangent kernel is of the same order as the -norm .
The discrepancy between the norms. For the network in Eq. (8) we have . Hence,
The transition to linearity stems from this observation and the fact discussed above that the Hessian norm scales as , while the tangent kernel is of the same order as .
In what follows, we show that this is a general principle applicable to wide neural networks. We start by analyzing two hidden layer neural networks, which are mathematically similar to the general case, but much less complex in terms of the notation.
2 Two hidden layer neural networks
Now, we demonstrate that analogous results hold for -hidden layer neural networks. Consider the -hidden layer neural network:
We denote the output of the first hidden layer by and the output of the second hidden layer by .
Hessian is controlled by . Similarly to Eq.(13), we can bound the Hessian spectral norm by -norms of and .
Here denotes partial derivatives w.r.t. each element of , i.e. after flattening the matrix .
As this Proposition is a special case of Theorem 3.1, we omit the proof.
When are initialized as random Gaussians, every term in Eq. (17), except for and , is of order , with high probability within a ball of a finite radius (see the discussion in Subsection 3.3 for details).
Hence, just like the one hidden layer case, the magnitude of Hessian spectral norm is controlled by these -norms:
Tangent kernel and the gradient are controlled by . A diagonal entry of the kernel matrix can be decomposed into
with each additive term being related to each layer. As the matrix and the vector are independent from each other and random at initialization, we expect to be of the same order as , for .
3 Multilayer neural networks
Now, we extend the analysis to general deep neural networks.
First, we show that, in parallel to one and two hidden layer networks, the Hessian spectral norm and the tangent kernel of a multilayer neural network are controlled by -norms and -norms of the vectors , respectively. Then we show that the magnitudes of the two types of vector norms scales differently with respect to the network width.
We consider a general form of a deep neural network with a linear output layer:
Initialization and parameterization. In this paper, we consider the NTK initialization/ parameterization jacot2018neural (12), under which the constancy of the tangent kernel had been initially observed. Specifically, the parameters, (weights), are drawn i.i.d. from a standard Gaussian, i.e., , at initialization, denoted as . The factor in the output layer is required by the NTK parameterization in order that the output is of order . Different parameterizations (e.g., LeCun initialization: ) rescale the tangent kernel and the Hessian by the same factor, and thus do not change our conclusions (see Appendix A).
To simplify the notation, we start by defining the following useful quantities:
It is important to note that the quantity is simply the maximum of the -norms , and that and are independent of the vectors .
The Hessian spectral norm is bounded by these quantities via the following theorem (see Appendix E for the proof).
Consider a -layer neural network in the form of Eq.(3.3). For any in the parameter space, the following inequality holds:
where and .
The factor in the second term comes from the definition of the output layer in Eq. (3.3) and is useful to make sure the model output at initialization is of the same order as the ground truth labels.
Tangent kernel and -norms. A diagonal entry of the kernel matrix can be decomposed into
with each additive term being related to each layer. As before, we expect each term has the same order as .
3.2 Small Hessian spectral norm and constant tangent kernel
To simplify our analysis, we make the following assumption.
Assumptions. We assume the hidden layer width for all , the number of parameters in each layer , and the output is a scalar.The assumption is to simplify the analysis, as we discuss below we only need . We assume that (vector-valued) layer functions are -Lipschitz continuous and twice differentiable with respect to input and parameters .
A fully connected neural network has the form as in Eq.(3.3), with each layer function specified by
where is a -Lipschitz continuous, -smooth activation function, such as and . The layer parameters are reshaped into an matrix. The Euclidean norm of becomes: .
With high probability over the Gaussian random initialization, we have the following lemma to bound the quantities , and in a neighborhood of :
Consider a fully connected neural network with linear output layer and Gaussian random initialization . Given any fixed , at any point , with high probability over the initialization, the quantity
See the proof of the lemma in Appendix F. Applying this lemma to Theorem 3.1, we immediately obtain the following theorem:
Consider a fully connected neural network with linear output layer and Gaussian random initialization . Given any fixed , and any , with high probability over the initialization, the Hessian spectral norm satisfies the following:
We note that the above theorem also applies to more general networks that have different hidden layer widths, as long as the width of each layer is larger than . See Theorem 3.3below.
In the limit of , the spectral norm of the Hessian converges to , for all . By Proposition 2.3, this immediately implies constancy of tangent kernel and linearity of the model, in the ball .
On the other hand, the tangent kernel is of order (see for example du2018gradientdeep (7), where the smallest eigenvalue of the tangent kernel is lower bounded by a width-independent constant). Intuitively, the order of tangent kernel stems from the fact that the -norms are of order .
By the optimization theory built in our work liu2020toward (17), a finite radius is enough to include the gradient descent solution, for the square loss. Hence, for very wide networks, the tangent kernel is constant during gradient descent training.
3.3 Neural networks with hidden layers of different width and general architectures
Our analysis above is applicable to other common neural architectures including Convolutional Neural Networks (CNN) and ResNets, as well as networks with a mixed architectural types. Below we briefly highlight the main differences from the fully connected case. Precise statements can be found in Appendix G.
The key observation is that a convolutional layer is “fully connected” in the channel dimension. In contrast, the convolutional operation, which is sparse, is only within the spatial dimensions. Hence, we can apply our analysis to the channel dimension with only minor modifications. As the spatial dimension sizes are independent of the network width, the convolutional operation only contributes constant factors to our analysis. Therefore, our norm analysis extends to the CNN setting.
Architecture with mixed layer types. Neural networks used in practice are often a mixture of different layer types, e.g., a series of convolutional layers followed by fully connected layers. Since our analysis relies on layer-wise quantities, our results extend to such networks.
We have the following general theorem which summarizes our theoretical results.
Consider a general neural network of the form Eq.(3.3), which can be a fully connected network, CNN, ResNet or a mixture of these types. Let be the minimum of the hidden layer widths, i.e., . Given any fixed , and any , with high probability over the initialization, the Hessian spectral norm satisfies the following:
Constant tangent kernel is not a general property of wide networks
In this section, we show that a class of infinitely wide neural networks with non-linear output, do not generally have constant tangent kernels. It also demonstrates that a linear output layer is a necessary condition for transition to linearity.
We note that the term vanishes as due to the constancy of the tangent kernel of . However the term is generally of the order , when is non-linearIf is linear, the term is identically zero.. To see that consider any solution such that (which exists for over-parameterized networks). Since is generally not equal to , we obtain the result.
where is the Hessian matrix of model . Hence, the spectral norm satisfies
This makes the quantity to be the order of . Then, Theorem 3.1 indicates that the Hessian spectral norm is no longer arbitrarily small, suggesting a non-constant tangent kernel during training.
Indeed, as we prove below, the Hessian spectral norm is lower bounded by a positive constant, which in turn implies that the linearity does not hold for this kind of neural networks.
Specifically, consider a bottleneck network with of the following form:
This network has three hidden layers, where the first and third hidden layer have an arbitrarily large width , and the second hidden layer, as the bottleneck layer, has a width . Each individual parameter is initialized by the standard norm distribution. For simplicity of the analysis, the activation function is identity for the bottleneck layer is identity, and is quadratic for the first and third layers, i.e. .
The following theorem gives a lower bound for the Hessian spectral norm in a ball around the initialization .
Consider the bottleneck network defined in Eq. (31). Given an arbitrary radius , for any and any , the Hessian matrix of the model satisfies
for some constant , with probability at least .
In particularly, in the limit of ,
See the proof in Appendix H. With this lower bounded Hessian, Proposition 2.2 directly implies that the linearity of the model does not hold for this network. As Eq. (2) shows that , our analysis implies the model is not linear, hence tangent kernel is not constant, along the optimization path. In Section 6, we empirically verify this finding.
In table 1, we summarize the key findings of this section and compare them with the case of neural networks with linear output layer.
Optimization of wide neural networks
A number of recent analyses show convergence of gradient descent for wide neural networks du2018gradientshallow (8, 7, 1, 23, 3, 13, 4). While an extended discussion of optimization is beyond the scope of this work, we refer the interested reader to our separate paper liu2020toward (17). The goal of this section is to clarify the important difference between the (near-)linearity of large models and convergence of optimization by gradient descent. It is easy to see that a wide model undergoing the transition to linearity can be optimized by gradient descent if its tangent kernel is well-conditioned at the initialization point. The dynamics of such a model will be essentially the same as for a linear model, an observation originally made in jacot2018neural (12).
However near-linearity or, equivalently, near-constancy of the tangent kernel is not necessary for successful optimization. What is needed is that the tangent kernel is well-conditioned along the optimization path, a far weaker condition.
The technical result is a consequence of Corollary 8.1 in liu2020toward (17).
Numerical Verification
We conduct experiments to verify the non-constancy of tangent kernels for certain types of wide neural networks, as theoretically observed in Section 4.
Specifically, we use gradient descent to train each neural network described below on a synthetic data until convergence. We compute the following quantity to measure the max (relative) change of tangent kernel from initialization to convergence: For a network that has a nearly constant tangent kernel during training, is expected to be close to , while a network with a non-constant tangent kernel, should be . Detailed experimental setup and data description are given in Appendix B.
In Figure 1, right panel, we demonstrate the evolution of tangent kernel with respect to the training time for a very wide neural network (width ). We see that, for the neural network with a non-linear output layer, tangent kernel changes significantly from initialization, while tangent kernel of the linear output network is nearly unchanged during training.
Wide neural networks with a bottleneck. We consider a fully connected neural network with hidden layers and a linear output layer. The second hidden layer, i.e., the bottleneck layer, has a width which is typically small, while the width of the other hidden layers are typically very large, in our experiment. For different bottleneck width , , , , , ,, we train the network on a synthetic dataset using gradient descent until convergence, and compute .
The change of tangent kernels for different bottleneck width is shown in Figure 2. We can see that a narrow bottleneck layer in a wide neural network prevent the neural tangent kernel from being constant during training. As expected, increasing the width of the bottleneck layer, makes the change of the tangent kernel smaller. We observe that the scaling of the tangent kernel change with width follows close to (dashed line in Figure 2) in alignment with our theoretical results (Theorem 3.3).
Acknowledgements
The authors acknowledge support from NSF, the Simons Foundation and a Google Faculty Research Award. We thank James Lucas for correcting the proof of Prop. 2.3. The GPU used for the experiments was donated by Nvidia.
References
Appendix A Other Parameterization Strategies
Throughout the paper, our analysis is based on the NTK prameterization jacot2018neural (12), under which the constancy of tangent kernel is originally observed. In this section, we show that different parameterization strategies (e.g., LeCun initialization lecun2012efficient (15) : ) do not change our conclusions.
Specifically, we show that, compared to the NTK prameterization, a different parameterization strategy only rescales the tangent kernel and the spectral norm of the Hessian by the same factor, hence the ratio between tangent kernel and Hessian spectral norm keeps the same and still holds. This still implies that the tangent kernel is almost constant during training.
Recall that we initialize the parameters of the general form of a deep neural network , Eq.(3.3) by a standard Gaussian, i.e. . If we apply another parameterization strategy here, for example, , where can be a function of , we can see every where .
In this case, the gradient of the model w.r.t. the weights of layer is
And by the same reason, the Hessian of the model f w.r.t. the weights of layer and is
Therefore, it’s easy to see the ratio of the norm of the tangent kernel to the norm of the Hessian keeps the same:
In many practical machine learning tasks, it is popular to use the LeCun initialization/parameterization: each individual parameter , while there is no factor in the definition of the layer function, e.g., for fully connected layers
In this setting, the factor . Then, by the analysis above, we see that
It is also interesting to note that, the Euclidean norm of the parameter change also scales:
Appendix B Experimental Setup
We use a synthetic dataset of size which contains classes. Each data point is sampled as follows: label is randomly sampled from with equal probability; given , is drawn from the following distribution:
We encode each in by a one-hot vector . And means the -th component of . We use this dataset for all the optimization tasks mentioned below.
B.1 Wide neural networks with non-linear output layers
In the experiments, we train three different neural networks:
Neural network with a linear output layer
Neural network with a softmax-activated (non-linear) output layer
Neural network with a swish-activated (non-linear) output layer
We use gradient descent to minimize the loss functions until convergence is achieved (i.e. loss less than ). To measure the change of tangent kernels, we compute the max (relative) change of tangent kernel from initialization to convergence: For each training, we take independent runs and report the average .
B.2 Wide neural networks with a bottleneck
In the experiment, we use a fully connected neural network with hidden layers and a linear output layer. Its second hidden layer, i.e., the bottleneck layer has a width , while the other hidden layers has a width . Specifically, it is defined as:
For each bottleneck width, we use gradient descent to minimize the loss functions until convergence is achieved (i.e. loss less than ) and compute the max (relative) change of tangent kernel from initialization to convergence: For each training, take independent runs and report the average .
Appendix C Proof for Proposition 2.2
Recall that the tangent kernel is defined as
For a constant tangent kernel, each element is constant. Noting that , we have is constant in , for all input .
The following arguments basically follow the idea from 868044 (9) (a more general result was shown in sakai1996riemannian (19)).
To simplify the notation, in the rest of the proof, we hide the argument , and we use to denote .
Let . Consider the ordinary differential equation (ODE)
For any , since , we have
but , which indicates
Dividing by and taking to allows us to have . Then we construct the level set
where for all which shows is linear.
Appendix D Proof of Proposition 2.3
Since the function is twice differentiable w.r.t. , according to Taylor’s theorem, we have the following expression for the gradient:
Then the Euclidean norm of the gradient change is bounded by
Since and the ball is convex, the point is within . Hence,
Since is smooth, the gradients and are bounded. Therefore, . ∎
Appendix E Proof of Theorem 3.1
The Hessian matrix of the neural network can be written as the following structure:
Here, each Hessian block is the second derivative of w.r.t. its weights of -th and -th layers, where we treat the final layer parameters as .
The following lemma allows us to bound the Hessian spectral norm by the norms of its blocks (see proof in Appendix I.1).
Spectral norm of a matrix (58) is upper bounded by the sum of the spectral norm of its blocks, i.e. , .
Now, we analyze the Hessian blocks case by case. Since the Hessian matrix is symmetry, without loss of generosity, we assume .
By the chain rule, the gradient of the model w.r.t. the weights of layer , can be written as
Then, the Hessian block has the following expression:
Hence, the spectral norm of Hessian block is bounded by
with .
𝐿11\leq l_{1} 𝐿1l_{1}=l_{2}=L+1. In this case, the Hessian block is simply zero. Hence, the spectral norm is zero. Applying Lemma E.1, we immediately obtain the desired result. ∎ According to the definitions of the quantities , and in Eq.(21), it suffices to show that the followings layer-wise properties hold everywhere in the ball with high probability over the initialization: The matrix spectral norm w.r.t. , for all ; The -norms of order tensors, , and are all of the order w.r.t. , for all . We start the proof with some preliminary results, and then prove the above statements one by one. The fully connected neural network is defined in the following way: where which is the dimension of the input , and for all . The trainable parameters of this network are , and are initialized by the random Gaussian initialization, i.e., each parameter , and , . As the parameters of each layer are reshaped into matrices, the Euclidean norm of parameters becomes , where is the Frobenius norm of a matrix. To make the presentation of the proof as simple as possible, we first make the following assumption about the initial parameters . Then we prove it in Lemma F.1 that the assumption is satisfied with high probability over the random Gaussian initialization. We assume that there exists a constant such that, for all initial weight matrices/vector , , where . If the parameters are initialized as for all and , then, for each layer , we have with probability at least , We prove the following lemma which states that the norm of the matrix keeps its order in a finite ball around the . If satisfies Assumption F.1, then for any such that , we have See the proof in Appendix I.3. The following lemma gives bounds on the Euclidean norm of the vector of hidden neurons for each layer. If satisfies Assumption F.1, then, for any such that , we have, at all hidden layers When . Recall from Eq.(22) that, a fully connected layer is defined as, for : Note that, in this case, the parameter vector is reshaped to an matrix . The first derivatives of are By the definition of spectral norm, , we have, for all , In the last inequality, we used Lemma F.3 and the Lipschitz continuity of the activation . In this layer, the input is fixed (independent of trainable parameters) and not a dynamical variable. Hence, is not an interesting object in our Hessian analysisIndeed, it does not show up in the Hessian analysis (c.f. the proof of Theorem 3.1 in Section E).. For , we have (with a similar analysis as in Eq.(71)), We consider the first layer i.e. and the rest of the layers i.e. separately. When . The second derivatives of the vector-valued layer function , which are order tensors, have the following expressions: By the definition of the -norm for order tensors, and Lemma F.2, we get Similarly, by using Lemma F.2 and Lemma F.3, we have, When . As discussed in Section F.2, the input is constant, we only need to analyze the tensor in this case. With a similar analysis in Eq.(77), we have First of all, we present a few useful facts, Lemma F.4-F.6 that will be used during the proof. The proofs of the following lemmas are in Appendix I.5-I.7. We first show that each activation of the hidden layers is bounded at initialization, with high probability. The following lemma gives an upper bound to Euclidean norms of in the ball . If the initial parameters of the multi-layer neural network satisfies Assumption F.1, then, for any such that , we have, at all hidden layers, i.e., , First of all, we prove, by induction, the following claim: for all , In the base case, we consider . We have To bound the second additive term above, we need the following inequality: where the last equality is the result of Lemma F.3 that . Also, note that is a diagonal matrix, then, we have where we used Lemma F.5 and Eq.(85) in the last equality. Now, insert Eq.(86) into Eq.(84), and apply Lemma F.5 and the induction hypothesis, then we have In this section, we apply Theorem 3.1 to both convolutional neural networks (CNN) and residual networks (ResNets), and show that they both have small Hessian spectral norms when the network width is sufficiently large and last layer is of linear form. A convolutional neural network (CNN) is a network of the type in Eq.(3.3), with each convolutional layer function defined as where is the convolution operator (see the definition below), and the layer width for all , and with as the number of channels of the input. To simplify the notation, we consider a one-dimensional CNN, i.e., a “image” is an -D array of “pixels”, and one will find that the analysis in this section also applies to higher dimensional CNNs. We also drop the layer indices , wherever there is no ambiguity. Reformulation of convolutional layer. Now, we reformulate the convolutional layer function in Eq.(90) into a fully-connected-like function. Then, we can use the techniques developed in Section F to prove for the CNN. Specifically, for all , define matrices and such that each entry and . Then, the convolution operator in Eq.(91) can be rewritten as Here in the summation, it is matrix multiplication. Note that, while are independent from each other for different , the inputs are not independent from each other; instead, they share pixels: , i.e., each is a pixel-shifted version of (newly generated pixels after shift is filled with zeros). Therefore, the convolutional layer function can also be written as (for ) Here, we can see we will use this expression of convolutional layer function for analysis in this section. Before proceeding to the proof for CNN, we first point out a few useful facts, as summarized in the following lemmas. Given matrices and such that , we have , where is the spectral norm of matrix . See the proof in Appendix I.8. The following two lemmas provide bounds on the spectral norm of weights and Frobenius norm of hidden layers. These two lemmas (and the proofs) are analogous to Lemma F.2 and F.3, and we omit the proof. Suppose the parameters are initialized as , for all . Then, with high probability of the random initialization, we have for any the following holds Suppose the parameters are initialized as , for all and for all layers. Then, with high probability of the random initialization, we have for any the following holds at all hidden layers We note that the proof for CNNs is basically analogous to that for fully connected neural networks (FCNs). Here, we refer readers to follow the proof idea for FCNs and only discuss the main differences below. In the following, we focus on analyzing the layers for . For the case of , we omit the proof, and refer the readers to the discussion in Section F, which also applies here. Here, in the second inequality, we used Lemma G.1, and in the last equality, we used Lemma G.2. Similarly, using Lemma G.1 and G.3, we also have Similarly, by using Lemma G.1, G.2 and G.3, we also have The parameters are initialized following the random Gaussian initialization strategy, i.e., , and , . This definition of ResNet differs from the standard ResNet architecture in he2016deep (11) that the skip connections are at every layer, instead of every two layers. One will find that the same analysis can be easily generalized to cases where skip connections are at every two or more layer. The same definition, up to a scaling factor, was also theoretically studied in du2018gradientdeep (7). We see that the ResNet is the same as a fully connected neural network, Eq. (F.1), except that the activations has an extra additive term from the previous layer, interpreted as skip connection. Because of this similarity, the proof for ResNet is almost identical to that for fully connected networks. In the following, we sketch the proof for ResNet. Specifically, we focus on the arguments that are new to ResNet, and omit those identical to the fully connected case. Parallel to Lemma F.2 and F.3 for fully connected case, we have the following lemmas for the ResNet. Suppose the parameters are initialized as , for all , and , . Then, with high probability of the random initialization, we have for any the following holds Suppose the parameters are initialized as , for all and , . Then, with high probability of the random initialization, we have for any the following holds at all hidden layers The proofs of the above two lemmas are almost identical to those of Lemma F.2 and F.3. We omit the proofs here, and refer interested readers to proofs of Lemma F.2 and F.3. We note that has the same expression as the one of the fully connected networks. By the same argument in Section F.2, as well as Lemma G.5, we have . When , the layer function is defined by In this layer, the input is fixed (independent of trainable parameters) and not a dynamical variable. Hence, is not an interesting object in our Hessian analysis. We see that both and are bounded, hence, the (vector-valued) layer function of ResNet is Lipschitz continuous. Note that the skip connection term in Eq.(101) is linear in and independent from . Hence, the order tensors are exactly the same as in the case of fully connected networks. Applying the same argument as in Section F.3 gives the following: For a ResNet, define vector for . Specifically, takes the following form: The proof of the lemma is deferred to Appendix I.9. Consider an arbitrary parameter setting . Note that spectral norm of a matrix is lower bounded by the norm of its blocks, then Hence, it’s sufficient to lower bound the norm of the Hessian block . With simple computation, the gradient of w.r.t. is: and each entry of the Hessian matrix takes the form: In the second equality above, we have used . Then, the spectral norm of this Hessian block is For the last factor , using the tail bound for laurent2000adaptive (14), we have, with probability at least , Applying Lemma H.1 to the factor and using union bound, for an arbitrary , we have, with probability at least , Hence, we get the lower bound of the Hessian spectral norm at In particular, for the initial parameter setting , we have Letting and noting that , we finish the proof. ∎ By triangle inequality and the definition , we have for all layers, i.e., , Note that, at the output layer, i.e. is a vector, and the Frobenius norm reduces to the Euclidean norm . ∎ To analyze , let’s first consider the input layer, i.e., : , where is the dimension of the input . Then we prove Eq.(66) by induction. For the first hidden layer , Above, we used the -Lipschitz continuity and applied Lemma F.2 in the second inequality. Now, suppose for -th layer we have Then, by a similar argument as in Eq.(114), we can get When , takes the following form: where we can see since at initialization. By the concentration inequality for Gaussian random variable, we have for by Lemma F.3. When , we have Similarly, at initialization, . Hence The expression of the derivatives is Suppose at -th layer, . Then Above, we used Lemma F.2 and the -Lipschitz continuity of the activation function in the second inequality. Setting , we immediately obtain Eq.(81). We prove it by induction. When , . Since , by the concentration inequality, for every , we have where . Similarly, we analyze every component of : For the first term, we use a Gaussian random variable to bound it: Using the concentration inequality, we have for some by Lemma F.5. For the second term, we have Let and , where each is a column of the matrix and each is a column of the matrix . Then we have First, let’s write and as where and . By the condition of the Lemma, we have and . Now, let’s lower bound the first term and upper bound the last three terms. For the first term, we lower bound it by the anti-concentration inequality, i.e., Theorem 8 in carbery2001distributional (5). Specifically, for any , there exists a constant , such that, with probability at least , Combining Eq.(121) and (122), we have, with probability at least , For the second and third terms, we notice that By the concentration inequality for Gaussian random variable (Prop 2.1.9 in tao2012topics (21)) and union bound, we have, for any , As for the last term, using and , it is easy to have the following bound: Putting inequalities Eq.(123), Eq.(124), and Eq.(125) into Eq.(I.9) and using union bound, we have with probability at least , If we set in the above analysis, we have, with probability at least ,Appendix F Proof for Lemma 3.1
F.3 (2,2,1)221(2,2,1)-norms of order 333 tensors are O(1)𝑂1O(1)
Appendix G Generalization to other architectures
G.2 Residual Networks (ResNet)
G.3 Architecture with mixed layer types
Appendix H Proof of Theorem 4.1
Appendix I Proofs of Technical Lemmas
I.2 Proofs for Gaussian Random Initialization
I.3 Proof of Lemma F.2
I.4 Proof of Lemma F.3
I.5 Proof of Lemma F.4
I.6 Proof of Lemma F.5
I.7 Proof of Lemma F.6
I.8 Proof of Lemma G.1
I.9 Proof of Lemma H.1