The Onset of Variance-Limited Behavior for Networks in the Lazy and Rich Regimes
Alexander Atanasov, Blake Bordelon, Sabarish Sainathan, Cengiz Pehlevan
Introduction
Deep learning systems are achieving state of the art performance on a variety of tasks (Tan & Le, 2019; Hoffmann et al., 2022). Exactly how their generalization is controlled by network architecture, training procedure, and task structure is still not fully understood. One promising direction for deep learning theory in recent years is the infinite-width limit. Under a certain parameterization, infinite-width networks yield a kernel method known as the neural tangent kernel (NTK) (Jacot et al., 2018; Lee et al., 2019). Kernel methods are easier to analyze, allowing for accurate prediction of the generalization performance of wide networks in this regime (Bordelon et al., 2020; Canatar et al., 2021; Bahri et al., 2021; Simon et al., 2021). Infinite-width networks can also operate in the mean-field regime if network outputs are rescaled by a small parameter that enhances feature learning (Mei et al., 2018; Chizat et al., 2019; Geiger et al., 2020b; Yang & Hu, 2020; Bordelon & Pehlevan, 2022).
While infinite-width networks provide useful limiting cases for deep learning theory, real networks have finite width. Analysis at finite width is more difficult, since predictions are dependent on the initialization of parameters. While several works have attempted to analyze feature evolution and kernel statistics at large but finite width (Dyer & Gur-Ari, 2020; Roberts et al., 2021), the implications of finite width on generalization are not entirely clear. Specifically, it is unknown at what value of the training set size the effects of finite width become relevant, what impact this critical has on the learning curve, and how it is affected by feature learning.
To identify the effects of finite width and feature learning on the deviation from infinite width learning curves, we empirically study neural networks trained across a wide range of output scales , widths , and training set sizes on the simple task of polynomial regression with a ReLU neural network. Concretely, our experiments show the following:
Learning curves for polynomial regression transition exhibit significant finite-width effects very early, around . Finite-width NNs at large are always outperformed by their infinite-width counterparts. We show this gap is driven primarily by variance of the predictor over initializations (Geiger et al., 2020a). Following prior work (Bahri et al., 2021), we refer to this as the variance-limited regime. We compare three distinct ensembling methods to reduce error in this regime.
Feature-learning NNs show improved generalization both before and after the transition to the variance limited regime. Feature learning can be enhanced through re-scaling the output of the network by a small scalar or by training on a more complex task (a higher-degree polynomial). We show that alignment between the final NTK and the target function on test data improves with feature learning and sample size.
We demonstrate that the learning curve for the NN is well-captured by the learning curve for kernel regression with the final empirical NTK, eNTKf , as has been observed in other works (Vyas et al., 2022; Geiger et al., 2020b; Atanasov et al., 2021; Wei et al., 2022).
Using this correspondence between the NN and the final NTK, we provide a cursory account of how fluctuations in the final NTK over random initializations are suppressed at large width and large feature learning strength. In a toy model, we reproduce several scaling phenomena, including the transition and the improvements due to feature learning through an alignment effect.
We validate that these effects qualitatively persist in the realistic setting of wide ResNets Zagoruyko & Komodakis (2017) trained on CIFAR in appendix E.
Overall, our results indicate that the onset of finite-width corrections to generalization in neural networks become relevant when the scale of the variance of kernel fluctuations becomes comparable to the bias component of the generalization error in the bias-variance decomposition. The variance contribution to generalization error can be reduced both through ensemble averaging and through feature learning, which we show promotes higher alignment between the final kernel and the task. We construct a model of noisy random features which reproduces the essential aspects of our observations.
Geiger et al. (2020a) analyzed the scaling of network generalization with the number of model parameters. Since the NTK fluctuates with variance for a width network (Dyer & Gur-Ari, 2020; Roberts et al., 2021), they find that finite width networks in the lazy regime generically perform worse than their infinite width counterparts.
The scaling laws of networks over varying and were also studied, both empirically and theoretically by Bahri et al. (2021). They consider two types of learning curve scalings. First, they describe resolution-limited scaling, where either training set size or width are effectively infinite and the scaling behavior of generalization error with the other quantity is studied. There, the scaling laws can been obtained by the theory in Bordelon et al. (2020). Second, they analyze variance-limited scaling where width or training set size are fixed to a finite value and the other parameter is taken to infinity. While that work showed for any fixed that the learning curve converges to the infinite width curve as , these asymptotics do not predict, for fixed , at which value of the NN learning curve begins to deviate from the infinite width theory. This is the focus of our work.
The contrast between rich and lazy networks has been empirically studied in several prior works. Depending on the structure of the task, the lazy regime can have either worse (Fort et al., 2020) or better (Ortiz-Jiménez et al., 2021; Geiger et al., 2020b) performance than the feature learning regime. For our setting, where the signal depends on only a small number of relevant input directions, we expect representation learning to be useful, as discussed in (Ghorbani et al., 2020; Paccolat et al., 2021b). Consequently, we posit and verify that the rich network will outperform the lazy one.
Our toy model is inspired by the literature on random feature models. Analysis of generalization for two layer networks at initialization in the limit of high dimensional data have been carried out using techniques from random matrix theory (Mei & Montanari, 2022; Hu & Lu, 2020; Adlam & Pennington, 2020a; Dhifallah & Lu, 2020; Adlam & Pennington, 2020b) and statistical mechanics (Gerace et al., 2020; d’Ascoli et al., 2020; 2020). Several of these works have identified that when is comparable to , the network generalization error has a contribution from variance over initial parameters. Further, they provide a theoretical explanation of the benefit of ensembling predictions of many networks trained with different initial parameters. Recently, Ba et al. (2022) studied regression with the hidden features of a two layer network after taking one step of gradient descent, finding significant improvements to the learning curve due to feature learning. Zavatone-Veth et al. (2022) analyzed linear regression for Bayesian deep linear networks with width comparable to sample size and demonstrated the advantage of training multiple layers compared to only training the only last layer, finding that feature learning advantage has leading correction of scale at small .
Problem Setup and Notation
Empirical Results
In this section, we will study learning curves for ReLU NNs trained on polynomial regression tasks of varying degrees. We take our task to be learning where is random vector of norm and is the th gegenbauer polynomial. We will establish the following key observations, which we will set out to theoretically explain in Section 4.
Both eNTK0 and sufficiently lazy networks perform strictly worse than NTK∞ , but the ensembled predictors approach the NTK∞ test error.
NNs in the feature learning regime of small can outperform NTK∞ for an intermediate range of . Over this range, the effect of ensembling is less notable.
Even richly trained finite width NNs eventually perform worse than NTK∞ at sufficiently large . However, these small feature-learning networks become variance-limited at larger than lazy networks. Once in the variance-limited regime, all networks benefit from ensembling over initializations.
For all networks, the transition to the variance-limited regime begins at a that scales sub-linearly with . For polynomial regression, we find .
These findings support our hypothesis that finite width introduces variance in eNTK0 over initializations, which ultimately leads to variance in the learned predictor and higher generalization error. Although we primarily focus on polynomial interpolation tasks in this paper, in Appendix F we provide results for wide ResNets trained on CIFAR and observe that rich networks also outperform lazy ones, and that lazy ones benefit more significantly from ensembling.
In this section, we first investigate how finite width NN learning curves differ from infinite width NTK regression. In Figure 1 we show the generalization error for a depth 3 network with width trained on a quadratic and quartic polynomial regression task. Additional plots for other degree polynomials are provided in Appendix F. We sweep over to show the effect of more data on generalization, which is the main relationship we are interested in studying. For each training set size we sweep over a grid of 20 random draws of the train set and 20 random network initializations. This for 400 trained networks in total at each choice of . We see that a discrepancy arises at large enough where the neural networks begin to perform worse than NTK∞ .
We probe the source of the discrepancy between finite width NNs and NTK∞ by ensemble averaging network predictions over initializations . In Figures 1b and 1d, we calculate the error of , each trained on the same dataset. We then plot . This ensembled error approximates the bias in a bias-variance decomposition (Appendix B). Thus, any gap between 1 (a) and 1 (b) is driven by variance of over .
In addition to initialization variance, variance over dataset contributes to the total generalization error. Following (Adlam & Pennington, 2020b), we discuss a symmetric decomposition of the variance in Appendix B, showing the contribution from dataset variance and the effects of bagging. We find that most of the variance in our experiments is due to initialization.
We show several other plots of the results of these studies in the appendix. We show the effect of bagging (Figure 7), phase plots of different degree target functions (Figures 10, 9), phase plots over (Figure 11) and a comparison of network predictions against the initial and final kernel regressors (Figures 18, 19).
2 Final NTK Variance leads to Generalization Plateau
In this section, we show how the variance over initialization can be interpreted as kernel variance in both the rich and lazy regimes. We also show how this implies a plateau for the generalization error.
To begin, we demonstrate empirically that all networks have the same generalization error as kernel regression solutions with their final eNTKs. At large , the initial and the final kernel are already close, so this follows from earlier results of Chizat et al. (2019). In the rich regime, the properties of the eNTKf have been studied in several prior works. Several have empirically demonstrated that the eNTKf is a good match to the final network predictor for a trained network (Long, 2021; Vyas et al., 2022; Wei et al., 2022) while others have given conditions under which such an effect would hold true (Atanasov et al., 2021; Bordelon & Pehlevan, 2022). We comment on this in appendix C.4. We show in Figure 3 how the final network generalization error matches the generalization error of eNTKf . As a consequence, we can use eNTKf to study the observed generalization behavior.
Next, we relate the variance of the final predictor to the corresponding infinite width network . The finite size fluctuations of the kernel at initialization have been studied in (Dyer & Gur-Ari, 2020; Hanin & Nica, 2019; Roberts et al., 2021). The variance of the kernel elements has been shown to scale as . We perform the following bias-variance decomposition: Take to be the eNTK0 predictor, or a sufficiently lazy network trained to interpolation on a dataset . Then,
We demonstrate this equality using a relationship between the infinite-width network and an infinite ensemble of finite-width networks derived in Appendix B. There we also show that the term is strictly positive for sufficiently large . Thus, for lazy networks of sufficiently large , finite width effects lead to strictly worse generalization error. The decomposition in Equation 2 continues to hold for rich networks at small if is interpreted as the infinite-width mean field limit. In this case one can show that ensembles of rich networks are approximating an infinite width limit in the mean-field regime. See Appendix B for details.
3 Feature Learning delays variance limited transition
We now consider how feature learning alters the onset of the variance limited regime, and how this onset scales with . We define the onset of the variance limited regime to take place at the value where over half of the generalization error is due to variance over initializations. Equivalently we have . By using an interpolation method together with bisection, we solve for and plot it in Figure 4.
We can understand the delay of the variance limited transition, as well as the lower value of the final plateau using a mechanistic picture similar to the effect observed in Atanasov et al. (2021). In that setting, under small initialization, the kernel follows a deterministic trajectory, picking up a low rank component in the direction of the train set targets , and then changing only in scale as the network weights grow to interpolate the dataset. In their case, for initial output scale , eNTKf is deterministic up to a variance of . In our case, the kernel variance at initialization scales as . As the kernel’s trajectory becomes deterministic up to a variance term scaling with as , which implies that the final predictor also has a variance scaling as .
Signal plus noise correlated feature model
In Section 3.2 we have shown that in both the rich and lazy regimes, the generalization error of the NN is well approximated by the generalization of a kernel regression solution with eNTKf . This finding motivates an analysis of the generalization of kernel machines which depend on network initialization . Unlike many analyses of random feature models which specialize to two layer networks and focus on high dimensional Gaussian random data (Mei & Montanari, 2022; Adlam & Pennington, 2020a; Gerace et al., 2020; Ba et al., 2022), we propose to analyze regression with the eNTKf for more general feature structures. This work builds on the kernel generalization theory for kernels developed with statistical mechanics (Bordelon et al., 2020; Canatar et al., 2021; Simon et al., 2021; Loureiro et al., 2021). We will attempt to derive approximate learning curves in terms of the eNTKf ’s signal and noise components, which provide some phenomenological explanations of the onset of the variance limited regime and the benefits of feature learning. Starting with the final NTK which depends on the random initial parameters , we project its square root (as defined in equation 32) on a fixed basis orthonormal with respect to . This defines a feature map
To gain insight into the role of feature noise, we characterize the test error associated with a Gaussian covariate model in a high dimensional limit with .
This model was also studied by Loureiro et al. (2021) and subsumes the classic two layer random feature models of prior works (Hu & Lu, 2020; Adlam & Pennington, 2020a; Mei & Montanari, 2022). The expected generalization error for any distribution of has the form
where and . Details of the calculation can be found in Appendix D. We also provide experiments showing the predictive accuracy of the theory in Figure 6. In general, we do not know the induced distribution of over disorder . In Appendix D.5, we compute explicit learning curves for a simple toy model where entries as i.i.d. Gaussian over the random initialization . A similar random feature model was recently analyzed with diagrammatic techniques by Maloney et al. (2022). In the high dimensional limit with , our replica calculation demonstrates that test error is self-averaging (the same for every random instance of ) which we describe in Appendix D.5 and Figure 16.
2 Explaining Feature Learning Benefits and Error Plateaus
Using our model, we can also approximate the role of feature learning as enhancement in the signal correlation along task-relevant eigenfunctions. In Figure 6 (d) we plot the learning curves for networks trained with different levels of feature learning, controlled by . We see that feature learning leads to improvements in the learning curve both before and after onset of variance limits. In Figure 6 (e)-(f), we plot the theoretical generalization for kernels with enhanced signal eigenvalue for the task eigenfunction . This enhancement, based on the intuition of kernel alignment, leads to lower bias and lower asymptotic variance. However, this model does not capture the fact that feature learning advantages are small at small and that the slopes of the learning curves are different at different . Following the observation of Paccolat et al. (2021a) that kernel alignment can occur with scale , we plot the learning curves for signal enhancements that scale as . Though this toy model reproduces the onset of the variance limited regime and the reduction in variance due to feature learning, our current result is not the complete story. A more refined future theory could use the structure of neural architecture to constrain the structure of the distribution.
Conclusion
We performed an extensive empirical study for deep ReLU NNs learning a fairly simple polynomial regression problems. For sufficiently large dataset size , all neural networks under-perform the infinite width limit, and we demonstrated that this worse performance is driven by initialization variance. We show that the onset of the variance limited regime can occur early in the learning curve with , but this can be delayed by enhancing feature learning. Finally, we studied a simple random-feature model to attempt to explain these effects and qualitatively reproduce the observed behavior, as well as quantitatively reproducing the relevant scaling relationship for . This work takes a step towards understanding scaling laws in regimes where finite-size networks undergo feature learning. This has implications for how the choice of initialization scale, neural architecture, and number networks in an ensemble can be tuned to achieve optimal performance under a fixed compute and data budget.
References
Appendix A Details on Experiments
We used JAX (Bradbury et al., 2018) for all neural network training. We built multi-layer perceptrons (MLPs) of depth 2 and 3. Most of the results are reported for depth 3 perceptrons, where there is a separation between the width of the network and the number of parameters . Sweeping over more depths and architectures is possible, but because of the extensive dimensionality of the hyperparameter search space, we have not yet experimented with deeper networks.
We considered MLPs with no bias terms. Since the Gegenbauer polynomials are mean zero, we do not need biases to fit the training set and generalize well. We have also verified that adding trainable biases does not change the final results in any substantial way.
As mentioned in the main text, we consider the final output function to be the initial network output minus the output at initialization:
Here, only is differentiated through, while is held fixed. The rationale for this choice is that without this subtraction, in the lazy limit the trained neural network output can be written as
We trained this network with full batch gradient descent with a learning rate so that
Each network was trained to an interpolation threshold of . If a network could not reach this threshold in under 30k steps, we checked if the training error was less than times the generalization error. If this was not satisfied, then that run of the network was discarded.
For each fixed , we generated 20 independent datasets. For each fixed we generated 20 independent neural network initializations. This table yields a total of 400 neural networks trained on every combination of initialization and dataset choice.
The infinite width network predictions were calculated using the Neural Tangents package (Novak et al., 2020). The finite width eNTK0 s were also calculated using the empirical methods in Neural Tangents. They were trained to interpolation using the gradient_descent_mse method. This is substantially faster than training the linearized model using standard full-batch gradient descent, which we have found to take a very long time for most networks. We use the same strategy for the eNTKf s.
For the experiments in the main text, we have taken the input dimension to be and sweep over . We swept over 15 values in logspace from size to size 10k, and over 6 values of in logspace from size to size . We then swept over alpha values . Depending on , we tuned the learning rate of the network small enough to stay close to the gradient flow limit, but allow for the interpolation threshold to be feasibly reached.
For each of the 1800 settings of and each of the 400 networks, 400 eNTK0 s, 400 eNTKf s, and 20 NTK∞ s, the generalization error was saved, as well as a vector of predictions on a test set of 2000 points. In addition, for the neural networks we saved both initial and final parameters. All are saved as lists of numpy arrays in a directory of about 1TB. We plan to make the results of our experiments publicly accessible, alongside the code to generate them.
We apply the same methodology of centering the network and allowing to control the degree of laziness by redefining
We consider the task of binary classification for CIFAR-10. In order to allow to become large we divide the data into two classes: animate and inanimate objects. We choose to subsample eight classes and superclass them into two: (cat, deer, dog, horse) vs (airplane, automobile, ship, truck). Each superclass consists of 20,000 training examples and 4,000 test examples retrieved from the CIFAR-10 dataset.
On subsets of this dataset, we train wide residual networks (ResNets) Zagoruyko & Komodakis (2017) of width and block size with the NTK parameterization Jacot et al. (2018) on this task using mini-batch gradient descent with batch size of 256 and MSE loss. Step sizes are governed by the Adam optimizer Kingma & Ba (2014) with initial learning rate Every network is trained for 24,000 steps, such that under nearly all settings of and dataset size the network has attained infinitesimal train loss.
We sweep from to and from to . For each value of , we randomly sample five training datasets of size and compute ensembles of size 20. For each network in an ensemble the initialization and the order of the training data is randomly chosen independently of those for the other networks.
Appendix B Fine-grained bias-variance decomposition
Let be a dataset of viewed as a random variable. Let represent the initial parameters of a neural network, viewed as a random variable. In the case of no label noise, as in section 2.2.1 of Adlam & Pennington (2020b), we derive the symmetric decomposition of the generalization error in terms of the variance due to initialization and the variance due to the dataset. We have
and give the components of the variance explained by variance in respectively. is the remaining part of the variance not explained by either of these two sources. As in the main text, is the ensemble average of the trained predictors over initializations. is commonly referred to as the bagged predictor. In the next subsection we study these terms empirically.
B.2 Empirical Study of Dataset Variance
Using the network simulations, one can show that the bagged predictor does not have substantially lower generalization error in the regimes that we are interested in. This implies that most of the variance driving higher generalization error is due to variance over initializations. In figure 7, we make phase plots of the fraction of that arises from variance due to initialization, variance over datasets, and total variance for width 1000. This can be obtained by computing the ensembled predictor, the bagged predictor, and the ensembled-bagged predictor respectively.
B.3 Relating Ensembled Network Generalization to Infinite Width Generalization
Making use of the fact that at leading order, the eNTKf (either in the rich or lazy regime) of a trained network has -dependent fluctuations with variance , one can write the kernel Gram matrices as
Here, are the leading order fluctuations around the infinite width network. Because of how we have written them, their variance is with respect to . Using perturbation theory (Dyer & Gur-Ari, 2020), one can demonstrate that these leading order terms have mean zero around their infinite-width limit.
The predictor for the eNTK0 (or for a sufficiently large neural network) for a training set with target labels is given by:
Upon taking the ensemble, because of the mean zero property of the deviations, we get that
We can now bound the generalization error of the ensemble of networks in terms of the infinite-width generalization:
By equation 18, the second term yields a positive contribution going as . The last term can be bounded by Cauchy-Schwarz:
After we enter the variance limited regime by taking we get so this last term is bounded by . Consequently, the difference in generalization error between the infinite width NTK and an ensemble of lazy network or eNTK0 predictors is subleading in compared to the generalization gap, which goes as .
The same argument can be extended to any predictor that differs from some infinite width limit. In particular Bordelon & Pehlevan (2022) show that the fluctuations of the eNTKf in any mean field network are asymptotically mean zero with variance . The above argument then applies to the predictor obtained by ensembling networks that have learned features. This implies that in the variance limited regime, ensemble averages of feature learning networks have the same generalization as the infinite-width mean field solutions up to a term that decays faster than .
Appendix C Feature Learning
After appropriately rescaling learning rate to we get
Under the assumption that and so that the error term is we get that the output changes in time as .
On the other hand, using the chain rule one can show that the features change as a product of the gradient update and the features in the prior layer, yielding the scaling
This gives us that the change in the features scales as while the change in the output scales as . Thus, for sufficiently small, the features can move dramatically.
C.2 Output Rescaling without Rescaling Weights
C.3 Kernel Alignment
In this section we comment on our choice of kernel alignment metric
For kernels that are diagonally dominant, such as those encountered in the experiments, this metric is related to another alignment metric
Here is the Frobenius norm of the Gram matrix of the kernel. This metric was extensively used in Baratin et al. (2021). The advantage of the first metric over the second is that one can quickly estimate the denominator of via Monte Carlo estimation of .
We use as a measure of feature learning, as we have found that this more finely captures elements of feature learning than other related metrics. We list several metrics we tried that did not work.
One option for a representation-learning metric involves measuring the magnitude of the change between the initial and final kernels, :
However, this is more sensitive to the raw parameter change than any task-relevant data. If one instead were to normalize the kernels to be unit norm at the beginning and the end, the modified metric
This metric however remains remarkably flat over the whole range of , as does the centered kernel alignment (CKA) of Cortes et al. (2012)
Here is the centering matrix that subtracts off the mean components of the kernel for a kernel. This alignment metric has been shown to be useful in comparing neural representations (Kornblith et al., 2019). For our task, however, because the signal is low-dimensional, only a small set of eigenspaces of the kernel align to this task. As a result, the CKA, which counts all eigenspaces equally, appears to be too coarse to capture the low-dimensional feature learning that is happening.
On the other hand, we find that (with given by the eNTKf evaluated on a test set) can very finely detect alignment along the task relevant directions. This produces a clear signal of feature learning at small and large as shown in Figure 2c.
can be related to the centered kernel alignment between the eNTKf and the (mean zero) task kernel , where is a vector of draws from the population distribution .
C.4 Relationship Between Trained Network and Final Kernel
In general, the learned function contains contributions from the instantaneous NTKs at every point in the training. Concretely, following Atanasov et al. (2021) we have the following formula for the final network predictor
where and and . In general there are contributions from earlier kernels for and so the function cannot always be written as a linear combination of the final NTK on training data: . However, as Vyas et al. (2022); Atanasov et al. (2021) have shown, the final predictions of the network are often well modeled by regression with the final NTK. We verify this for our task in section 3.2.
Appendix D Generic Random Feature Model
For a random kernel, , we first compute its Mercer decomposition
From the eigenvalues and eigenfunctions , we can construct the square root
Lastly, using , we can get a feature map by projecting against a static basis giving
These features reproduce the kernel so that . This can be observed from the following observation
where the last line follows from the orthogonality of and recovers .
D.2 Decomposition of Finite Width Features
We now attempt to characterize the variance in the features over the sample distribution. We will first consider the case of a fixed realization of before providing a typical case analysis over random . For a fixed initialization we define the following covariance matrices
where are the truncated (but deterministic) features induced by the deterministic infinite width kernel. We will mainly be interested in the case where and where the target function can be expressed as the linear combination of these features. For example, in the case of our experiments on the sphere, could be the spherical harmonic functions. Further, in the limit, we will be able to express the target features as linear combinations of the features
The matrix are the coefficients of the decomposition which can vary over initializations. Crucially projects to the subspace of dimension where the finite width features have variance over . The population risk for this has an irreducible component
where the bound is tight for the optimal weights . The irreducible error is determined by a projection matrix which preserves the subspace where the features have variance: . In general, this will preserve some fraction of the variance in the target function, but some variance in the target function will not be expressible by linear combinations of the features . We expect that random finite width neural networks will have unexplained variance in the target function on the order .
D.3 Gaussian Covariate Model
Following prior works on learning curves for kernel regression (Bordelon et al., 2020; Canatar et al., 2021; Loureiro et al., 2021), we will approximate the learning problem with a Gaussian covariates model with matching second moments.
The features will be treated as Gaussian over random draws of datapoints. We will assume centered features. We decompose the features in the orthonormal basis , which we approximate as a Gaussian vector .
We refer readers to Hu & Lu (2020) for a discussion of this equivalence between random feature regression and this Gaussian covariate model.
D.4 Replica Calculation of the Learning Curve
To analyze the typical case performance of kernel regression, we define the following partition function which is dominated
For proper normalization, we assume that and . We note that in the limit, the partition function is dominated by the unique minimizer of the regularized least squares objective (Canatar et al., 2021; Loureiro et al., 2021). Further, for a fixed realization of the average generalization error over datasets can be computed by differentiation of the source term
Thus the limit of the above quantity will give the expected generalization error of the risk minimizer. We see the need to average the quantity over realizations of datasets . For this, we resort to the replica trick . We will compute the integer moments for integer and then analytically continue the resulting expressions to under a symmetry ansatz. The replicated partition function thus has the form
We now need to perform the necessary average over the random realizations of data points . We note that the scalar quantities are Gaussian with mean zero and covariance
We further see that the generalization error in replica is . Performing the Gaussian integral over gives
To take the limit, we make the replica symmetry ansatz
which is well motivated since this is a convex optimization problem. Letting , we find that under the RS ansatz the replicated partition function has the form
In a limit where is , then this is intensive . We can thus appeal to saddle point integration (method of steepest descent) to compute the set of order parameters which have dominant contribution to the free energy.
The order parameters are defined via the saddle point equations . For our purposes, it suffices to analyze two of these equations
We can now take the zero temperature () limit to solve for the generalization error
We see that we need to compute the derivatives on . We let and note
We see that this recovers the minimal possible error in the limit. The derived learning curves depend on the instance of random initial condition . To get the average case performance, we take an additional average of this expression over
This average is complicated since all depend on . In the next section we go beyond this analysis to try average case analysis for random Gaussian .
D.5 Quenched Average over Gaussian A
In this section we will define a distribution of features which allows an exact asymptotic prediction over random realizations of disorder and datasets . This is a nontrivial extension of the result of Loureiro et al. (2021) since the number of necessary saddle point equations to be solved doubles from two to four. However, this more complicated theory allows us to exactly compute the expectation in equation 55 under an ansatz for the random matrix . We construct our features with
We will now perform an approximate average over both datasets and realizations of
As before, we first average over and define order parameters as before.
where we defined the fields which are mean zero Gaussian with covariance where . Performing the Gaussian integral over , we find
Next, we need to integrate over which gives
Now the replicated partition function has the form
Now we make a replica symmetry ansatz on the order parameters
We introduce the shorthand for normalized trace of a matrix as . Under the replica symmetry ansatz, we find the following free energy
Letting , the saddle point equations read
Now the generalization error can be determined from
We see that it is necessary to compute and in order to obtain the final result. For simplicity, we set . The equations for the source derivatives are
Once the value of the order parameters have been determined, these source derivatives can be obtained by solving a linear system. Examples of these solutions are provided in Figure 16.
We can compute the asymptotic () generalization error due to the random projection in the limit of . First, note that if , then the asymptotic error would be zero. Therefore, we will assume that for some . The saddle point equations give the following asymptotic conditions
For , this equation can only be satisfied as if so that has the same scaling with as . If then we could get the equation . If , then the equation would give . The constant solves the equation
Using this fact, our order parameters satisfy the following large scalings
The source derivative equations simplify to and
We note that only depends on the product which is an implicit function of and . The generalization error is
We see that in the generic case, the asymptotic error has a nontrivial dependence on the task and the correlation structure . To gain more intuition, we will now consider the special case of isotropic features . In this case, we have so that . This results in the following generalization error
We see that as , the asymptotic error converges to zero since all information in the original features is preserved.
D.5.2 Simplified Isotropic Feature Noise
We can simplify the above expressions somewhat in the case where and . In this case, the order parameters become
Letting , the source derivatives have the form
For each , we can solve for and to get the final generalization error with the formula
An example of these solutions can be found in Figure 16, where we show good agreement between theory and experiment.