The Neural Tangent Kernel in High Dimensions: Triple Descent and a Multi-Scale Theory of Generalization
Ben Adlam, Jeffrey Pennington
Introduction
Machine learning models based on deep neural networks have achieved widespread success across a variety of domains, often playing integral roles in products and services people depend on. As users rely on these systems in increasingly important scenarios, it becomes paramount to establish a rigorous understanding for when the models might work, and, crucially, when they might not. Unfortunately, the current theoretical understanding of deep learning is modest at best, as large gaps persist between theory and observation and many basic questions remain unanswered.
One of the most conspicuous such gaps is the unexpectedly good generalization performance of large, heavily-overparameterized models. These models can be so expressive that they can perfectly fit the training data (even when the labels are replace by pure noise), but still manage to generalize well on real data (Zhang et al., 2016). An emerging paradigm for describing this behavior is in terms of a double descent curve (Belkin et al., 2019a), in which increasing a model’s capacity causes its test error to first decrease, then increase to a maximum near the interpolation threshold (where the number of parameters equals the number of samples), and then decrease again in the overparameterized regime.
There are of course more elaborate measures of a model’s capacity than a naive parameter count. Recent empirical and theoretical work studying the correlation of these capacity measures with generalization has found mixed results, with many measures having the opposite relationship with generalization that theory would predict (Neyshabur et al., 2017). Other work has questioned whether it is possible in principle for uniform convergence results to explain the generalization performance of neural networks (Nagarajan & Kolter, 2019).
Our approach is quite different. We consider the algorithm’s asymptotic performance on a specific data distribution, leveraging the large system size to get precise theoretical results. In particular, we examine the high-dimensional asymptotics of kernel ridge regression with respect to the Neural Tangent Kernel (NTK) (Jacot et al., 2018) and conclude that double descent does not always provide an accurate or complete picture of generalization performance. Instead, we identify complex non-monotonic behavior in the test error as the number of parameters varies across multiple scales and find that it can exhibit additional peaks and descents when the number of parameters scales quadratically with the dataset size.
Our theoretical analysis focuses on the NTK of a single-layer fully-connected model when the samples are drawn independently from a Gaussian distribution and the targets are generated by a wide teacher neural network. We provide an exact analytical characterization of the generalization error in the high-dimensional limit in which the number of samples , the number of features , and the number of hidden units tend to infinity with fixed ratios and . By adjusting these ratios, we reveal the intricate ways in which the generalization error depends on the dataset size and the effective model capacity.
We investigate various limits of our results, including the behavior when the NTK degenerates into the kernel with respect to only the first-layer or only the second-layer weights. The latter corresponds to the standard setting of random feature ridge regression, which was recently analyzed in (Mei & Montanari, 2019). In this case, the total number of parameters is equal to the width , i.e. , so that is linear in the dataset size. In contrast, for the full kernel, the number of parameters is , i.e. it is quadratic in the dataset size. By studying these two kernels, we derive insight into the generalization performance in the vicinities of linear and quadratic overparameterization, and by piecing these two perspectives together, we infer the existence of multi-scale phenomena, which sometimes can include triple descent. See Fig. 1 for an illustration and Fig. 4 for empirical confirmation of this behavior.
We derive exact high-dimensional asymptotic expressions for the test error of NTK ridge regression.
We prove that the test error can exhibit non-monotonic behavior deep in the overparameterized regime.
We investigate the origins of this non-monotonicity and attribute them to the kernel with respect to the second-layer weights.
We provide empirical evidence that triple descent can indeed occur for finite-sized networks trained with gradient descent.
We find exceptionally fast learning curves in the noiseless case, with .
2 Related Work
A recent line of work studying the behavior of interpolating models was initiated by the intriguing experimental results of (Zhang et al., 2016; Belkin et al., 2018b), which showed that deep neural networks and kernel methods can generalize well even in the interpolation regime. A number of theoretical results have since established this behavior in certain settings, such as interpolating nearest neighbor schemes (Belkin et al., 2018a) and kernel regression (Belkin et al., 2019c; Liang et al., 2020b).
These observations, coupled with classical notions of the bias-variance tradeoff, have given rise to the double descent paradigm for understanding how test error depends on model complexity. These ideas were first discussed in (Belkin et al., 2019a), and empirical evidence was obtained in (Advani & Saxe, 2017; Geiger et al., 2020) and recently in (Nakkiran et al., 2019). Precise theoretical predictions soon confirmed this picture for linear regression in various scenarios (Belkin et al., 2019b; Hastie et al., 2019; Mitra, 2019).
Linear models struggle to capture all of the phenomena relevant to double descent because the parameter count is tied to the number of features. Recent work found multiple descents in the test loss for minimum-norm interpolants in Reproducing Kernel Hilbert Spaces (Liang et al., 2020a), but it similarly requires changing the data distribution to vary model capacity. A precise analysis of a nonlinear system for a fixed data generating process is the most direct way to draw insight into double descent. A recent preprint (Mei & Montanari, 2019) shares this view and adopts a similar analysis to ours, but focuses entirely on the standard case of unstructured random features. Such a setup can indeed model double descent, and certainly bears relevance to certain wide neural networks in which only the top-layer weights are optimized (Neal, 1996; Rahimi & Recht, 2008; Lee et al., 2018; de G. Matthews et al., 2018; Lee et al., 2019), but its connection to neural networks trained with gradient descent remains less clear.
Gradient-based training of wide neural networks initialized in the standard way was recently shown to correspond to kernel gradient descent with respect to the Neural Tangent Kernel (Jacot et al., 2018). This result has spawned renewed interest in kernel methods and their connection to deep learning; a woefully incomplete list of papers in this direction includes Lee et al. (2019); Chizat et al. (2019); Du et al. (2019, 2018); Arora et al. (2019); Xiao et al. (2019).
To connect these research directions, our analysis requires tools and recent results from random matrix theory and free probability. A central challenge stems from the fact that many of the matrices in question have nonlinear dependencies between the elements, which arises from the nonlinear feature matrix . This challenge was overcome in (Pennington & Worah, 2017), which computed the spectrum of , and in (Pennington & Worah, 2018), which examined the spectrum of the Fisher information matrix; see also (Louart et al., 2018). We also utilize the results of (Adlam et al., 2019; Péché et al., 2019), which established a linear signal plus noise model for that shares the same bulk statistics. This linearized model allows us to write the test error as the trace of a rational function of the underlying random matrices. The methods we use to compute such quantities rely on so-called linear pencils that represent the rational function in terms of the inverse of a larger block matrix (Helton et al., 2018), and on operator-valued free probability for computing the trace of the latter (Far et al., 2006).
Preliminaries
In this section, we introduce our theoretical setting and some of the tools required to state our results.
Let denote the model’s predictive function. We consider squared error, so the test loss is,
where the expectation is over an iid test point conditional on the training set, the teacher parameters, and any randomness in the learning algorithm producing , such as the random parameters defining the random features. Note that the test loss is a random variable; however, in the high-dimensional asymptotics we consider here, it concentrates about its mean.
2 Neural Tangent Kernel Regression
We consider predictive functions defined by approximate (i.e. random feature) kernel ridge regression using the Neural Tangent Kernel (NTK) of a single-hidden-layer neural network. The NTK can be considered a kernel that is approximated by random features corresponding to the Jacobian of the network’s output with respect to its parameters, i.e. . As the width of the network becomes very large (compared to all other relevant scales in the system), the approximate NTK converges to a constant kernel determined by the network’s initial parameters and describes the trajectory of the network’s output under gradient descent. In particular,
where is the output of the network at time , , , is the learning rate, and is a ridge regularization constantThese overloaded definitions of can be distinguished by the number of arguments and should be clear from context.. For this work, we are interested in the limit of (3), which defines the predictive function,
We remark that if the width is not asymptotically larger than the dataset size, the validity of (3) can break down and (4) may not accurately describe the late-time predictions of the neural network. While this potential discrepancy is an interesting topic, we defer an in-depth analysis to future work (but see Fig. 4) for an empirical analysis of gradient descent). Instead, we regard (4) as the definition of our predictive function and focus on kernel regression with the NTK. We believe this setup is interesting its own right; for example, recent work has demonstrated its effectiveness as a kernel method on complex image datasets (Li et al., 2019) and found it to be competitive with neural networks in small data regimes.
In this work, we restrict our study to the NTK of single-hidden-layer fully-connected networks. In particular, consider a network of with width and pointwise activation function , defined by,
We collect our assumptions on the activation functions below, in Assumption 1. Their main purpose is to ensure that certain moments and derivatives exist almost surely, but for simplicity we state somewhat stronger conditions than are actually required for our analysis. To simplify the already cumbersome algebraic manipulations, we assume that has zero Gaussian mean. We emphasize that this condition is not essential and our techniques easily generalize to all commonly used activation functions.
The Jacobian of (5) with respect to the parameters naturally decomposes into the Jacobian with respect to and , i.e. . Therefore the kernel also decomposes this way, and we can write.
A simple calculation yields the per-layer constituent kernels,
where we have introduced the abbreviations and . Notice that when , , i.e. the NTK degenerates into the standard random features kernel. However, the predictive function (4) contains an offset which would typically be set to zero in standard random feature kernel regression because it simply increases the variance of test predictions. Removing this variance component has an analogous operation in neural network training: either the function value at initialization can be subtracted throughout training, or a symmetrization trick can be used in which two copies of the NN are initialized identically, and their normalized difference is trained with gradient descent. Either method preserves the kernel while enforcing . We call this setup centering, and present results with and without it.
Finally, we note that ridge regularization in the kernel perspective corresponds to using L2 regularization of the neural network’s weights toward their initial values.
Three Regimes of Parameterization
In this section, we outline an argument based on the structure of the NTK as to why one should expect the test error to exhibit non-trivial phenomena at two different scales of overparameterization. From the expressions for the test error (2) and the predictive function (4), it is evident that the behavior of the test error is determined by the spectral properties of the NTK. Although the fine details of the relationship can only be revealed by the explicit calculation, we can nevertheless make some basic high-level observations based on the coarser structure of the kernel.
The number of trainable parameters relative to the dataset size controls the amount of parameterization or complexity of a model. In our setting of a single-hidden-layer fully-connected neural network, , and for a fixed dataset, we can adjust the ratio by varying the hidden-layer width .
These two scales partition the degree of parameterization into three regimes. We consider the classical regime to be when because classical generalization theory tends to hold and the U-shaped test error curve is observed. The transition around manifests as a sharp rise in the test loss near the interpolation threshold, followed by a quick descent as increases further, as can be seen in Fig. 2(a). We call this the linear scaling transition. After this, we enter a regime we call abundant parameterization when . In this regime, the test error tends to decrease until nears the vicinity of , where it can sometimes increase again, producing a second U-shaped curve. When , another transition is observed, which we call the quadratic scaling transition, which can be seen in Fig. 2(b). On the other side of this transition, , a regime we call superabundant parameterization. See Fig 1 for an illustration of this general picture.
While the classical regime has been long studied, and the superabundant regime has generated considerable recent interest due to the NTK, our main aim in delineating the above regimes is to highlight the existence of the intermediate scale containing complex phenomenology. For this reason, we focus our theoretical analysis on the novel scaling regime in which . In particular, as mentioned in Sec. 1, we consider the high-dimensional asymptotics in which with and held constant.
Overview of Techniques
In this section, we provide a high-level overview of the analytical tools and mathematical results we use to compute the generalization error. To begin with, let us first describe the main technical challenges in computing explicit asymptotic limits of (2).
The first challenge, which is evident upon inspecting (8), is that the kernel contains a Hadamard product of random matrices, for which concrete results in the random matrix literature are few and far between. We address this problem in Sec. 4.1.
The second challenge, which is apparent by inspecting (9), is that the kernel depends on random matrices with nonlinear dependencies between the entries. We describe how to circumvent this difficulty in Sec. 4.2.
Finally, by expanding the square in (2) and substituting (4), we find terms that are constant, linear, and quadratic in . Some of the random matrices that appear inside the matrix inverses (e.g. , and ) also appear outside of them as multiplicative factors, a situation that prevents the straightforward application of many standard proof techniques in random matrix theory. We describe how to overcome this challenge in Sec. 4.3.
A straightforward central limiting argument shows that in the asymptotic limit the entries of are marginally Gaussian with mean zero and unit variance. As such, the first and second moments of the entries in the matrix are equal to
It follows that we can split into two terms,
where is a centered version of . Focusing on the first term, because , the random fluctuations in the off-diagonal elements are , which are too small to contribute to the spectrum or moments of an matrix whose diagonal entries are order one. In fact, the diagonal entries are simply proportional to the variance of the entries of , namely . Putting this together, we can eliminate the Hadamard product entirely and write,
where the notation means the two matrices share the same bulk statistics asymptotically. We make this argument precise in Sec. S1.
2 Linearization 1: Gaussian Equivalents
The test error (2) involves large random matrices with nonlinear dependencies, which are not immediately amenable to standard methods of analysis in random matrix theory. The main culprit is the random feature matrix , but , , and all suffer from the same issue.
The solution is to replace each of these matrices with an equivalent matrix without nonlinear dependencies, but chosen to maintain the same first- and second-order moments for all of the terms that appear in the test error (2). This approach was described for in (Adlam et al., 2019) (see also (Péché et al., 2019)). The upshot is that the test error is asymptotically invariant to the following substitutions,
The new objects , , , and are matrices of the appropriate shapes with iid standard Gaussian entries. The constants , and are chosen so that the mixed moments up to second order are the same for the original and linearized versions. In particular,
The statement that the test error only depends on is consistent with the observations made in (Ghorbani et al., 2019; Mei & Montanari, 2019) that in the high-dimensional regime where , only linear functions of the data can be learned. Indeed, is equivalent to a linear teacher plus noise with signal-to-noise ratio given by,
We often make this equivalence to a linear teacher explicit by setting , which implies . Doing so also removes the noise from the test label, but since this noise merely contributes an additive shift to the test loss, removing it does not change any of our conclusions.
3 Linearization 2: Linear Pencil
Next we turn our attention to the actual computation of the asymptotic test loss. Expanding the test error (2) we haveFor simplicity, we discuss the centered setting with , which captures all of the technical complexities.,
which, when applied to (21) together with the substitutions (13)-(16), expresses the test error directly in terms of the iid Gaussian random matrices and . The expectations over and are trivial because these variables do not appear inside the matrix inverse . Moreover, asymptotically the traces concentrate around their means with respect to and , which we can also compute easily for the same reason. Therefore, the test error can be written as,
Eqn. (24) is a rational function of the noncommutative random variables and . A useful result from noncommutative algebra guarantees that such a rational function can be linearized in the sense that it can be expressed in terms of the inverse of a matrix whose entries are linear in the noncommutative variables. This representation is often called a linear pencil, and is not unique; see e.g. (Helton et al., 2018) for details.
To illustrate this concept, consider the simple case of . After applying the substitutions (13)-(16) to (22), a linear pencil is given by
which can be checked by an explicit computation of the block matrix inverse. After obtaining a linear pencil for each of the terms in (24), the only task that remains is computing the trace. Since each linear pencil is a block matrix whose blocks are iid Gaussian random matrices, its trace can be evaluated using the techniques described in (Far et al., 2006) or through the general formalism of operator-valued free probability. We refer the reader to the book (Mingo & Speicher, 2017) for more details on these topics.
Asymptotic Training and Test Error
The calculations described in the previous section are presented in the Supplementary Materials. Here we present the main results.
The subtraction of in eqn. (27) is because we have assumed that there is no label noise on the test points. Had we included the same label noise on both the training and test distributions, that term would be absent.
When , the quantity on the right hand side of eqn. (27) is precisely the generalized cross-validation (GCV) metric of (Golub et al., 1979). Theorem 1 shows that the GCV gives the exact asymptotic test error for the problem studied here.
Test Error in Limiting Cases
While the explicit formulas in preceding section provide an exact characterization of the asymptotic training and test loss, they do not readily admit clear interpretations. On the other hand, eqn. (LABEL:eq:prop1) and therefore the expressions for simplify considerably under several natural limits, which we examine in this section.
Here we examine the test error in the superabundant regime in which the width is larger than any constant times the dataset size , which can be obtained by letting and . In this setting we find,
where with centering and without it and , , and
The learning curve is remarkably steep with centering. To see this, we expand the result as , i.e. as ,
Interestingly, we see that when the network is super abundantly parameterized, we obtain very fast learning curves: for finite SNR, , and in the noiseless case . See Fig 3(b).
2 Small Width Limit
Here we consider the limit in which the width is smaller than any constant times the dataset size or the number of features , which can be obtained by letting with held constant. In this setting we find,
where , and
The small width limit characterizes one boundary of the abundant parameterization regime and as such provides an upper bound on the test loss in that regime. Therefore, a sufficient condition for the global minimum to occur at intermediate widths is . By comparing eqn. (28) to eqn. (31), precise though unenlightening constraints on the parameters can be derived for satisfying this condition. One such configuration is illustrated in Fig. 4(b).
3 Large Dataset Limit
Here we consider the limit in which the dataset is larger than any constant times the width , which can be obtained by letting with . In this setting we find,
where with centering and with without it and,
Here again we observe very steep learning curves, similar to the large width limit above.
4 Ridgeless Limit: First-Layer Kernel
Here we examine the ridgeless limit of the first-layer kernel . We find that the result can be obtained through a degeneration of (28),
where, and we have specialized to the centered case . The expansion as also looks similar to (30) and can be obtained from that equation by substituting .
5 Ridgeless Limit: Second-Layer Kernel
Here we examine the ridgeless limit when the kernel is due to the second-layer weights only, i.e. . This limit can be obtained by letting . In this setting, the result can be expressed as,
where , , and
and we have again specialized to the centered case . This expression is in agreement with the result presented in (Mei & Montanari, 2019).
When the system is far in the regime of abundant parameterization, namely (or ), we can examine the large dataset behavior by first sending and then expanding as . The result is described by (30) by substituting .
Quadratic Overparameterization
In this section, we investigate the implications of our theoretical results about the generalization performance of NTK regression in the quadratic scaling limit with and held constant. Our high-level observation is that there is complex non-monotonic behavior in this regime as these ratios are varied, and that this behavior can depend on the signal-to-noise ratio and the initial parameter variance in intricate ways. We highlight a few examples in Fig. 3.
In Fig. 3(a), we plot the test error as a function of and , which reveals the behavior of jointly varying the number of features and the number of hidden units . As expected from Fig. 2(b), for fixed the test error has a hump near . Perhaps unexpectedly, for large , the test loss exhibits non-monotonic dependence on , with a spike near . Notice that for small , this non-monotonicity disappears. It is clear that the test error depends in a complex way on both variables, underscoring the richness of the quadratically-overparameterized regime.
Fig. 3(b) shows learning curves for fixed and various values of the SNR. For small enough SNR, there are visible bumps in the vicinity of and that reveal the existence of regimes in which more training data actually hurts test performance. Note that so these two humps are separated by a constant factor, so the presence of two humps in this figure is not evidence of multi-scale behavior, though it surely reflects the complex behavior at the quadratic scale.
It is natural to wonder about the origins of this complex behavior. Can it be attributed to a particular component of the kernel ? We investigate this question in Fig. 3(c), which shows how the test error changes as the relative contributions of the per-layer kernels and are varied. By decreasing , the contribution of decreases and the kernel becomes more like , and the small hump at the quadratic transition increases in size until it resembles the large spike at the linear transition (c.f. Fig. 2), suggesting that is in fact responsible for the non-monotonicity in the quadratically-overparameterized regime.
Empirical Validation
Our theoretical results establish the existence of nontrivial behavior of the test loss at for the second-layer kernel and at for the full kernel . While these results are strongly suggestive of multi-scale behavior, they do not prove this behavior exists for a single kernel, nor do they guarantee it will be revealed for finite-size systems, let alone for models trained with gradient descent. Here we provide positive empirical evidence on all counts.
Fig. 4 demonstrates multi-scale phenomena, triple descent, and the linear and quadratic scaling transitions for random feature NTK regression and gradient descent for finite-dimensional systems. The simulations all show a peak near the linear parameterization transition, as well as a bump near the quadratic transition. The asymptotic theoretical predictions agree well with kernel regression in their regime of validity, which is when is near . While we found that the global minimum of the test error is often at , there are some configurations for which the optimal lies between and , as illustrated in Fig. 4(b).
Fig. 4(a) clearly shows triple descent for NTK regression and a marked difference in loss with and without centering, suggesting that this source of variance may often dominate the error for large .
Fig. 4(c) confirms the existence of triple descent for a single-layer neural network trained with gradient descent. The noticeable difference between kernel regression and the actual neural network is to be expected because the NTK can change during the course of training when the width is not significantly larger than the dataset size. Indeed, the deviation diminishes for large . In any case, the qualitative behavior is similar across all scales, providing support for the validity of our framework beyond pure kernel methods.
Conclusion
In this work, we provided a precise description of the high-dimensional asymptotic generalization performance of kernel regression with the Neural Tangent Kernel of a single-hidden-layer neural network. Our results revealed that the test error has complex non-monotonic behavior deep in the overparameterized regime, indicating that double descent does not always provide an accurate or complete picture of generalization performance. Instead, we argued that the test error may exhibit additional peaks and descents as the number of parameters varies across multiple scales, and we provided empirical evidence of this behavior for kernel ridge regression and for neural networks trained with gradient descent. We conjecture that similar multi-scale phenomena may exist for broader classes of architectures and datasets, but we leave that investigation for future work.
References
S1 Simplification of the first-layer kernel
In this section, we get explicit control in spectral norm of the difference between the empirical (i.e. finite-size) NTK and the version in eqn. (22) that arises through the simplification of the first-layer kernel in eqn. (12). We will use the notation , where is defined similarly. Recall from eqns. (8) and (9) that the empirical NTK is given by
and from eqn. (22) the simplified kernel is given by
where . Elementary arguments given in Sec. S1.2 show that, in operator norm, the two rightmost terms in eqn. (S6) are bounded by . In Sec. S1.1, we bound by using the fact that, conditional on , is a sum of independent random matrices to apply the matrix Bernstein inequality (Tropp, 2015).
We start with a supremum bound on . For any vector , we have
by the Cauchy-Schwarz inequality. Note that by assumption on , eqn. (S7) is .
which we note is the same for all . We now calculate these 2- and 4-point expectations to leading order.
Since the entries of are multivariate Gaussian conditional on , we find
Taylor expanding in the covariance term, one can show that, for all ,
for some . We find and
using the Cauchy-Schwarz inequality and that assumption that all dimensions are on the same order.
Thus finally applying the matrix Bernstein inequality with for some sufficiently large constant , we find for any
for sufficiently large . Moreover, eqn. (S25) holds with random as it is independent of and , and our assumptions on hold for any for sufficiently large .
S1.2 Bounding remaining terms
where ’s diagonal entries are and off-diagonal entries are . Taking the terms one by one, we first bound
Eqn. (S28) can be demonstrated by taking the 4th power of the trace as in (El Karoui et al., 2010). This is expected, since the entries are mean zero and have variance order . Proving the spectral bound is a straightforward calculation using the independence of the entries of , but we avoid details here. The final term can also be bounded in this way, yielding,
The inclusion of the matrix is necessary, due to the nonzero mean of the entries. See (El Karoui et al., 2010) for an example of this calculation.
Similarly using the assumptions on , we can bound the remaining diagonal matrix of eqn. (S6) as follows
Summing our bounds on and eqns. (S27)-(S30) completes the proof of eqn. (S4).
S2 Gaussian equivalents
In this section we discuss the key arguments for existence of Gaussian equivalents and the linearizations of Sec. 4.2. As all the main elements of this argument have been established elsewhere, here we just provide the main intuitions and refer to prior work for the details.
Many of the statistics of random matrices are universal, that is, their limiting behavior as the matrix gets larger is insensitive to the detailed properties of their entries’ distributions. Considerable work has gone into demonstrating universality for an increasingly large class of random matrices and a growing number of detailed statistics. In our case, the test loss is a global measurement of several random matrices. This perspective gives some intuition for why we are able to replace many of the intractable terms in the expressions we analyze with tractable terms, which only need to match quite superficial properties of the distributions to ensure the limiting test loss is the same.
In Secs. S3 and S4, we use this replacement strategy in two distinct situations. The first is for terms of the form
for deterministic and random . Under assumptions on and , standard concentration inequalities can be used to describe the limiting behavior of sums like eqn. (S31). In our setting, one finds that this behavior only depends on the the low-order moments of . By matching these low-order moments with Gaussian random variables, we can replace with a Gaussian random matrix with the same limiting behavior. Note, often is not actually deterministic, we are simply conditioning on it and only considering the randomness in . The approach is suitable for determining the average behavior of eqn. (S31) when we have control over the (weak) correlations in the entries of and . Linearizing the matrices and in this setting is just a convenient bookkeeping device for performing these computations.
When one of the matrices in eqn. (S31) is inverted, the situation is more complex, and indeed this is the case for the kernel matrix in expressions for the training and test loss. To apply the linear pencil algorithm, we have to replace the NTK in all expressions with a linearized version (see eqn. (22)), which is a rational expression of the i.i.d. Gaussian matrices, , , etc. In Sec. S1, we bounded the difference between the first-layer kernel and its linearization, thus removing the Hadamard product structure. It remains to linearize the second-layer kernel, i.e. linearize . This has been discussed in previous works, see (Mei & Montanari, 2019; Adlam et al., 2019; Péché et al., 2019; Benigni & Péché, 2019).
It should be expected that a linearized version of will lead to the same asymptotic statistics due to some very general results on the limiting behavior of expressions of the form,
Finding Gaussian equivalents for and in expressions like eqns. (S31) and (S32) is relatively simple in our case. We encounter terms for which the matrix depends on some other random matrix through a coordinate-wise nonlinear function . For such cases, Taylor expanding the function is the key tool to finding these equivalents (see e.g. (Adlam et al., 2019) for more details on this type of approach).
S3 Exact asymptotics for the training loss
The model’s predictions on the training set, , take a simple form,
The expected training loss can be written as,
where with centering and without it and,
Note we can suppress the terms linear in since they vanish in expectation owing to the linear dependence on the mean-zero random variable . Here is the linearized NTK and is given by,
This substitution can be justified using the result of Sec. S1:
Note that taking the expectation over in eqn. (S39) and eqn. (S40) yields
which can be used to calculate the expectation over and to leading order (i.e. with remainder terms ) using the approach of eqn. (S31). Concretely,
Putting these pieces together, we can write for and ,
Self-consistent equations for and can be computed using the resolvent method, as was done in (Adlam et al., 2019) for the case of . In order to pave the way for the analysis of the test error, we instead demonstrate how to compute these traces using operator-valued free probability.
In the remainder of this section, and in Sec. S4, we assume at times that is non-linear (so that and ) and/or in order that certain denominator factors are non-zero. The linear and/or ridgeless cases can be obtained by limits of our general results, or through special cases of the pertinent intermediate formulas.
S3.2 Linear pencils
To begin, we construct linear pencils for and . Using the linearization eqn. (13), a straightforward block-matrix inversion confirms that
The matrix is not self-adjoint, but a self-adjoint representation can be obtained from it by doubling the dimensionality. In particular, letting
Observe that is a self-adjoint matrix whose blocks are either constants or proportional to one of ; let us denote the constant terms as . As such, we can directly utilize the results of (Far et al., 2006; Mingo & Speicher, 2017) to compute the necessary traces.
S3.3 Operator-valued Stieltjes transform
where is dimensionality of the th block and denotes the covariance between the entries of the blocks block of and entries of the block of . Eqn. (S53) may admit many solutions, but there is a unique solution such that for .
The constants , the entries of , and therefore the equations (S54) are manifest by inspection of the block matrix representation for . Although the matrix representation of the equations is too large to reproduce here, we can nevertheless extract the equations satisfied by each entry of .
The equations satisfied by the operator-valued Stieltjes transform of induce the following structure on ,
and the independent entry-wise component functions , and satisfy the following system of polynomial equations,
It is straightforward algebra to eliminate and from the above equations. A simple set of equations for and follows,
It will prove useful to obtain expressions for and . By differentiating eqns. (S67) and (S68) with respect to , we find
where we have introduced some auxiliary variables to ease the presentation,
S4 Exact asymptotics for the test loss
As described in Sec. 4.3, the test loss can be written as,
As in Sec. S3, we suppress the terms linear in as they vanish in expectation. The Neural Tangent Kernels and are given by,
where the substitution for the linearized NTK is justified as in Sec. S3 using the spectral norm bound of Sec. S1.
Using the cyclicity and linearity of the trace, the expectation over requires the computation of
As described in Sec. 4.2, without loss of generality we can consider the case of a linear teacher, so that and (16) and (15) become
Using these substitutions, the expectations over are now trivial and we readily find,
One may interpret the substitutions in eqn. (S78) as a tool to calculate the expectations above to leading order as it leads to terms like eqn. (S31). Next we recall the substitution (S44),
As above, we consider the leading order behavior with respect to the random variables , , and using eqn. (S31) to find
where with centering and without it,
S4.2 Linear pencils
Repeated application of the Schur complement formula for block matrix inversion establishes the following representations for
A linear pencil for follows from the representation,
A linear pencil for follows from the representation,
A linear pencil for follows from the representation,
and, for ,
A linear pencil for follows from the representation,
and, for
A linear pencil for follows from the representation,
and, for ,
S4.3 Operator-valued Stieltjes transform
Even though the individual error terms can be written as the trace of self-adjoint matrices, the individual matrices are not themselves self-adjoint. However, by enlarging the dimensionality by a factor of two, equivalent self-adjoint representations can easily be constructed. To do so, we simply utilize the identity,
Observe that and are all self-adjoint block matrices whose blocks are either constants or proportional to one of ; let us denote the constant terms as . As such, we can directly utilize the results of (Far et al., 2006; Mingo & Speicher, 2017) to compute the error terms in question.
where is dimensionality of the th block and denotes the covariance between the entries of the block of and entries of the block of . Eqn. (S127) may admit many solutions, but there is a unique solution such that for .
The constants , the entries of , and therefore the equations (S128) are manifest by inspection of the block matrix representations for . Although the matrix representations are too large to reproduce here, we can nevertheless extract the equations satisfied by each entry of , which we present in the subsequent sections.
The equations satisfied by the operator-valued Stieltjes transform of induce the following structure on ,
and the independent entry-wise component functions combine to produce the error through the relation,
and themselves satisfy the following system of polynomial equations,
After some straightforward algebra, one can eliminate all except for and , which satisfy coupled polynomial equations. Those equations can be shown to be identical to eqn. (S48) by invoking the change of variables,
In terms of these variables, the error is given by,
The equations satisfied by the operator-valued Stieltjes transform of induce the following structure on ,
and the independent entry-wise component functions combine to produce the error through the relation,
and themselves satisfy the following system of polynomial equations,
After some straightforward algebra, one can eliminate all except for and , which satisfy coupled polynomial equations. Those equations can be shown to be identical to eqn. (S48) by invoking the change of variables,
The equations satisfied by the operator-valued Stieltjes transform of induce the following structure on ,
and the independent entry-wise component functions give the error through the relation,
and themselves satisfy the following system of polynomial equations,
After some straightforward algebra, one can eliminate all except for and , which satisfy coupled polynomial equations. Those equations can be shown to be identical to eqn. (S48) by invoking the change of variables,
The error can then be written in terms of and its derivative (S69),
The equations satisfied by the operator-valued Stieltjes transform of induce the following structure on ,
and the independent entry-wise component functions give the error through the relation,
and themselves satisfy the following system of polynomial equations,
After some straightforward algebra, one can eliminate all except for and , which satisfy coupled polynomial equations. Those equations can be shown to be identical to eqn. (S48) by invoking the change of variables,
In terms of , , and (S70), the error is given by,
The equations satisfied by the operator-valued Stieltjes transform of induce the following structure on ,
and the independent entry-wise component functions give the error through the relation,
and themselves satisfy the following system of polynomial equations,
After some straightforward algebra, one can eliminate all except for and , which satisfy coupled polynomial equations. Those equations can be shown to be identical to eqn. (S48) by invoking the change of variables,
In terms of , , and their derivatives (S69), (S70), the error is given by,
S4.4 Total test error
Recall from eqns. (S72, S91-S93) that the total test error can be written as
where with centering and without it. Combining the results from the previous subsections, we find
thereby establishing the result of the main theorem (27).