Generalization error of random features and kernel methods: hypercontractivity and kernel matrix concentration

Song Mei, Theodor Misiakiewicz, Andrea Montanari

Introduction

A number of statistical learning methods can be viewed as a combination of two steps: featurization and training. Featurization maps sample points into a convenient ‘feature space’ H{\mathcal{H}} (a vector space) via a featurization map ϕ:X→H{\bm{\phi}}:{\mathcal{X}}\to{\mathcal{H}}, xi↦ϕ(xi){\bm{x}}_{i}\mapsto{\bm{\phi}}({\bm{x}}_{i}). Training fits a model that is linear in the feature space: f^(x)=⟨a,ϕ(x)⟩H\hat{f}({\bm{x}})=\langle{\bm{a}},{\bm{\phi}}({\bm{x}})\rangle_{{\mathcal{H}}}. In this paper we will be concerned with a relatively simple method for training, ridge regression:

Here it is implicitly assumed that H{\mathcal{H}} is an Hilbert space, and therefore a∈H{\bm{a}}\in{\mathcal{H}} and ⟨ ⋅ , ⋅ ⟩H\langle\,\cdot\,,\,\cdot\,\rangle_{{\mathcal{H}}}, ∥ ⋅ ∥H\|\,\cdot\,\|_{{\mathcal{H}}} are the scalar product and norm in H{\mathcal{H}}.

It is useful to discuss a few examples of this paradigm, some of which will play a role in what follows (we refer to Section 2.1 for formal definitions).

Here ⟨f,g⟩n:=n−1∑i=1nf(xi)g(xi)\langle f,g\rangle_{n}:=n^{-1}\sum_{i=1}^{n}f({\bm{x}}_{i})g({\bm{x}}_{i}) denotes the scalar product with respect to the empirical measure.

Because of the connection to two-layers neural networks (see below) we shall refer to NN as the ‘number of neurons’ (although, ‘number of parameters’ would be more appropriate), and to σ\sigma as the ‘activation function.’ The resulting function f^\hat{f} takes the form

We will refer to the procedure defined by Eq. (1) with ϕ{\bm{\phi}} the random feature map defined here as ‘random features ridge regression’ (RFRR). RFRR is closely related to KRR. First of all, we can view RFRR as an example of KRR, with kernel

Notice however that the kernel HNH_{N} has finite rank and is random, because of the random features θ1,…,θN{\bm{\theta}}_{1},\dots,{\bm{\theta}}_{N}.

Second, for large NN, we can expect HNH_{N} to be a good approximation of its expectation

Hence, for large NN, we expect RFRR to have similar generalization properties as the underlying RKHS, while possibly exhibiting lower complexity because it only operates on N×nN\times n matrices (instead of n×nn\times n matrices as for KRR).

Neural networks in the linear (lazy) regime. The methods described above fit the general paradigm of Eq. (1). Training does not affect the feature map ϕ{\bm{\phi}}. The model f^λ( ⋅ )\hat{f}_{\lambda}(\,\cdot\,) is linear in y{\bm{y}}, as a consequence of the fact that the loss is quadratic (see also Eq. (2)). In contrast, neural networks aim at learning the best feature representation of the data. The feature map changes during training, and indeed there is no clear separation between the feature map ϕ(x){\bm{\phi}}({\bm{x}}) and the coefficients a{\bm{a}}.

Apart from the zero-th order term f(x;θ0)f({\bm{x}};{\bm{\theta}}_{0}) (which has no free parameters, and hence plays the role of an offset), this linearized model takes the same form f^(x)=⟨a,ϕ(x)⟩\hat{f}({\bm{x}})=\langle{\bm{a}},{\bm{\phi}}({\bm{x}})\rangle. The featurization map is given by ϕ(x)=∇θf(x;θ0){\bm{\phi}}({\bm{x}})=\nabla_{{\bm{\theta}}}f({\bm{x}};{\bm{\theta}}_{0}). We refer to the model x↦⟨a,∇θf(x;θ0)⟩{\bm{x}}\mapsto\langle{\bm{a}},\nabla_{{\bm{\theta}}}f({\bm{x}};{\bm{\theta}}_{0})\rangle as the neural tangent (NT) model.

Notice that the NT featurization map is random, because of the random initialization θ0{\bm{\theta}}_{0}. However, in general it does not take the form of the RF model, because the entries of ∇θf(x;θ0)\nabla_{{\bm{\theta}}}f({\bm{x}};{\bm{\theta}}_{0}) are not independent. Despite this important difference, we expect key properties of the RF model to generalize to suitable classes of NT models. Examples of this phenomenon were studied recently in [GMMM19, MZ20].

In particular our results allow to answer in a quantitative way two sets of key questions that emerge from the above discussion:

How does the test error of KRR depends on the sample size nn, on the target function ff, and on the kernel HH? While this question has attracted considerable attention in the past (see Section 1.3 for an overview), a very precise answer can be given in the present setting.

How does the test error of RFRR depend on the sample size nn, and the number of neurons NN? In particular, for a given sample size, how big NN should be to achieve the same error as for the associated KRR (which corresponds formally to N=∞N=\infty)?

How do the answers to the previous questions depend on the regularization parameter λ\lambda? In particular, in which cases the optimal test error is achieved by choosing λ→0\lambda\to 0, i.e. by using the minimum norm interpolator to the training data?

Let us emphasize that the second question is technically more challenging than the first one, because it amounts to studying KRR with a random kernel. The setting introduced here is particularly motivated by the objective to address Q2 (and its ramifications in Q3). Indeed, to the best of our knowledge, we provide the first set of results on the optimal choice of the overparametrization N/nN/n under polynomial scalings of N,n,dN,n,d.

2 Summary of main results

Before summarizing our results, it is useful to describe informally our assumptions: we refer to Sections 2.2 and 3.2 for a formal statement of the same assumptions. We consider (xi)i≤n∼iidν({\bm{x}}_{i})_{i\leq n}\sim_{iid}\nu with ν\nu a probability distribution of the covariates space X{\mathcal{X}}, and yi=f(xi)+εiy_{i}=f({\bm{x}}_{i})+\varepsilon_{i}, where ff is the target function and εi∼N(0,σε2)\varepsilon_{i}\sim{\sf N}(0,\sigma_{\varepsilon}^{2}) independent of xi{\bm{x}}_{i} is noise.

We will consider sequences of such problems indexed by an integer dd, and characterize their behavior as N,n,d→∞N,n,d\to\infty. In applications, dd typically corresponds to the dimension of the covariates space X{\mathcal{X}}. In this informal summary, we drop any reference to dd for simplicity.

We next describe informally our key assumptions, which depends on integers (m,M,u)({\mathsf{m}},{\mathsf{M}},u), with u≥max⁡(M,m)u\geq\max({\mathsf{M}},{\mathsf{m}}). (For the sake of simplicity, we omit some assumptions of a more technical nature.)

Concentration of diagonal elements of the kernels. Denote by H>mH_{>{\mathsf{m}}} the kernel obtained from HH by setting to zero the eigenvalues λ1,…,λm\lambda_{1},\dots,\lambda_{\mathsf{m}}. We require that the diagonal elements {H>m(xi,xi)}i≤n\{H_{>{\mathsf{m}}}({\bm{x}}_{i},{\bm{x}}_{i})\}_{i\leq n} concentrate around their expectation with respect to the measure ν\nu on X{\mathcal{X}}. Analogously, we require the diagonal elements {U>M(θi,θi)}i≤N\{U_{>{\mathsf{M}}}({\bm{\theta}}_{i},{\bm{\theta}}_{i})\}_{i\leq N} to concentrate around their expectation.

This assumption amounts to a condition of symmetry: most points x{\bm{x}} in the support of ν\nu are roughly equivalent, in the sense of having the same value of H>m(x,x)H_{>{\mathsf{m}}}({\bm{x}},{\bm{x}}), and similarly for most θ{\bm{\theta}} in the support of ν\nu.

Spectral gap. Recall that (λj2)j≥1(\lambda_{j}^{2})_{j\geq 1} denote the eigenvalues of the kernel HH in decreasing order. We then assume one of the following two conditions to hold:

Undeparametrized regime. We have N≪nN\ll n and

Overparametrized regime. We have n≪Nn\ll N and

This assumption is ensures a clear separation between the subspace of Dd{\mathcal{D}}_{d} which is estimated accurately (spanned by the eigenfunction of HH corresponding to the top eigenvalues) and the subspace that is estimated trivially by (corresponding to the low eigenvalues of HH.) As we will see, a spectral gap condition holds for classical high-dimensional examples. On the other hand, we believe it should be possible to avoid this condition at the price of a more complicate characterization of the risk, and indeed we do not require it for KRR.

As explained above, KRR attempts to estimate accurately the projection of the target function f∗f_{*} onto the top eigenvectors of the kernel HH, and shrinks to zero its other components. RFRR behaves similarly, except that it only constructs a finite rank approximation of the kernel HH. How many components of the target function are estimated accurately? There are of course two limiting factors: the statistical error which depends on the sample size nn, and the approximation error which depends on the number of neurons NN.

It turns out that, in the present setting, the interplay between nn and NN takes a particularly simple form. In a nutshell what matters is the smaller of nn and NN. If n≪Nn\ll N, then the statistical error dominates and ridge regression estimates correctly the projection of f∗f_{*} onto the top m{\mathsf{m}} eigenfunctions of HH (where m{\mathsf{m}} is defined per Eq. (8)). If on the other hand N≪nN\ll n, then the approximation error dominates and ridge regression estimates correctly the projection of f∗f_{*} onto the top M{\mathsf{M}} eigenfunctions of HH (where M{\mathsf{M}} is defined per Eq. (7)).

This characterization implies a relatively simple answer to questions Q1, Q2, and Q3, which we posed in the previous section. We summarize some of the insights that follow from this result.

As mentioned above, Eq. (9) can be restated as saying that (for the special case N=∞N=\infty), f^λ(x)≈P≤mf∗(x)\hat{f}_{\lambda}({\bm{x}})\approx{\mathsf{P}}_{\leq{\mathsf{m}}}f_{*}({\bm{x}}). Indeed, we will prove a stronger result, which does not require the spectral gap assumption of Eq. (8). The KRR estimator f^λ\hat{f}_{\lambda} is well approximated by the KRR estimator for the population problem (n=∞n=\infty), but with a larger value of the ridge regularization γ>λ\gamma>\lambda. In other words KRR acts as a shrinkage operator along the eigenfunctions of the kernel.

In random features models, we are free to choose the number of neurons NN. Equation (9) indicates that any choice of NN has roughly the same test error (which is also the test error of KRR) as long as N≫nN\gg n. This is interesting in both directions. First, the test error does not deteriorate as the number of parameters increases, and becomes much larger than the sample size. This contrasts with a naive measure of the model complexity: indeed, counting the number of parameters would naively suggest that N≫nN\gg n might hurt generalization. Second, the error does not improve with overparametrization either, as long as N≫nN\gg n.

At what level of overparametrization should we operate? In view of the previous point, it is sufficient to use a model with a number of parameters much larger than the sample size (formally, N≥n1+δN\geq n^{1+\delta} for some δ>0\delta>0, although this specific condition is mainly dictated by our proof technique). Further overparametrization does not improve the statistical behavior.

Let us also note that —as proven in [MM19]— choosing N/n=:ψ=O(1)N/n=:\psi=O(1) can lead to sub-optimal test error, with the suboptimality vanishing if ψ→∞\psi\to\infty after, N,n→∞N,n\to\infty.

3 Related literature

The test error of KRR was studied by a number of authors in the past [CDV07, JŞS+20], [Wai19, Theorem 13.17]. In particular, [CDV07] establishes that KRR achieves minimax optimal rates over certain subclasses of the associated RKHS. However these results require a strictly positive ridge regularizer (and hence do not cover interpolation) and characterize the decay of the error as n→∞n\to\infty in fixed dimension dd. In contrast our focus is on the case in which both dd and nn grow simultaneously. Further, we provide upper and lower bounds that hold pointwise (for a given target function f∗f_{*}) while earlier work mostly establish pointwise upper bound and minimax lower bounds (for the worst case f∗f_{*}). The recent work [JŞS+20] also derived pointwise upper and lower bounds for kernel ridge regression (but with strictly positive ridge regularizer), which is very similar to our Theorem 4. However, these results are based on a universality assumption whose validity is unclear in specific settings.

Recently, the ridge-less (interpolation) limit of KRR was studied by Liang, Rakhlin and Zhai [LR20, LRZ19]. Again, these authors provide minimax upper bounds that hold within the RKHS, holding for inner product kernel, when the feature vectors x{\bm{x}} have independent coordinates. Their results are related but not directly comparable to ours.

The complexity of training kernel machine scales at least quadratically in the sample size. This has motivated the development of randomized techniques to lower the complexity of training and testing. While our focus is on random features methods, alternative approaches are based on subsampling the columns-rows of the empirical kernel matrix, see e.g. [Bac13, AM15, RCR15]. In particular, [RCR15] compares the prediction errors using the sketched and the full kernel matrices, and shows that —for a fixed RKHS— it is sufficient to use a number of rows/columns of the order of the square root of the sample size in order to achieve the minimax rate over that RKHS.

The generalization properties of random features methods have been studied in a smaller number of papers [RR09, RR17, MWW20]. Rahimi and Recht [RR09] proved an upper bound of the order 1/N+1/n1/\sqrt{N}+1/\sqrt{n} on the generalization error. The insight provided by this bound is similar to one of our points: about N≍nN\asymp n neurons are sufficient for the error to be of the same order as for N→∞N\to\infty. On the other hand, [RR09] proves only a minimax upper bound, it is limited to Lipschitz losses, and, crucially, requires the coefficients max⁡i≤N∣ai∣≤C\max_{i\leq N}|a_{i}|\leq C so that ∥a∥22=O(N)\|{\bm{a}}\|_{2}^{2}=O(N). In contrast, in the present setting, we typically have ∥a∥22=Θ(nN)\|{\bm{a}}\|_{2}^{2}=\Theta(nN) The case of square loss was considered earlier by Rudi and Rosasco [RR17] who proved that, for a target function f∗f_{*} in the RKHS, N=Cnlog⁡nN=C\sqrt{n}\log n is sufficient to learn a random features model with test error of order 1/n1/\sqrt{n}. These authors interpret this finding as implying that roughly n\sqrt{n} random features are sufficient: we will discuss the difference between their setting and ours in Section 2.3.

Finally, [Bac15] studies optimized distributions for sampling the random features, while [YLM+12] provides a comparison between random features approaches and subsampling of the kernel matrix.

As pointed out above, we find that taking λ→0\lambda\to 0 yields nearly optimal test error, within our setting. Optimality of minimum norm interpolators has attracted considerable attention recently [BHMM19, BRT19, HMRT19, BLLT20, TB20]. In particular our results point in the same direction as the general analysis of ridge regression in [BLLT20, TB20]. Note however that the general results of [BLLT20, TB20] do not apply to the present setting because they require subgaussian features ϕ(xi){\bm{\phi}}({\bm{x}}_{i}). Further, they only provide upper and lower bounds that match up to factors depending on the condition number of a certain random matrix. In contrast, our characterization is specialized to the random features setting, does not require subgaussianity, and holds up to additive errors that are negligible compared to the null risk.

The present paper solves a number of open problems that were left open in our earlier work [GMMM19]. First of all, [GMMM19] only considered the cases n=∞n=\infty (approximation error of random features models) or N=∞N=\infty (generalization error of KRR). Here instead we establish the complete picture for both nn and NN finite. Second, [GMMM19] assumed a special data distribution (ν\nu was the uniform distribution over the dd-dimensional sphere), a special structure for the kernel (inner product kernels), and a special type of activation functions (depending on the inner product ⟨θ,x⟩)\langle{\bm{\theta}},{\bm{x}}\rangle)). The present paper considers general data distribution, kernel, and activation functions, under a set of assumptions that covers the previous example as a special case. Finally, the proofs of [GMMM19] made use of the moment method, which is difficult to generalize beyond special examples. Here we use a decoupling approach and matrix concentration methods which are significantly more flexible.

The results of [GMMM19] were generalized to certain anisotropic distributions in [GMMM20]. For the inner product activation functions on the sphere, the precise asymptotics (for N,n,d→∞N,n,d\to\infty with N/d→ψ1N/d\to\psi_{1}, n/d→ψ2n/d\to\psi_{2}, ψ1,ψ2∈(0,∞)\psi_{1},\psi_{2}\in(0,\infty)) of generalization error of random features models was calculated in [MM19].

4 Notations

Generalization error of random features ridge regression

In this section, we present our results on the generalization error of random features models. We begin in Section 2.1 by introducing the general abstract setting in which we work, and some of its basic properties. We then state our assumptions in Section 2.2, and state our main theorem (Theorem 1) in Section 2.3.

We consider two sequences of Polish probability spaces (Xd,νd)({\mathcal{X}}_{d},\nu_{d}) and (Ωd,τd)(\Omega_{d},\tau_{d}), indexed by an integer dd. We denote by L2(Xd)=L2(Xd,νd)L^{2}({\mathcal{X}}_{d})=L^{2}({\mathcal{X}}_{d},\nu_{d}) the space of square integrable functions on (Xd,νd)({\mathcal{X}}_{d},\nu_{d}), and by L2(Ωd)=L2(Ωd,τd)L^{2}(\Omega_{d})=L^{2}(\Omega_{d},\tau_{d}) the space of square integrable functions on (Ωd,τd)(\Omega_{d},\tau_{d}). Since (Xd,νd)({\mathcal{X}}_{d},\nu_{d}) and (Ωd,τd)(\Omega_{d},\tau_{d}) are standard probability spaces [Dud18, Theorem 13.1.1], it follows that L2(Xd)L^{2}({\mathcal{X}}_{d}) and L2(Ωd)L^{2}(\Omega_{d}) are separable.

While in simple examples we might assume Dd=L2(Xd){\mathcal{D}}_{d}=L^{2}({\mathcal{X}}_{d}), the extra flexibility afforded by a general subspace Dd⊆L2(Xd){\mathcal{D}}_{d}\subseteq L^{2}({\mathcal{X}}_{d}) allows to model some important applications [MMM21].

By Cauchy-Schwartz inequality, we have Ud∈L2(Ωd×Ωd)U_{d}\in L^{2}(\Omega_{d}\times\Omega_{d}) and Hd∈L2(Xd×Xd)H_{d}\in L^{2}({\mathcal{X}}_{d}\times{\mathcal{X}}_{d}).

(Here convergence holds in operator norm.) In terms of the kernel, these identities read

Here convergence holds in L2(Xd×Ωd)L^{2}({\mathcal{X}}_{d}\times\Omega_{d}), L2(Ωd×Ωd)L^{2}(\Omega_{d}\times\Omega_{d}), and L2(Xd×Xd)L^{2}({\mathcal{X}}_{d}\times{\mathcal{X}}_{d}).

where ∥⋅∥H\|\cdot\|_{{\mathcal{H}}} denotes the RKHS norm associated to H{\mathcal{H}}. In particular, H{\mathcal{H}} is dense in Dd{\mathcal{D}}_{d}, provided λd,j2>0\lambda_{d,j}^{2}>0 for all jj.

2 Assumptions

Let Θ=(θi)i∈[N]∼iidτd{\bm{\Theta}}=({\bm{\theta}}_{i})_{i\in[N]}\sim_{iid}\tau_{d}. We define the random features function class to be

Note that the factor 1/N1/N is immaterial here, and only introduced in order to match the definition of feature map and scalar product in Section 1.1.

We observe pairs (yi,xi)i∈[n](y_{i},{\bm{x}}_{i})_{i\in[n]}, with (xi)i∈[n]∼iidνd({\bm{x}}_{i})_{i\in[n]}\sim_{iid}\nu_{d}, and yi=fd(xi)+εiy_{i}=f_{d}({\bm{x}}_{i})+\varepsilon_{i}, fd∈L2(Xd)f_{d}\in L^{2}({\mathcal{X}}_{d}) and εi∼N(0,σε2)\varepsilon_{i}\sim{\sf N}(0,\sigma_{\varepsilon}^{2}) independently. We fit the coefficients (ai)i≤N(a_{i})_{i\leq N} using ridge regression, cf. Eq. (1) that we reproduce here

We allow λ\lambda to depend on the dimension parameter dd. The test error is given by

We say that the sequence of activation functions {σd}d≥1\{\sigma_{d}\}_{d\geq 1} satisfies the Feature Map Concentration Property (FMCP) with respect to the sequence {(N(d),M(d),n(d),m(d))}d≥1\{(N(d),{\mathsf{M}}(d),n(d),{\mathsf{m}}(d))\}_{d\geq 1} if there exists a sequence {u(d)}d≥1\{u(d)\}_{d\geq 1} with u(d)≥max⁡(M(d),m(d))u(d)\geq\max({\mathsf{M}}(d),{\mathsf{m}}(d)) such that the following hold.

(Hypercontractivity of finite eigenspaces)

(Hypercontractivity of finite eigenspaces on Dd{\mathcal{D}}_{d}.) For any integer k≥1k\geq 1, there exists CC such that, for any g∈Dd,≤u(d)=span(ψs,1≤s≤u(d))g\in{\mathcal{D}}_{d,\leq u(d)}={\rm span}(\psi_{s},1\leq s\leq u(d)), we have

(Hypercontractivity of finite eigenspaces on Vd{\mathcal{V}}_{d}.) For any integer k≥2k\geq 2, there exists C′C^{\prime} such that, for any g∈Vd,≤u(d)=span(ϕs,1≤s≤u(d))g\in{\mathcal{V}}_{d,\leq u(d)}={\rm span}(\phi_{s},1\leq s\leq u(d)), we have

(Properly decaying eigenvalues.) There exists a fixed δ0>0\delta_{0}>0, such that , for all dd large enough

(Hypercontractivity of the high degree part.) Let σd,>u(d)\sigma_{d,>u(d)} corresponds to the projection on the high degree part of σd\sigma_{d}. Then there exists a fixed δ0>0\delta_{0}>0 and an integer kk such that

(Concentration of diagonal elements) For (xi)i∈[n(d)]∼iidνd({\bm{x}}_{i})_{i\in[n(d)]}\sim_{iid}\nu_{d} and (θi)i∈[N(d)]∼iidτd({\bm{\theta}}_{i})_{i\in[N(d)]}\sim_{iid}\tau_{d}, we have

The second assumption (assumption (b)(b)) requires that the eigenvalues of kernel operators do not decay too rapidly. If this is not the case, the RKHS will be very close to a low-dimensional space. For instance, if λd,k2≍k−2α\lambda^{2}_{d,k}\asymp k^{-2\alpha}, α>0\alpha>0, then this condition holds as long as we take u(d)≥max⁡(N(d),n(d))2+δ0u(d)\geq\max(N(d),n(d))^{2+\delta_{0}} for some δ0>0\delta_{0}>0.

Finally, assumption (d)(d) concerns the diagonal elements of the kernel matrices. They require the truncated kernel functions Hd,>m(d)H_{d,>{\mathsf{m}}(d)} and Ud,>M(d)U_{d,>{\mathsf{M}}(d)} evaluated on covariates and weight vectors to have nearly constant diagonal values.

The second set of assumptions concerns the spectrum of the kernel operator, defined by the sequence of eigenvalues (λd,j2)j≥1(\lambda_{d,j}^{2})_{j\geq 1}. We require that the spectrum has a gap: the location of this gap dictates the relationship between N(d)N(d) and M(d){\mathsf{M}}(d) and between n(d)n(d) and m(d){\mathsf{m}}(d).

We say that the sequence of activation functions {σd}d≥1\{\sigma_{d}\}_{d\geq 1} has a spectral gap at level {(N(d),M(d),n(d),m(d))}d≥1\{(N(d),{\mathsf{M}}(d),n(d),{\mathsf{m}}(d))\}_{d\geq 1} if one of the following conditions (a)(a), (b)(b) hold for all dd large enough.

(Overparametrized regime.) We have N(d)≥n(d)N(d)\geq n(d) and

(Number of samples) There exists fixed δ0>0\delta_{0}>0 such that m(d)≤n(d)1−δ0{\mathsf{m}}(d)\leq n(d)^{1-\delta_{0}} and

(Number of features) There exists fixed δ0>0\delta_{0}>0 such that M(d)≤N(d)1−δ0{\mathsf{M}}(d)\leq N(d)^{1-\delta_{0}}, M(d)≥m(d){\mathsf{M}}(d)\geq{\mathsf{m}}(d) and

(Underparametrized regime) We have n(d)≥N(d)n(d)\geq N(d) and

(Number of features) There exists fixed δ0>0\delta_{0}>0 such that M(d)≤N(d)1−δ0{\mathsf{M}}(d)\leq N(d)^{1-\delta_{0}} and

(Number of samples) There exists fixed δ0>0\delta_{0}>0 such that m(d)≤n(d)1−δ0{\mathsf{m}}(d)\leq n(d)^{1-\delta_{0}}, m(d)≥M(d){\mathsf{m}}(d)\geq{\mathsf{M}}(d) and

The assumption of a spectral gap is useful in that it leads to a clear-cut separation in our main statement below. For instance, in the overparametrized regime n(d)≪N(d)n(d)\ll N(d), the projection of the target function onto Dd,≤m(d){\mathcal{D}}_{d,\leq{\mathsf{m}}(d)} is estimated with negligible error, while the projection onto Dd,>m(d){\mathcal{D}}_{d,>{\mathsf{m}}(d)} is estimated with . If there was no spectral gap, the transition would not be as sharp. However, we expect this to affect only target functions with a large projection onto eigenfunctions whose indices are close to m(d){\mathsf{m}}(d). In this sense, while restrictive, the spectral gap assumption can be in fact a good model for a more generic situation.

3 A general theorem

We are now in position to state our main results for random features ridge regression.

Let {fd∈Dd}d≥1\{f_{d}\in{\mathcal{D}}_{d}\}_{d\geq 1} be a sequence of functions, X=(xi)i∈[n(d)]{\bm{X}}=({\bm{x}}_{i})_{i\in[n(d)]} and Θ=(θj)j∈[N(d)]{\bm{\Theta}}=({\bm{\theta}}_{j})_{j\in[N(d)]} with (xi)i∈[n(d)]∼νd({\bm{x}}_{i})_{i\in[n(d)]}\sim\nu_{d} and (θj)j∈[N(d)]∼τd({\bm{\theta}}_{j})_{j\in[N(d)]}\sim\tau_{d} independently. Let yi=fd(xi)+εiy_{i}=f_{d}({\bm{x}}_{i})+\varepsilon_{i} and εi∼iidN(0,σε2)\varepsilon_{i}\sim_{iid}{\sf N}(0,\sigma_{\varepsilon}^{2}) for some σε>0\sigma_{\varepsilon}>0. Let {σd}d≥1\{\sigma_{d}\}_{d\geq 1} be a sequence of activation functions satisfying {(N(d),M(d),n(d),m(d))}d≥1\{(N(d),{\mathsf{M}}(d),n(d),{\mathsf{m}}(d))\}_{d\geq 1}-FMCP (Assumption 1) and spectral gap at level {(N(d),M(d),n(d),m(d)))}d≥1\{(N(d),{\mathsf{M}}(d),n(d),{\mathsf{m}}(d)))\}_{d\geq 1} (Assumption 2). Then the following hold for the test error of RFRR (see Eq. (17)):

The two limits N=∞N=\infty and n=∞n=\infty play a special role. For N=∞N=\infty, the random kernel HN(x1,x2)=N−1∑i=1Nσ(x1;θi)σ(x2;θi)H_{N}({\bm{x}}_{1},{\bm{x}}_{2})=N^{-1}\sum_{i=1}^{N}\sigma({\bm{x}}_{1};{\bm{\theta}}_{i})\sigma({\bm{x}}_{2};{\bm{\theta}}_{i}) converges to its expectation, and we recover KRR. While this case is not technically covered by Theorem 1, we establish the relevant characterization in Theorems 3 and 4.

In the case n=∞n=\infty the generalization error vanishes, and we are left with the approximation error. This case is covered separately in Appendix A. In both these limit cases we confirm the result that would have been obtained by naively setting N=∞N=\infty or n=∞n=\infty in the last theorem.

Notice that the sample size nn and the number of neurons NN play a nearly symmetric role in this statement, and the smallest of the two determines the test error. An important insight follows: in the present setting, the test error is nearly insensitive to the number of neurons as long as we take N≫nN\gg n. If we want to minimize computational complexity subject to achieving nearly optimal generalization properties, we should operate, say, at N≍n1+δN\asymp n^{1+\delta} for some small δ>0\delta>0.

It is instructive to compare this result with [RR17] which instead suggests N≍nlog⁡nN\asymp\sqrt{n}\log n. While our setting differs from the one of [RR17] in a number of technical aspects, we believe that the core difference between the two results lies in the treatment of the target function fdf_{d}. Simplifying, the recommendation of [RR17] is based on two results, the second of which proved in [CDV07] (with an abuse of notation, we indicate the number of neurons and sample size as arguments of RRF(fd)=RRF(fd;N,n)R_{{\rm RF}}(f_{d})=R_{{\rm RF}}(f_{d};N,n), and use N=∞N=\infty to denote the KRR limit case):

where b∈(1,∞)b\in(1,\infty) encodes the decay of eigenvalues of the kernelThe results of [CDV07, RR17] assume the weaker condition that inf⁡g∈H∥fd−g∥L2\inf_{g\in{\mathcal{H}}}\|f_{d}-g\|_{L^{2}} is achieved in H{\mathcal{H}}: since H{\mathcal{H}} is dense in L2(Xd)L^{2}({\mathcal{X}}_{d}) (provided the kernel is strictly positive definite), this is equivalent to fd∈Hf_{d}\in{\mathcal{H}}.. Now, considering the worst case decay b→1b\to 1, the error rate achieved by RFRR, cf. Eq. (23), is of the same order as the one achieved by KRR, cf. Eq. (24).

Note several differences with respect to our results: (i)(i) The analysis of [RR17, CDV07] is minimax, over balls in the RKHS, while our results hold pointwise, i.e., for a given function fdf_{d}; (ii)(ii) Optimality in [RR17] is established in terms of rates, i.e., up to multiplicative constant, while ours hold up to additive errors (multiplicative constants are exactly characterized); (iii)(iii) The results of [RR17, CDV07] apply to a fixed RKHS (in particular, a fixed dimension dd), while we study the case in which dd is large and N,n,dN,n,d are polynomially related.

Some of these distinction are also relevant in comparing our work to recent results on KRR. In particular points (i)(i) and (ii)(ii) apply when comparing with [LR20, LRZ19].

4 Examples: The binary hypercube and the sphere

In order to apply Theorem 1, we make the following assumption about σˉd\bar{\sigma}_{d}.

There exists an integer kk and constants c1<1c_{1}<1 and c0>0c_{0}>0, δ0>1/k\delta_{0}>1/k such that n≤N1−δ0n\leq N^{1-\delta_{0}} or N≤n1−δ0N\leq n^{1-\delta_{0}} and ∣σˉd(x)∣≤c0exp⁡(c1x2/(4k))|\bar{\sigma}_{d}(x)|\leq c_{0}\exp(c_{1}x^{2}/(4k)).

where e∈Ad{\bm{e}}\in{\mathcal{A}}_{d} is a fixed vector (it is easy to see that these quantities do not depend on e{\bm{e}}).

If Ad=\mathscrsfsQd{\mathcal{A}}_{d}={\mathscrsfs Q}^{d}, we have, for all dd large enough

Assumption (a)(a) requires nn, NN to be well separated and a technical integrability condition. The latter is necessary for the hypercontractivity condition in Assumption 1.(c)(c) to make sense.

Equations (26) and (27) (Assumption (b)(b)) are a quantitative version of a universality condition: if P‾kσˉd(⟨e,⋅⟩/d)=0{\overline{\mathsf{P}}}_{k}\bar{\sigma}_{d}(\langle{\bm{e}},\cdot\rangle/\sqrt{d})=0 for some kk, then linear combinations of σˉd\bar{\sigma}_{d} can only span a linear subspace of L2(Ad,ρd)L^{2}({\mathcal{A}}_{d},\rho_{d}). Equation (28) (Assumption (b)(b)) requires the high degree part of σˉd\bar{\sigma}_{d} to be non-vanishing (and therefore induce a non-zero regularization from the high degree non-linearity).

For Ad=\mathscrsfsQd{\mathcal{A}}_{d}={\mathscrsfs Q}^{d}, we further require Assumption (c)(c), namely that the last eigenvalues of σˉd\bar{\sigma}_{d} decrease sufficiently fast. This is a necessary conditions to avoid pathological sequences {σˉd}d≥1\{\bar{\sigma}_{d}\}_{d\geq 1} which are very rapidly oscillating.

If σˉd=σˉ\bar{\sigma}_{d}=\bar{\sigma} is independent of the dimension, then Assumptions (b)(b), (c)(c) are easy to check:

The third part of Assumption (b)(b) (Eq. (28)) amounts to requiring σˉ\bar{\sigma} not to be a degree-(2max⁡(s,S)+1)(2\max({\mathsf{s}},{\mathsf{S}})+1) polynomial.

In Appendix D.2 we check that Assumption (c)(c) holds if σˉ\bar{\sigma} is smooth and there exists c0>0c_{0}>0 and c1<1c_{1}<1 constants such that the (2max⁡(s,S)+2)(2\max({\mathsf{s}},{\mathsf{S}})+2)-th derivative verifies ∣σˉ(2max⁡(s,S)+2)(x)∣≤c0exp⁡(c1x2/4)|\bar{\sigma}^{(2\max({\mathsf{s}},{\mathsf{S}})+2)}(x)|\leq c_{0}\exp(c_{1}x^{2}/4).

Let {fd∈L2(Ad,ρd)}d≥1\{f_{d}\in L^{2}({\mathcal{A}}_{d},\rho_{d})\}_{d\geq 1} be a sequence of functions. Let Θ=(θi)i∈[N]{\bm{\Theta}}=({\bm{\theta}}_{i})_{i\in[N]} with (θi)i∈[N]∼ρd({\bm{\theta}}_{i})_{i\in[N]}\sim\rho_{d} independently and X=(xi)i∈[n]{\bm{X}}=({\bm{x}}_{i})_{i\in[n]} with (xi)i∈[n]∼ρd({\bm{x}}_{i})_{i\in[n]}\sim\rho_{d} independently. Let yi=fd(xi)+εiy_{i}=f_{d}({\bm{x}}_{i})+\varepsilon_{i} and εi∼iidN(0,σε2)\varepsilon_{i}\sim_{iid}{\sf N}(0,\sigma_{\varepsilon}^{2}) for some σε>0\sigma_{\varepsilon}>0. Assume ds+δ0≤n≤ds+1−δ0d^{{\mathsf{s}}+\delta_{0}}\leq n\leq d^{{\mathsf{s}}+1-\delta_{0}} and dS+δ0≤N≤dS+1−δ0d^{{\mathsf{S}}+\delta_{0}}\leq N\leq d^{{\mathsf{S}}+1-\delta_{0}} for fixed integers s,S{\mathsf{s}},{\mathsf{S}} and for some δ0>0\delta_{0}>0. Let {σˉd}d≥1\{\bar{\sigma}_{d}\}_{d\geq 1} satisfy Assumption 3 at level (s,S)({\mathsf{s}},{\mathsf{S}}). Then the following hold for the test error of RFRR (see Eq. (17)):

Assume N≥ndδN\geq nd^{\delta} for some δ>0\delta>0. Then for any regularization parameter λ=Od(1)\lambda=O_{d}(1) (including λ=0\lambda=0 identically), any η>0\eta>0 and ε>0\varepsilon>0, we have, with high probability,

Assume n≥Ndδn\geq Nd^{\delta} for some δ>0\delta>0. Then, for any regularization parameter λ=Od(n/N)\lambda=O_{d}(n/N) (including λ=0\lambda=0 identically), η>0\eta>0 and ε>0\varepsilon>0, we have, with high probability,

As mentioned in the introduction, [GMMM19] proves this theorem in the cases n=∞n=\infty (RF approximation error) and N=∞N=\infty (generalization error of KRR), for the uniform measure on the sphere. The general case follows here as a consequence of Theorem 1.

which matches the assumptions in Theorem 2.

We plot the observed average risk in the sample-size/number-of-parameters plane whose axes are log⁡n/log⁡d\log n/\log d and log⁡N/log⁡d\log N/\log d (corresponding to the exponents in the polynomial relation between nn and dd, and between NN and dd). Several prominent features of this plot are worth of note:

The risk has a large peak for N≈nN\approx n. This phenomenon was characterized precisely in the proportional regime N≍dN\asymp d, n≍dn\asymp d in [HMRT19, MM19].

The plot appears completely symmetric under exchange of NN and nn: the number of parameters and sample size plays the same role in limiting the generalization abilities, as anticipated by Theorem 1 and Theorem 2.

The risk is bounded away from zero even for N,n≍d3N,n\asymp d^{3}. Indeed, Theorem 2 implies that consistent estimation would require N,n≫d4N,n\gg d^{4} in this case.

Finally, for a fixed nn, near optimal test error is achieved when N≍n1+δ∗N\asymp n^{1+\delta_{*}}, for δ∗\delta_{*} a small positive constant.

Generalization error of kernel machines

Formally, kernel ridge regression (KRR) corresponds to the limit N→∞N\to\infty of random feature ridge regression. Despite this, we cannot apply directly Theorem 1 with N=∞N=\infty. We state therefore a separate theorems for kernel methods. As a side benefit, we establish somewhat stronger results in this case. In particular:

We simplify the set of assumptions (in particular, the assumptions concern only HdH_{d} and not the activation function σd\sigma_{d}, as they should).

We prove a risk lower bound, Theorem 3, that holds for general kernel methods, not only KRR.

Crucially, we remove the spectral gap assumption. In this more general setting, the risk of KRR is not approximated by the square norm of the projection of fdf_{d} orthogonal to the leading eigenfunctions of the kernel. We instead obtain an approximation in terms of a population-level ridge regression problem, with an effective value of the regularization parameter, which we determine.

Throughout this section, the setting is the same as in the previous one: we observe i.i.d. data (yi,xi)i∈[n](y_{i},{\bm{x}}_{i})_{i\in[n]}, with feature vectors xi{\bm{x}}_{i} from the probability space (Xd,νd)({\mathcal{X}}_{d},\nu_{d}). Responses are given by yi=fd(xi)+εiy_{i}=f_{d}({\bm{x}}_{i})+\varepsilon_{i}, fd∈Ddf_{d}\in{\mathcal{D}}_{d} and εi∼N(0,σε2)\varepsilon_{i}\sim{\sf N}(0,\sigma_{\varepsilon}^{2}) independently of xi{\bm{x}}_{i}.

We introduce some general background in Section 3.1, then state our assumptions in Section 3.2, and formally state our results in Sections 3.3 and 3.4.

Given a choice of this square root, we can rewrite the estimator (36) as f^λ(x)=f(x;a^λ)\hat{f}_{\lambda}({\bm{x}})=f({\bm{x}};{\hat{a}}_{\lambda}), where a^λ∈L2(Ωd;νd){\hat{a}}_{\lambda}\in L^{2}(\Omega_{d};\nu_{d}) and

This can be informally seen as the N→∞N\to\infty limit of Eq. (16) if we choose the square loss function.

2 Assumptions on the kernel

As for the case of RFRR, we collect our assumptions in two groups. The first one is mainly concerned with the concentration properties of the kernel, which are quantified in terms of the sequences of integers n(d)n(d), m(d){\mathsf{m}}(d).

(Hypercontractivity of finite eigenspaces.) For any fixed q≥1q\geq 1, there exists a constant CC such that, for any h∈Dd,≤u(d)=span(ψs,1≤s≤u(d))h\in{\mathcal{D}}_{d,\leq u(d)}={\rm span}(\psi_{s},1\leq s\leq u(d)), we have

(Properly decaying eigenvalues.) There exists fixed δ0>0\delta_{0}>0, such that, for all dd large enough,

(Concentration of diagonal elements of kernel) For (xi)i∈[n(d)]∼iidνd({\bm{x}}_{i})_{i\in[n(d)]}\sim_{iid}\nu_{d}, we have:

The next condition essentially connects the sample size n(d)n(d) to the eigenvalue index m(d){\mathsf{m}}(d), via the eigenvalues sequence.

There exists fixed δ0>0\delta_{0}>0, such that

There exists fixed δ0>0\delta_{0}>0, such that

Unlike in the case of RFRR, we do not require the existence of a spectral gap, but we assume two different upper bounds n(d)n(d) to hold simultaneously. In many cases of interest, the right hand sides of (45) and (46) have roughly the same value, which is given by the number of eigenvalues between λd,m(d)+1\lambda_{d,{\mathsf{m}}(d)+1} and c0λd,m(d)+1c_{0}\lambda_{d,{\mathsf{m}}(d)+1} for a small c0c_{0} (counting degeneracy). The technical requirement (b)(b) is mild and we do not know of any interesting counterexample.

3 Lower bound for general kernel methods

Consider any regression method of the form (36). By the representer theorem, there exist coefficients ζ^1,…,ζ^n\hat{\zeta}_{1},\dots,\hat{\zeta}_{n} such that

We are therefore led to define the following data-dependent prediction risk function for kernel methods

This is a lower bound on the prediction error of any kernel methods of the form (36).

The next theorem provides a lower bound on the generalization of kernel methods that is a consequence of the approximation bound in Theorem 5.(a)(a) derived for the random features model, in Appendix A.

This follows immediately from Theorem 5 (a)(a) stated in Appendix A. Indeed, setting σd(x,x′)=Hd(x,x′)\sigma_{d}({\bm{x}},{\bm{x}}^{\prime})=H_{d}({\bm{x}},{\bm{x}}^{\prime}), we obtain RH(fd,X)=RRF(fd,X)R_{H}(f_{d},{\bm{X}})=R_{{\rm RF}}(f_{d},{\bm{X}}), whence the claim follows by applying Eq. (57). ∎

Notice that RH(P≤m(d)fd,X)≥0R_{H}({\mathsf{P}}_{\leq{\mathsf{m}}(d)}f_{d},{\bm{X}})\geq 0 by construction and therefore this theorem immediately implies a lower bound of the test error of kernel ridge regression (cf. Eq. (37))

4 The risk of kernel ridge regression

where the kernel matrix H=(Hij)ij∈[n]{\bm{H}}=(H_{ij})_{ij\in[n]} is given by Hij=Hd(xi,xj)H_{ij}=H_{d}({\bm{x}}_{i},{\bm{x}}_{j}), and y=(y1,…,yn)T{\bm{y}}=(y_{1},\ldots,y_{n})^{\mathsf{T}}.

It is convenient to state our main results in terms of an effective ridge regression estimator

Further, the ridge regression estimator f^λ\hat{f}_{\lambda} is close to the effective estimator f^γ\mboxeff\mboxeff\hat{f}_{\gamma^{\mbox{\tiny\rm eff}}}^{\mbox{\tiny\rm eff}}, namely

The proof of Theorem 4 is deferred to Appendix C.

As mentioned above, we do not assume here any eigenvalue gap condition. However, formulas simplify if we assume an eigenvalue gap, e.g.:

Under this additional assumption, Theorem 4 implies the following simplified formula for the test error:

As anticipated, this coincides with the risk of RFRR, if we heuristically set N=∞N=\infty in Theorem 1.

Acknowledgnements

This work was supported by NSF through award DMS-2031883 and from the Simons Foundation through Award 814639 for the Collaboration on the Theoretical Foundations of Deep Learning We also acknowledge NSF grants CCF-2006489, IIS-1741162 and the ONR grant N00014-18-1-2729.

References

Appendix A Approximation error of random features model

In this section, we consider the approximation error of the random features function class. Formally, the approximation error can be seen as the generalization error of random features ridge regression for finite number of neurons N<∞N<\infty and infinite data n=∞n=\infty. However, we cannot apply directly Theorem 1 with n=∞n=\infty. We therefore state a separate theorem. This is also used to prove the lower bound of Theorem 3 on the generalization error of general kernel methods.

In Section A.1, we state our assumptions and theorem. Sections A.2 and A.3 provide a proof of the theorem, while Section A.4 gathers key technical concentration results that will also be used in the proofs of Theorem 1 and Theorem 4.

Recall the definition of the random features function class (see Section 2.1): let Θ=(θi)i∈[N]∼iidτd{\bm{\Theta}}=({\bm{\theta}}_{i})_{i\in[N]}\sim_{iid}\tau_{d},

We define the approximation error of the random features function class for a target function fd∈L2(Xd)f_{d}\in L^{2}({\mathcal{X}}_{d}) as

Similarly to Sections 2.2 and 3.2, we will quantify our assumptions on the sequences of probability spaces (Xd,νd)({\mathcal{X}}_{d},\nu_{d}) and (Ωd,τd)(\Omega_{d},\tau_{d}), and on the activation functions σd∈L2(Xd×Ωd)\sigma_{d}\in L^{2}({\mathcal{X}}_{d}\times\Omega_{d}), in terms of the sequences of integers N(d),M(d)N(d),{\mathsf{M}}(d). We state the assumptions in two groups: Assumption 6 and Assumption 7 deal respectively with the concentration properties and the spectrum of the sequence of feature kernel operator {Ud}d≥1\{U_{d}\}_{d\geq 1} defined as

(Hypercontractivity of finite eigenspaces.) For any fixed q≥1q\geq 1, there exists CC such that, for any g∈Vd,≤u(d)=span(ϕs,1≤s≤u(d))g\in{\mathcal{V}}_{d,\leq u(d)}={\rm span}(\phi_{s},1\leq s\leq u(d)), we have

(Properly decaying eigenvalues.) There exists a fixed δ0>0\delta_{0}>0, such that

(Upper bound on the diagonal elements of the kernel) For (θi)i∈[N(d)]∼iidτd({\bm{\theta}}_{i})_{i\in[N(d)]}\sim_{iid}\tau_{d} and any δ>0\delta>0, we have

(Lower bound on the diagonal elements of the kernel) For (θi)i∈[N(d)]∼iidτd({\bm{\theta}}_{i})_{i\in[N(d)]}\sim_{iid}\tau_{d} and any δ>0\delta>0, we have

There exists a fixed δ0>0\delta_{0}>0, such that

There exists a fixed δ0>0\delta_{0}>0, such that M(d)≤N(d)1−δ0{\mathsf{M}}(d)\leq N(d)^{1-\delta_{0}} and

In Assumption 6.(c)(c), we can replace Ud,>M(d)U_{d,>{\mathsf{M}}(d)} by Ud,>u(d)U_{d,>u(d)} (see Lemma 7).

We are now in position to state our theorem on the approximation error of the random features function class. We state the lower and upper bounds and their assumptions separately.

Let {fd∈Dd}d≥1\{f_{d}\in{\mathcal{D}}_{d}\}_{d\geq 1} be a sequence of functions and Θ=(θi)i∈[N(d)]{\bm{\Theta}}=({\bm{\theta}}_{i})_{i\in[N(d)]} with (θi)i∈[N(d)]∼τd({\bm{\theta}}_{i})_{i\in[N(d)]}\sim\tau_{d} independently. Let {σd}d≥1\{\sigma_{d}\}_{d\geq 1} be a sequence of activation functions satisfying Assumptions 6.(a) and 6.(b)(b) at level {M(d)}d≥1\{{\mathsf{M}}(d)\}_{d\geq 1}. Then the following hold for the approximation error of the random features class (see Eq. (56)):

(Lower bound) If {σd}d≥1\{\sigma_{d}\}_{d\geq 1} satisfies further Assumptions 6.(d)(d) and 7.(a), then we have

(Upper bound) If {σd}d≥1\{\sigma_{d}\}_{d\geq 1} satisfies further Assumptions 6.(c) and 7, then we have

Point (a)(a) is proved in Section A.2, while point (b)(b) is proved in Section A.3.

The lower bound on general kernel methods in Theorem 3 is obtained as a direct consequence of Theorem 5.(a), by taking σd(x,x′)=Hd(x,x′)\sigma_{d}({\bm{x}},{\bm{x}}^{\prime})=H_{d}({\bm{x}},{\bm{x}}^{\prime}). Indeed, it is easy to check that Eqs. (40) and (42) imply Assumptions 6.(a) and 6.(b)(b), Eq. (44) implies Assumptions 6.(c)(c) and 6.(d)(d), and Eq. (46) implies Assumption 7.(a).

A.2 Proof of Theorem 5.(a)𝑎(a): lower bound on the approximation error

Define the random vectors V=(V1,…,VN)T{\bm{V}}=(V_{1},\ldots,V_{N})^{\mathsf{T}}, V≤M=(V1,≤M,…,VN,≤M)T{\bm{V}}_{\leq{\mathsf{M}}}=(V_{1,\leq{\mathsf{M}}},\ldots,V_{N,\leq{\mathsf{M}}})^{\mathsf{T}}, V>M=(V1,>M,…,VN,>M)T{\bm{V}}_{>{\mathsf{M}}}=(V_{1,>{\mathsf{M}}},\ldots,V_{N,>{\mathsf{M}}})^{\mathsf{T}}, with

Define the random matrix U=(Uij)i,j∈[N]{\bm{U}}=(U_{ij})_{i,j\in[N]}, with

In what follows, we write RApp(fd)=RApp(fd,Θ)R_{{\rm App}}(f_{d})=R_{{\rm App}}(f_{d},{\bm{\Theta}}) for the approximation error of the random features model, omitting the dependence on the weights Θ{\bm{\Theta}}. By definition and a simple calculation, we have

where the last inequality used the fact that

By Eq. (60), to prove Theorem 5.(a)(a), we need to bound ∥U−1∥op∥V>M∥22\|{\bm{U}}^{-1}\|_{{\rm op}}\|{\bm{V}}_{>{\mathsf{M}}}\|_{2}^{2}. This is achieved in the two following propositions.

Let {fd∈Dd}\{f_{d}\in{\mathcal{D}}_{d}\} be a sequence of target functions. Define E>M{\mathcal{E}}_{>{\mathsf{M}}} by

This is a direct consequence of Theorem 6.(a)(a). ∎

Next, by Proposition 2 and Assumption 6.(d)(d), for any fixed δ>0\delta>0 with δ<δ′\delta<\delta^{\prime}, we have

Combining Eq. (64) with Eq. (60) proves Theorem 5.(a)(a).

A.3 Proof of Theorem 5.(b)𝑏(b): upper bound on the approximation error

In the following, we would like to calculate the quantity RApp(P≤Mfd,Θ)R_{{\rm App}}({\mathsf{P}}_{\leq{\mathsf{M}}}f_{d},{\bm{\Theta}}). We have

where V≤M=(V≤M,1,…,V≤M,N)T{\bm{V}}_{\leq{\mathsf{M}}}=(V_{\leq{\mathsf{M}},1},\ldots,V_{\leq{\mathsf{M}},N})^{\mathsf{T}} and U=(Uij)ij∈[N]{\bm{U}}=(U_{ij})_{ij\in[N]} with

By orthonormality of the (ψk)k≥1(\psi_{k})_{k\geq 1}, we have

The last equation is by Lemma 1 which is stated and proved below. This proves the theorem.

Let Assumptions 6.(a)(a), 6.(b)(b), 6.(c)(c) and 7 hold. Then we have

By the Sherman-Morrison-Woodbury formula, we have

By Assumption 7.(b)(b), there exists δ0>0\delta_{0}>0, such that

Combining the above equalities with Eq. (66) and choosing δ\delta such that 0<δ<δ00<\delta<\delta_{0}, we have

Combining with Eq. (65) proves the lemma. ∎

A.4 Structure of the empirical kernel matrix

Let Assumptions 6.(a)(a), 6.(b)(b) and 7.(a)(a) hold. Let (θi)i∈[N]∼τd({\bm{\theta}}_{i})_{i\in[N]}\sim\tau_{d} independently, and define U=(Uij)ij∈[N]{\bm{U}}=(U_{ij})_{ij\in[N]} with

There exists a fixed δ′>0\delta^{\prime}>0, such that

If further we assume M(d)≤N(d)1−δ0{\mathsf{M}}(d)\leq N(d)^{1-\delta_{0}} for a fixed δ0>0\delta_{0}>0, then we have

For S⊆{1,2,3,… }S\subseteq\{1,2,3,\dots\}, recall that

By decomposing the entries of U{\bm{U}} in the orthonormal basis {ϕj}j≥1\{\phi_{j}\}_{j\geq 1}, we can write U=U≤M+U>M{\bm{U}}={\bm{U}}_{\leq{\mathsf{M}}}+{\bm{U}}_{>{\mathsf{M}}} where

Taking q>1/δ0q>1/\delta_{0}, the right hand side become od(1)o_{d}(1) and Theorem 6.(b)(b) follows by Markov’s inequality.

The next proposition establishes a generalization of this fact for the case in which both DD and NN diverge.

Then for any q≥2q\geq 2, there exists K=K(q)K=K(q) that only depends on C(q)C(q), such that denoting δ≡K(q)Dlog⁡(D∨N)/N1−1/q\delta\equiv K(q)D\log(D\vee N)/N^{1-1/q}, we have

By the hypercontractivity assumption, cf. Eq. (69), we have

Applying Lemma 2 below proves the proposition. ∎

We state a key proposition) whose proof will be presented in Section A.5. The statement and the assumptions are self-contained.

When S⊆{1,2,3,…}S\subseteq\{1,2,3,\ldots\}, we denote

There exists a sequence {v(d)}d≥1\{v(d)\}_{d\geq 1}, such that for any fixed q≥1q\geq 1, there exists C=C(q,{v(d)}d≥1)C=C(q,\{v(d)\}_{d\geq 1}) such that, for any fd∈V^d,≤v(d)≡span(ϕ^s,1≤s≤v(d))f_{d}\in\widehat{\mathcal{V}}_{d,\leq v(d)}\equiv{\rm span}(\hat{\phi}_{s},1\leq s\leq v(d)), we have

For the same sequence {v(d)}d≥1\{v(d)\}_{d\geq 1} as in (A1), there exists fixed δ0>0\delta_{0}>0, such that

Then there exists δ′>0\delta^{\prime}>0, such that

A.5 Proof of Proposition 4

We begin by stating two key estimates which are used in the proof of Proposition 4. The notations of Lemma 3 follow the notations of Proposition 4. The notations and assumptions of Proposition 5 are self-contained. We collect a number of technical lemmas in Section A.5.1.

Consider the same setup as Proposition 4. Let {N(d)}d≥1\{N(d)\}_{d\geq 1} and {v(d)}d≥1\{v(d)\}_{d\geq 1} be two sequences, and assume that there exists δ0>0\delta_{0}>0 such that (this is Assumption (A2) in Proposition 4)

Then for any integer p>0p>0, there exists a constant K(p)K(p) which only depends on the constant C(p)C(p), such that

We are now in position to prove Proposition 4.

By Assumption (A2) and by Lemma 3, we have

Combining the equations in the last two displays proves the proposition. ∎

where the last equation is by Eq. (71). This proves the lemma. ∎

Note by the hypercontractivity assumption as in Eq. (72), we have

Step 5. Combining the equations. Combining Eq. (75), (76), and (77), we have

The following standard decoupling trick follows, for instance, from [Ver10] in Lemma 5.60.

Let {ϕk}1≤k≤Z⊆L2(Ω,τ)\{\phi_{k}\}_{1\leq k\leq Z}\subseteq L^{2}(\Omega,\tau) be a set of orthonormal functions. We assume that, for any fixed q≥1q\geq 1, there exists C=C(q)C=C(q), such that for any f∈span{ϕk:1≤k≤Z}f\in{\rm span}\{\phi_{k}:1\leq k\leq Z\}, we have

For θ,θ′∈Ω{\bm{\theta}},{\bm{\theta}}^{\prime}\in\Omega, we denote U‾(θ,θ′)=∑k=1Zλk2ϕk(θ)ϕk(θ′)\overline{U}({\bm{\theta}},{\bm{\theta}}^{\prime})=\sum_{k=1}^{Z}\lambda_{k}^{2}\phi_{k}({\bm{\theta}})\phi_{k}({\bm{\theta}}^{\prime}) where {λk}1≤k≤Z\{\lambda_{k}\}_{1\leq k\leq Z} are fixed real numbers. Then for any q≥1q\geq 1, we have

Here, inequality (a)(a) follows by applying the hypercontractivity inequality with respect to f(θ2)=∑k=1Zλk2ϕk(θ1)ϕk(θ2)f({\bm{\theta}}_{2})=\sum_{k=1}^{Z}\lambda_{k}^{2}\phi_{k}({\bm{\theta}}_{1})\phi_{k}({\bm{\theta}}_{2}) (and conditional on θ1{\bm{\theta}}_{1}). Equality (b)(b) by the fact that (ϕk)1≤k≤Z(\phi_{k})_{1\leq k\leq Z} are orthonormal functions. Inequality (c)(c) is by the Minkowski inequality. Inequality (d)(d) follows by applying the hypercontractivity inequality with respect to f(θ1)=ϕk(θ1)f({\bm{\theta}}_{1})=\phi_{k}({\bm{\theta}}_{1}). Equality (e)(e) holds because (ϕk)1≤k≤Z(\phi_{k})_{1\leq k\leq Z} are orthonormal functions. Finally, equality (f)(f) follows by simple calculation. This proves Eq. (78).

Here, inequality (a)(a) holds by Minkowski inequality. Inequality (b)(b) follows by applying the hypercontractivity inequality with respect to f(θ)=ϕk(θ)f({\bm{\theta}})=\phi_{k}({\bm{\theta}}). Equality (c)(c) holds because (ϕk)1≤k≤Z(\phi_{k})_{1\leq k\leq Z} are orthonormal functions, and equality (d)(d) by a simple calculation. This proves Eq. (79). ∎

Consider a sequence of probability spaces (Ωd,τd)(\Omega_{d},\tau_{d}) with {ϕd,k}k≥1\{\phi_{d,k}\}_{k\geq 1} an orthonormal basis of functions for Dd⊆L2(Ωd,τd){\mathcal{D}}_{d}\subseteq L^{2}(\Omega_{d},\tau_{d}). Assume that there exists a sequence of integers {u(d)}d≥1\{u(d)\}_{d\geq 1} such that the subspace Dd,≤u(d)=span(ϕd,k:1≤k≤u(d)){\mathcal{D}}_{d,\leq u(d)}={\rm span}(\phi_{d,k}:1\leq k\leq u(d)) is hypercontractive, i.e., for any fixed k≥1k\geq 1, there exists a constant CC such that, for any g∈Dd,≤u(d)g\in{\mathcal{D}}_{d,\leq u(d)}, we have

Let {Ud}d≥1\{U_{d}\}_{d\geq 1} be a sequence of positive definite kernels Ud∈L2(Ωd×Ωd)U_{d}\in L^{2}(\Omega_{d}\times\Omega_{d}) with

Furthermore, if we assume that for any δ>0\delta>0,

Let us decompose UdU_{d} in a high and low degree parts, Ud=Ud,≤u+Ud,>uU_{d}=U_{d,\leq u}+U_{d,>u} where

Hence, by Markov’s inequality and condition (80), we get for any δ>0\delta>0, taking qq sufficiently large,

The proof of Eq. (83) follows from a similar argument. ∎

Appendix B Generalization error of random features model: Proof of Theorem 1

In this section, we prove Theorem 1. The proof in the overparametrized regime is presented in Section B.1. The proof in the underparametrized regime follows from a very similar argument: we will omit it and simply add comments in the overparametrized proof where they differ.

We defer the proofs of some technical results to later sections. Section B.2 proves a key proposition on the structure of the feature matrix Z=(σd(xi;θj))i∈[n],j∈[N]{\bm{Z}}=(\sigma_{d}({\bm{x}}_{i};{\bm{\theta}}_{j}))_{i\in[n],j\in[N]}. Section B.3 gather some technical bounds necessary for the proof of Theorem 1. Finally, Section B.4 contains concentration results on the high degree part of the feature matrix.

In this section, we prove Theorem 1 in the overparametrized regime. We defer the proofs of some of the technical lemmas and matrix concentration results to Sections B.2, B.3 and B.4. The underparametrized case follows from the same proof with the following mapping n↔Nn\leftrightarrow N, m↔M{\mathsf{m}}\leftrightarrow{\mathsf{M}} and λ→λN=Nλ/n\lambda\rightarrow\lambda_{N}=N\lambda/n. We will add remarks in the proof when a difference arises.

Step 1. Rewrite the y{\bm{y}}, V{\bm{V}}, U{\bm{U}}, Z{\bm{Z}} matrices.

We recall that the random features ridge regression solution is given by

where V=(V1,…,VN)T{\bm{V}}=(V_{1},\ldots,V_{N})^{\mathsf{T}} and U=(Uij)ij∈[N]{\bm{U}}=(U_{ij})_{ij\in[N]}with

and U^λ=ZTZ/N+λIN\hat{{\bm{U}}}_{\lambda}={\bm{Z}}^{\mathsf{T}}{\bm{Z}}/N+\lambda{\mathbf{I}}_{N} is the (rescaled) regularized empirical kernel matrix

We recall that the eigendecomposition of σd\sigma_{d} is given by

We write the orthogonal decomposition of fdf_{d} in this basis as

Recall that y=(y1,…,yn)T=f+ε{\bm{y}}=(y_{1},\ldots,y_{n})^{\mathsf{T}}={\bm{f}}+{\bm{\varepsilon}} with

Using the above notations, we can decompose the vectors and matrices f{\bm{f}}, V{\bm{V}}, U{\bm{U}}, and as

We decompose the risk with respect to y=f+ε{\bm{y}}={\bm{f}}+{\bm{\varepsilon}} as follows

The proof relies on the following key result on the structure of the feature matrix Z{\bm{Z}}:

Follow the assumptions and the notations in the proof of Theorem 1 in the overparametrized regime (note in particular that N≥n1+δ0N\geq n^{1+\delta_{0}} and n≥m1+δ0n\geq{\mathsf{m}}^{1+\delta_{0}} for some fixed δ0>0\delta_{0}>0). Consider the singular value decomposition of Z=(Zij)i∈[n],j∈[N]{\bm{Z}}=(Z_{ij})_{i\in[n],j\in[N]} with Zij=σd(xi;θj)Z_{ij}=\sigma_{d}({\bm{x}}_{i};{\bm{\theta}}_{j}):

Then the singular value decomposition has the following properties:

Define Λ=diag((σi(Z/N))i∈[n]){\bm{\Lambda}}={\rm diag}((\sigma_{i}({\bm{Z}}/\sqrt{N}))_{i\in[n]}) the singular values (in non increasing order) of Z/N{\bm{Z}}/\sqrt{N}. Then the singular values verify

The left and right singular vectors associated to the (n−m)(n-{\mathsf{m}}) smallest singular values verify

We defer the proof of Proposition 6 to Section B.2.

Proposition 6 shows that the feature matrix Z=Z≤m+Z>m{\bm{Z}}={\bm{Z}}_{\leq{\mathsf{m}}}+{\bm{Z}}_{>{\mathsf{m}}} (cf. Eq. (85)) is a spiked matrix, with m{\mathsf{m}} spikes with singular values Λ1{\bm{\Lambda}}_{1} much larger than κ>m1/2\kappa_{>{\mathsf{m}}}^{1/2} coming from the low-degree part Z≤m{\bm{Z}}_{\leq{\mathsf{m}}} (in particular, Proposition 6.(b)(b) shows that the left and right singular vectors of the spikes are approximately spanned by the left and right singular vectors of Z≤m{\bm{Z}}_{\leq{\mathsf{m}}}) while the rest of the singular values are approximately constant equal to κ>m1/2\kappa_{>{\mathsf{m}}}^{1/2}. The proof of this proposition is based on the following observations:

Z≤m/N=ψ≤mD≤mϕ≤mT/N{\bm{Z}}_{\leq{\mathsf{m}}}/\sqrt{N}={\bm{\psi}}_{\leq{\mathsf{m}}}{\bm{D}}_{\leq{\mathsf{m}}}{\bm{\phi}}_{\leq{\mathsf{m}}}^{\mathsf{T}}/\sqrt{N} is a rank m{\mathsf{m}} matrix with

ψ≤m/n{\bm{\psi}}_{\leq{\mathsf{m}}}/\sqrt{n} and ϕ≤m/N{\bm{\phi}}_{\leq{\mathsf{m}}}/\sqrt{N} are approximately orthogonal matrices (see Eq. (105)).

Using Proposition 6, we can prove the following list of bounds that will be the main tools for the rest of the proof of Theorem 1.

Bounds on U^λ−1=(ZTZ/N+λIN)−1\hat{{\bm{U}}}_{\lambda}^{-1}=({\bm{Z}}^{\mathsf{T}}{\bm{Z}}/N+\lambda{\mathbf{I}}_{N})^{-1}:

The proof of Proposition 7 is deferred to Section B.3.

In the underparametrized case, the proofs and statements of Proposition 6 and Proposition 7.(a)(a) and 7.(c)(c) are symmetric under the mapping n↔Nn\leftrightarrow N, m↔M{\mathsf{m}}\leftrightarrow{\mathsf{M}} and λ→λN=Nλ/n\lambda\rightarrow\lambda_{N}=N\lambda/n. The bounds in Propositions 7.(b)(b) and 7.(d)(d) can be easily replaced by

In order to bound the term T22T_{22} in Eq. (100), we will further use the following bound

that we prove in Section B.3.5. It is easy to plug the new bounds below with the aforementioned mapping and check that the underparametrized case follows indeed from the same computation.

Recall that V≤m=ϕ≤mD≤mf^≤m{\bm{V}}_{\leq{\mathsf{m}}}={\bm{\phi}}_{\leq{\mathsf{m}}}{\bm{D}}_{\leq{\mathsf{m}}}\hat{\bm{f}}_{\leq{\mathsf{m}}} and f≤m=ψ≤mf^≤m{\bm{f}}_{\leq{\mathsf{m}}}={\bm{\psi}}_{\leq{\mathsf{m}}}\hat{\bm{f}}_{\leq{\mathsf{m}}}. Hence by Eq. (91) in Proposition 7.(a)(a), we have

Similarly by Eq. (92) in Proposition 7.(a)(a),

Using Proposition 7.(c)(c) and 7.(d)(d) as well as Eq. (94) in Proposition 7.(a)(a), we get

Combining Eqs. (95), (96) and (97) yields

Recalling U=ϕ≤mD≤m2ϕ≤mT+U>m{\bm{U}}={\bm{\phi}}_{\leq{\mathsf{m}}}{\bm{D}}_{\leq{\mathsf{m}}}^{2}{\bm{\phi}}_{\leq{\mathsf{m}}}^{\mathsf{T}}+{\bm{U}}_{>{\mathsf{m}}}, we can decompose T2T_{2} as

From Eqs. (91) and (92) in Proposition 7.(a)(a), we have

From Eq. (94) in Proposition 7.(a)(a) as well as Proposition 7.(b)(b), 7.(c)(c), the second term is bounded by

As a result, combining Eqs. (99) and (100), we have

Let us start with the term T3T_{3}. Decompose U=ϕ≤mD≤m2ϕ≤mT+U>m{\bm{U}}={\bm{\phi}}_{\leq{\mathsf{m}}}{\bm{D}}_{\leq{\mathsf{m}}}^{2}{\bm{\phi}}_{\leq{\mathsf{m}}}^{\mathsf{T}}+{\bm{U}}_{>{\mathsf{m}}}:

By Eq. (93) in Proposition 7.(a)(a), and since m≤n1−δ0{\mathsf{m}}\leq n^{1-\delta_{0}} by Assumption 2.(a)(a), we have

By Eq. (94) in Proposition 7.(a)(a) as well as Proposition 7.(b)(b), the second term is bounded by

Combining these two bounds and using Markov’s inequality, we get

Let us consider T4T_{4} term. Recall that we can decompose V=ϕ≤mD≤mf^≤m+V>m{\bm{V}}={\bm{\phi}}_{\leq{\mathsf{m}}}{\bm{D}}_{\leq{\mathsf{m}}}\hat{\bm{f}}_{\leq{\mathsf{m}}}+{\bm{V}}_{>{\mathsf{m}}},

We have by Eq. (93) in Proposition 7.(a)(a),

Combining the two above bounds, we get by Markov’s inequality

Let us consider the last term T5T_{5}. We have

By Eq. (92) in Proposition 7.(a)(a), and Proposition 7.(b)(b),

Combining Eqs. (98), (101), (102), (103) and (104), we have

B.2 Proof of Proposition 6: Structure of the feature matrix Z𝑍Z

Recall the definition Z=(σd(xi;θj))i∈[n],j∈[N]{\bm{Z}}=(\sigma_{d}({\bm{x}}_{i};{\bm{\theta}}_{j}))_{i\in[n],j\in[N]}. Recall the decomposition Z=Z≤m+Z>m{\bm{Z}}={\bm{Z}}_{\leq{\mathsf{m}}}+{\bm{Z}}_{>{\mathsf{m}}} into a low and high degree parts, as per Eq. (85). For convenience, we will consider the normalized quantities

Claim (a)(a). Bound on the singular values.

By Lemma 8 stated below in Section B.2.1, we have for i∈[n]i\in[n],

Using again Eq. (109), the n−mn-{\mathsf{m}} smallest singular values verify

Recalling Eq. (105) and Eq. (106), we have

which combined with Eq. (111) yields Eq. (88).

Part (b)(b). Left and right singular vectors.

Therefore, using the bounds (113) in Eq. (112), we get

We recall the following classical perturbation theory result.

Let A0{\bm{A}}_{0} be a n×Nn\times N-matrix with singular value decomposition

The next lemma implies that the projection of the noise matrix M{\bm{M}} on the top left singular vectors of the full matrix is approximately in the space orthogonal to the right singular vectors.

Let {N(d)}d≥1\{N(d)\}_{d\geq 1}, {n(d)}d≥1\{n(d)\}_{d\geq 1} and {m(d)}d≥1\{{\mathsf{m}}(d)\}_{d\geq 1} be three sequences of integers. For convenience, we denote N=N(d)N=N(d), n=n(d)n=n(d) and m=m(d){\mathsf{m}}={\mathsf{m}}(d). Assume that N≥n+mN\geq n+{\mathsf{m}} and n≥mn\geq{\mathsf{m}}. Consider the following sequence of random spiked matrices:

Recall that Λ1=diag((σ1,i(B))i∈[m]){\bm{\Lambda}}_{1}={\rm diag}((\sigma_{1,i}({\bm{B}}))_{i\in[{\mathsf{m}}]}). By Lemma 8, we have for any i∈[m]i\in[{\mathsf{m}}],

Step 3. The null space of the right eigenvectors Q{\bm{Q}}.

Projecting on the two orthogonal subspaces U0{\bm{U}}_{0} and U0,⊥{\bm{U}}_{0,\perp}, this is equivalent to

By construction, NTQ=0{\bm{N}}^{\mathsf{T}}{\bm{Q}}={\bm{0}} and using Eq. (123), we get

B.3 Proof of Proposition 7: technical bounds in the overparametrized regime

We prove the claims of this proposition in a different order than stated.

Let us now consider ψ≤mTf>m/n{\bm{\psi}}_{\leq{\mathsf{m}}}^{\mathsf{T}}{\bm{f}}_{>{\mathsf{m}}}/n. For any η>0\eta>0, we have

where the last inequality uses the hypercontractivity assumption of Assumption 1.(a)(a):

B.3.2 Proof of Proposition 7.(a)𝑎(a)

Let us decompose the first term along the large singular values Λ1{\bm{\Lambda}}_{1} and small singular values Λ2{\bm{\Lambda}}_{2}:

From Eqs. (87) and (89) in Proposition 6 and the assumption in the theorem λ=Od(1)⋅κ>m\lambda=O_{d}(1)\cdot\kappa_{>{\mathsf{m}}}, we have

By Eqs. (88) and (89) in Proposition 6, we get

Combining Eqs. (127) and (128) into Eq. (126) yields

The second term (129) can be decomposed as

which concludes the proof of the claims in Proposition 7.(a)(a).

B.3.3 Proof of Proposition 7.(b)𝑏(b)

Applying Theorem 6 to U>m{\bm{U}}_{>{\mathsf{m}}} (where the assumptions are satisfied by Assumptions 1.(a)(a) and (b)(b) and Assumption 2.(a)(a)), we get with Assumption 1.(d)(d),

By Proposition 3 (assumptions satisfied by Assumptions 1.(a)(a) and 2.(a)(a)), we get

B.3.4 Proof of Proposition 7.(d)𝑑(d)

Taking the expectation over (θ1,…,θN)({\bm{\theta}}_{1},\ldots,{\bm{\theta}}_{N}), we get

B.3.5 Bounds in the underparametrized regime

In the underparametrized case, we further prove the following lemma.

Follow the assumptions of Theorem 1 in the underparametrized case as well as the notations in Section B.1. Then, we have

Recall the decomposition of Z>M{\bm{Z}}_{>{\mathsf{M}}} in the eigenbasis of functions:

Consider the expected square norm (with respect to Θ=(θj)j∈[N]{\bm{\Theta}}=({\bm{\theta}}_{j})_{j\in[N]})

Consider the first term depending on Hd,M:mH_{d,{\mathsf{M}}:{\mathsf{m}}}. Using the same computation as in the proof of Proposition 7.(c)(c) and Lemma 6 (with the hypercontractivity assumption up to u≥mu\geq{\mathsf{m}} of Assumption 1.(a)(a)), by Hölder’s inequality we have for the qq

We deduce by Markov’s inequality that the first term is bounded by

For the second term, recall that by Assumption 1.(d)(d), we have

Taking the expectation of the third term gives

Merging Eqs. (137), (138) and (139), we get

Step 2. Bound on ∥U^λ−1ZTf/n∥2\|\hat{{\bm{U}}}_{\lambda}^{-1}{\bm{Z}}^{\mathsf{T}}{\bm{f}}/n\|_{2}.

By Proposition 6.(a)(a) in the underparametrized case, we have

Combining Eqs. (141) and (142) yields Eq. (136). ∎

We recall the following standard result on concentration of random matrices with independent rows:

where η=CΓlog⁡(min⁡(p,q))p\eta=C\sqrt{\frac{\Gamma\log(\min(p,q))}{p}} and CC is an absolute constant.

We will also use the following corollary for asymmetric matrices:

where η=C(Γa+Γb)log⁡(min⁡(n,N,m))n\eta=C\sqrt{\frac{(\Gamma_{\bm{a}}+\Gamma_{\bm{b}})\log(\min(n,N,{\mathsf{m}}))}{n}} and CC is an absolute constant.

where η=CΓlog⁡(min⁡(n,N+m))n\eta=C\sqrt{\frac{\Gamma\log(\min(n,N+{\mathsf{m}}))}{n}} with

Notice that ∥Σc∥op≤C(∥Σa∥op+∥Σb∥op)\|{\bm{\Sigma}}_{\bm{c}}\|_{{\rm op}}\leq C(\|{\bm{\Sigma}}_{\bm{a}}\|_{\rm op}+\|{\bm{\Sigma}}_{\bm{b}}\|_{\rm op}), and

Combining these bounds yields Eq. (143). ∎

Consider the feature matrix Z=(σd(xi;θj))i∈[n],j∈[N]{\bm{Z}}=(\sigma_{d}({\bm{x}}_{i};{\bm{\theta}}_{j}))_{i\in[n],j\in[N]}. We recall the decomposition Z=Z≤m+Z>m{\bm{Z}}={\bm{Z}}_{\leq{\mathsf{m}}}+{\bm{Z}}_{>{\mathsf{m}}} into a low and high degree parts:

We prove the following concentration result on Z>m{\bm{Z}}_{>{\mathsf{m}}}.

Consider the overparametrized case N(d)≥n(d)1+δ0N(d)\geq n(d)^{1+\delta_{0}} for some fixed δ0>0\delta_{0}>0. Let {σd}d≥1\{\sigma_{d}\}_{d\geq 1} be a sequence of activation functions satisfying the feature map concentration (Assumption 1) and the spectral gap (Assumption 2) at level {(N(d),M(d),n(d),m(d))}d≥1\{(N(d),{\mathsf{M}}(d),n(d),{\mathsf{m}}(d))\}_{d\geq 1}. Then, we have

Step 1. Bound on ∥Z>mZ>mT/N−κ>mIn∥op\|{\bm{Z}}_{>{\mathsf{m}}}{\bm{Z}}_{>{\mathsf{m}}}^{\mathsf{T}}/N-\kappa_{>{\mathsf{m}}}{\mathbf{I}}_{n}\|_{\rm op}.

Let us decompose σ>m\sigma_{>{\mathsf{m}}} into a low and high degree parts σ>m=σm:u+σ>u\sigma_{>{\mathsf{m}}}=\sigma_{{\mathsf{m}}:u}+\sigma_{>u} (recall that u(d)>m(d)u(d)>{\mathsf{m}}(d)):

Let q>0q>0 be an integer as in Assumption 1.(c)(c). We have

By Jensen’s inequality and Assumption 1.(c)(c), there exists a fixed δ0>0\delta_{0}>0 such that

Similarly, by the hypercontractivity assumption (Assumption 1.(a)(a)), we have

where κm:u=∑k=m+1uλk2\kappa_{{\mathsf{m}}:u}=\sum_{k={\mathsf{m}}+1}^{u}\lambda_{k}^{2}. Hence, by Markov’s inequality, we get

Step 2. Bound on ∥Z>mϕ≤m/N∥op\|{\bm{Z}}_{>{\mathsf{m}}}{\bm{\phi}}_{\leq{\mathsf{m}}}/N\|_{\rm op}.

Then by Corollary 1 applied to ATB/N{\bm{A}}^{\mathsf{T}}{\bm{B}}/N and recalling the assumption on qq in Assumption 1.(c)(c), we have

which concludes the proof by Markov’s inequality.

Appendix C Generalization error of kernel ridge regression: Proof of Theorem 4

In this section, we prove Theorem 4. We will then prove a different version of the same theorem in Section C.2, under somewhat different assumptions. Namely, we will relax Assumption 4.(c)(c) and instead impose a gap condition on the eigenvalues of the kernel.

Step 1. Expressing the risk in terms of empirical kernel matrix.

Recall that the KRR estimator is given by

where E=(E1,…,En)T{\bm{E}}=(E_{1},\ldots,E_{n})^{\mathsf{T}}, M=(Mij)ij∈[n]{\bm{M}}=(M_{ij})_{ij\in[n]} and H=(Hij)ij∈[n]{\bm{H}}=(H_{ij})_{ij\in[n]} are defined by

We recall that the eigendecomposition of HdH_{d} is given by

We write the orthogonal decomposition of fdf_{d} in the basis {ψk}k≥1\{\psi_{k}\}_{k\geq 1} as

We decompose the vectors and matrices f{\bm{f}}, E{\bm{E}}, H{\bm{H}}, and M{\bm{M}} in terms of orthogonal basis

Recalling y=f+ε{\bm{y}}={\bm{f}}+{\bm{\varepsilon}}, we decompose the risk as follows

By Lemma 12 which is stated in Section C.1.1 below, we have

Note that S≤m⪯Im{\bm{S}}_{\leq{\mathsf{m}}}\preceq{\mathbf{I}}_{{\mathsf{m}}} and we have

where the last inequality used the hypercontractivity assumption as in Assumption 4.(a)(a). Moreover

Using the last two displays, and the fact that m(d)≤n(d)1−δ{\mathsf{m}}(d)\leq n(d)^{1-\delta} by Assumption 5.(b)(b),

Using Cauchy-Schwarz inequality for T22T_{22}, we get

As a result, combining Eqs. (154), (155) and (156), we have

By Lemma 13 stated in Section C.1.1 below, we have

Using Cauchy-Schwarz inequality for T12T_{12}, and by the expression M=Ψ≤mD≤m4Ψ≤mT+κM(IM+ΔM){\bm{M}}={\bm{\Psi}}_{\leq{\mathsf{m}}}{\bm{D}}_{\leq{\mathsf{m}}}^{4}{\bm{\Psi}}_{\leq{\mathsf{m}}}^{\mathsf{T}}+\kappa_{M}({\mathbf{I}}_{M}+{\bm{\Delta}}_{M}), cf. Eq. (149), we get with high probability

Here (a)(a) follows by Cauchy-Schwarz; (b)(b) by the definition of norm; (c)(c) because M⪰Ψ≤mD≤m4Ψ≤mT+κM(I+ΔM)⪰Ψ≤mD≤m4Ψ≤mT{\bm{M}}\succeq{\bm{\Psi}}_{\leq{\mathsf{m}}}{\bm{D}}_{\leq{\mathsf{m}}}^{4}{\bm{\Psi}}_{\leq{\mathsf{m}}}^{\mathsf{T}}+\kappa_{M}({\mathbf{I}}+{\bm{\Delta}}_{M})\succeq{\bm{\Psi}}_{\leq{\mathsf{m}}}{\bm{D}}_{\leq{\mathsf{m}}}^{4}{\bm{\Psi}}_{\leq{\mathsf{m}}}^{\mathsf{T}}; (d)(d) by the definition of T23T_{23} as in Eq. (152); (e)(e) by Eq. (155).

By Proposition 3 and noting that S≤m⪯Im{\bm{S}}_{\leq{\mathsf{m}}}\preceq{\mathbf{I}}_{{\mathsf{m}}}, we have

Further notice that, using Lemma 12 (stated below) followed by Proposition 3, we get

We decompose T5T_{5} using f=f≤m+f>m{\bm{f}}={\bm{f}}_{\leq{\mathsf{m}}}+{\bm{f}}_{>{\mathsf{m}}},

where the last equality follows by Eq. (154). Similarly, we get

Combining Eqs. (157), (161), (162), (165) and (166), we have

Recall the expression (52) of f^γ\mboxeff\mboxeff\hat{f}_{\gamma^{\mbox{\tiny\rm eff}}}^{\mbox{\tiny\rm eff}}:

with γ\mboxeff=λ+κH\gamma^{\mbox{\tiny\rm eff}}=\lambda+\kappa_{H}. From Assumption 5.(a)(a), we have max⁡j>mλd,j2=od(1)⋅κH/n\max_{j>{\mathsf{m}}}\lambda_{d,j}^{2}=o_{d}(1)\cdot\kappa_{H}/n and we deduce

Proceeding analogously (with f^γ\mboxeff\mboxeff\hat{f}^{\mbox{\tiny\rm eff}}_{\gamma^{\mbox{\tiny\rm eff}}} replacing fdf_{d}) we obtain

Follow the assumptions and notations in the proof of Theorem 4. We have

where S≤m{\bm{S}}_{\leq{\mathsf{m}}} is the shrinkage matrix defined in Equation (151).

For T1T_{1}, by Eqs. (167) and (168), we have,

By Eq. (46) in Assumption 5.(a)(a), we have

For T2T_{2}, by the Sherman-Morrison-Woodbury formula, we have, setting ΔH′=κHΔH/(λ+κH){\bm{\Delta}}_{H}^{\prime}=\kappa_{H}{\bm{\Delta}}_{H}/(\lambda+\kappa_{H}),

Denote S:=S≤m=[Im+(κH+λ)(nD2)−1]−1{\bm{S}}:={\bm{S}}_{\leq{\mathsf{m}}}=[{\mathbf{I}}_{\mathsf{m}}+(\kappa_{H}+\lambda)(n{\bm{D}}^{2})^{-1}]^{-1}. We have

Follow the assumptions and notations in the proof of Theorem 4. We have

where S≤m{\bm{S}}_{\leq{\mathsf{m}}} is the shrinkage matrix defined in Equation (151).

where E=In+ΔH{\bm{E}}={\mathbf{I}}_{n}+{\bm{\Delta}}_{H} and R=[(κH+λ)(nD2)−1+ΨTE−1Ψ/n]−1{\bm{R}}=[(\kappa_{H}+\lambda)(n{\bm{D}}^{2})^{-1}+{\bm{\Psi}}^{\mathsf{T}}{\bm{E}}^{-1}{\bm{\Psi}}/n]^{-1}. We have

C.2 Kernel ridge regression under relaxed assumptions on the diagonal

In this section, we state and prove a version of Theorem 4 that holds under weaker assumptions. Namely, instead of the concentration bound in Assumption 4.(c)(c) we only require that the diagonal terms are upper bounded by a sub-polynomial factors times their expectation. Instead, we assume a spectral gap condition that was not required in the previous section.

We will first describe the modified assumption, then state the new version of the theorem. The proof is very similar to the one in the previous section. We will therefore use the same notations and only sketch the differences.

We assume the kernel concentration property at level {(n(d),m(d))}d≥1\{(n(d),{\mathsf{m}}(d))\}_{d\geq 1}, as stated in Assumption 4, with condition (c)(c) replaced by the following

(Upper bound on the diagonal elements of the kernel) For (xi)i∈[n(d)]∼iidνd({\bm{x}}_{i})_{i\in[n(d)]}\sim_{iid}\nu_{d} and any δ>0\delta>0, we have

We assume the eigenvalue condition Assumption 5 and, in addition, the following to hold

There exists a fixed δ0>0\delta_{0}>0, such that

For (xi)i∈[n(d)]∼iidνd({\bm{x}}_{i})_{i\in[n(d)]}\sim_{iid}\nu_{d} and any δ>0\delta>0, we have

Throughout this section, we will denote δ0>0\delta_{0}>0 a fixed constant and δ>0\delta>0 a constant that can be arbitrarily small. The value of δ0\delta_{0} is allowed to change from line to line.

By the spectral gap condition (Assumption 9), the population estimator f^γ\mboxeff\mboxeff\hat{f}_{\gamma^{\mbox{\tiny\rm eff}}}^{\mbox{\tiny\rm eff}} defined in Eq. (52) is approximately given by

Similarly, the shrinkage matrix defined in Eq. (151) verifies

and there exists a fixed δ0>0\delta_{0}>0 such that

From Lemma 7 applied to ΛH{\bm{\Lambda}}_{H} and ΛM{\bm{\Lambda}}_{M} with Assumptions 4.(a)(a) and 8.(c′)(c^{\prime}), we have

Furthermore from Assumption 10 and Eq. (176), we have for any δ<δ′\delta<\delta^{\prime},

Below we detail the proof of the updated auxiliary lemmas from Section C.1.1. Eq. (179) is used to bound the term T21T_{21}, Eq. (180) is used to bound the term T23T_{23}, while Eq. (181) is used to bound the term T3T_{3}, T4T_{4} and T5T_{5}.

Follow the assumptions of Theorem 8 and the same notations as in Section C.1. Define

Then, there exists a fixed δ0>0\delta_{0}>0 such that for any δ>0\delta>0,

Recall that we denote δ0>0\delta_{0}>0 a fixed constant and δ>0\delta>0 a constant that can be arbitrarily small. The value of δ0\delta_{0} is allowed to change from line to line.

Following the notations as in the proof of Lemma 12, we have

Consider the same decomposition G=T1+T2{\bm{G}}={\bm{T}}_{1}+{\bm{T}}_{2} as in the proof of Lemma 12, where

For T1{\bm{T}}_{1}, by Eqs. (177) and (178), we have for any δ>0\delta>0,

By Eq. (46) in Assumption 5.(a)(a), we have

Hence, taking δ\delta sufficiently small in Eq. (169) yields

Step 2. Simplifying the term T2{\bm{T}}_{2}.

Introduce A=ΛH+Δ+(λ/κH)⋅In{\bm{A}}={\bm{\Lambda}}_{H}+{\bm{\Delta}}+(\lambda/\kappa_{H})\cdot{\mathbf{I}}_{n} so that

By the Sherman-Morrison-Woodbury formula, we have

Denote {\bm{R}}={\bm{S}}^{-1}{\bm{\psi}}\big{(}{\bm{\psi}}^{\mathsf{T}}{\bm{S}}^{-1}{\bm{\psi}}/n\big{)}^{-2}{\bm{\psi}}^{\mathsf{T}}{\bm{S}}^{-1}/n.

for any δ>0\delta>0, which proves Eq. (181). Similarly,

Denote S=diag((si)i∈[n]){\bm{S}}={\rm diag}((s_{i})_{i\in[n]}) and recall the decomposition

Follow the assumptions of Theorem 8 and the same notations as in Section C.1. There exists a fixed δ0>0\delta_{0}>0 such that

We follow the same argument as in Lemma 13. We have

where we denoted A=ΛH+Δ+(λ/κH)⋅I{\bm{A}}={\bm{\Lambda}}_{H}+{\bm{\Delta}}+(\lambda/\kappa_{H})\cdot{\mathbf{I}}. By the Sherman-Morrison-Woodbury formula, we have

Taking δ\delta sufficiently small concludes the proof. ∎

Appendix D Proof of Theorem 2: generalization error of RFRR on the sphere and hypercube

We check that Assumption 3 implies the assumptions of Theorem 1 on the sphere (Section D.1) and on the hypercube (Section D.2).

Step 1. Diagonalization of the activation function and choosing m=m(d){\mathsf{m}}={\mathsf{m}}(d), M=M(d){\mathsf{M}}={\mathsf{M}}(d).

By rotational invariance, we can decompose σˉ\bar{\sigma} in the basis of spherical harmonics (see Section E.1)

where the distinct eigenvalues are ξd,k\xi_{d,k} with degeneracy

Denote {λd,j}j≥1\{\lambda_{d,j}\}_{j\geq 1} the eigenvalues {ξd,k}k≥0\{\xi_{d,k}\}_{k\geq 0} with their degeneracy in non increasing order of their absolute value. Set M{\mathsf{M}} and m{\mathsf{m}} to be the number of eigenvalues associated to spherical harmonics of degree less or equal to S{\mathsf{S}} and s{\mathsf{s}} respectively, i.e.,

Notice that Eqs. (184) and (186) imply that (λd,j)j≤m(\lambda_{d,j})_{j\leq{\mathsf{m}}} corresponds exactly to all the eigenvalues associated to spherical harmonics of degree less or equal to s{\mathsf{s}}. Similarly Eqs. (185) and (187) imply that (λd,j)j≤M(\lambda_{d,j})_{j\leq{\mathsf{M}}} corresponds exactly to all the eigenvalues associated to spherical harmonics of degree less or equal to S{\mathsf{S}}.

Step 2. Checking the assumptions at level {(N(d),M(d),n(d),m(d))}d≥1\{(N(d),{\mathsf{M}}(d),n(d),{\mathsf{m}}(d))\}_{d\geq 1}.

We are now in position to verify the assumptions of Theorem 1. Choose u:=u(d)u:=u(d) to be the number of eigenvalues with absolute value Ωd(d−2max⁡(s,S)−2+δ)\Omega_{d}(d^{-2\max({\mathsf{s}},{\mathsf{S}})-2+\delta}) for some δ>0\delta>0 that will be chosen small enough, see Eq. (191). In particular, (λd,j)j∈[u](\lambda_{d,j})_{j\in[u]} contains all the eigenvalues associated to the spherical harmonics of degree less or equal to max⁡(S,s)\max({\mathsf{S}},{\mathsf{s}}), and none of the eigenvalues associated to spherical harmonics of degree 2max⁡(S,s)+22\max({\mathsf{S}},{\mathsf{s}})+2 and bigger. We therefore must have u≥max⁡(M(d),m(d))u\geq\max({\mathsf{M}}(d),{\mathsf{m}}(d)).

Let us verify the conditions of (N,M,n,m)(N,{\mathsf{M}},n,{\mathsf{m}})-FMCP in Assumption 1 with the sequence of integers u(d)u(d):

The hypercontractivity of the space of polynomials of degree less or equal 2max⁡(S,s)+12\max({\mathsf{S}},{\mathsf{s}})+1 is a consequence of a classical result due to Beckner [Bec92] (see Section E.3).

Let us lower bound the right-hand side of Eq. (18). We have

for δ>0\delta>0 small enough, where we recall that n≤ds+1−δ0n\leq d^{{\mathsf{s}}+1-\delta_{0}} and N≤dS+1−δ0N\leq d^{{\mathsf{S}}+1-\delta_{0}} for some fixed δ0>0\delta_{0}>0.

From Eq. (28) in Assumption 3, we only need to check that for qq such that

Denote SS the set of eigenvalues λd,j\lambda_{d,j}, with j>uj>u, associated to spherical harmonics of degree less of equal to 2max⁡(s,S)+12\max({\mathsf{s}},{\mathsf{S}})+1. By triangular inequality, we have

where we used that PSσˉd{\mathsf{P}}_{S}\bar{\sigma}_{d} is a polynomial of degree less or equal to 2max⁡(S,s)+12\max({\mathsf{S}},{\mathsf{s}})+1 in each variable x{\bm{x}} and θ{\bm{\theta}} and satisfies the hypercontractivity property (see Lemma 6), i.e.,

while the bound on P‾>2max⁡(s,S)+1σˉd{\overline{\mathsf{P}}}_{>2\max({\mathsf{s}},{\mathsf{S}})+1}\bar{\sigma}_{d} follows from Assumption 3.(a)(a) and Lemma 16 stated below.

This is automatically verified because the diagonal elements are constant in this case (Eq. (190)).

Next, we check Assumption 2 at level (N,M,n,m)(N,{\mathsf{M}},n,{\mathsf{m}}). Consider the overparametrized case N(d)≥n(d)N(d)\geq n(d), and therefore M≥m{\mathsf{M}}\geq{\mathsf{m}}. The underparametrized case N(d)≤n(d)N(d)\leq n(d) is treated analogously.

The eigenvalue sums in Eq. (19) can be estimated as follows

The last equality in (192) follows from Eq. (183) and the assumption (186), Hence condition (19) in Assumption 2 is satisfied since, by the statement of Theorem 2, we assume ds+δ≤n≤ds+1−δd^{{\mathsf{s}}+\delta}\leq n\leq d^{{\mathsf{s}}+1-\delta}. Furthermore, by Eq. (189), we have m≤n1−δ{\mathsf{m}}\leq n^{1-\delta} for some δ>0\delta>0 chosen small enough.

Hence condition (20) in Assumption 2 is satisfied since, by the statement of Theorem 2, N≤dS+1−δ0N\leq d^{{\mathsf{S}}+1-\delta_{0}}. By Eq. (189), we have M≤N1−δ{\mathsf{M}}\leq N^{1-\delta} for some δ>0\delta>0 chosen small enough.

Furthermore, recall that τd1(dx)=Cd(1−x2/d)(d−3)/21x∈[−d,d]dx≤Cexp⁡(−x2/2)dx\tau_{d}^{1}({\rm d}x)=C_{d}(1-x^{2}/d)^{(d-3)/2}\bm{1}_{x\in[-\sqrt{d},\sqrt{d}]}{\rm d}x\leq C\exp(-x^{2}/2){\rm d}x. We can therefore upper bound the right hand side of Eq. (196) and use dominated convergence, which concludes the proof. ∎

D.2 On the hypercube

The proof for the hypercube \mathscrsfsQd{\mathscrsfs Q}^{d} follows from the same proof as for the sphere. We refer tp [O’D14] for background on Fourier analysis on \mathscrsfsQd{\mathscrsfs Q}^{d}, and Section E.2 for notations that make the analogy with the sphere transparent. In particular, an analogous of Lemma 16 follows by noticing that the law ⟨1,x⟩/d\langle\bm{1},{\bm{x}}\rangle/\sqrt{d} is a standardized binomial, which can be in terms of the standard normal distribution, times polynomial factors. The only difference comes from the degeneracy

Let us check that Assumption 3.(c)(c) holds for a class of smooth activation functions. We believe that indeed this assumption holds much more generally, but we leave such generalizations to future work.

where ξd,d−k(σˉ)=⟨σˉ(⟨e, ⋅ ⟩),Qd−k(d⟨e,⋅⟩)⟩L2(\mathscrsfsQd)\xi_{d,d-k}(\bar{\sigma})=\langle\bar{\sigma}(\langle{\bm{e}},\,\cdot\,\rangle),Q_{d-k}(\sqrt{d}\langle{\bm{e}},\cdot\rangle)\rangle_{L^{2}({\mathscrsfs Q}^{d})}, and QkQ_{k} is the kk-th hypercubic Gegenbauer polynomial (see Appendix E.2).

where we used that XX converges weakly to the standard normal distribution and dominated convergence. ∎

Appendix E Technical background

The dimension of each subspace is given by

E.1.2 Gegenbauer polynomials

We will use the following properties of Gegenbauer polynomials

These properties imply that —up to a constant— Qk(d)(⟨x,y⟩)Q_{k}^{(d)}(\langle{\bm{x}},{\bm{y}}\rangle) is a representation of the projector onto the subspace of degree -kk spherical harmonics

then we have the following equation holds in L2([−d,d],τd−11)L^{2}([-\sqrt{d},\sqrt{d}],\tau^{1}_{d-1}) sense

By rotational invariance, the space VkV_{k} of homogeneous polynomials of degree kk is an eigenspace of \mathscrsfsHd\mathscrsfs{H}_{d}, and we will denote the corresponding eigenvalue by ξd,k(hd)\xi_{d,k}(h_{d}). In other words \mathscrsfsHdf(x)≡∑k=0∞ξd,k(hd)P‾kf\mathscrsfs{H}_{d}f({\bm{x}})\equiv\sum_{k=0}^{\infty}\xi_{d,k}(h_{d}){\overline{\mathsf{P}}}_{k}f. The eigenvalues can be computed via

E.1.3 Hermite polynomials

Here and below, for PP a polynomial, Coeff{P(x)}{\rm Coeff}\{P(x)\} is the vector of the coefficients of PP. As a consequence, for any fixed integer kk, we have

where μk(σˉ)\mu_{k}(\bar{\sigma}) and ξd,k(σˉ)\xi_{d,k}(\bar{\sigma}) are given in Eq. (209) and (205).

E.2 Functions on the hypercube

Fourier analysis on the hypercube is a well studied subject [O’D14]. The purpose of this section is to introduce some notations that make the correspondence with proofs on the sphere straightforward. For convenience, we will adopt the same notations as for their spherical case.

It is easy to verify that (notice that xik=xix_{i}^{k}=x_{i} if kk is odd and xik=1x_{i}^{k}=1 if kk is even)

E.2.2 Hypercubic Gegenbauer

Notice that the right hand side only depends on ⟨x,y⟩\langle{\bm{x}},{\bm{y}}\rangle and therefore these polynomials are uniquely defined. In particular,

Notice that by weak convergence of ⟨1,x⟩/d\langle\bm{1},{\bm{x}}\rangle/\sqrt{d} to the normal distribution, we have also convergence of the (rescaled) hypercubic Gegenbauer polynomials to the Hermite polynomials, i.e., for any fixed kk, we have

E.3 Hypercontractivity of Gaussian measure and uniform distributions on the sphere and the hypercube

By Holder’s inequality, we have ∥f∥Lp≤∥f∥Lq\|f\|_{L^{p}}\leq\|f\|_{L^{q}} for any ff and any p≤qp\leq q. The reverse inequality does not hold in general, even up to a constant. However, for some measures, the reverse inequality will hold for some sufficiently nice functions. These measures satisfy the celebrated hypercontractivity properties [Gro75, Bon70, Bec75, Bec92].

The Gaussian hypercontractivity is a direct consequence of hypercube hypercontractivity.