Learning curves of generic features maps for realistic datasets with a teacher-student model
Bruno Loureiro, Cédric Gerbelot, Hugo Cui, Sebastian Goldt, Florent Krzakala, Marc Mézard, Lenka Zdeborová
Introduction
Teacher-student models are a popular framework to study the high-dimensional asymptotic performance of learning problems with synthetic data, and have been the subject of intense investigations spanning three decades . In the wake of understanding the limitations of classical statistical learning approaches , this direction is witnessing a renewal of interest . However, this framework is often assuming the input data to be Gaussian i.i.d., which is arguably too simplistic to be able to capture properties of realistic data. In this paper, we redeem this line of work by defining a Gaussian covariate model where the teacher and student act on different Gaussian correlated spaces with arbitrary covariance. We derive a rigorous asymptotic solution of this model generalizing the formulas found in the above mentioned classical works.
We then put forward a theory, supported by universality arguments and numerical experiments, that this model captures learning curves, i.e. the dependence of the training and test errors on the number of samples, for a generic class of feature maps applied to realistic datasets. These maps can be deterministic, random, or even learnt from the data. This analysis thus gives a unified framework to describe the learning curves of, for example, kernel regression and classification, the analysis of feature maps – random projections , neural tangent kernels , scattering transforms – as well as the analysis of transfer learning performance on data generated by generative adversarial networks . We also discuss limits of applicability of our results, by showing concrete situations where the learning curves of the Gaussian covariate model differ from the actual ones.
The labels are generated by a teacher function that is only using the vectors :
Our two main technical contributions are:
In Theorems 1 & 2, we give a rigorous closed-form characterisation of the properties of the estimator for the Gaussian covariate model (1.1), and the corresponding training and generalisation errors in the high-dimensional limit. We prove our result using Gaussian comparison inequalities ;
We show how the same expression can be obtained using the replica method from statistical physics . This is of additional interest given the wide range of applications of the replica approach in machine learning and computer science . In particular, this allows to put on a rigorous basis many results previously derived with the replica method.
The Gaussian covariate model (1.1) is exact in the case where are Gaussian variables and the feature maps preserve the Gaussianity, for example linear features. In particular, this is the case for , which is the widely-studied vanilla teacher-student model . The interest of the model (1.1) is that it also captures a range of cases in which the feature maps and are deterministic, or even learnt from the data. The covariance matrices , , and then represent different aspects of the data-generative process and learning model. The student (1.3) then corresponds to the last layer of the learning model. These observation can be distilled into the following conjecture:
(Gaussian equivalent model) For a wide class of data distributions , and features maps , the generalisation and training errors of estimator (1.3) are asymptotically captured by the equivalent Gaussian model (1.1), where are jointly Gaussian variables, and thus by the closed-form expressions of Theorem 1.
The second part of our main contributions are:
In Sec. 3.3 we show that the theoretical predictions from (C1) captures the learning curves in non-trivial cases, e.g. when input data are generated using a trained generative adversarial network, while extracting both the feature maps from a neural network trained on real data.
In Sec. 3.4, we show empirically that for ridge regression the asymptotic formula of Theorem 1 can be applied directly to real data sets, even though the Gaussian hypothesis is not satisfied. This universality-like property is a consequence of Theorem 3 and is illustrated in Fig. 1 (right) where the real learning curve of several features maps learning the odd-versus-even digit task on MNIST is compared to the theoretical prediction.
Rigorous results for teacher-student models: The Gaussian covariate model (1.1) contains the vanilla teacher-student model as a special case where one takes and identical, with unique covariance matrix . This special case has been extensively studied in the statistical physics community using the heuristic replica method . Many recent rigorous results for such models can be rederived as a special case of our formula, e.g. refs. . Numerous of these results are based on the same proof technique as we employed here: the Gordon’s Gaussian min-max inequalities . The asymptotic analysis of kernel ridge regression , of margin-based classification also follow from our theorem. See also Appendix A.6 for the details on these connections. Other examples include models of the double descent phenomenon . Closer to our work is the recent work of on the random feature model. For ridge regression, there are also precise predictions thanks to random matrix theory . A related set of results was obtained in for orthogonal random matrix models. The main technical novelty of our proof is the handling of a generic loss and regularisation, not only ridge, representing convex empirical risk minimization, for both classification and regression, with the generic correlation structure of the model (1.1).
Gaussian equivalence: A similar Gaussian conjecture has been discussed in a series of recent works, and some authors proved partial results in this direction . Ref. analyses a special case of the Gaussian model (corresponding to here), and proves a Gaussian equivalence theorem (GET) for feature maps given by single-layer neural networks with fixed weights. They also show that for Gaussian data , feature maps of the form (with some technical restriction on the weights) led to the jointly-Gaussian property for the two scalars for almost any vector . However, their stringent assumptions on random teacher weights limited the scope of applications to unrealistic label models. A related line of work discussed similar universality through the lens of random matrix theory . In particular, Seddik et al. showed that, in our notations, vectors obtained from Gaussian inputs with Lipschitz feature maps satisfy a concentration property. In this case, again, one can expect the two scalars to be jointly Gaussian with high-probability on . Remarkably, in the case of random feature maps, could go beyond this central-limit-like behavior and established the universality of the Gaussian covariate model (1.1) for the actual learned weights .
Main technical results
We start by defining key quantities that we will use to characterize the estimator . Let be the spectral decomposition of . Let:
and define the joint empirical density between :
Note that is the projection of the teacher weights on the student space, and therefore is the rotated projection on the basis of the student covariance, rescaled by the teacher variance. Together with the student eigenvalues , these are relevant statistics of the model, encoded here in the joint distribution .
Consider the high-dimensional limit in which the number of samples and the dimensions go to infinity with fixed ratios:
The relevance of these assumptions in a supervised machine learning context is discussed in Appendix B.1. We are now in a position to state our result.
where prox stands for the proximal operator defined as
and where are jointly Gaussian scalar variables:
and the overlap parameters are prescribed by the unique fixed point of the following set of self-consistent equations:
where we defined the scalar random functions and as the first derivative of the proximal operator.
Proof: This result is a consequence of Theorem 2, whose proof can be found in appendix B.
Or in words: is the correlation between the estimator projected in the teacher space, while is the reweighted norm of the estimator by the covariance . The parameter also has a concrete interpretation : it parametrizes the deformation that must be applied to a Gaussian field specified by the solution of the fixed point equations to obtain the asymptotic behaviour of . It prescribes the degree of non-linearity given to the linear output by the chosen loss function. This is coherent with the robust regression viewpoint, where one introduces non-square losses to deal with the potential non-linearity of the generative model. plays a similar role for the estimator through the proximal operator of the regularisation, see Theorem 4 and 5 in the Appendix. Two cases are of particular relevance for the experiments that follow. The first is the case of ridge regression, in which and both the loss and the performance measure are taken to be the mean-squared error , and the asymptotic errors are given by the simple closed-form expression:
while the training error depends on the choice of - which we will take to be the logistic loss in all of the binary classification experiments.
where and are random vectors independent of the other quantities, , , and is the unique solution to the fixed point equations presented in Lemma 12 of appendix B. Those fixed point equations are the generalization of (2.8) to generic, non-separable loss function and regularization. The formal concentration of measure result can then be stated in the following way:
Applications of the Gaussian model
We now discuss how the theorems above are applied to characterise the learning curves for a range of concrete cases. We present a number of cases – some rather surprising – for which Conjecture 1 seems valid, and point out some where it is not. An out-of-the-box iterator for all the cases studied hereafter is provided in the GitHub repository for this manuscript at https://github.com/IdePHICS/GCMProject.
If we choose random feature maps for a random matrix F and a chosen scalar function acting component-wise, we obtain the random kitchen sink model . This model has seen a surge of interest recently, and a sharp asymptotic analysis was provided in the particular case of uncorrelated Gaussian data and in for ridge regression and generalised by for generic convex losses. Both results can be framed as a Gaussian covariate model with:
In this case, the averages over in eq. (2.8) can be directly expressed in terms of the Stieltjes transform associated with the spectral density of . Note, however, that our present framework can accommodate more involved random sinks models, such as when the teacher features are also a random feature model or multi-layer random architectures.
2 Kernel methods with Gaussian data
Another direct application of our formalism is to kernel methods. Kernel methods admit a dual representation in terms of optimization over feature space . The connection is given by Mercer’s theorem, which provides an eigen-decomposition of the kernel and of the target function in the feature basis, effectively mapping kernel regression to a teacher-student problem on feature space. The classical way of studying the performance of kernel methods is then to directly analyse the performance of convex learning in this space. In our notation, the teacher and student feature maps are equal, and we thus set where are the eigenvalues of the kernel and we take the teacher weights to be the decomposition of the target function in the kernel feature basis.
There are many results in classical learning theory on this problem for the case of ridge regression (where the teacher is usually called "the source" and the eigenvalues of the kernel matrix the "capacity", see e.g. ). However, these are worst case approaches, where no assumption is made on the true distribution of the data. In contrast, here we follow a typical case analysis, assuming Gaussianity in feature space. Through Theorem 1, this allows us to go beyond the restriction of the ridge loss. An example for logistic loss is in Fig. 2.
For the particular case of kernel ridge regression, Th. 1 provides a rigorous proof of the formula conjectured in . App. A.6 presents an explicit mapping to their results. Hard-margin Support Vector Machines (SVMs) have also been studied using the heuristic replica method from statistical physics in . In our framework, this corresponds to the hinge loss when . Our theorem thus puts also these works on rigorous grounds, and extends them to more general losses and regularization.
3 GAN-generated data and learned teachers
To approach more realistic data sets, we now consider the case in which the input data is given by a generative neural network , where is a Gaussian i.i.d. latent vector. Therefore, the covariates are the result of the following Markov chain:
Fig. 3 depicts the resulting learning curves obtained by training the last layer of the student. Interestingly, the performance of the feature map at epoch (random initialisation) beats the performance of the learned features during early phases of training in this experiment. Another interesting behaviour is given by the separability threshold of the learned features, i.e. the number of samples for which the training loss becomes larger than in logistic regression. At epoch the learned features are separable at lower sample complexity than at epoch - even though in the later the training and generalisation performances are better.
4 Learning from real data sets
Given that the learning curves of realistic-looking inputs can be captured by the Gaussian covariate model, it is fair to ask whether the same might be true for real data sets. To test this idea, we first need to cast the real data set into the teacher-student formalism, and then compute the covariance matrices and teacher vector required by model (1.1).
At this point, we have all we need to run the self-consistent equations (2.8). The issue with this approach is that there is not a unique teacher map and teacher vector that fit the true labels. However, we can show that all interpolating linear teachers are equivalent:
(Universality of linear teachers) For any teacher feature map , and for any that interpolates the data so that , the asymptotic predictions of model (1.1) are equivalent.
It follows from the fact that the teacher weights and covariances only appear in eq. (2.8) through and the projection . Using the estimation (3.4) and the assumption that it exists , one can write these quantities directly from the labels :
For linear interpolating teachers, results are thus independent of the choice of the teacher. ∎
Although this result might seen surprising at first sight, it is quite intuitive. Indeed, the information about the teacher model only enters the Gaussian covariate model (1.1) through the statistics of . For a linear teacher , this is precisely given by the labels.
Fig. 1 (right) shows a similar experiment on the MNIST data set, but for different out-of-the-box feature maps, such as random features and the scattering transform , and we chose the number of random features to match the number of features from the scattering transform. Note the characteristic double-descent behaviour , and the accurate prediction of the peak where the interpolation transition occurs. We note in Appendix D.1 that for both Figs. 4 and 1, for a number of samples closer to we start to see deviations between the real learning curve and the theory. This is to be expected since in the teacher-student framework the student can, in principle, express the same function as the teacher if it recovers its weights exactly. Recovering the teacher weights becomes possible with a large training set. In that case, its test error will be zero. However, in our setup the test error on real data remains finite even if more training data is added, leading to the discrepancy between teacher-student learning curve and real data, see Appendix D.1 for further discussion.
Why is the Gaussian model so effective for describing learning with data that are not Gaussian? The point is that ridge regression is sensitive only to second order statistics, and not to the full distribution of the data. It is a classical property (see Appendix E) that the training and generalisation errors are only a function of the spectrum of the empirical and population covariances, and of their products. Random matrix theory teaches us that such quantities are very robust, and their asymptotic behaviour is universal for a broad class of distributions of . The asymptotic behavior of kernel matrices has indeed been the subject of intense scrutiny . Indeed, a universality result akin to Theorem 3 was noted in in the specific case of kernel methods. We thus expect the validity of model (1.1) for ridge regression, with a linear teacher, to go way beyond the Gaussian assumption.
We present an additional experiment in Fig. 3. We compare the learning curves of logistic regression on a classification task on the real CIFAR10 images with the real labels versus the one on dcGAN-generated CIFAR10-like images and teacher generated labels from Sec. 3.3. While the Gaussian theory captures well the behaviour of the later, it fails on the former. A histogram of the distribution of the product for a fixed number of samples illustrates well the deviation from the prediction of the theory with the real case, in particular on the tails of the distribution. The difference between GAN generated data (that fits the Gaussian theory) and real data is clear. Given that for classification problems there exists a number of choices of "sign" teachers and feature maps that give the exact same labels as in the data set, an interesting open question is: is there a teacher that allows to reproduce the learning curves more accurately? This question is left for future works.
Acknowledgements
We thank Romain Couillet, Cosme Louart, Loucas Pillaud-Vivien, Matthieu Wyart, Federica Gerace, Luca Saglietti and Yue Lu for discussions. We are grateful to Kabir Aladin Chandrasekher, Ashwin Pananjady and Christos Thrampoulidis for pointing out discrepancies in the finite size rates and insightful related discussions. We acknowledge funding from the ERC under the European Union’s Horizon 2020 Research and Innovation Programme Grant Agreement 714608-SMiLe, and from the French National Research Agency grants ANR-17-CE23-0023-01 PAIL.
References
Appendix A Main result from the replica method
In this appendix we derive the formula for the performance of the Gaussian covariate model from a heuristic replica analysis. The computation closely follows the recent developments in . We refer to for an introduction to this remarkable heuristic (but seemingly never failing) approach.
In our analysis, we are interested in the training and generalisation performance of a linear classifier trained on independent samples from by minimising the regularised empirical risk:
where is the regularisation strength. We define the sample complexity and the aspect ratio .
As it was proven in Theorem 4 of the main manuscript, the asymptotic performance of the estimator in eq. (A.3) is fully characterised by the following scalar parameters:
The replica method is precisely a heuristic tool allowing us to circumvent the high-dimensional estimation problem defined in eq. (A.3) and giving us direct access to .
where , known as the partition function, is a constant normalising the Gibbs measure :
Note that and can be interpreted as a (unormalised) likelihood and prior distribution respectively. In the limit , the measure concentrates around solutions of the minimisation in eq. (A.3). The aim in the replica method is to compute the free energy density, defined as:
A.1 Replica computation of the free energy
The average in eq. (A.7) is not straightforward due to the logarithm term. The replica method consists of computing it using the following trick to get rid of the logarithm:
Averaging
Applying the trick above, the computation of the free energy density boils down to the evaluation of the averaged replicated partition function:
Note that the term in brackets defines the joint density over . It is easy to check that these are Gaussian random variables with zero mean and covariance matrix given by:
where the so-called overlap parameters are related to the weights :
We can therefore write the averaged replicated partition function as:
Rewriting as a saddle-point problem
The next step is to free the overlap parameters by introducing delta functions:
Inserting this in eq. (A.11) allow us to rewrite:
where we have absorbed a factor in the integrals (this won’t matter since we will look to the saddle-point) and defined the potential:
where we recall that , and:
In the high-dimensional limit where while and stay finite, the integral in eq. (A.13) concentrate around the values of the overlaps that extremise , and therefore we can write:
Replica symmetric ansatz
In order to proceed with the limit, we restrict the extremisation above to the following replica symmetric ansatz:
Inserting this ansatz in eq. (A.14) allows us to explicitly take the limit for each term. The first three terms are straightforward to obtain. The limit of is cumbersome, but it common to many replica computations for the generalised linear likelihood . We refer the curious reader to Appendix C of or to Appendix IV of for details, and write the final result here:
Summary
The replica symmetric free energy density is simply given by:
A.2 Ridge regression and fixed weights
where we have included a convenient constant, and therefore:
taking the log and using , up to the limit:
Defining the shorthand , we can now take the averages over explicitly:
A.3 Taking the β→∞→𝛽\beta\to\infty limit
Finally, in order to take the limit explicitly, we note that under the rescaling
The potential has a trivial limit:
while requires more attention. Since only depends on , it is invariant under the rescaling. On the other hand, we have that:
where is the Moreau envelope associated to the loss :
The zero temperature therefore is simply given by:
A.4 Saddle-point equations
To solve the extremisation problem defined by eq. (A.34), we search for vanishing gradient points of the potential. This lead to a set of self-consistent saddle-point equations:
where , which can also be obtained from the proximal operator
using the envelope theorem . A python implementation of the saddle-point equations for the losses discussed below is available in https://github.com/IdePHICS/GCMProject
A.5 Examples
We now discuss a couple of examples in which the equations above simplify.
For the linear task, the asymptotic training and generalisation errors read:
where and are the fixed point of the following set of self-consistent equations:
Note that quite interestingly we have the following relationship between the training and generalisation error:
This give us an interesting interpretation of as parametrising the variance gap between the generalisation and training errorWe thank Stéphane d’Ascoli for bringing this relation to our attention.. In particular, note that only depends on the spectrum of the population covariance, since it is the solution of:
where is the spectral density of .
Binary classification
where again are solutions of the self-consistent saddle-point equations. The teacher measure is given by:
The explicit form of the equation depends on the choice of the loss function, three of which are of particular interest:
As in the ridge case, for the saddle-point equations simplify considerably:
Similarly, the asymptotic training error also admits a simple expression:
Different from the previous cases, for logistic loss the equations for cannot be integrated explicitly, since the proximal operator doesn’t admit a closed form solution. Instead, can be found by solving the following self-consistent equation:
Another useful case in which the proximal operator has a closed form solution is for the hinge loss . In this case:
Again, the equations cannot be integrated explicitly. Note that in the limit , both the logistic and soft-margin solutions converge to the max-margin estimator
A.6 Relation to previous models
The feature map for random features learning can be written as:
These relations hold asymptotically, and rely on the Gaussian equivalence theorem (GET), see for a proof.
In , a similar Gaussian covariate model was used to study the performance of random feature regression on data generated from pre-trained generative models:
Let be a Kernel Reproducing Hilbert space (RKHS) associated to a given kernel and be a labelled data set with independently, and set . In Kernel regression, the aim is to solve:
where is the norm induced by the scalar product in . An alternative representation of this problem is given by the feature decomposition of the kernel given by Mercer’s theorem:
where and are the eigenvalues and eigenvectors associated with the kernel:
Note that form an orthonormal basis of the space of square-integrable functions (with respect to the standard scalar product of ). It is also convenient to define the feature map , which is an orthonormal basis of (with respect to the scalar product induced by ). Therefore, if we assume that the labels are generated from a ground truth target function (not necessarely part of ), we can expand both and the feature basis:
Note that implies that for this sum to make sense needs to decay fast enough with respect to , but in general we can have meaning that decays slower than but still fast enough such that . If the number of features is finite ( for ) or if we introduce a cut-off , the representation in the feature basis in eq. (A.54) allow us to rewrite Kernel regression problem in eq. (A.51) simply as ridge regression in feature space:
Indeed, inserting this expression equation (A.38):
and making a change of variables , , , , , , we recover exactly the self-consistent equations of for the performance of kernel ridge regression directly from our equations. Moreover, our model allow to generalise this discussion to more involved kernel tasks such as kernel logistic regression and support vector machines.
Appendix B Rigorous proof of the main result
Intuitively, the variables and will play a key role in the analysis. Given an instance of and , the tuple is a bivariate Gaussian with covariance:
We thus define the following overlaps, that will play a fundamental role in the analysis:
Note that here, we will not introduce the spectral decomposition 2.2 as it will not simplify the expressions as in the case. The representations are mathematically equivalent nonetheless. Our main result is that the distribution of the estimator can be exactly computed in the weak sense from the solution to six scalar fixed point equations with a unique solution.
We start with a list of the necessary assumptions for the most generic version of the result to hold. We also briefly discuss how they are relevant in a supervised machine learning context.
The spectral distributions of the matrices and converge to distributions such that the overlaps defined by equation (B.5) are well-defined. Additionally, the maximum singular values of the covariance matrices are bounded with high probability when .
The functions and are proper, lower semi-continuous, convex functions. Additionally, we assume that the cost function is coercive, i.e.:
The random elements of the function are independent of the matrices and . Additionally the following limit exists and is finite
When we send the dimensions to infinity, they grow with finite ratios , .
Additional assumptions for linear finite sample size rates : the teacher vector has sub-Gaussian one dimensional marginals. The functions are pseudo-Lipschitz of finite order. The eigenvalues of the covariance matrices are bounded with probability one.
Additional assumptions for exponential finite sample size rates: all of the above, and the loss function is separable and pseudo-Lipschitz of order 2, the regularisation is either a ridge or a Lipschitz function, the functions are respectively separable, pseudo-Lipschitz of order 2, and a square or Lipschitz function.
The first assumption (A1) ensures that the teacher distribution is non-vanishing. The positive definiteness in (A2) means the covariance matrices of the blocks U and V are well-specified. Note that the cross-correlation matrix can have singular values equal to zero. The assumption about the limiting spectral distribution is essentially a summability condition which is immediately verified if the limiting spectral distributions have compact support, a common case. The scaling assumptions from (A3) are natural as they imply that non-diverging inputs result in non-diverging outputs in the functions and , as well as the sub-differentials. Similar scaling assumptions are encountered in proofs such as . They also allow to show Gaussian concentration of Moreau envelopes, as we will see in Lemma 5. The coercivity assumption is verified in most common machine learning setups : any convex loss with ridge regularisation, or any convex loss that is bounded below with a coercive regularisation (LASSO, elastic-net,…), see Corollary 11.15 from . Assumption (A4) is a classical assumption of teacher-student setups, where any correlation between the teacher and the student is modeled by the covariance matrices and not by the label generating function . The summability condition ensures generalization error is well-defined for squared performance measures. Finally, (A5) is the typical high-dimensional limit used in statistical physics of learning, random matrix theory and a large recent body of work in high-dimensional statistical learning.
B.2 Main theorem
First, let’s define quantities and a scalar optimization problem that will be used to state the asymptotic behaviour of (1.2-1.3):
(Scalar potentials/replica free energy) Define the following functions of the scalar variables :
where and are random vectors independent of the other quantities, , , and denotes the Moreau envelope of a target function.
From these quantities define the following potential:
Under Assumption (B.1), the previously defined quantities all admit finite limits when .
Proof: This follows directly from Lemma 5.
The next lemma characterizes important properties of the "potential" function :
(Geometry and minimizers of ) The function is jointly convex in and jointly concave in , and the optimization problem
has a unique solution on .
Proof: see Appendix 13. The optimality condition of problem (B.12) yields the set of self-consistent fixed point equations given in Lemma 12 of Appendix B. Finally, define the following variables:
where prox denotes the proximal operator. With these definitions, we can now state our main result:
(Training loss and generalisation error) Under Assumption (B.1), there exist constants such that, for any optimal solution to (1.3), the training loss and generalisation error defined by equation verify, for any :
where is defined as follows:
and the random variables are jointly Gaussian with covariance
Proof: see Appendix B.6. Note that the regularisation may be removed to evaluate the training loss. A more generic result, aiming directly at the estimator , can also be stated:
Proof: see Appendix B.6. Concentration still holds for a larger class of functions , but exponential rates are lost. This is discussed in Appendix B.1.
B.3 Theoretical toolbox
Here we remind a few known results that are used throughout the proof. We also provide proofs of useful, straightforward consequences of theses results that do not appear explicitly in the literature for completeness.
We start with the Convex Gaussian Min-max Theorem, as presented in , which is a tight version of an inequality initially derived in .
Following , we will say that any reformulation of a target problem matching the form of (B.19) is an acceptable primary optimization problem (PO), and the corresponding form (B.20) is an acceptable auxiliary problem (AO). The main idea of this approach is to study the asymptotic properties of the (PO) by studying the simpler (AO).
B.3.2 Proximal operators and Moreau envelopes : differentials and useful functions
As reminded in , the Moreau envelope is jointly convex in and differentiable almost everywhere, with gradients:
We remind that is the unique point which solves the strongly convex optimization problem defining the Moreau envelope, i.e.:
We also remind the definition of order k pseudo-Lipschitz function.
We now give some further properties that will be helpful throughout the proof.
Proof of Lemma 2: For any in , we have, using the pseudo-Lipschitz property:
where the second line follows immediately with the same constant owing to the firm-nonexpansiveness of the proximal operator. Furthermore
due to the pseudo-Lipschitz property, one has
This, along with the firm-nonexpansiveness of , concludes the proof. ∎
is nondecreasing, and are nonincreasing.
which implies that is non-increasing. Using the Moreau decomposition, see e.g. , we have:
Proof of Lemma 4 : the subdifferential of a proper convex function is a monotone operator, thus:
additionally, , hence:
B.3.3 Useful concentration of measure elements
We begin by reminding the Gaussian-Poincaré inequality, see e.g. .
We now use this previous result to show Gaussian concentration of Moreau envelopes of appropriately scaled convex functions.
where the second line is integrable under a multivariate Gaussian measure. Then, using Proposition 1, we get:
Using Proposition 12.27 and Corollary 4.3 from , is firmly non-expansive and:
Chebyshev’s inequality then gives, for any :
Gaussian concentration of pseudo-Lipschitz functions of finite order can also be proven using the Gaussian Poincaré inequality to yield a bound similar to the one obtained for Moreau envelopes. We thus give the result without proof:
We now cite an exponential concentration lemma for separable, pseudo-Lipschitz functions of order 2, taken from .
where it is understood that .
B.4 Determining a candidate primary problem, auxiliary problem and its solution.
We start with a reformulation of the problem (1.2-1.3) in order to obtain an acceptable primary problem in the framework of Theorem 6. Partitioning the Gaussian distribution, we can rewrite the matrices U and in the following way, introducing the standard normal vector:
We can then rewrite the vectors and matrices as:
where the matrices and have independent standard normal entries and are independent of . The learning problem then becomes equivalent to :
We are then interested in the optimal cost of the following problem
Introducing the auxiliary variable :
In the remainder of the proof, the preceding cost function will be denoted
such that the problem reads . Theorem 6 requires working with compact feasibility sets. Adopting similar approaches to the ones from , the next lemma shows that the optimization problem (B.61) can be equivalently recast as one over compact sets.
(Compactness of feasibility set) Let be optimal in (B.61). Then there exists positive constants and such that
Proof of Lemma 8: consider the initial minimisation problem:
Now consider the equivalent formulation of problem (B.64):
The optimality condition in gives:
According to assumption (A2), the operator norms of the matrices involving the covariance matrices are bounded with high probability and using known results on random matrices, see e.g. , the operator norms of and are bounded by finite constants with high probability when the dimensions go to infinity. Thus there exists a constant also independent of d such that:
Finally, the scaling condition from assumption (A3) directly shows that there exists a constant such that
The rest of this section can then be summarized by the following lemma, the proof of which shows how to find an acceptable (PO) for problem (B.71), the corresponding (AO) and how to reduce the (AO) to a scalar optimization problem. At this point we will assume the teacher vector is deterministic, and relax this assumption in paragraph B.7. For this reason we do not add it to the initial list of assumptions in section B.1.
(Scalar equivalent problem) In the framework of Theorem 6, acceptable (AO)s of problem (B.71) can be reduced to the following scalar optimization problems
Proof of Lemma 9: We need to find an i.i.d. Gaussian matrix independent from the rest of the problem in order to use Theorem 6. We thus decompose the mixing matrix A by taking conditional expectations w.r.t. , which amounts to conditioning on a linear subset of the Gaussian space generated by A. Dropping the feasibility sets for confort of notation in the following lines:
Two cases must now be considered, and . Another possible case is , however it leads to the same steps as the case .
A follow-up of the previous equations shows that the feasibility set now reads :
We now turn to the simplification of this problem. The variable only appears in linear terms, we can thus directly optimize over its direction, introducing the positive scalar variable :
The previous expression may not be convex-concave because of the term . However, it was shown in that the order of the min and max can still be inverted in this case, because of the convexity of the original problem. As the proof would be very similar, we do not reproduce it. Inverting the max-min order and performing the linear optimization on with :
using the following representation of the norm, as in , for any vector , :
performing the minimisation over and recognizing the Moreau envelope of :
At this point we have a convex-concave problem. Inverting the min-max order, appears in a well defined strictly convex least-square problem.
Isolating the terms depending on , we get a strictly convex least-square problem, remembering that :
Another strictly convex least-square problem appears on , the solution and optimal value of which read
At this point we have expressed feasible solutions of as functions of the remaining variables. For any feasible solution in those variables, and are the same. Replacing in the (AO) and a completion of squares leads to
where the Moreau envelopes of and are respectively defined w.r.t. the variables and . At this point we have reduced the initial high-dimensional minimisation problem (B.4) to a scalar problem over six parameters. Another follow-up of the feasibility set shows that there exist positive constants independent of such that , and .
In this case, the min-max problem (B.85) becomes:
where the compactness of the feasibility set is preserved almost surely from the almost sure boundedness of the eigenvalues of . We can thus write the corresponding auxiliary optimization problem, reintroducing the normalization by d:
introducing the convex conjugate of with dual parameter :
Using the square root trick with parameters :
performing the optimizations on and recognizing the Moreau envelopes, the problem becomes:
B.5 Study of the scalar equivalent problem : geometry and asymptotics.
Here we study the geometry, solutions and asymptotics of the scalar optimization problem (B.4). We will focus on the case as the other case simply shows that no learning is performed (see the remark at the end of this section). The following lemma characterizes the continuity and geometry of the cost function .
(Geometry of ) Recall the function:
Then is continuous on its domain, jointly convex in and jointly concave in .
Proof of Lemma 10 : is a linear combination of linear and quadratic terms with Moreau envelopes, which are all continuous on their domain. Remembering the formulation
The squared term in can be written as
(Asymptotics of ) Recall the following quantities:
and is continuously differentiable on its domain, jointly convex in and jointly concave in .
using the Gaussian tail. The Borel-Cantelli lemma and summability of this tail gives
Concentration of the Moreau envelopes of both and follows directly from lemma 5. We thus have the pointwise convergence:
Since pointwise convergence preserves convexity, is jointly convex in and jointly concave in . Now recall the expression of
The feasibility sets of are compact from Lemma 8 and the subsequent follow-up of the feasibility sets. Then, using Proposition 12.32 from , for fixed , we have:
which is a finite quantity since is a proper, convex function verifying the scaling assumptions B.1. Then, since , we have:
Similarly, for fixed and noting that composing with the positive definite matrix does not change its convexity, or it being proper and lower semi-continuous, we get:
which is also a bounded quantity from the scaling assumptions made on . Since , we then have:
Finally, the limit needs to be checked for both and since there is no restriction on the sign of . From the definition of the Moreau envelope, we can write:
Thus, for any fixed :
which immediately gives . Turning to the other limit, remembering that is continuously differentiable on its domain, we have:
Thus . Since is continuously differentiable in on , and from the short argument led above, we have shown
Using similar arguments as in the proof of Lemma 8, we can now reduce the feasibility set of to a compact one. Then, using the fact that convergence of convex functions on compact sets implies uniform convergence , we obtain
which is the desired result. ∎ At this point, it is necessary to characterize the set of solutions of the asymptotic minimisation problem (B.12). We start with the explicit form of the optimality condition associated to any solution.
(Fixed point equations) The zero-gradient condition of the optimization problem (B.12) prescribes the following set of fixed point equations for any feasible solution:
This set of equations can be converted to the replica notations using the table (C.2).
Proof of Lemma 12: Using arguments similar to the ones in the proof of Lemma 5, Moreau envelopes and their derivatives verify the necessary conditions of the dominated convergence theorem. Additionally, uniform convergence of the sequence of derivatives can be verified in a straightforward manner as all involved functions are firmly non-expansive and integrated w.r.t. Gaussian measures. We can therefore invert the limits and derivatives, and invert expectations and derivatives. We can now write explicitly the optimality condition for the scalar problem (B.126), using the expressions for derivatives of Moreau envelopes from Appendix B.3. Some algebra and replacing with prescriptions obtained from each partial derivative leads to the set of equations above. ∎ Remark : Here we see that the potential function (B.126) can be further studied using the fixed point equations (12) and the relation (B.24). For any optimal , it holds that
Finally, we give a strict-convexity and strict-concavity property of the asymptotic potential which will be helpful to prove Lemma 1.
(Strict convexity and strict concavity near minimisers) Consider the asymptotic potential function . Then for any fixed in their feasibility sets, the function
is jointly strictly concave in . Additionally, consider the set defined by:
then for any fixed in , the function is jointly strictly convex in on
Proof of Lemma 13: We will use the following first order characterization of strictly convex functions: . To simplify notations, we will write, for any fixed
As we will see in the next section, this will lead to estimators solely based on noise.
B.6 Back to the original problem : proof of Theorem 4 and 5
We begin this part by considering that the "necessary assumptions for exponential rates" from the set of assumptions B.1 are verified. In the end we will discuss how relaxing these assumptions modifies the convergence speed. We closely follow the analysis introduced in and further developed in . The main difference resides in checking the concentration properties of generic Moreau envelopes depending on the regularity of the target function instead of specific instances such as the LASSO. Since the dimensions are linked by multiplicative constants, we can express the rates with any of the three. Recall the original reformulation of the problem defining the student.
Consider the finite size scalar optimization problem
where the feasibility set of is compact and . Then any optimal values verify:
For any , there exist constants such that:
Proof of Lemma 15: for any fixed , we can determine the rates of convergence of all the random quantities in . The linear terms involving are sub-Gaussian with sub-Gaussian norm bounded by for some constant . Thus we can find constants, such that, for any :
The term involving is deterministic in this setting. We will see in section B.7 how a random affects the convergence rates. The term involving is a weighted sum of sub-exponential random variables, the tail of which can be determined using Bernstein’s inequality, see e.g. Corollary 2.8.3, which gives a sub-Gaussian tail for small deviations and a sub-exponential tail for large deviations. Parametrizing the deviation with a scalar variable , we thus get the following bound : for any , there exists constants such that:
For any , there exist constants such that:
For any , there exists constants such that the event
has probability at most .
For any , there exists constants such that the event
has probability at most .
which proves Theorem 5 using the fact that are minimizers of the initial cost function. Theorem 4 is a consequence of Theorem 5. If the restriction on are relaxed to any pseudo-Lipschitz functions of finite orders, the exponential rates involving them are lost and become linear following Lemma 5.
B.7 Relaxing the deterministic teacher assumption
The entirety of the previous proof has been done with a deterministic vector . Now, if is assumed to be a random vector independent of all other quantities, as prescribed in the set of assumptions B.1, we can "freeze" the variable by conditioning on it. The whole proof can then be understood as studying the value of the cost conditioned on the value of . Note that, in the Gaussian case, correlations between the teacher and student are expressed through the covariance matrices, thus leaving the possibility to parametrise the teacher with a vector indeed independent of all the rest. To lift the conditioning in the end, one only needs to average out on the distribution of , the summability conditions of which are prescribed in the set of assumptions B.1. Thus, random teacher vectors can be treated simply by taking an additional expectation in the expressions of Theorem 5, provided is independent of the matrices and the randomness in . As mentioned at the end of the previous section, the finite size rates will be determined by the assumptions made on the teacher vector and decay of the eigenvalues of the covariance matrices. We do not investigate in detail the limiting assumptions under which exponential rates still hold regarding the randomness of the teacher or tails of the eigenvalue distributions of covariance matrices.
B.8 The ’vanilla’ teacher-student scenario
In this section, we give the explicit forms of the fixed points equations and optimal asymptotic estimators in the case where the teacher and the student are sampled from the same distribution, i.e. where is a positive definite matrix with sub-Gaussian eigenvalue decay. This setup was rigorously studied in for the LASSO and heuristically in for the ridge regularized logistic regression. In this case, the fixed point equations become
and the asymptotic optimal estimators read:
Appendix C Equivalence replica-Gordon
In this Appendix, we show that the rigorous result of Theorem 5 can be used to prove the replica prediction in the case of a separable loss, a ridge penalty. For simplicity, we restrict ourselves to the case of random teacher weights with . We provide an exact analytical matching between the replica prediction and the one obtained with Gordon’s theorem. We start by an explicit derivation of the form presented in Corollary 1 from the main result (1).
using Lemma 5 with a separable function, the expectation over the Moreau envelope converges to:
where and are standard normal random variables and . The corresponding optimality conditions then reads:
simplifying these equations using Stein’s lemma, we get:
C.2 Matching with Replica equations
In this section, we show that the fixed point equations obtained from the asymptotic optimality condition of the scalar minimization problem 1 match the ones obtained using the replica method. In what follows we will use the same notations as in , and an explicit, clear match with the notations from the proof of the main theorem will be shown. The replica computation, similar to the one from , leads to the following fixed point equations, in the replica notations:
where and is given by:
To be explicit with the notation, let’s open the equations up. Take for instance the one for . Opening all the integrals:
where in we integrated over explicitly. A direct comparison between the two sets of equations suggests the following mapping to navigate between the replica derivation and the proof using Gaussian comparison theorems. We denote replica quantities with Rep indices:
The first three equations match the replica prediction, the last three can be exactly matched using the following change of variable and Gaussian integration:
Appendix D Details on the simulations
In this Appendix we give full details on the numerics used to generate the plots in the main manuscript. An implementation of all the pipelines described below is available at https://github.com/IdePHICS/GCMProject.
First, we discuss in detail how we conducted the numerical simulations in Figs. 4 and 4 in the main manuscript.
In Fig. 4, the feature is taken from a learned neural network at different epochs of training. For this experiment, we chose the following architecture implemented in \pythPytorch: {python} Sequential( (0): Linear(in_features=784, out_features=2352, bias=False) (1): ReLU() (2): Linear(in_features=2352, out_features=2352, bias=False) (3): ReLU() (4): Linear(in_features=2352, out_features=1, bias=False) )
In both experiments, we ran ridge regression at fixed regularisation by sub-sampling samples from the data set , , with the estimator given by the closed-form expression:
In principle, the teacher weights need to be estimated by inverting . However, as explained in in Sec. 3.4, one can avoid doing so by noting the teacher weights only appear in the self-consistent equations 2.8 through and . Therefore, all teacher vector and feature map that linearly interpolate the data set are equivalent, since we can write:
which is independent from . In particular, note that for our binary labels , we have . In both Fig. 4 and 4 of the main, we estimated the covariance as in eq. (D.3) by applying the feature maps described above to the whole data set, took (since in both we have binary labels) and used eq. (D.4) to estimate . This was then fed to our iterator package (https://github.com/IdePHICS/GCMProject) to compute the curves. For the kernel curve, we used the random features approximation of eq. (D.1) with a dimensional feature space to estimate the covariance . We have checked that this indeed provide a good approximation of for the sample range considered, see Fig.5.
As we have discussed above, a key ingredient of our theoretical analysis is the estimation of the population covariances. For real data, this relies on the empirical covariance of the whole data set with samples. We expect this approximation to be good only for samples, as it is the case for the ranges plotted in Figs. 4 and 4. Indeed, as we start observing deviations between the theoretical prediction and the simulations. In Fig. 6 (right) we show an example of a NTK kernel regression task on 8 vs 9 MNIST digit classification, for which . Note that while the theoretical prediction reach perfect generalisation at , the simulated error approaches a plateau. Alternatively, instead of varying the sample range, in Fig. 6 (left) we show how the matching betweem theory and simulation degrades by varying on a fixed sample range for a MNIST odd vs. even task.
As it was discussed in Sec. 3.4 of the main manuscript, the universality argument sketched above is only valid in the case of a linear student. For instance, applying the same construction to a binary classification task with lead to a mismatch between theory and experiments, as exemplified in Fig. 3 of the main for a logistic regression task on CIFAR10 gray-scale images. Interestingly, this is even the case for binary classification with the square loss , in which the estimator is the same as for ridge regression. In other words, by simply changing the predictor , we have a breakdown of universality, as shown in Fig. 7.
D.2 Binary classification on GAN generated data
and which has been trained on the full CIFAR10 data set. It therefore takes a -dimensional latent vector and returns a CIFAR10-looking image. The GAN was trained on the original CIFAR10 data set without data augmentation for 50 epochs. Both the discriminator and the generator were trained using Adam, with Adam parameters and . In practice, the advantage of working with a GAN is that we have a generative process to sample as many independent data points as we need, both for the simulations and for the estimation of the population covariances.
The experiment shown in Fig. 3 follow a similar pipeline as the one described in Sec. D.1. The student feature maps are obtained by removing the last layer of a trained a 3-layer student network with architecture: {python} Sequential( (0): Linear(in_features=1024, out_features=2304, bias=False) (1): ReLU() (2): Linear(in_features=2304, out_features=2304, bias=False) (3): ReLU() (4): Linear(in_features=2304, out_features=1, bias=False) ) Training was performed on a data set composed of independent samples drawn from the dcGAN described above, with labels assigned by the learned teacher , . The network was trained for epochs using Adam optimiser on the MSE loss and \pythpyTorch’s default Kaiming initialisation, and snapshops of the weights were extracted at epochs . Finally, logistic regression was performed on the learned features on fresh pair of dcGAN generated samples and labels using the out-of-the-box \pythLogisticRegression solver from \pythScikit-learn. The points and error bars in Fig. 3 were computed by averaging over independent runs. The same pipeline was used for Fig. 3, but for and on dcGAN generated CIFAR10 gray-scale images.
As before, the self-consistent eqs. 2.8 require the population covariances and the teacher weights . For synthetic GAN data, the population covariances of the feature maps used in the simulations can be estimated as well as needed with a Monte Carlo sampling algorithm. For the curves shown in Figs. 3 and 3, the covariances were estimated with samples with a precision of the order of . Together with the teacher weights used to generate the labels, this provides everything needed to compute the theoretical learning curves from the self-consistent equations.
Appendix E Ridge regression with linear teachers
In this Appendix we discuss briefly random matrix theory, and consider heuristic reasons behind the validity of our asymptotic result beyond Gaussian covariates in the context of ridge regression, with linear teacher. As is well known, the computation of the training and test MSE for ridge regression can be written as a random matrix theory problem. We do not attempt a rigorous approach, but rather to motivate with simple arguments, many of them actually well known, the observed universality and its limits.
We assume the existence of a linear teacher generating the labels , and recall the student performs ridge regression on the data matrix .
The Gaussian model we consider can therefore be rewritten with a Rademacher vector provided we change the correlation matrix (as well as the cross-correlation ) accordingly.
where we have defined the empirical covariance matrices
Given this vector, one can now readily write the expected value of the training and test losses as follows:
where we have denoted the population correlation matrices for readability and a direct comparison with their empirical counterpart. The traces appears by the left and right multiplication by the random vector .
At this point, the entire problem has been mapped to a random matrix theory exercise: assuming data are indeed Gaussian, one can use RMT to compute the six traces that appears in (E.5,E.6). Indeed, this is the canonical approach used in most rigorous works for the ridge regression task in the teacher-student framework, instance in . Remarkably, the replica (and the rigorous Gordon counterpart) allow to find the same result without the explicit use of RMT.
We now discuss, heuristically, why these results are valid even though the distribution of is not actually Gaussian, and in some instances even for real data. Indeed, that both do not depend explicitly on the distribution of the data, but —assuming some concentration (or self-averaging)— only on:
The spectrum of the population covariances .
The spectrum of the empirical covariances .
The expectation of the trace of products between empirical and population covariances.
We expect that asymptotically the prediction from the theory will thus be valid for much more generic distributions , provided they share the same population covariances (which we call ). To see this, we need to check how this change in distribution would affect points (1),(2) and (3). Fixing the population covariances, the first bullet point (1) is automatically taken into account. Point (2) and (3) are, however, less trivial: in order to have universality we need that a) the spectrum of the empirical covariances of the non-Gaussian distribution to converge the one obtained with the Gaussian one; and b) the trace of products between the empirical and the population covariances also to converge to the universal values computed from Gaussians data.
These two last points have been investigated in RMT [anderson2010introduction], and it is a classical result that such quantities are universal and converge to the Gaussian-predicted values for many distribution, way beyond the Gaussian assumption (in which case the spectral densities are known as the Wigner and Wishart model, or Marcenko-Pastur distribution [marchenko1967distribution]): this powerful universality of RMT is at the origin of the applicability of the model beyond Gaussian data. For instance, showed that these assumptions are verified for any data generated as , assuming the components of the vector are drawn i.i.d. from any distribution (with some assumption on the larger moments). While this is still restrictive, stronger results can be shown, and [63, 65, chafai2018convergence, 49] extended them (also loosening the independence assumption) for a very generic class of distributions of correlated random vectors .
Let us give a concrete example. For simplicity, consider the restricted case where , i.e. the teacher acts on the same space as the student. In this case, eqs. (E.5,E.6) simplify (this is essentially the analysis in ) to:
In the expression of the training loss eq. (E.7), we see terms such as
In the expression of the generalisation loss eq. (E.8), however, terms such as
appears. These can be computed using classical RMT results on the concentration of the inverse of the covariance [hachem2007deterministic, 64]. The strongest result we are aware of for such problems is from the remarkable work of . This universality of random matrix theory is thus at the origin of the surprisingly successful application of our Gaussian theory to real data with arbitrary feature maps. Of course the discussion here is limited to the case where and a concrete mathematical statement would require the generalisation of these arguments to the more generic case of eqs.(E.5,E.6), which are closer to the work of . We leave this discussion to future works.
A similar universality has been discussed for kernel methods in very recent works, but for the slightly different setting in which data is drawn from a Mixture of Gaussians (in which case there is no teacher, the label depends on which Gaussian has been chosen). The universality observed here for ridge regression with linear student, albeit different, is of a similar nature, and it would be interesting to discuss the link between these two approaches.