A F INE -G RAINED S PECTRAL P ERSPECTIVE ON N EURAL N ETWORKS
Anonymous authors
Paper under double-blind review
A BSTRACT
Are neural networks biased toward simple functions?
Does depth always help learn more complex features?
Is training the last layer of a network as good as training all layers?
How to set the range for learning rate tuning?
These questions seem unrelated at face value, but in this work we give all of them a common treatment from the spectral perspective.
We will study the spectra of the Conjugate Kernel,
CK, (also called the Neural Network-Gaussian Process Kernel ), and the Neural
Tangent Kernel, NTK .
Roughly, the CK and the NTK tell us respectively “what a network looks like at initialization” and “what a network looks like during and after training.”
Their spectra then encode valuable information about the initial distribution and the training and generalization properties of neural networks.
By analyzing the eigenvalues, we lend novel insights into the questions put forth at the beginning, and we verify these insights by extensive experiments of neural networks.
We believe the computational tools we develop here for analyzing the spectra of CK and NTK serve as a solid foundation for future studies of deep neural networks.
We have open-sourced the code for it and for generating the plots in this paper at github.com/jxVmnLgedVwv6mNcGCBy/NNspectra .
I NTRODUCTION
Understanding the behavior of neural networks and why they generalize has been a central pursuit of the theoretical deep learning community.
Recently, Valle-Pérez et al.
(2018) observed that neural networks have a certain “simplicity bias” and proposed this as a solution to the generalization question.
One of the ways with which they argued that this bias exists is the following experiment: they drew a large sample of boolean functions by randomly initializing neural networks and thresholding the output.
They observed that there is a bias toward some "simple" functions which get sampled disproportionately more often.
However, their experiments were only done for relu networks.
Can one expect this “simplicity bias” to hold universally, for any architecture?
A priori , this seems difﬁcult, as the nonlinear nature seems to present an obstacle in reasoning about the distribution of random networks.
However, this question turns out to be more easily treated if we allow the width to go to inﬁnity .
A long line of works starting with Neal (1995) and extended recently by Lee et al.
; Novak et al.
; Yang (2019) have shown that randomly initialized, inﬁnite-width networks are distributed as Gaussian processes.
These Gaussian processes also describe ﬁnite width random networks
well (Valle-Pérez et al., 2018).
We will refer to the corresponding kernels as the Conjugate Kernels (CK), following the terminology of Daniely et al.
Given the
CK K , the simplicity bias of a wide neural network can be read off quickly from the spectrum of K :
If the largest eigenvalue of K accounts for most of tr K , then a typical random network looks like a function from the top eigenspace of K .
In this paper, we will use this spectral perspective to probe not only the simplicity bias, but more generally, questions regarding how hyperparameters affect the generalization of neural networks.
Via the usual connection between Gaussian processes and linear models with features, the CK can be thought of as the kernel matrix associated to training only the last layer of a wide randomly initialized network.
It is a remarkable recent advance (Jacot et al., 2018; Allen-Zhu et al., 2018a;c; Du et al., 2018)
that, under a certain regime, a wide neural network of any depth evolves like a linear model even when training all parameters.
The associated kernel is call the Neural Tangent Kernel , which is typically different from CK.
While its theory was initially derived in the inﬁnite width setting,
Lee et al.
(2019) conﬁrmed with extensive experiment that this limit is predictive of ﬁnite width neural networks as well.
Thus, just as the CK reveals information about what a network looks like at initialization , NTK reveals information about what a network looks like after training.
As such, if we can understand how hyperparameters change the NTK, we can also hope to understand how they affect the performance of the corresponding ﬁnite-width network.
Our Contributions
In this paper, in addition to showing that the simplicity bias is not universal, we will attempt a ﬁrst step at understanding the effects of the hyperparameters on generalization from a spectral perspective.
At the foundation is a spectral theory of the CK and the NTK on the boolean cube.
In Section 3, we show that these kernels, as integral operators on functions over the boolean cube, are diagonalized by the natural Fourier basis, echoing similar results for over the sphere (Smola et al., 2001).
We also partially diagonalize the kernels over standard Gaussian, and show that, as expected, the kernels over the different distributions (boolean cube, sphere, standard Gaussian) behave very similarly in high dimensions.
However, the spectrum is much easier to compute over the boolean cube: while the sphere and Gaussian eigenvalues would require integration against a kind of polynomials known as the Gegenbauer polynomials, the boolean ones only require calculating a linear combination of a small number of terms.
For this reason, in the rest of the paper we focus on analyzing the eigenvalues over the boolean cube.
Just as the usual Fourier basis over R has a notion of frequency that can be interpreted as a measure of complexity, so does the boolean Fourier basis (this is just the degree ; see Section 3.1).
While not perfect, we adopt this natural notion of complexity in this work; a “simple” function is then one that is well approximated by “low frequencies.”
This spectral perspective immediately yields that the simplicity bias is not universal (Section 4).
In particular, while it seems to hold more or less for relu networks, for sigmoidal networks, the simplicity bias can be made arbitrarily weak by changing the weight variance and the depth.
In the extreme case, the random function obtained from sampling a deep erf network with large weights is distributed like a “white noise.”
However, there is a very weak sense in which the simplicity bias does hold: the eigenvalues of more “complex” eigenspaces cannot be bigger than those of less “complex” eigenspaces (Thm 4.1).
Next, we examine how hyperparameters affect the performance of neural networks through the lens of NTK and its spectrum.
To do so, we ﬁrst need to understand the simpler question of how a kernel affects the accuracy of the function learned by kernel regression.
A coarse-grained theory, concerned with big-O asymptotics, exists from classical kernel literature (Yao et al., 2007; Raskutti et al., 2013; Wei et al.
; Lin and Rosasco; Schölkopf and Smola, 2002).
However, the ﬁne-grained details, required for discerning the effect of hyperparameters, have been much less studied.
We make a ﬁrst attempt at a heuristic, fractional variance (i.e. what fraction of the trace of the kernel does an eigenspace contribute), for understanding how a minute change in kernel effects a change in performance.
Intuitively, if an eigenspace has very large fractional variance, so that it accounts for most of the trace, then a ground truth function from this eigenspace should be very easy to learn.
Using this heuristic, we make two predictions about neural networks, motivated by observations in the spectra of NTK and CK, and verify them with extensive experiments.
• Deeper networks learn more complex features, but excess depth can be detrimental as well.
Spectrally, depth can increase fractional variance of an eigenspace, but past an optimal depth , it will also decrease it.
(Section 5)
Thus, deeper is not always better.
• Training all layers is better than training just the last layer when it comes to more complex features, but the opposite is true for simpler features.
Spectrally, fractional variances of more “complex” eigenspaces for the NTK are larger than the correponding quantities of the CK.
(Section 6)
Finally, we use our spectral theory to predict the maximal nondiverging learning rate (“max learning rate”) of SGD (Section 7).
In general, we will not only verify our theory with experiments on the theoretically interesting distributions, i.e. uniform measures over the boolean cube and the sphere, or the standard Gaussian, but also conﬁrm these ﬁndings on real data like MNIST and CIFAR10 1 .
For space concerns, we review relevant literature along the ﬂow of the main text, and relegate a more complete discussion of the related research landscape in Appendix A.
K ERNELS A SSOCIATED TO N EURAL N ETWORKS
As mentioned in the introduction, we now know several kernels associated to inﬁnite width, randomly initialized neural networks.
The most prominent of these are the neural tangent kernel (NTK)
(Jacot et al., 2018) and the conjugate kernel (CK) (Daniely et al., 2016), which is also called the NNGP kernel (Lee et al., 2018).
We brieﬂy review them below.
First we introduce the following notation that we will repeatedly use.
Deﬁnition 2.1.
For φ : R → R , write V φ for the function that takes a PSD (positive semideﬁnite) kernel function to a PSD kernel of the same domain by the formula
[Equation]
Conjugate Kernel Neural networks are commonly thought of as learning a high-quality embedding of inputs to the latent space represented by the network’s last hidden layer, and then using its ﬁnal linear layer to read out a classiﬁcation given the embedding.
The conjugate kernel is just the kernel associated to the embedding induced by a random initialization of the neural network.
Consider an
MLP with widths { n l } l , weight matrices { W l ∈ R n l × n l − 1 } l , and biases { b l ∈ R n l } l , l = 1 , . . .
, L .
For simplicity of exposition, in this paper, we will only consider scalar output n L = 1 .
Suppose it is parametrized by the NTK parametrization , i.e. its computation is given recursively as
[Equation]
with some hyperparameters σ w , σ b that are ﬁxed throughout training 2 .
At initialization time, suppose
W lαβ , b lα ∼ N (0 , 1) for each α ∈ [ n l ] , β ∈ [ n l − 1 ] .
It can be shown that, for each α ∈ [ n l ] , h lα is a
Gaussian process with zero mean and kernel function Σ l in the limit as all hidden layers become inﬁnitely wide ( n l → ∞ , l = 1 , . . .
, L − 1 ), where Σ l is deﬁned inductively on l as
[Equation]
The kernel Σ L corresponding the the last layer L is the network’s conjugate kernel , and the associated
Gaussian process limit is the reason for its alternative name Neural Network-Gaussian process kernel .
In short, if we were to train a linear model with features given by the embedding x (cid:55)→ h
L − 1 ( x ) when the network parameters are randomly sampled as above, then the CK is the kernel of this linear model.
See Daniely et al.
; Lee et al.
and Appendix F for more details.
Neural Tangent Kernel
On the other hand, the NTK corresponds to training the entire model instead of just the last layer.
Intuitively, if we let θ be the entire set of parameters { W l } l ∪ { b l } l of
Eq.
(MLP), then for θ close to its initialized value θ 0 , we expect
[Equation]
via a naive ﬁrst-order Taylor expansion.
In other words, h L ( x ; θ ) − h L ( x ; θ 0 ) behaves like a linear model with feature of x given by the gradient taken w.r.t.
the initial network, ∇ θ h L ( x ; θ 0 ) , and the weights of this linear model are the deviation θ − θ 0 of θ from its initial value.
It turns out that, in the limit as all hidden layer widths tend to inﬁnity, this intuition is correct (Jacot et al., 2018; Lee et al., 2018;
Yang, 2019), and the following inductive formula computes the corresponding inﬁnite-width kernel of this linear model:
[Equation]
Computing CK and NTK
While in general, computing V φ and V φ (cid:48) requires evaluating a multivariate Gaussian expectation, in speciﬁc cases, such as when φ = relu or erf , there exists explicit, efﬁcient formulas that only require pointwise evaluation of some simple functions (see Facts F. and F.2).
This allows us to evaluate CK and NTK on a set X of inputs in only time O ( |X| 2 L ) .
What Do the Spectra of CK and NTK Tell Us?
In summary, the CK governs the distribution of a randomly initialized neural network and also the properties of training only the last layer of a network, while the NTK governs the dynamics of training (all parameters of) a neural network.
A study of their spectra thus informs us of the “implicit prior” of a randomly initialized neural network as well as the “implicit bias” of GD in the context of training neural networks.
In regards to the implicit prior at initialization, we know from Lee et al.
(2018) that a randomly initialized network as in Eq.
(MLP) is distributed as a Gaussian process N (0 , K ) , where K is the corresponding CK, in the inﬁnite-width limit.
If we have the eigendecomposition
[Equation]
with eigenvalues λ i in decreasing order and corresponding eigenfunctions u i , then each sample from this GP can be obtained as
[Equation]
If, for example, λ 1 (cid:29) (cid:80) i ≥ 2 λ i , then a typical sample function is just a very small perturbation of u 1 .
We will see that for relu, this is indeed the case (Section 4), and this explains the “simplicity bias” in relu networks found by Valle-Pérez et al.
Training the last layer of a randomly initialized network via full batch gradient descent for an inﬁnite amount of time corresponds to Gaussian process inference with kernel K (Lee et al., 2018; 2019).
A similar intuition holds for NTK: training all parameters of the network (Eq.
(MLP)) for an inﬁnite amount of time yields the mean prediction of the GP N (0 , NTK ) in expectation; see Lee et al.
and Appendix F.4 for more discussion.
Thus, the more the GP prior (governed by the CK or the NTK) is consistent with the ground truth function f ∗ , the more we expect the Gaussian process inference and GD training to generalize well.
We can measure this consistency in the “alignment” between the eigenvalues
λ i and the squared coefﬁcients a 2 i of f ∗ ’s expansion in the { u i } i basis.
The former can be interpreted as the expected magnitude (squared) of the u i -component of a sample f ∼ N (0 , K ) , and the latter can be interpreted as the actual magnitude squared of such component of f ∗ .
In this paper, we will investigate an even cleaner setting where f ∗ =
u i is an eigenfunction.
Thus we would hope to use a kernel whose i th eigenvalue
λ i is as large as possible.
Neural Kernels From the forms of the equation Eqs.
(CK) and (NTK) and the fact that
V φ ( K )( x, x (cid:48) ) only depends on K ( x, x ) , K ( x, x (cid:48) ) , and K ( x (cid:48) , x (cid:48) ) , we see that CK or NTK of MLPs takes the form
[Equation]
for some function Φ : R 3 → R .
We will refer to this kind of kernel as Neural Kernel in this paper.
Kernels as Integral Operators We will consider input spaces of various forms X
⊆
R
d equipped with some probability measure.
Then a kernel function K acts as an integral operator on functions f ∈ L 2 ( X ) by
[Equation]
We will use the “juxtaposition syntax” Kf to denote this application of the integral operator.
Under certain assumptions, it then makes sense to speak of the eigenvalues and eigenfunctions of the integral operator K .
While we will appeal to an intuitive understanding of eigenvalues and eigenfunctions in the main text below, we include a more formal discussion of Hilbert-Schmidt operators and their spectral theory in Appendix G for completeness.
In the next section, we investigate the eigendecomposition of neural kernels as integral operators over different distributions.
T HE S PECTRA OF N EURAL K ERNELS 3. B OOLEAN C UBE
We ﬁrst consider a neural kernel K on the boolean cube X = (cid:28) d def = {± 1 } d , equipped with the uniform measure.
In this case, since each x ∈ X has the same norm, K ( x, y ) =
Φ (cid:16) (cid:104) x,y
[Table]
(cid:107) x (cid:107)(cid:107) y
(cid:107) , (cid:107) x (cid:107) 2 d
(cid:107) y (cid:107) 2 d (cid:17) effectively only depends on (cid:104) x, y (cid:105) , so we will treat Φ as a single variate function in this section, Φ( c ) =
Φ( c, 1 , 1) .
Brief review of basic Fourier analysis on the boolean cube (cid:28) d (O’Donnell (2014)).
The space of real functions on (cid:28) d forms a 2 d -dimensional space.
Any such function has a unique expansion into a multilinear polynomial (polynomials whose monomials do not contain x pi , p ≥ 2 , of any variable x i ).
For example, the majority function over 3 bits has the following unique multilinear expansion
[Equation]
In the language of Fourier analysis, the 2 d multilinear monomial functions
[Equation]
d
[Equation]
form a Fourier basis of the function space L 2 (
[Equation]
) =
{ f :
[Equation]
d → R } , in the sense that their inner products satisfy
[Equation]
Thus, any function f : (cid:28) d
→ R can be always written as
[Equation]
x
[Equation]
=
[Equation] [Equation]
[Equation]
) for a unique set of coefﬁcients { ˆ f ( S ) } S ⊆
[ d ] .
It turns out that K is always diagonalized by this Fourier basis { χ S } S ⊆
[ d ] .
Theorem 3.1.
On the d -dimensional boolean cube (cid:28) d , for every S ⊆
[ d ] , χ S is an eigenfunction of
K with eigenvalue
[Equation]
where 1 = (1 , . . . , 1) ∈ (cid:28) d .
This deﬁnition of µ | S | does not depend on the choice S , only on the cardinality of S .
These are all of the eigenfunctions of K by dimensionality considerations.
Deﬁne T ∆ to be the shift operator on functions over [ − 1 , 1] that sends Φ( · ) to Φ( · − ∆) .
Then we can re-express the eigenvalue as follows.
Lemma 3.2.
With µ k as in Thm 3.1,
[Equation]
where
[Equation]
Eq.
(5) will be important for computational purposes, and we will come back to discuss this more in
Section 3.5.
It also turns out µ k affords a pretty expression via the Fourier series coefﬁcients of Φ .
As this is not essential to the main text, we relegate its exposition to Appendix H.1.
3. S PHERE
Now let’s consider the case when X = √ d S d − 1 is the radius- √ d sphere in R d equipped with the uniform measure.
Again, because x ∈ X all have the same norm, we will treat Φ as a univariate function with K ( x, y ) =
Φ( (cid:104) x, y (cid:105) / (cid:107) x
cid:107)(cid:107) y (cid:107) ) =
Φ( (cid:104) x, y (cid:105) /d ) .
As is long known (Schoenberg, 1942;
Gneiting, 2013; Xu and Cheney, 1992; Smola et al., 2001), K is diagonalized by spherical harmonics, and the eigenvalues are given by the coefﬁcients of Φ against a system of orthogonal polynomials called Gegenbuaer polynomials.
We relegate a complete review of this topic to Appendix H.2.
3. I SOTROPIC G AUSSIAN
Now let’s consider X
= R d equipped with standard isotropic Gaussian N (0 , I ) , so that K behaves like
[Equation]
for any f ∈ L 2 ( N (0 , I )) .
In contrast to the previous two sections, K will essentially depend on the effect of the norms (cid:107) x (cid:107) and (cid:107)
y
(cid:107) on Φ .
Nevertheless, because an isotropic Gaussian vector can be obtained by sampling its direction uniformly from the sphere and its magnitude from a chi distribution, K can still be partially diagonalized into a sum of products between spherical harmonics and kernels on R equipped with a chi distribution (Thm H.14).
In certain cases, we can obtain complete eigendecompositions, for example when Φ is positive homogeneous.
See Appendix H.3 for more details.
3. K ERNEL IS S AME OVER B OOLEAN C UBE , S PHERE , OR G AUSSIAN WHEN d (cid:29)
The reason we have curtailed a detailed discussion of neural kernels on the sphere and on the standard
Gaussian is because, in high dimension, the kernel behaves the same under these distributions as under uniform distribution over the boolean cube.
Indeed, by intuition along the lines of the central limit theorem, we expect that uniform distribution over a high dimension boolean cube should approximate high dimensional standard Gaussian.
Similarly, by concentration of measure, most of the mass of a
Gaussian is concentrated around a thin shell of radius √ d .
Thus, morally, we expect the same kernel function K induces approximately the same integral operator on these three distributions in high dimension, and as such, their eigenvalues should also approximately coincide.
We verify empirically and theoretically this is indeed the case in Appendix H.4.
3. C OMPUTING THE E IGENVALUES
As the eigenvalues of K over the different distributions are very close, we will focus in the rest of this paper on eigenvalues over the boolean cube.
This has the additional beneﬁt of being much easier to compute.
Each eigenvalue over the sphere and the standard Gaussian requires an integration of Φ against a
Gegenbauer polynomial.
In high dimension d , these Gegenbauer polynomials varies wildly in a sinusoidal fashion, and blows up toward the boundary (see Fig.
15 in the Appendix).
As such, it is difﬁcult to obtain a numerically stable estimate of this integral in an efﬁcient manner when d is large.
In contrast, we have multiple ways of computing boolean cube eigenvalues, via Eqs.
(5) and (6).
In either case, we just take some linear combination of the values of Φ at a grid of points on [ − 1 , 1] , spaced apart by ∆ = 2 /d .
While the coefﬁcients C d − k,k r (deﬁned in Eq.
(7)) are relatively efﬁcient to compute, the change in the sign of C d − k,k r makes this procedure numerically unstable for large d .
Instead, we use Eq.
(5) to isolate the alternating part to evaluate in a numerically stable way: Since µ k = (cid:0)
I + T ∆ 2 (cid:1) d − k (cid:0)
I −T ∆ 2 (cid:1) k Φ(1) , we can evaluate ˜Φ def = (cid:0) I −T ∆ 2 (cid:1) k
Φ via k ﬁnite differences, and then compute
[Equation]
[Figure] [Figure]
101010p r o b a b ili t y (a) probability vs rank of 10 4 random networks on {±1} 7 | 2 w | 2 b relu | 2 | 2 erf | 1 | 0 erf | 2 |erf
| 4 |       7 degree k 1010101010n o r m a li
z
e
d e i g e n v a l u e k (
[Figure]
We plot them in log scale against the degree.
Note that for erf and σ b = 0 , the even degree µ k vanish.
See main text for explanations.
When Φ arises from the CK or the NTK of an MLP, all derivatives of Φ at 0 are nonnegative (Thm I.3).
Thus intuitively, the ﬁnite difference ˜Φ should be also all nonnegative, and this sum can be evaluated without worry about ﬂoating point errors from cancellation of large terms.
A slightly more clever way to improve the numerical stability when 2 k ≤ d is to note that
[Equation]
So an improved algorithm is to ﬁrst compute the k th ﬁnite difference ( I − T 2∆ ) k with the larger step size 2∆ , then compute the sum ( I + T ∆ )
d − 2 k as in Eq.
C LARIFYING THE “S IMPLICITY B IAS ” OF R ANDOM N EURAL N ETWORKS
As mentioned in the introduction, Valle-Pérez et al.
(2018) claims that neural networks are biased toward simple functions .
We show that this phenomenon depends crucially on the nonlinearity, the sampling variances, and the depth of the network.
In Fig. 1(a), we have repeated their experiment for 10 4 random functions obtained by sampling relu neural networks with 2 hidden layers, 40 neurons each, following Valle-Pérez et al.
(2018)’s
architectural choices 5 .
We also do the same for erf networks of the same depth and width, varying as well the sampling variances of the weights and biases, as shown in the legend.
As discussed in Valle-Pérez et al.
(2018), for relu, there is indeed this bias, where a single function gets sampled more than 10% of the time.
However, for erf, as we increase σ 2 w , we see this bias disappear, and every function in the sample gets sampled only once.
This phenomenon can be explained by looking at the eigendecomposition of the CK, which is the Gaussian process kernel of the distribution of the random networks as their hidden widths tend to inﬁnity.
In Fig. 1(b), we plot the normalized eigenvalues { µ k / (cid:80) 7 i =
(cid:0)
i (cid:1) µ i } 7 k =0 for the
CKs corresponding to the networks sampled in Fig. 1(a).
Immediately, we see that for relu and σ 2 w = σ 2 b = 2 , the degree 0 eigenspace, corresponding to constant functions, accounts for more than 80% of the variance.
This means that a typical inﬁnite-width relu network of 2 layers is expected to be almost constant, and this should be even more true after we threshold the network to be a boolean function.
On the other hand, for erf and σ b = 0 , the even degree µ k s all vanish, and most of the variance comes from degree 1 components (i.e. linear functions).
This concentration in degreealso lessens as σ 2 w increases.
But because this variance is spread across a dimension 7 eigenspace, we don’t see duplicate function samples nearly as much as in the relu case.
As σ w increases, we also see the eigenvalues become more equally distributed, which corresponds to the ﬂattening of
[Figure]
the probability-vs-rank curve in Fig. 1(a).
Finally, we observe that a 32-layer erf network with σ 2 w = 4 has all its nonzero eigenvalues (associated to odd degrees) all equal (see points marked by ∗ in Fig. 1(b)).
This means that its distribution is a "white noise" on the space of odd functions, and the distribution of boolean functions obtained by thresholding the Gaussian process samples is the uniform distribution on odd functions.
This is the complete lack of simplicity bias modulo the oddness constraint.
However, from the spectral perspective, there is a weak sense in which a simplicity bias holds for all neural network-induced CKs and NTKs.
Theorem 4.1 (Weak Spectral Simplicity Bias) .
Let K be the CK or NTK of an MLP on a boolean cube (cid:28) d .
Then the eigenvalues µ k , k = 0 , . . .
, d, satisfy
[Equation]
Even though it’s not true that the fraction of variance contributed by the degree k eigenspace is decreasing with k , the eigenvalue themselves will be in a nonincreasing pattern across even and odd degrees.
In fact, if we ﬁx k and let d → ∞ , then we can show that (Thm I.6)
[Equation]
Of course, as we have seen, this is a very weak sense of simplicity bias, as it doesn’t prevent “white noise” behavior as in the case of erf CK with large σ 2 w and large depth.
D EEPER N ETWORKS L EARN M ORE C OMPLEX F EATURES
In the rest of this work, we compute the eigenvalues µ k over the 128-dimensional boolean cube ( (cid:28) d , with d = 128 ) for a large number of different hyperparameters, and analyze how the latter affect the former.
We vary the degree k ∈ [0 , 8] , the nonlinearity between relu and erf, the depth (number of hidden layers) from 1 to 128, and σ 2 b ∈ [0 , 4] .
We ﬁx σ 2 w = 2 for relu kernels, but additionally vary σ 2 w ∈ [1 , 5] for erf kernels.
Comprehensive contour plots of how these hyperparameters affect the kernels are included in Appendix D, but in the main text we summarize several trends we see.
We will primarily measure the change in the spectrum by the degree k fractional variance , which is just
[Equation]
This terminology comes from the fact that, if we were to sample a function f from a Gaussian process with kernel K , then we expect that r % of the total variance of f comes from degree k components of f , where r % is the degree k fractional variance.
If we were to try to learn a homogeneous degree- k
[Figure]
depth increases with the degree, as predicted by
Fig.
Note that we do not expect the dashed and solid curves to match up, just that they are positively correlated as shown by (a).
In higher degrees, the losses are high across all depths, and the variance is large, so we omit them.
See Appendix E for experimental details.
(c) Similar experimental setting as (a), but with more hyperparameters, and now comparing training last layer vs training all layers.
The color of each dot indicates the degree of the ground truth polynomial.
Below the identity line, training all layers is better than training last layer.
We see that the only nontrivial case where this is not true is when learning degree 0 polynomials, i.e. constant functions.
See Appendix E for experimental details.
We also replicate (b) for MNIST and CIFAR10, and moreover both (b) and (c) over the input distributions of standard Gaussian and the uniform measure over the sphere.
See Figs.
6 to 8.
polynomial using a kernel K , intuitively we should try to choose K such that its µ k is maximized, relative to other eigenvalues.
Fig.
3(a) shows that this is indeed the case even with neural networks: over a large number of different hyperparameter settings, degree k fractional variance is inversely related to the validation loss incurred when learning a degree k polynomial.
However, this plot also shows that there does not seem like a precise, clean relationship between fractional variance and validation loss.
Obtaining a better measure for predicting generalization is left for future work.
Before we continue, we remark that the fractional variance of a ﬁxed degree k converges to a ﬁxed value as the input dimension d → ∞ :
Theorem 5.1 (Asymptotic Fractional Variance) .
Let K be the CK or NTK of an MLP on a boolean cube (cid:28) d .
Then K can be expressed as K ( x, y ) =
Φ( (cid:104) x, y (cid:105) /d ) for some analytic function Φ : R → R .
If we ﬁx k and let the input dimension d → ∞ , then the fractional variance of degree k converges to
[Equation]
where Φ ( k ) denotes the k th derivative of Φ .
For the fractional variances we compute in this paper, their values at d = 128 are already very close to their d → ∞ limit, so we focus on the d = 128 case experimentally.
If K were to be the CK or NTK of a relu or erf MLP, then we ﬁnd that for higher k , the depth of the network helps increase the degree k fractional variance.
In Fig. 2(a) and (b), we plot, for each degree k , the depth that (with some combination of other hyperparameters like σ 2 b ) achieves this maximum, for respectively relu and erf kernels.
Clearly, the maximizing depths are increasing with k for relu, and also for erf when considering either odd k or even k only.
The slightly differing behavior between even and odd k is expected, as seen in the form of Thm 4.1.
Note the different scales of y-axes for relu and erf — the depth effect is much stronger for erf than relu.
For relu NTK and CK, σ 2 b = 0 maximizes fractional variance in general, and the same holds for erf NTK and CK in the odd degrees (see Appendix D).
In Fig. 2(c) and Fig. 2(d) we give a more ﬁne-grained look at the σ 2 b = 0 slice, via heatmaps of fractional variance against degree and depth.
[Figure]
f r a c t
i
o
n a l v a r i a n c e (
[Figure] [Figure]
|
[Figure]
| 0.
[Figure]
|
[Figure] [Figure]
| 0.
[Figure]
ntkck
[Figure] [Figure]
We verify this increase of optimal depth with degree in Fig. 3(b).
There we have trained relu networks of varying depth against a ground truth multilinear polynomial of varying degree.
We see clearly that the optimal depth is increasing with degree.
We also verify this phenomenon when the input distribution changes to the standard Gaussian or the uniform distribution over the sphere √ d S d − 1 ; see Fig. 6.
Note that implicit in our results here is a highly nontrivial observation: Past some point (the optimal depth ), high depth can be detrimental to the performance of the network, beyond just the difﬁculty to train, and this detriment can already be seen in the corresponding NTK or CK.
In particular, it’s not true that the optimal depth is inﬁnite.
We conﬁrm the existence of such an optimal depth even in real distributions like MNIST and CIFAR10; see Fig.
This adds signiﬁcant nuance to the folk wisdom that “depth increases expressivity and allows neural networks to learn more complex features.”
NTK F AVORS M ORE C OMPLEX F EATURES T HAN CK
We generally ﬁnd the degree k fractional variance of NTK to be higher than that of CK when k is large, and vice versa when k is small, as shown in Fig.
This means that, if we train only the last layer of a neural network (i.e. CK dynamics), we intuitively should expect to learn simpler features better, while, if we train all parameters of the network (i.e. NTK dynamics), we should expect to learn more complex features better.
Similarly, if we were to sample a function from a Gaussian process with the CK as kernel (recall this is just the distribution of randomly initialized inﬁnite width
MLPs (Lee et al., 2018)), this function is more likely to be accurately approximated by low degree polynomials than the same with the NTK.
We verify this intuition by training a large number of neural networks against ground truth functions of various homogeneous polynomials of different degrees, and show a scatterplot of how training the last layer only measures against training all layers (Fig. 3(c)).
This phenomenon remains true over the standard Gaussian or the uniform distribution on the sphere (Fig.
Consistent with our theory, the only place training the last layer works meaningfully better than training all layers is when the ground truth is a constant function.
However, we reiterate that fractional variance is an imperfect indicator of performance.
Even though for erf neural networks and k ≥ 1 , degree k fractional variance of NTK is not always greater than that of the CK, we do not see any instance where training the last layer of an erf network is better than training all layers.
We leave an investigation of this discrepancy to future work.
P REDICTING THE M AXIMUM L EARNING R ATE
In any setup that tries to push deep learning benchmarks, learning rate tuning is a painful but indispensable part.
In this section, we show that our spectral theory can accurately predict the maximal nondiverging learning rate over real datasets as well as toy input distributions, which would help set the correct upper limit for a learning rate search.
By Jacot et al.
(2018), in the limit of large width and inﬁnite data, the function g : X → R represented by our neural network evolves like
[Equation]
when trained under full batch GD (with the entire population) with L2 loss L ( f, g ) =
E x ∼X ( f ( x ) − g ( x )) 2 , ground truth g ∗ , and learning rate α , starting from randomly initialization.
If we train only the last layer, then K is the CK; if we train all layers, then K is the NTK.
Given an eigendecomposition of K as in Eq.
(1), if g 0 − g ∗ =
(cid:80) i a i u
i is the decomposition of g 0 in the eigenbasis { u i } i , then one can easily deduce that
[Equation]
Consequently, we must have α < (max i λ i ) − 1 in order for Eq.
(10) to converge
When the input distribution is the uniform distribution over (cid:28) d , the maximum learning rate is max( µ 0 , µ 1 ) by Thm 4.1.
By Thm 5.1, as long as the Φ function corresonding to K has Φ(0) (cid:54) = 0 , when d is large, we expect µ 0 ≈ Φ(0) but µ 1 ∼ d − 1 Φ (cid:48) (0) (cid:28) µ 0 .
Therefore, we should predict 1Φ(0) for the maximal learning rate when training on the boolean cube.
However, as Fig.
5 shows, this prediction is accurate not only for the boolean cube, but also over the sphere, the standard Gaussian, and even MNIST and CIFAR10!
C ONCLUSION
In this work we have taken a ﬁrst step at studying how hyperparameters change the initial distribution and the generalization properties of neural networks through the lens of neural kernels and their spectra.
We obtained interesting insights by computing kernel eigenvalues over the boolean cube and relating them to generalization through the fractional variance heuristic.
While it inspired valid predictions that are backed up by experiments, fractional variance is clearly just a rough indicator.
We hope future work can reﬁne on this idea to produce a much more precise prediction of test loss.
Nevertheless, we believe the spectral perspective is the right line of research that will not only shed light on mysteries in deep learning but also inform design choices in practice.
A R ELATED W ORKS
The Gaussian process behavior of neural networks was found by Neal (1995) for shallow networks and then extended over the years to different settings and architectures (Williams, 1997; Le Roux and Bengio, 2007; Hazan and Jaakkola, 2015; Daniely et al., 2016; Lee et al., 2018;
Matthews et al., 2018; Novak et al., 2018).
This connection was exploited implicitly or explicitly to build new models (Cho and Saul, 2009; Lawrence and Moore, 2007; Damianou and Lawrence, 2013; Wilson et al., 2016a;b; Bradshaw et al., 2017;
van der Wilk et al., 2017; Kumar et al., 2018; Blomqvist et al., 2018;
Borovykh, 2018; Garriga-Alonso et al., 2018; Novak et al., 2018; Lee et al., 2018).
The Neural
Tangent Kernel is a much more recent discovery by Jacot et al.
(2018) and later Allen-Zhu et al.
(2018a;c;b);
Du et al.
Arora et al. (2019b); Zou et al.
(2018) came upon the same reasoning independently.
Like CK, NTK has also been applied toward building new models or algorithms (Arora et al., 2019a; Achiam et al., 2019).
Closely related to the discussion of CK and NTK is the signal propagation literature, which tries to understand how to prevent pathological behaviors in randomly initialized neural networks when they are deep (Poole et al., 2016;
Schoenholz et al., 2017; Yang and Schoenholz, 2017; 2018; Hanin, 2018;
Hanin and Rolnick, 2018; Chen et al., 2018;
Yang et al., 2019; Pennington et al., 2017a;
Hayou et al., 2018; Philipp and Carbonell, 2018).
This line of work can trace its original at least to the advent of the Glorot and He initialization schemes for deep networks (Glorot and Bengio, 2010;
He et al., 2015).
The investigation of forward signal propagation , or how random neural networks change with depth, corresponds to studying the inﬁnite-depth limit of CK, and the investigation of backward signal propagation , or how gradients of random networks change with depth, corresponds to studying the inﬁnite-depth limit of NTK.
Some of the quite remarkable results from this literature includes how to train a 10,000 layer CNN (Xiao et al., 2017) and that, counterintuitively, batch normalization causes gradient explosion (Yang et al., 2019).
This signal propagation perspective can be reﬁned via random matrix theory (Pennington et al., 2017a; 2018).
In these works, free probability is leveraged to compute the singular value distribution of the input-output map given by the random neural network, as the input dimension and width tend to inﬁnity together.
Other works also investigate various questions of neural network training and generalization from the random matrix perspective (Pennington and Worah, 2017; Pennington and
Bahri, 2017; Pennington and Worah, 2018).
Yang (2019) presents a common framework, known as Tensor Programs , unifying the GP, NTK, signal propagation, and random matrix perspectives, as well as extending them to new scenarios, like recurrent neural networks.
It proves the existence of and allows the computation of a large number of inﬁnite-width limits (including ones relevant to the above perspectives) by expressing the quantity of interest as the output of a computation graph and then manipulating the graph mechanically.
Several other works also adopt a spectral perspective on neural networks (Candès, 1999; Sonoda and Murata, 2017; Eldan and Shamir, 2016; Barron, 1993;
Xu et al., 2018; Zhang et al., 2019; Xu et al., 2019; Xu, 2018); here we highlight a few most relevant to us.
Rahaman et al.
(2018) studies the real Fourier frequencies of relu networks and perform experiments on real data as well as synthetic ones.
They convincingly show that relu networks learn low frequencies components ﬁrst.
They also investigate the subtleties when the data manifold is low dimensional and embedded in various ways in the input space.
In contrast, our work focuses on the spectra of the CK and NTK (which indirectly informs the Fourier frequencies of a typical network).
Nevertheless, our results are complementary to theirs, as they readily explain the low frequency bias in relu that they found.
Karakida et al.
(2018) studies the spectrum of the Fisher information matrix, which share the nonzero eigenvalues with the NTK.
They compute the mean, variance, and maximum of the eigenvalues Fisher eigenvalues (taking the width to inﬁnity ﬁrst, and then considering ﬁnite amount of data sampled iid from a
Gaussian).
In comparison, our spectral results yield all eigenvalues of the NTK (and thus also all nonzero eigenvalues of the Fisher) as well as eigenfunctions.
Finally, we note that several recent works (Xie et al., 2016; Bietti and Mairal, 2019; Basri et al., 2019;
Ghorbani et al., 2019) studied one-hidden layer neural networks over the sphere, building on Smola et al.
(2001)’s observation that spherical harmonics diagonalize dot product kernels, with the latter two concurrent to us.
This is in contrast to the focus on boolean cube here, which allows us to study the ﬁne-grained effect of hyperparameters on the spectra, leading to a variety of insights into neural networks’ generalization properties.
B U NIVERSALITY OF O UR B OOLEAN C UBE O BSERVATIONS IN O THER I NPUT D ISTRIBUTIONS
Using the spectral theory we developed in this paper, we made three observations, that can be roughly summarized as follows: 1) the simplicity bias noted by Valle-Pérez et al.
(2018) is not universal; 2) for each function of ﬁxed “complexity” there is an optimal depth such that networks shallower or deeper will not learn it as well; 3) training last layer only is better than training all layers when learning “simpler” features, and the opposite is true for learning “complex” features.
In this section, we discuss the applicability of these observations to distributions that are not uniform over the boolean cube: in particular, the uniform distribution over the sphere √ d S d − 1 , the standard
Gaussian N (0 , I d ) , as well as realistic data distributions such as MNIST and CIFAR10.
Simplicity bias The simplicity bias noted by Valle-Pérez et al.
(2018), in particular Fig.
1, depends on the ﬁniteness of the boolean cube as a domain, so we cannot effectively test this on the distributions above, which all have uncountable support.
Optimal depth With regard to the second observation, we can test whether an optimal depth exists for learning functions over the distributions above.
Since polynomial degrees remain the natural indicator of complexity for the sphere and the Gaussian (see Appendices H.2 and H.3 for the relevant spectral theory), we replicated the experiment in Fig. 3(b) for these distributions, using the same ground truth functions of polynomials of different degrees.
The results are shown in Fig.
We see the same phenomenon as in the boolean cube case, with an optimal depth for each degree, and with the optimal depth increasing with degree.
For MNIST and CIFAR10, the notion of “feature complexity” is less clear, so we will not test the hypothesis that “optimal depth increases with degree” for these distributions but only test for the existence of the optimal depth for the ground truth marked by the labels of the datasets.
We do so by training a large number of MLPs of varying depth on these datasets until convergence, and plot the results in Fig.
This ﬁgure clearly shows that such an optimal depth exists, such that shallower or deeper networks do monotonically worse as the depth diverge away from this optimal depth.
Again, the existence of the optimal depth is not obvious at all, as conventional deep learning wisdom would have one believe that adding depth should always help.
Training last layer only vs training all layers Finally, we repeat the experiment in Fig. 3(c) for the sphere and the standard Gaussian, with polynomials of different degrees as ground truth functions.
The results are shown in Fig.
We see the same phenomenon as in the boolean cube case: for degree 0 polynomials, training last layer works better in general, but for higher degree polynomials, training all layers fares better.
Note that, unlike the sphere and the Gaussian, whose spectral theory tells us that (harmonic) polynomial degree is a natural notion of complexity, for MNIST and CIFAR
we have much less clear idea of what a “complex” or a “simple” feature is.
Therefore, we did not attempt a similar experiment on these datasets.
C T HEORETICAL VS E MPIRICAL M AX L EARNING R ATES UNDER D IFFERENT P REPROCESSING FOR MNIST AND CIFAR
In the main text Fig. 5, on the MNIST and CIFAR10 datasets, we preprocessed the data by centering and normalizing to the sphere (see Appendix E.2 for a precise description).
With this preprocessing, our theory accurately predicts the max learning rate in practice.
In general, if we go by another preprocessing, such as PCA or ZCA, or no preprocessing, our theoretical max learning rate 1 / Φ(0) is less accurate but still correlated in general.
The only exception seems to be relu networks on PCA- or ZCA- preprocessed CIFAR10.
See Fig.
[Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure]
D V ISUALIZING THE S PECTRAL E FFECTS OF σ 2 w , σ 2 b , AND D EPTH
While in the main text, we summarized several trends of interest kn several plots, they do not give the entire picture of how eigenvalues and fractional variances vary with σ 2 w , σ 2 b , and depth.
Here we try to present this relationship more completely in a series of contour plots.
Fig.
10 shows how varying depth and σ 2 b changes the fractional variances of each degree, for relu CK and NTK.
We are ﬁxing σ 2 w = 2 in the CK plots, as the fractional variances only depend on the ratio σ 2 b /σ 2 w ; even though this is not true for relu NTK, we ﬁx σ 2 w = 2 as well for consistency.
For erf, however, the fractional variance will crucially depend on both σ 2 w and σ 2 b , so we present 3D contour plots of how σ 2 w , σ 2 b , and depth changes fractional variance in Fig. 13.
Complementarily, we also show in Figs.
11 anda few slices of these 3D contour plots for different ﬁxed values of σ 2 b , for erf CK and NTK.
[Figure]
[Figure]
E E XPERIMENTAL D ETAILS E. F IG .
Fig. 3(a), (b) and (c) differ in the set of hyperparameters they involve (to be speciﬁed below), but in all of them, we train relu networks against a randomly generated ground truth multilinear polynomial, with input space (cid:28) 128 and L2 loss L ( f ) =
E x ∈ (cid:28) d ( f ( x ) − f ∗ ( x )) 2 .
Training We perform SGD with batch size 1000.
In each iteration, we freshly sample a new batch, and we train for a total of 100,000 iterations, so the network potentially sees 10 8 different examples.
At every 1000 iterations, we validate the current network on a freshly drawn batch of 10,000 examples.
We thus record a total of 100 validation losses, and we take the lowest to be the “best validation loss.”
Generating the Ground Truth Function
The ground truth function f ∗ ( x ) is generated by ﬁrst sampling 10 monomials m 1 , . . .
, m 10 of degree k , then randomly sampling 10 coefﬁcients a 1 , . . .
, a 10 for them.
The ﬁnal function is obtained by normalizing { a i } such that the sum of their squares is 1:
[Equation]
Hyperparameters for Fig.
a)
• The learning rate is half the theoretical maximum learning rate 7 12 max( µ
[Equation]
, µ 1 ) −• Ground truth degree k ∈ { 0 , 1 , 2 , 3 } • Depth ∈ { 0 , . .
. , 10 } • activation = relu • σ 2 w =• σ 2 b =• width =
• 10 random seeds per hyperparameter combination • training last layer (marked “ck”), or all layers (marked “ntk”).
In the latter case, we use the NTK parametrization of the MLP (Eq.
(MLP)).
Hyperparameters for Fig. 3(b)
• The learning rate is half the theoretical maximum learning rate 12 max( µ 0 , µ 1 ) −• Ground truth degree k ∈ { 0 , 1 , 2 , 3 } • Depth ∈ { 0 , . .
, 10 } • activation = relu • σ 2 w =• σ 2 b =• width =• 100 random seeds per hyperparameter combination • training last layer weight and bias only
upper ← 16 × theoretical max lr lower ←tol ← 0 .
01 × theoretical max lr while | upper − lower | > tol do α ← ( upper + lower ) /
Run SGD with learning rate α for 1000 iterations if loss diverges then upper ← α else lower ← α end if end while
Output: upper
Hyperparameters for Fig. 3(c)
• The learning rate ∈ { 0 . 05 , 0 . 1 , 0 . 5 } • Ground truth degree k ∈ { 0 , 1 , . .
. , 6 } • Depth ∈ { 1 , . . .
, 5 } • activation ∈ { relu , erf } • σ 2 w = 2 for relu, but σ 2 w ∈ { 1 , 2 , . .
, 5 } for erf • σ 2 b ∈ { 0 , 1 , . .
. , 4 } • width =• 1 random seed per hyperparameter combination •
Training all layers, using the NTK parametrization of the MLP (Eq.
(MLP))
E. M AX L EARNING R ATE E XPERIMENTS
Here we describe the experimental details for the experiments underlying Figs.
5 and 9.
Theoretical max learning rate For a ﬁxed setup, we compute Φ according to Eq.
(CK) (if only last layer is trained) or Eq.
(NTK) (if all layers are trained).
For ground truth problems where the output is n -dimensional, the theoretical max learning rate is n Φ(0) − 1 ; in particular, the max learning rates for MNIST and CIFAR10 are 10 times those for boolean cube, sphere, and Gaussian.
This is because the kernel for an multi-output problem effectively becomes
[Equation]
where the 1 n factor is due to the 1 n factor in the scaled square loss L ( f, f ∗ )
=
E x ∼X 1 n (cid:80) ni
=
( f ( x ) i − f ∗ ( x ) i ) 2 .
The top eigenvalue for 1 n K ⊕ n is just 1 n times the top eigenvalue for K .
Empirical max learning rate For a ﬁxed setup, we perform binary search for the empirical max learning rate as in Algorithm 1.
Preprocessing In Fig.
5, for MNIST and CIFAR10, we center and project each image onto the sphere √ d S d − 1 , where d = 28 × 28 = 784 for MNIST and d = 3 × 32 × 32 = 3072 for CIFAR10.
More precisely, we compute the average image ¯ x over the entire dataset, and we preprocess each image x as √ d x − ¯ x (cid:107) x − ¯ x (cid:107) .
In Fig.
9, there are three different preprocessing schemes.
For “no preprocessing,” we load the MNIST and CIFAR10 data as is.
In “PCA128,” we take the top 128 eigencomponents of the data, so that the data has only 128 dimensions.
In “ZCA128,” we take the top 128 eigencomponents but rotate it back to the original space, so that the data still has dimension d , where d = 28 × 28 =for MNIST and d = 3 × 32 × 32 = 3072 for CIFAR10.
Hyperparameters
• Target function: For boolean cube, sphere, and standard Gaussian, we randomly sample a degree 1 polynomial as in Eq.
For MNIST and CIFAR10, we just use the label in the dataset, encoded as a one-hot vector for square-loss regression.
• Depth ∈ { 1 , 2 , 4 , 8 , 16 } • activation ∈
relu , erf } • σ 2 w = 2 for relu, but
σ 2 w ∈ { 1 , 2 , . . . , 5 } for erf • σ 2 b ∈ { 1 , . . .
, 4 } • width =•
1 random seed per hyperparameter combination • Training last layer (CK) or all layers (NTK).
In the latter case, we use the NTK parametrization of the MLP (Eq.
(MLP)).
F R EVIEW OF THE T HEORY OF N EURAL T ANGENT K ERNELS F. C ONVERGENCE OF I NFINITE -W IDTH K ERNELS AT I NITIALIZATION
Conjugate Kernel Via a central-limit-like intuition, each unit h l ( x ) α of Eq.
(MLP) should behave like a Gaussian as width n l − 1 → ∞ , as it is a sum of a large number of roughly independent random variables (Poole et al., 2016; Schoenholz et al., 2017; Yang and Schoenholz, 2017).
The devil, of course, is in what “roughly independent” means and how to apply the central limit theorem (CLT) to this setting.
It can be done, however, (Lee et al., 2018; Matthews et al., 2018;
Novak et al., 2018), and in the most general case, using a “Gaussian conditioning” technique, this result can be rigorously generalized to almost any architecture Yang (2019).
In any case, the consequence is that, for any ﬁnite set S ⊆ X , { h lα ( x ) } x ∈ S converges in distribution to
N (0 , Σ l ( S, S )) , as min { n 1 , . . . , n l − 1 } → ∞ , where Σ l is the CK as given in Eq.
(CK).
Neural Tangent Kernel By a slightly more involved version of the “Gaussian conditioning” technique, Yang (2019) also showed that, for any x, y ∈ X ,
[Equation]
[Equation]
converges almost surely to Θ L ( x, y ) as the widths tend to inﬁnity, where Θ l is the NTK as given in Eq.
(NTK).
F. F AST E VALUATIONS OF CK AND NTK
For certain φ like relu or erf, V φ and V (cid:48) φ can be evaluated very quickly, so that both the CK and NTK can be computed in O ( |X| 2 L ) time, where X is the set of points we want to compute the kernel function over, and L is the number of layers.
Fact F.1 (Cho and Saul (2009)) .
For any kernel K
[Equation]
where c = K ( x, x (cid:48) ) / (cid:112) K ( x, x ) K ( x (cid:48) , x (cid:48) ) .
Fact F.2 (Neal (1995)) .
For any kernel K ,
[Equation] [Equation]
Fact F.3.
Let φ ( x ) =
exp
( x/σ ) for some σ > 0 .
For any kernel K ,
[Equation]
F
L INEAR E VOLUTION OF N EURAL N ETWORK UNDER GD
Remarkably, the NTK governs the evolution of the neural network function under gradient descent in the inﬁnite-width limit.
First, let’s consider how the parameters θ and the neural network function f evolve under continuous time gradient ﬂow.
Suppose f is only deﬁned on a ﬁnite input space
X = { x 1 , . . .
, x k } .
We will visualize f
[Equation]
(best viewed in color).
Then under continuous time gradient descent with learning rate η ,
[Equation]
(12) where Θ t = ∇ θ f (cid:62) t · ∇ θ f t ∈ R k × k is of course the (ﬁnite width) NTK.
These equations can be visualized as
[Equation]
Thus f undergoes kernel gradient descent with (functional) loss L ( f ) and kernel Θ t .
This kernel Θ t of course changes as f evolves, but remarkably, it in fact stays constant for f being an inﬁnitely wide
MLP (Jacot et al., 2018):
[Equation]
) where Θ is the inﬁnite-width NTK corresponding to f .
A similar equation holds for the CK Σ if we train only the last layer,
[Equation]
Training Last Layer
[Equation]
If L is the square loss against a ground truth function f ∗ , then ∇ f L ( f t ) =
12 k ∇ f (cid:107) f t − f ∗
[Equation]
2 =k
( f t − f ∗ ) , and the equations above become linear differential equations.
However, typically we only have a training set X train ⊆
X of size far less than |X| .
In this case, the loss function is effectively
[Equation]
with functional gradient
[Equation]
where D train is a diagonal matrix of size k × k whose diagonal is 1 on x ∈ X train and 0 else.
Then our function still evolves linearly
[Equation]
(13) where K is the CK or the NTK depending on which parameters are trained.
F. R ELATIONSHIP TO G AUSSIAN P ROCESS I NFERENCE .
Recall that the initial f 0 in Eq.
(13) is distributed as a Gaussian process N (0 , Σ) in the inﬁnite width limit.
As Eq.
(13) is a linear differential equation, the distribution of f t will remain a Gaussian process for all t , whether K is CK or NTK.
Under suitable conditions, it can be shown that (Lee et al., 2019), in the limit as t → ∞ , if we train only the last layer, then the resulting function f ∞ is distributed as a Gaussian process with mean ¯ f ∞ given by
[Equation]
and kernel Var f ∞ given by
[Equation]
These formulas precisely described the posterior distribution of f given prior N (0 , Σ) and data { ( x, f ∗ ( x )) } x ∈X train .
If we train all layers, then similarly as t → ∞ , the function f ∞ is distributed as a Gaussian process with mean ¯ f ∞ given by (Lee et al., 2019)
[Equation]
This is, again, the mean of the Gaussian process posterior given prior N (0 , Θ) and the training data { ( x, f ∗ ( x )) } x ∈X train .
However, the kernel of f ∞ is no longer the kernel of this posterior, but rather is an expression involving both the NTK Θ and the CK Σ ; see Lee et al.
In any case, we can make the following informal statement in the limit of large width
Training the last layer (resp.
all layers) of an MLP inﬁnitely long, in expectation, yields the mean prediction of
the
GP inference
given
prior N (
, Σ) (
resp
N (0 , Θ) ).
G A B RIEF R EVIEW OF H ILBERT -S CHMIDT O PERATORS AND T HEIR S PECTRAL T HEORY
In this section, we brieﬂy review the theory of Hilbert-Schmidt kernels, and more importantly, to properly deﬁne the notion of eigenvalues and eigenfunctions.
A function K : X 2 → R is called a
Hilbert-Schmidt operator if K ∈ L 2 ( X × X ) ,
i.e.
[Equation]
(cid:107) K (cid:107) 2 HS is known as the Hilbert-Schmidt norm of K .
K is called symmetric if K ( x, y ) =
K ( y, x ) and positive deﬁnite (resp. semideﬁnite)
if
[Equation]
A spectral theorem (Mercer’s theorem) holds for Hilbert-Schmidt operators.
Fact G.1.
If K is a symmetric positive semideﬁnite Hilbert-Schmidt kernel, then there is a sequence of scalars λ i ≥ 0 (eigenvalues) and functions f
i ∈
L 2 ( X ) (eigenfunctions), for i ∈ N , such that
[Equation]
and K
[Equation]
x, y
[Equation]
where the convergence is in L 2 ( X × X ) norm.
This theorem allows us to speak of the eigenfunctions and eigenvalues, which are important for training and generalization considerations when K is a kernel used in machine learning, as discussed in the main text.
A sufﬁcient condition for K to be a Hilbert-Schmidt kernel in our case (concerning only probability measure on X ) is just that K is f f ˜
H E IGENDECOMPOSITION OF N EURAL K ERNEL ON D IFFERENT D OMAINS H. B OOLEAN C UBE
From the Fourier Series Perspective.
We continue from the discussion of the boolean cube in the main text.
Recall that T ∆ is the shift operator on functions that sends Φ( · ) to Φ( · − ∆) .
Notice that, if we let Φ( t ) =
e κt for some κ ∈ C , then T ∆ Φ( s ) =
e − κ ∆ · e κt .
Thus Φ is an “eigenfunction” of the operator T ∆ with eigenvalue e − κ ∆ .
In particular, this implies that
Proposition H.1.
Suppose Φ( t ) =
e t/σ 2 , as in the case when K is the CK or NTK of a 1-layer neural network with nonlinearity exp( · /σ ) , up to multiplicative constant (Fact F.3).
Then the eigenvalue µ k over the boolean cube (cid:28) d equals
[Equation]
where ∆ = 2 /d .
It would be nice if we can express any Φ as a linear combination of exponentials, so that Eq.
(5) simpliﬁes in the fashion of Prop H.1 — this is precisely the idea of Fourier series.
We will use the theory of Fourier analysis on the circle, and for this we need to discuss periodic functions.
Let ˜Φ : [ − 2 , 2] → R be deﬁned as
[Equation]
See Fig.
14 for an example illustration.
Note that if Φ is continuous on [ − 1 , 1] , then ˜Φ is continuous as a periodic function on [ − 2 , 2] .
The Fourier basis on functions over [ − 2 , 2] is the collection { t (cid:55)→ e 1 2 πist } s ∈ Z .
Under generic conditions (for example if Ψ ∈ L 2 [ − 2 , 2] ), a function Ψ has an associated Fourier series (cid:80) s ∈ Z ˆΨ( s ) e 12 πist .
We brieﬂy review basic facts of Fourier analysis on the circle.
Recall the following notion of functions of bounded variation .
Deﬁnition H.2.
A function f : [ a, b ] → R is said to have bounded variation if
[Equation]
where the supremum is taken over all partitions P of the interval [ a, b ] ,
[Equation]
Intuitively, a function of bounded variation has a graph (in [ a, b ] × R ) of ﬁnite length.
Fact H.3 (Katznelson (2004)) .
A bounded variation function f : [ − 2 , 2] → R that is periodic (i.e. f ( − 2) =
f (2) ) has a pointwise-convergent Fourier series:
[Equation]
From this fact easily follows the following lemma.
Lemma H.4.
Suppose Φ is continuous and has bounded variation on [ − 1 , 1] .
Then ˜Φ is also continuous and has bounded variation, and its Fourier Series (on [ − 2 , 2] ) converges pointwise to ˜Φ .
Proof.
˜Φ is obviously continuous and has bounded variation as well, and from Fact H.3, we know a periodic continuous function with bounded variation has a pointwise-convergent Fourier Series.
Certainly, T ∆ sends continuous bounded variation functions to continuous bounded variation functions.
Because T
[Equation]
whenever both sides are well deﬁned.
If Ψ is continuous and has bounded variation then T ∆ Ψ is also continuous and has bounded variation, and thus its Fourier series, the RHS above, converges pointwise to T ∆ Ψ .
Now, observe
[Equation]
Expressing the LHS in Fourier basis, we obtain
Theorem H.5.
[Equation]
where
[Equation]
denote the Fourier coefﬁcients of ˜Φ on [ − 2 , 2] .
(Here i is the imaginary unit here, not an index).
Recovering the values of Φ given the eigenvalues µ 0 , . .
. , µ d .
Conversely, given eigenvalues µ 0 , . . .
, µ d corresponding to each monomial degree, we can recover the entries of the matrix K .
Theorem H.6.
For any x, y ∈ (cid:28) d with Hamming distance r ,
[Equation]
where C d − r,r k = (cid:80)
j
[Equation]
−
[Equation]
+
[Equation]
(cid:1) as in Eq.
Proof.
Recall that for any S ⊆
[ d ] , χ S ( x ) =
x S is the Fourier basis corresponding to S (see Eq.
Then by converting from the Fourier basis to the regular basis, we get
[Equation]
= K ( x, y ) for any x, y ∈ (cid:28) d with Hamming distance r =
[Equation]
|
[Equation]
y ) .
- 2 × 102 × 104 ×
C 0 ( 63 ) ( x )
C 1 ( 63 ) ( x )
C 2 ( 63 ) ( x )
C 3 ( 63 ) ( x )
C 4 ( 63 ) ( x )
C 8 ( 63 ) ( x )
If x and y differ on a set T ⊆
[ d ] , then we can simplify the inner sum
[Equation]
Remark H.7 .
If we let T be the operator that sends µ • (cid:55)→ µ • +1 , then we have the following operator expression
[Equation]
Remark H.8 .
The above shows that the matrix C
= { C d − r,r k
[Equation]
H. S PHERE
Now let’s consider the case when X = √ d S d − 1 is the radius- √ d sphere in R d equipped with the uniform measure.
Again, because x ∈ X all have the same norm, we will consider Φ as a univariate function with K ( x, y ) =
Φ( (cid:104) x, y (cid:105) / (cid:107) x
cid:107)(cid:107) y (cid:107) ) =
Φ( (cid:104) x, y (cid:105) /d ) .
As is long known (Schoenberg, 1942; Gneiting, 2013; Xu and Cheney, 1992; Smola et al., 2001), K is diagonalized by spherical harmonics.
We review these results brieﬂy below, as we will build on them to deduce spectral information of K on isotropic Gaussian distributions.
Review: spherical harmonics and Gegenbauer polynomials.
Spherical harmonics are L 2 functions on S d − 1 that are eigenfunctions of the Laplace-Beltrami operator ∆ S d − 1 of S d − 1 .
They can be described as the restriction of certain homogeneous polynomials in R d to S d − 1 .
Denote by H d − 1 , ( l ) the space of spherical harmonics of degree l on sphere S d − 1 .
Then we have the orthogonal decomposition
L
[Equation] [Equation]
l ) .
It is a standard fact that dim
[Equation]
There is a special class of spherical harmonics called zonal harmonics that can be represented as x (cid:55)→ p ( (cid:104) x, y (cid:105) ) for speciﬁc polynomials p : R → R , and that possess a special reproducing property which we will describe shortly.
Intuitively, the value of any zonal harmonics only depends on the “height” of x along some ﬁxed axis y , so a typical zonal harmonics looks like Fig.
The polynomials p must be one of the Gegenbauer polynomials.
Gegenbauer polynomials { C ( α ) l ( t ) } ∞ l =0 are orthogonal polynomials with respect to the measure (1 − t 2 )
α − 12 on [ − 1 , 1] (see Fig.
15 for examples), and here we adopt the convention that
[Equation]
Then for each (oriented) axis y ∈ S
d − 1 and degree l , there is a unique zonal harmonic
[Equation]
for any x, y ∈ S d − 1 , where c d,l = d − 2 d +2 l − 2 .
Very importantly, they satisfy the following
Fact H.9 (Reproducing property (Suetin)) .
For any f ∈ H d − 1 , ( m ) ,
[Equation]
We also record a useful fact about Gegenbauer polynomials.
Fact H.10 (Suetin) .
[Equation]
By a result of Schoenberg (1942), we have the following eigendecomposition of K on the sphere.
Theorem H.11 (Schoenberg) .
Suppose Φ : [ − 1 , 1] → R is in L 2 ((1 − t 2 )
d
− 12 − 1 ) , so that it has the
Gegenbauer expansion
[Equation]
Then K has eigenspaces H d − 1 , ( l ) √
d def = { f ( x/ √ d ) :
f ∈ H d − 1 , ( l ) } with corresponding eigenvalues a l .
Since (cid:76) ∞ l =
H d − 1 , ( l ) √ d is an orthogonal decomposition of L 2 ( √ d S d − 1 ) , this describes all eigenfunctions of K considered as an operator on L 2 ( √ d S d − 1 ) .
For completeness, we include the proof of this theorem in Appendix I.
By Bezubik et al.
(2008), we can express the Gegenbauer coefﬁcients, and thus equivalently the eigenvalues, via derivatives of Φ :
Theorem H.12 (Bezubik et al.
If the Taylor expansion of Φ at 0,
[Equation]
is absolutely convergent on the closed interval [ − 1 , 1] , then the Gegenbauer coefﬁcients a l in
Thm H.11 in dimension d is equal to the absolute convergent series
[Equation]
As the dimension d of the sphere tends to ∞ , the eigenvalues in fact simplify to the derivatives of Φ :
Theorem H.13.
Let K be the CK or NTK of an MLP on the sphere √ d S d − 1 .
Then K can be expressed as K ( x, y ) =
Φ( (cid:104) x, y (cid:105) /d )
for some smooth Φ : [ − 1 , 1] → R .
Let a (cid:96) denote K ’s eigenvalues on the sphere (as in Thm H.11).
If we ﬁx (cid:96) and let d → ∞ , then
[Equation]
where Φ ( (cid:96) ) denotes the (cid:96) th derivative of Φ .
This theorem is the same as Thm I.6 except that it concerns the sphere rather than the boolean cube.
Proof.
By Thm I.3, Φ ’s Taylor expansion around 0 is absolutely convergent on [ − 1 , 1] , so that the condition of Thm H.12 is satisﬁed.
Therefore, Eq.
(15) holds and is absolutely convergent.
By dominated convergence theorem, we can exchange the limit and the summation, and get
[Equation]
as desired.
H. I SOTROPIC G AUSSIAN
Now let’s consider X
= R d equipped with standard isotropic Gaussian N (0 , I ) , so that K behaves like
[Equation]
for any f ∈ L 2 ( N (0 , I )) .
In contrast to the previous two sections, K will essentially depend on the effect of the norms (cid:107) x (cid:107) and (cid:107)
y
(cid:107) on Φ .
Note that an isotropic Gaussian vector z ∼ N (0 , I ) can be sampled by independently sampling its direction v uniformly from the sphere S d − 1 and sampling its magnitude r from a chi distribution
χ d with d degrees of freedom.
Proceeding along this line of logic yields the following spectral theorem:
Theorem H.14.
A function K : ( R d )
→ R of the form
[Equation]
forms a positive semideﬁnite Hilbert-Schmidt operator on L 2 ( N (0 , I ))
iff Φ can be decomposed as
[Equation]
16) satisfying
[Equation]
) where
[Equation]
• C ( d − 22 ) l ( t ) are Gegenbauer polynomials as in Appendix H.2, with (cid:107) C ( d − 22 )
l (cid:107) =
(cid:113)(cid:82)
[Table]
C
[Table] [Table]
denoting the
[Table]
of
[Table]
• and A l are positive semideﬁnite Hilbert-Schmidt kernels on L 2 ( 1 d χ 2 d ) , the L 2 space over the probability measure of a χ 2 d -variable divided by d , and with (cid:107) A l (cid:107) denoting the HilbertSchmidt norm of A l .
In addition, K is positive deﬁnite iff all A l are.
See Appendix I for a proof.
As a consequence, K has an eigendecomposition as follows under the standard Gaussian measure in d dimensions.
Corollary H.15.
Suppose K and Φ are as in Thm H.14 and K is a positive semideﬁnite HilbertSchmidt operator, so that Eq.
(16) holds, with Hilbert-Schmidt kernels A l .
Let A l have eigendecomposition
[Equation]
for eigenvalues a li ≥ 0 and eigenfunctions
u li ∈ L 2 ( 1 d χ 2 d ) with E q ∼ 1 d χ 2 d u li ( q ) 2 = 1 .
Then K has eigenvalues { a li : l, i ∈ [0 , ∞ ) } , and each eigenvalue a li corresponds to the eigenspace
[Equation]
where H d − 1 , ( l ) is the space of degree l spherical harmonics on the unit sphere S d − 1 of ambient dimension d .
For certain simple F , we can obtain { A l } l ≥ 0 explicitly.
For example, suppose K is degree- s positive-homogeneous , in the sense that, for a, b > 0 ,
K
[Equation]
ax
[Equation]
ab
[Equation]
x
[Equation]
y ) .
This happens when K is the CK or NTK of an MLP with degree- s positive-homogeneous.
Then it’s easy to see that Φ( t, q, q (cid:48) )
= ( qq (cid:48) )
s ¯Φ( t ) for some ¯Φ : [ − 1 , 1] → R , and
[Equation]
where { a l } l are the Gegenbauer coefﬁcients of ¯Φ ,
[Equation]
We can then conclude with the following theorem.
Theorem H.16.
Suppose K : ( R d ) 2 → R is a kernel given by
[Equation]
for some functions R : [0 , ∞ ) → R , ¯Φ : [ − 1 , 1] → R .
Let
[Equation]
be the Gegenbauer expansion of ¯Φ .
Also deﬁne
[Equation]
Then over the standard Gaussian in R d , K has the following eigendecomposition
• For each l ≥ 0 ,
[Equation] [Equation]
is an eigenspace with eigenvalue λ
a l . • For any S ∈ L 2 ( 1 d χ 2 d ) that is orthogonal to R , i.e.
[Equation]
the function
[Equation]
for any f ∈ L 2 ( S d − 1 ) is in the null space of K .
Proof.
The A l in Eq.
(16) for K are all equal to
[Equation]
This is a rank 1 kernel (on L 2 ( 1 d χ 2 d ) ), with eigenfunction R/λ and eigenvalue λ 2 .
The rest then follows straightforwardly from Thm H.11.
A common example where Thm H.16 applies is when K is the CK of an MLP with relu, or more generally degree-
s positive homogeneous activation functions, so that the R in Thm H.16 is a polynomial.
In general, we cannot expect K can be exactly diagonalized in a natural basis, as { A l } l ≥ 0 cannot even be simultaneously diagonalizable.
We can, however, investigate the “variance due to each degree of spherical harmonics” by computing
[Equation]
(19) which is the coefﬁcient of Gegenbauer polynomials in
[Equation]
( t
[Equation] [Equation]
Proposition H.17.
Assume that Φ( t, q, q (cid:48) ) is continuous in q and q (cid:48) .
Suppose for any d and any t ∈ [ − 1 , 1] , the random variable Φ( t, q, q (cid:48) ) with q, q (cid:48) ∼ d − 1 χ 2 d has a bound | Φ( t, q, q (cid:48) )
| ≤ Y for some random variable Y with E | Y | < ∞ .
Then for every t ∈ [ − 1 , 1] ,
[Equation]
Proof.
By the strong law of large number, d − 1 χ 2 d converges to 1 almost surely.
Because Φ( t, q, q (cid:48) ) is continuous in q and q (cid:48) , almost surely we have Φ( t, q, q (cid:48) )
→ Φ( t, 1 , 1) almost surely.
Since Φ is bounded by Y , by dominated convergence, we have
[Equation]
as desired.
In the ﬁnal part of this section, we show that in the limit of large input dimension d , the top eigenvalues of K over the standard Gaussian can be easily described (Thm H.19).
First, we need to specify some conditions on Φ .
Deﬁnition H.18.
Φ : [ − 1 , 1] × R + × R + → R is called reasonable if
• There is a Taylor expansion in t ,
[Equation]
that is absolutely convergent on ( t, q, q (cid:48) )
∈ [ − 1 , 1] × R + ×
R + , and such that each B (cid:96) is smooth ( C ∞ ) on ( q, q (cid:48) )
∈ R + × R + .
• for all ( t, q, q (cid:48) ) ∈ [ − 1 , 1] × R + × R + , and for any l ∈ [0 , ∞ ) , we have | B l ( t, q, q (cid:48) )
| ≤ C (1 + | q | r + | q (cid:48) | r ) for some constants C, r > 0 that may depend on l but not on t, q, q (cid:48) .
Theorem H.19.
Suppose K is a the CK or NTK of an MLP with polynomially bounded activation function.
For every degree l , K over N (0 , I d ) has an eigenvalue a l 0 at spherical harmonics degree l (in the sense of Cor H.15) with
[Equation]
where A l is as in Eq.
Furthermore,
[Equation]
Here Φ ( l ) is the l th derivative of Φ( t, q, q (cid:48) ) against t .
Proof.
By Lem H.20 below, Φ is reasonable.
Let a l = E q ∼ 1 d χ 2 d A l ( q, q ) as in Eq.
(19), and let b l def =
E q (cid:48) ∼ 1 d χ 2 d
A l ( q, q (cid:48) ) .
Let a li be the i th largest eigenvalue of A l as in Eq.
(18), with a l 0 being the largest.
Note that all of these quantities a l , b l , a li depend on d , but we suppress this notationally.
We seek to prove the following claims:
a l 0 ≤ a l 2.
a l 0 ≥ b l 3.
d l b l → Φ ( l ) (0 , 1 , 1) 4.
d l a l → Φ ( l ) (0 , 1 , 1)
Claim 1: a l 0 ≤ a l .
First note that a l is the trace of the operator A l , so that a l = (cid:80) ∞ i =0 a li .
Thus, any eigenvalue a li is at most a l .
Claim 2: a l 0 ≥ b l .
Now, by Min-Max theorem, the largest eigenvalue a l 0 of A l is equal to
[Equation]
where 0 (cid:54) =
f ∈ L 2 ( 1 d χ 2 d ) and q, q (cid:48) ∼ 1 d χ 2 d .
If we set f ( q ) = 1 identically, then we get
[Equation]
as desired.
Claims 3 and 4.
Now note that we have the following equalities in the Hilbert space L 2 ((1 − t 2 ) d − 12 − 1 ) , because of the absolute convergence in Eq.
[Equation]
ˇΦ( t ) def =
E
[Equation]
( t )
[Equation]
Thus, by Eq.
[Equation]
By the absolute convergence of Eq.
(21), differentiation commutes with expectation:
[Equation]
where B l +2 k is as in Eq.
Furthermore, as d → ∞ , because Φ ( l +2 k ) ( t, q, q (cid:48) ) is smooth and polynomially bounded in q and q (cid:48) , while 1 d χ 2 d has exponential tails and converges a.s. to 1, we have
[Equation]
Finally, by dominated convergence, we get
[Equation]
as desired.
The proof of lim d l b l = Φ ( l ) (0 , 1 , 1) is similar.
Lemma H.20.
Let Φ be the function corresponding to the CK or NTK of an MLP with polynomially bounded activation functions.
Then Φ is reasonable (Defn H.18).
Proof.
The Taylor expansion Eq.
(21), its absolute convergence, and the smoothness of B l follows from the proof of Thm I.3.
The polynomial-boundedness of B l follows trivially from the polynomialboundedness of activation.
H. I N H IGH D IMENSION , B OOLEAN C UBE ≈ S PHERE ≈ S TANDARD G AUSSIAN
For the same neural kernel K with K ( x, y ) =
Φ( (cid:104) x, y (cid:105) / (cid:107) x
cid:107)(cid:107) y (cid:107) , (cid:107) x (cid:107)
/d, (cid:107) y (cid:107) 2 /d )
, let ˆΦ d be as deﬁned in Eq.
(20), and let Φ S def =
Φ( t, 1 , 1) .
Thus Φ S is the univariate Φ that we studied in
Appendix H.2 in the context of the sphere.
Empirical veriﬁcation of the spectral closeness As d → ∞ , 1 d χ 2 d converges almost surely to 1, and each A l in Eq.
(16) converges weakly to the simple operator that multiplies the input function by
A l (1 , 1) .
We verify in Fig.
17 that, for different erf kernels, ˆΦ d approximates Φ S when d is large, which would then imply that their spectra become identical for large d .
Note that this is tautologically true for relu kernels with no bias σ b = 0 because they are positive-homogeneous.
Next, we compute the eigenvalues of K on the boolean cube and the sphere, as well as the eigenvalues of the kernel ˆ K ( x, y ) def = ˆΦ
d ( (cid:104) x, y (cid:105) / (cid:107) x
cid:107)(cid:107) y (cid:107) ) on the sphere, which “summarizes” the eigenvalues of K on the standard Gaussian distribution.
In Fig.
18, we compare them for different dimensions d up to degree 5 (there, “Gaussian” means ˆ K on the sphere).
We see that by dimension 128, all eigenvalues shown are very close to each other for each data distribution.
Theoretical veriﬁcation of the spectral closeness Thms H.13, H.19 and I.6 show that when the dimension d is sufﬁciently large, the top eigenvalues of K as an operator on (cid:28) d is very close to the top eigenvalues of K as an operator on √ d S d − 1 and those of K as an operator on N (0 , I d ) :
Corollary H.21.
Let K be the CK or NTK of an MLP with polynomially bounded activation function.
Then K can be expressed as K ( x, y ) =
Φ( (cid:104) x, y (cid:105) /d )
for some smooth Φ : [ − 1 , 1] → R .
Let µ k denote the eigenvalue of K as an operator on (cid:28) d corresponding to the eigenspace of degree k polynomials (see Thm 3.1).
Let a k denote the eigenvalue of K as an operator on √ d S d − 1 corresponding to the eigenspace of degree k spherical harmonics (see Thm H.11).
Let a k 0 denote the largest eigenvalue of K as an operator on N (0 , I d ) restricted to degree k spherical harmonics (see Thm H.19).
Then for any ﬁxed k ≥ 0 , for sufﬁciently large d , we have
[Equation]
where Φ ( k ) (0) is the k th derivative of Φ at 0.
If Φ ( k ) (0) (cid:54) = 0 , then
[Equation]
erf NTK σ w 2 = 2, σ b 2 = 0.05,L =
[Figure]
--   erf CK σ w 2 = 2, σ b 2 = 0.05,L =- 1. erf NTK σ w 2 = 2, σ b 2 =
2,L
=
Φ d d =d =d =d =d =Φ S
[Figure]
[Figure]
● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ⨯ ⨯ ⨯ ⨯
⨯
⨯ ⨯
⨯ ⨯
⨯ ⨯
⨯ ⨯
⨯
⨯ ⨯
⨯ ⨯
⨯ ⨯
⨯ ⨯
⨯
⨯ + + + + + + + + + + + + + + + + + + + + + + + +
[Figure]
k ● d =● d =● d =● d =● boolean ⨯ sphere +
Gaussian
If we ﬁx k and let the input dimension d → ∞ , then the fractional variance of degree k converges to
[Equation]
for all three input distributions (cid:28) d , √ d S d − 1 , and N (0 , I d ) .
Practically speaking, only the top eigenvalues matter.
Observe that, in the empirical and theoretical results above, we only verify that the top eigenvalues ( µ k , a k , or a k 0 for k small compared to d ) are close when d is large.
While this result may seem very weak at face value, in practice, the closeness of these top eigenvalues is the only thing that matters.
Indeed, in machine learning, we will only ever have a ﬁnite number, say N , of training samples to work with.
Thus, we can only use a ﬁnite N × N submatrix of the kernel K .
This submatrix, of course, has only N eigenvalues.
Furthermore, if these samples are collected in an iid fashion (as is typically assumed), then these eigenvalues approximate the largest N eigenvalues (top N counting multiplicity) of the kernel K itself (Tropp, 2015).
As such, the smaller eigenvalues of K can hardly be detected in the training sample, and cannot affect the machine learning process very much.
Let’s discuss a more concrete example: Fig.
18 shows that the boolean cube eigenvalues µ k are very close to the sphere eigenvalues a k for all k ≤ 5 .
Over the boolean cube, µ 0 , . . .
, µ 5 cover eigenspaces of total dimension (cid:0) d 0 (cid:1) + · · · + (cid:0) d 5 (cid:1) , which is 275,584,033 when d = 128 .
We need at least that many samples to be able to even detect the eigenvalue µ 6 and the possible difference between it and the sphere eigenvalue a 6 .
But note in comparison, Imagenet, one of the most common large datasets in use today, has only about 15 million samples, 10 times less than the number above.
Additionally, in this same comparison, d = 128 dramatically pales compared to Imagenet’s input dimension 3 × 256 2 = 196608 , and even to the those of the smaller common datasets like CIFAR ( d = 3 × 32 2 = 3072 ) and MNIST ( d = 24 2 = 576 ) — if we were to even use the input dimension of MNIST above, then µ 0 , . .
. , µ 5 would cover eigenspaces of 523 billion total dimensions!
Hence, it is quite practically relevant to consider the effect of large d on the eigenvalues, while keeping k small.
Again, we remark that even when one ﬁxes k and increases d , the dimension of eigenspaces affected by our limit theorems Thms H.13, H.19 and I.6 increases like Θ( d k ) , which implies one needs an increasing number Θ( d k ) of training samples to see the difference of eigenvalues in higher degrees k .
Finally, from the perspective of fractional variance, we also can see that only the top k spectral closeness matters: By Cor H.21, for any (cid:15) > 0 , there is a k such that the total fractional variance of degree 0 to degree k (corresponding to eigenspaces of total dimension Θ( d k ) ) sums up to more than 1 − (cid:15) , for the cube, the sphere, and the standard Gaussian simultaneously, when d is sufﬁciently large.
This is because the asymptotic fractional variance is completely determined by the derivatives of Φ at t = 0 .
I O MITTED P ROOFS
Theorem 3.1.
On the d -dimensional boolean cube (cid:28) d , for every S ⊆
[ d ] , χ S is an eigenfunction of
K with eigenvalue
[Equation]
(cid:32)(cid:88)
[Equation]
where 1 = (1 , . . . , 1) ∈ (cid:28) d .
This deﬁnition of µ | S | does not depend on the choice S , only on the cardinality of S .
These are all of the eigenfunctions of K by dimensionality considerations.
Proof.
We directly verify Kχ S [Equation] | S | χ S .
Notice ﬁrst that
[Equation]
where (cid:12) is Hadamard product.
We then calculate
[Equation]
Here we are using the fact that x and y are boolean to get x S
=
( x (cid:12) y ) S y S .
Changing variable z def = x (cid:12) y , we get
[Equation]
as desired.
Finally, note that µ | S | is invariant under permutation of [ d ] , so indeed it depends only on the size of S .
Theorem H.11 (Schoenberg) .
Suppose Φ : [ − 1 , 1] → R is in L 2 ((1 − t 2 )
d
− 12 − 1 ) , so that it has the
Gegenbauer expansion
[Equation]
Then K has eigenspaces H d − 1 , ( l ) √
d def = { f ( x/ √ d ) :
f ∈ H d − 1 , ( l ) } with corresponding eigenvalues a l .
Since (cid:76) ∞ l =
H d − 1 , ( l ) √ d is an orthogonal decomposition of L 2 ( √ d S d − 1 ) , this describes all eigenfunctions of K considered as an operator on L 2 ( √ d S d − 1 ) .
Proof.
Let f ∈ H
d − 1 , ( n ) .
Then for any x ∈ √ d S d − 1 ,
[Equation]
by orthogonality
[Equation]
by reproducing property.
Lemma 3.2.
With µ k as in Thm 3.1,
[Equation]
where
[Equation]
Proof.
Because (cid:80) i x i /d only takes on values {− d 2 ∆ , ( − d 2 + 1)∆ , . . .
, ( d 2 − 1)∆ , d 2 ∆ } , where ∆ = 2 d , we can collect like terms in Eq.
(4) and obtain
[Equation]
which can easily be shown to be equal to
[Equation]
, proving Eq.
(6) in the claim.
Finally, observe that C d − k,k r is also the coefﬁcient of x r in the polynomial (1 − x ) k
(1 + x ) d − k .
Some operator arithmetic then yields Eq.
Theorem H.14.
A function K : ( R d )
→ R of the form
[Equation]
forms a positive semideﬁnite Hilbert-Schmidt operator on L 2 ( N (0 , I ))
iff Φ can be decomposed as
[Equation]
satisfying
[Equation]
where
• c d,l = d − 2 d +2 l −• C ( d − 22 ) l ( t ) are Gegenbauer polynomials as in Appendix H.2, with (cid:107) C
( d − 22 ) l
[Equation]
(cid:113)(cid:82)− 1 C ( d − 22 )
[Equation]
[Equation]
[Equation]
d − [Equation] 1 d t denoting the norm of
[Equation]
d − [Equation]
[Equation] in L [Equation] • and A l are positive semideﬁnite Hilbert-Schmidt kernels on L 2 ( 1 d χ 2 d ) , the L 2 space over the probability measure of a χ 2 d -variable divided by d , and with (cid:107) A l (cid:107) denoting the HilbertSchmidt norm of A l .
In addition, K is positive deﬁnite iff all A l are.
Proof.
Note that an isotropic Gaussian vector z ∼ N (0 , I ) can be sampled by independently sampling its direction v uniformly from the sphere S d − 1 and sampling its magnitude r from a chi distribution
χ d with d degrees of freedom.
In the following, we adopt the following notations
[Equation]
Then, by the reasoning above,
[Equation]
Here f ∈ L 2 ( N (0 , I/d ))
(so that f ( · / √ d ) ∈
L 2 ( N (0 , I )) ) and d − 1 χ 2 d is the distribution of a χ 2 d random variable divided by d .
Because of this decomposition of N (0 , I ) into a product distribution of direction and magnitude, its space of L 2 functions naturally decomposes into a tensor product of corresponding L 2 spaces
[Equation]
where every f ∈ L 2 ( N (0 , I )) can be written as a sum
[Equation]
v ) where q = (cid:107) x (cid:107) 2 /d, v = x/ (cid:107) x (cid:107) as above, P l ∈ H d − 1 , ( l ) is a spherical harmonic of degree l , and
R l ∈ L 2 ( d − 1 χ 2 d ) (i.e. R l ( · /d
) ∈
L 2 ( χ 2 d ) ).
Here, the equality is understood as a convergence of the
RHS partial sums in the Hilbert space L 2 ( S d [Equation] 1 ) ⊗ L 2 ( d − 1 χ 2 d ) .
Likewise, assuming K is Hilbert-Schmidt, then its Hilbert-Schmidt norm (measured against the uniform distribution over the sphere) is bounded:
[Equation]
Thus Φ resides in the tensor product space
[Equation]
and therefore can be expanded as
[Equation]
where C ( [Equation] − 22 ) l ( t ) are Gegenbauer polynomials as in Appendix H.2 and A l ∈ L 2 ( d − 1 χ 2 d ) ⊗ 2 .
By
Lem I.1 below, K being Hilbert-Schmidt implies that each A l is, as well.
Furthermore, since (cid:107) K
[Equation]
HS = (cid:107) Φ [Equation] 2 F is ﬁnite, we have
[Equation]
(cid:107)
[Equation]
< ∞
[Equation]
Here, (cid:107) A l (cid:107) = (cid:113) E q,q (cid:48) ∼ 1 d χ 2 d
A l ( q, q (cid:48) ) 2 is the Hilbert-Schmidt norm of A l (i.e. its norm in
L 2 ( d − 1 χ 2 d ) ⊗ 2 ), and (cid:107) C ( d − 22 ) l
[Equation] [Equation]
[Equation]
d
[Equation]
is the norm of
[Equation]
in
L 2 ((1 − t 2 ) d − 12 − 1 ) .
Simplifying according to Eq.
(14) yields the equality in the claim.
Conversely, if each A l is Hilbert-Schmidt satisfying Eq.
(17), then K is obviously a Hilbert-Schmidt kernel as it has ﬁnite Hilbert-Schmidt norm.
Lemma I.1.
For each l , A l is a positive semideﬁnite Hilbert-Schmidt kernel.
It is positive deﬁnite if
K is.
Proof.
With q = (cid:107) x (cid:107) 2 /d [Equation] v = x/ (cid:107) x (cid:107) as above [Equation]
let f ( x/ √ d )
=
f ( √ qv )
=
R m ( q ) P m ( v ) for some degree m nonzero spherical harmonics
P m ∈ H d − 1 , ( m ) and some scalar function R m ∈
L 2 ( d − 1 χ 2 d ) that is not a.e. zero.
We have
[Equation]
Therefore,
[Equation]
is nonnegative, and is positive if K is positive deﬁnite, by the assumption above that f is not a.e. zero.
Since E P m ( v ) 2 > 0 as P m (cid:54) = 0 , we must have
[Equation]
This argument holds for any R m ∈ L 2 ( d − 1 χ 2 d ) that is not a.e. zero, so this implies that A l is positive semideﬁnite, and positive deﬁnite if K is so.
Weak Spectral Simplicity Bias
Theorem 4.1 (Weak Spectral Simplicity Bias) .
Let K be the CK or NTK of an MLP on a boolean cube (cid:28) d .
Then the eigenvalues µ k , k = 0 , . . .
, d, satisfy
[Equation]
Proof.
Again, there is a function Φ such that K ( x, y ) =
Φ( (cid:104) x, y (cid:105) / (cid:107) x
cid:107)(cid:107) y (cid:107) ) .
By Thm I.3, Φ has a
Taylor expansion with only nonnegative coefﬁcients.
[Equation]
By Lem I.2, Eq.
(9) is true for polynomials Φ( c )
=
c r
[Equation]
[Equation]
Then since each µ k = µ k (Φ) is a linear function of Φ , µ k (Φ)
= (cid:80) ∞
r =0 a r µ k ( c r ) also follows the same ordering.
Lemma I.2.
Let T ∆ be the shift operator with step ∆ that sends a function Φ( · ) to Φ( · − ∆) .
Let Φ( c ) =
c t for some t .
Let µ dk be the eigenvalue of K ( x, y )
=
Φ( (cid:104) x, y (cid:105) / (cid:107) x
cid:107)(cid:107) y (cid:107) ) on the boolean cube (cid:28) d .
Then for any 0 ≤ k ≤ d ,
[Equation] [Equation]
We furthermore have the identity
[Equation]
for any 2 ≤ k ≤ d .
Proof.
As in Eq.
[Equation]
where C d − k,k r def = (cid:80) j =0 ( − 1) r + j (cid:0) d − k j (cid:1)(cid:0)
k
r − j (cid:1) .
It’s easy to observe that
[Equation]
In the ﬁrst case, when Φ( c ) =
c t with t odd, then by symmetry µ k = 0 .
Similarly for the second case when t is even.
This ﬁnishes the proof for Eq.
Note that it’s clear from the form of Eq.
(5) that µ dk ≤ Φ(1) = 1 always.
So we show via induction on d that the rest of Eq.
(24) is true for any t ∈ N .
The induction will reduce the case of d to the case of d − 2 .
So for the base case, we need both d = 0 and d = 1 .
Both can be shown by some simple calculations.
Now for the inductive step, assume Eq.
(24) for d − 2 ,
and we observe that
[Equation]
By Eq.
(5), we can expand this into
[Equation]
By induction, µ d − 2 k − 2 ≥ 0 , so we have
[Equation]
as desired.
Theorem I.3.
Let K be the CK or NTK of an MLP with domain √ d S d − 1 ⊆ R d .
Then K ( x, y ) =
Φ (cid:16)
[Equation]
where Φ : [ − 1 , 1] → R has a Taylor series expansion around
[Equation]
with the properties that a i ≥ 0 for all i and (cid:80) i a i = Φ(1) ≤ ∞ , so that Eq.
(25) is absolutely convergent on c ∈ [ − 1 , 1] .
Proof.
We ﬁrst prove this statement for the CK of an L layer MLP with nonlinearity φ .
Let Φ l be the corresponding Φ -function for the CK Σ l .
It sufﬁces to prove this by induction on depth L .
For
L = 1 , Σ 1 ( x, x (cid:48) )
=
σ 2 w ( n 0 ) − 1 (cid:104) x, x (cid:48) (cid:105)
+ σ 2 b by Eq.
(CK), so clearly Φ 1 ( c ) =
a 0 + a 1 c where a 0 and a 1 are nonnegative.
Now for the inductive step, suppose Σ l − 1 satisﬁes the property that Φ l − 1 has Taylor expansion of the desired form.
We seek to show the same for Σ l and Φ l .
First notice that it sufﬁces to show this for
V φ (Σ l − 1 ) , since multiplication by σ 2 w and addition of σ 2 b preserves the property.
But
[Equation]
where
[Equation]
Using the notation of Lem I.4, we can express this as
[Equation]
Substituting the Taylor expansion of Φ l − 1 ( c ) Φ l − 1 (1) into the Taylor expansion of ˆ φ given by Lem I.4 gives us a Taylor series whose coefﬁcients are all nonnegative, since those of Φ
[Equation]
(1) and ˆ φ are nonnegative as well.
In addition, plugging in 1 for c in this Taylor series shows that the sum of the coefﬁcients equal ˆ φ (1)
= 1 , so the series is absolutely convergent for c ∈ [ − 1 , 1] .
This proves the inductive step.
For the NTK, the proof is similar, except we now also have a product step where we multiply
V φ (cid:48)
(Σ l − 1 ) with Θ l − 1 , and we simply just need to use the fact that product of two Taylor series with nonnegative coefﬁcients is another Taylor series with nonnegative coefﬁcients, and that the resulting radius of convergence is the minimum of the original two radii of convergence.
Lemma I.4.
Consider any σ > 0 and any φ : R → R square-integrable against N (0 , σ 2 ) .
Then the function
[Equation]
where ( x, y ) ∼ N (cid:18) 0 , (cid:18)
[Equation]
σ 2 c σ
[Equation]
c σ(cid:19)(cid:19) , has a Taylor series expansion around
[Equation]
with the properties that a i ≥ 0 for all i and (cid:80) i a
[Equation]
= ˆ φ (1) = 1 , so that Eq.
(27) is absolutely convergent on c ∈ [ − 1 , 1] .
Proof.
Since the denominator of ˆ φ doesn’t depend on c , it sufﬁces to prove this Taylor expansion exists for its numerator.
Let ˜ φ ( c ) def = φ ( σc ) .
Then
[Equation]
By Fact I.5, this is just
[Equation]
where b i are the Hermite coefﬁcients of ˜ φ .
Since φ ∈ L 2 ( N (0 , σ 2 ))
[Equation]
as desired.
Fact I.5 (O’Donnell (2014)) .
For any φ, ψ ∈ L 2 ( N (0 , 1)) ,
[Equation]
where a i and b i are respectively the Hermite coefﬁcients of φ and ψ .
Fixing k , taking the d → ∞ limit In this subsection, we prove that µ k ∼ d − k as d → ∞ with k ﬁxed.
More precisely,
Theorem I.6.
Let K be the CK or NTK of an MLP on a boolean cube (cid:28) d .
Then K can be expressed as K ( x, y ) =
Φ( (cid:104) x, y (cid:105) /d ) for some Φ : [ − 1 , 1] → R .
If we ﬁx k and let d → ∞ , then
[Equation]
where Φ ( k ) denotes the k th derivative of Φ .
An immediate consequence, using the fact that the degree k eigenspace has dimension (cid:0) dk (cid:1) ∼ d k /k !
for large d , is
Theorem 5.1 (Asymptotic Fractional Variance) .
Let K be the CK or NTK of an MLP on a boolean cube (cid:28) d .
Then K can be expressed as K ( x, y ) =
Φ( (cid:104) x, y (cid:105) /d ) for some analytic function Φ : R → R .
If we ﬁx k and let the input dimension d → ∞ , then the fractional variance of degree k converges to
[Equation]
where Φ ( k ) denotes the k th derivative of Φ .
Let’s ﬁrst give some intuition for why Thm I.6 should be true.
By Eqs.
(8) and (5),
[Equation]
=
[Equation] [Equation]
[Equation]
∆
[Equation] [Equation]
[Equation] [Equation]
r
[Equation] [Equation]
[Equation]
where Φ [ k ] = (1 − T ∆ )
k
Φ is the k th backward ﬁnite difference with step ∆ = 2 /d .
Approximating the ﬁnite difference with derivative, we thus would expect that, as suggested by Lem I.8,
[Equation]
when d is large, where Φ ( k ) is the k th derivative of Φ .
Since
[Equation]
is the probability mass at 1 − r ∆ of the binomial variable B def =
[Equation]
i
[Equation]
X i , where X i is the Bernoulli variable taking ± 1 value with half chance each.
This random variable converges almost surely to the delta distribution at 0, by law of large numbers.
Therefore, we would expect
[Equation]
as d → ∞ .
There is a single difﬁculty when trying to formalize this intuition.
One is the possibility that the k th derivative Φ ( k ) does not exist at the endpoints 1 and − 1 (note that it must exist in the interior, because by Thm I.3, Φ is analytic on ( − 1 , 1) ).
In this case, we must show that the portion of the interval [ − 1 , 1] near the endpoints contributes exponentially little mass to the probability distribution of the binomial variable B , that it suppresses any blowup that can happen at the edge.
We formalize this reasoning in the proof below.
Proof.
We ﬁrst prevent any blowup that may happen at the edge.
Let Φ [ k ] be the k th backward difference of Φ with step size ∆ = 2 /d , as in Lem I.8.
First note the trivial bound
[Equation]
since Φ is nondecreasing by Lem I.7.
Then for any R ∈ [0 , ( d − k ) / 2 − 1] ,
[Equation]
Now, in the second term, Φ [ k ] (1 − r ∆) ≤ 2 k Φ(1) as above, so that, by the binomial coefﬁcient entropy bound (Fact I.9),
[Equation] [Equation]
where p =
R/
( d − k ) .
If we choose R = (cid:98)
˜ p ( d − k ) (cid:99) for a ﬁxed ˜ p < 1 / 10 , then H ( p ) < 1 , and (28) is decreasing exponentially fast to 0 with d .
Now we formalize the law of large number intuition.
It then sufﬁces to show that
[Equation]
We will do so by presenting an upper and a lower bound which both converge to this limit.
We ﬁrst discuss the upper bound.
By Lem I.8,
[Equation]
The RHS can be upper bounded by an expectation over a binomial random variable:
Let X i be ±
Bernoulli variables, and let Φ ( k ) 12 ˜ p be the function
[Equation]
otherwise
Note that Φ ( k ) 12 ˜ p ( x ) is a bounded function.
Then with the binomial variable B = 1 d (cid:80) d − k i =
( X i + k/ ( d − k )) , we have
[Equation]
By strong law of large numbers, B converges almost surely to 0 as d → ∞ with k ﬁxed.
Thus the
RHS converges to
[Equation]
as desired.
A similar argument proceeds for the lower bound, after noting that, by Lem I.8,
[Equation]
Lemma I.7.
Let K be the CK or NTK of an MLP with domain √ d S d − 1 ⊆ R d .
Then K ( x, y ) =
Φ (cid:16) (cid:104) x,y (cid:105) (cid:107) x (cid:107)(cid:107) y (cid:107) (cid:17) where Φ : [ − 1 , 1] → R is analytic on ( − 1 , 1) , and all derivatives of Φ are nonnegative on ( − 1 , 1) .
Proof.
Note that, by Thm I.3, Φ has a convergent Taylor expansion on ( − 1 , 1) , i.e Φ is analytic on ( − 1 , 1) .
Thus, all derivatives of Φ exist (and are ﬁnite) on the interval ( − 1 , 1) and have the obvious
Taylor series derived from Eq.
For example,
[Equation]
Such Taylor series also converge on the open interval ( − 1 , 1) (but could diverge on the endpoints −and 1 ).
We get the desired result by noting that all a i are nonnegative.
By expressing ﬁnite difference as an integral, it’s easy to see that
Lemma I.8.
With the same setting as in Lem I.7, let Φ [ k ] be the k th backward ﬁnite difference with step size ∆ = 2 /d ,
[Equation]
Then Φ [ k ] is analytic on ( − 1 , 1) , has all derivatives nonnegative, and
[Equation]
29) where Φ ( k ) is the k th derivative of Φ .
Proof.
Everything follows immediately from
[Equation]
and Lem I.7.
Fact I.9 (Entropy bound on sum of binomial coefﬁcients) .
For any k ≤ d and R ≤ d/ 2 ,
R (cid:88) r
= (cid:18)
d − k r (cid:19) ≤ 2 H ( p )( d − k ) where p =
R/ ( d − k ) , and H is the binary entropy
[Equation]
p )
= − p log 2 p − (1 − p ) log 2 (1 − p ) .
[Figure]
[Figure]
p r o b a b ili t y probability vs rank of 10 4 random networks on {±1}| 2 w | 2 b | depth relu | 2 | 2 |erf
| 1 | 0 | 2 erf | 2 | 0 | 2 erf | 4 | 0 |erf | 4 | 0 |
J T HE { 0 , 1 } d VS THE {± 1 } d B OOLEAN C UBE
Valle-Pérez et al.
(2018) actually did their experiments on the { 0 , 1 } d boolean cube, whereas here, we have focused on the {± 1 } d boolean cube.
As datasets are typically centered before feeding into a neural network (for example, using Pytorch’s torchvision.transform.
Normalize ), {± 1 } d is much more natural.
In comparison, using the { 0 , 1 } d cube is equivalent to adding a bias in the input of a network and reducing the weight variance in the input layer, since any x ∈ {± 1 } d corresponds to 12 ( x + 1) ∈ { 0 , 1 } d .
As such, one would expect there is more bias toward low frequency components with inputs from { 0 , 1 } d .
Nevertheless, here we verify that our observations of Section 4 above still holds over the { 0 , 1 } d cube by repeating the same experiments as Fig.
1 in this setting (Fig. 19).
Just like over the {± 1 } d cube, the relu network biases signiﬁcantly toward certain functions, but with erf, and with increasing σ 2 w , this lessens.
With depth 32 and σ 2 w , the boolean functions obtained from erf network see no bias at all.