Regularization Matters: Generalization and Optimization of Neural Nets v.s. their Induced Kernel
Colin Wei, Jason D. Lee, Qiang Liu, Tengyu Ma
Introduction
In deep learning, over-parametrization refers to the widely-adopted technique of using more parameters than necessary . Over-parametrization is crucial for successful optimization, and a large body of work has been devoted towards understanding why. One line of recent works offers an explanation that invites analogy with kernel methods, proving that with sufficient over-parameterization and a certain initialization scale and learning rate schedule, gradient descent essentially learns a linear classifier on top of the initial random features. For this same setting, Daniely , Du et al. , Jacot et al. , Arora et al. make this connection explicit by establishing that the prediction function found by gradient descent is in the span of the training data in a reproducing kernel Hilbert space (RKHS) induced by the Neural Tangent Kernel (NTK). The generalization error of the resulting network can be analyzed via the Rademacher complexity of the kernel method.
These works provide some of the first algorithmic results for the success of gradient descent in optimizing neural nets; however, the resulting generalization error is only as good as that of fixed kernels . On the other hand, the equivalence of gradient descent and NTK is broken if the loss has an explicit regularizer such as weight decay.
In this paper, we study the effect of an explicit regularizer on neural net generalization via the lens of margin theory. We first construct a simple distribution on which the two-layer network optimizing explicitly regularized logistic loss will achieve a large margin, and therefore, good generalization. On the other hand, any prediction function in the span of the training data in the RKHS induced by the NTK will overfit to noise and therefore achieve poor margin and bad generalization.
Motivated by the provably better generalization of regularized neural nets for our constructed instance, in Section 3 we study their optimization, as the previously cited results only apply when the neural net behaves like a kernel. We show optimization is possible for infinite-width regularized nets.
This improves upon prior works which study optimization in the same infinite-width limit but do not provide polynomial convergence rates. (See more discussions in Section 3.)
Finally, we empirically validate several claims made in this paper in Section 5. First, we confirm on synthetic data that neural networks do generalize better with an explicit regularizer vs. without. Second, we show that for two-layer networks, the test error decreases and margin increases as the hidden layer grows, as predicted by our theory.
Zhang et al. and Neyshabur et al. show that neural network generalization defies conventional explanations and requires new ones. Neyshabur et al. initiate the search for the “inductive bias” of neural networks towards solutions with good generalization. Recent papers study inductive bias through training time and sharpness of local minima. Neyshabur et al. propose a steepest descent algorithm in a geometry invariant to weight rescaling and show this improves generalization. Morcos et al. relate generalization to the number of “directions” in the neurons. Other papers study implicit regularization towards a specific solution. Ma et al. show that implicit regularization helps gradient descent avoid overshooting optima. Rosset et al. study linear logistic regression with weak regularization and show convergence to the max margin. In Section 4, we adopt their techniques and extend their results.
A line of work initiated by Neyshabur et al. has focused on deriving tighter norm-based Rademacher complexity bounds for deep neural networks and new compression based generalization properties . Bartlett et al. highlight the important role of normalized margin in neural net generalization. Wei and Ma prove generalization bounds depending on additional data-dependent properties. Dziugaite and Roy compute non-vacuous generalization bounds from PAC-Bayes bounds. Neyshabur et al. investigate the Rademacher complexity of two-layer networks and propose a bound that is decreasing with the distance to initialization. Liang and Rakhlin and Belkin et al. study the generalization of kernel methods.
For optimization, Soudry and Carmon explain why over-parametrization can remove bad local minima. Safran and Shamir show over-parametrization can improve the quality of a random initialization. Haeffele and Vidal , Nguyen and Hein , and Venturi et al. show that for sufficiently overparametrized networks, all local minima are global, but do not show how to find these minima via gradient descent. Du and Lee show for two-layer networks with quadratic activations, all second-order stationary points are global minimizers. Arora et al. interpret over-parametrization as a means of acceleration. Mei et al. , Chizat and Bach , Sirignano and Spiliopoulos , Dou and Liang , Mei et al. analyze a distributional view of over-parametrized networks. Chizat and Bach show that Wasserstein gradient flow converges to global optimizers under structural assumptions. We extend this to a polynomial-time result.
Finally, many papers have shown convergence of gradient descent on neural nets using analyses which prove the weights do not move far from initialization. These analyses do not apply to the regularized loss, and our experiments in Section F suggest that moving away from the initialization is important for better test performance.
Another line of work takes a Bayesian perspective on neural nets. Under an appropriate choice of prior, they show an equivalence between the random neural net and Gaussian processes in the limit of infinite width or channels . This provides another kernel perspective of neural nets.
Yehudai and Shamir , Chizat and Bach also argue that the kernel perspective of neural nets is not sufficient for understanding the success of deep learning. Chizat and Bach argue that the kernel perspective of gradient descent is caused by a large initialization and does not necessarily explain the empirical successes of over-parametrization. Yehudai and Shamir prove that random relu features cannot approximate a single neuron in squared error loss. In comparison, our lower bounds are for the sample complexity rather than width of the NTK prediction function and apply even with infinite over-parametrization for both classification and squared loss.
2 Notation
Generalization of Regularized Neural Net vs. NTK Kernel
We will compare neural net solutions found via regularization and methods involving the NTK and construct a data distribution in dimensions which the neural net optimizer of regularized logistic loss learns with sample complexity . The kernel method will require samples to learn.
The distribution contains all of its signal in the first 2 coordinates, and the remaining coordinates are noise. We visualize its first 2 coordinates in Figure 1.
Let be its global optimizer. Define the NTK kernel associated with the architecture (with random weights):
For coefficients , we can then define the prediction function in the RKHS induced by as . For example, such a classifier would be attained by running gradient descent on squared loss for a wide network using the appropriate random initialization (see ). We now present our comparison theorem below and fill in its proof in Section B.
Let be the distribution defined in equation 2.5. With probability over the random draw of samples from , for all choices of , the kernel prediction function will have at least error:
Meanwhile, for , the regularized neural net solution with at least 4 hidden units can have good generalization with samples because we have the following generalization error bound:
This implies a sample-complexity gap between the regularized neural net and kernel prediction function.
Our intuition of this gap is that the regularization allows the neural net to find informative features (weight vectors), that are adaptive to the data distribution and easier for the last layers’ weights to separate. For example, the neurons , , , are enough to fit our particular distribution. In comparison, the NTK method is unable to change the feature space and is only searching for the coefficients in the kernel space.
Proof techniques for the upper bound: For the upper bound, neural nets with small Euclidean norm will be able to separate with large margin (a two-layer net with width 4 can already achieve a large margin). As we show in Section 4, a solution with a max neural-net margin is attained by the global optimizer of the regularized logistic loss — in fact, we show this holds for generally homogeneous networks of any depth and width (Theorem 4.1). Then, by the classical connection between margin and generalization , this optimizer will generalize well.
Proof techniques for the lower bound: On the other hand, the NTK will have a worse margin when fitting samples from than the regularized neural networks because NTK operates in a fixed kernel space.There could be some variations of the NTK space depending on the scales of the initialization of the two layers, but our Theorem 2.1 shows that these variations also suffer from a worse sample complexity. However, proving that the NTK has a small margin does not suffice because the generalization error bounds which depend on margin may not be tight.
We develop a new technique to prove lower bounds for kernel methods, which we believe is of independent interest, as there are few prior works that prove lower bounds for kernel methods. (One that does is , but their results require constructing an artificial kernel and data distribution, whereas our lower bounds are for a fixed kernel.) The main intuition is that because NTK uses infinitely many random features, it is difficult for the NTK to focus on a small number of informative features – doing so would require a very high RKHS norm. In fact, we show that with a limited number of examples, any function that in the span of the training examples must heavily use random features rather than informative features. The random features can collectively fit the training data, but will give worse generalization.
Perturbed Wasserstein Gradient Flow Finds Global Optimizers in Polynomial Time
Prior work has shown that as the hidden layer size grows to infinity, gradient descent for a finite neural network approaches the Wasserstein gradient flow over distributions of hidden units (defined in equation 3.1). With the assumption that the gradient flow converges, which is non-trivial since the space of distributions is infinite-dimensional, Chizat and Bach prove that Wasserstein gradient flow converges to a global optimizer but do not specify a rate. Mei et al. add an entropy regularizer to form an objective that is the infinite-neuron limit of stochastic Langevin dynamics. They show global convergence but also do not provide explicit rates. In the worst case, their convergence can be exponential in dimension. In contrast, we provide explicit polynomial convergence rates for a slightly different algorithm, perturbed Wasserstein gradient flow.
and are differentiable as well as upper bounded and Lipschitz on the unit sphere. is Lipschitz and its Hessian has bounded operator norm.
We interpret as a distribution over the parameters of the network. Let and for . In this case, is a distributional neural network that computes an output for each of the training examples (like a standard neural network, it also computes a weighted sum over hidden units). We can compute the distributional version of the regularized logistic loss in equation 2.6 by setting and .
where denotes the divergence of a vector field. For neural networks, these dynamics formally define continuous-time gradient descent when the hidden layer has infinite size (see Theorem 2.6 of , for instance). More generally, equation 3.1 is due to the formula for Wasserstein gradient flow dynamics (see for example ), which are derived via continuous-time steepest descent with respect to Wasserstein distance over the space of probability distributions on the neurons. We propose the following modified dynamics:
Suppose that and are 2-homogeneous and the regularity conditions of Assumption 3.1 are satisfied. Also assume that from starting distribution , a solution to the dynamics in equation 3.2 exists. Define . Let be a desired error threshold and choose and , where the regularity parameters for , , and are hidden in the . Then, perturbed Wasserstein gradient flow converges to an -approximate global minimum in time:
As a technical detail, Theorem 3.3 requires that a solution to the dynamics exists. We can remove this assumption by analyzing a discrete-time version of equation 3.2: , and additionally assuming and have Lipschitz gradients. In this setting, a polynomial time convergence result also holds. We state the result in Section E.4.
Weak Regularizer Guarantees Max Margin Solutions
In this section, we collect a number of results regarding the margin of a regularized neural net. These results provide the tools for proving generalization of the weakly-regularized NN solution in Theorem 2.1. The key technique is showing that with small regularizer , the global optimizer of regularized logistic loss will obtain a maximum margin. It is well-understood that a large neural net margin implies good generalization performance .
In fact, our result applies to a function class much broader than two-layer relu nets: in Theorem 4.1 we show that when we add a weak regularizer to cross-entropy loss with any positive-homogeneous prediction function, the normalized margin of the optimum converges to the max margin. For example, Theorem 4.1 applies to feedforward relu networks of arbitrary depth and width. In Theorem C.2, we bound the approximation error in the maximum margin when we only obtain an approximate optimizer of the regularized loss. In Corollary 4.2, we leverage these results and pre-existing Rademacher complexity bounds to conclude that the optimizer of the weakly-regularized logistic loss will have width-free generalization bound scaling with the inverse of the max margin and network depth. Finally, we note that the maximum possible margin can only increase with the width of the network, which suggests that increasing width can improve generalization of the solution (see Theorem 4.3).
for fixed . Let .We formally show that has a minimizer in Claim C.3 of Section C. Define the normalized margin and max-margin by and . Let achieve this maximum.
We show that with sufficiently small regularization level , the normalized margin approaches the maximum margin . Our theorem and proof are inspired by the result of Rosset et al. , who analyze the special case when is a linear function. In contrast, our result can be applied to non-linear as long as is homogeneous.
Assume the training data is separable by a network with an optimal normalized margin . Then, the normalized margin of the global optimum of the weakly-regularized objective (equation 4.1) converges to as the regularization goes to zero. Mathematically,
An intuitive explanation for our result is as follows: because of the homogeneity, the loss roughly satisfies the following (for small , and ignoring parameters such as ):
Thus, the loss selects parameters with larger margin, while the regularization favors smaller norms. The full proof of the theorem is deferred to Section C.
Though the result in this section is stated for binary classification, it extends to the multi-class setting with cross-entropy loss. We provide formal definitions and results in Section C. In Theorem C.2, we also show that an approximate minimizer of can obtain margin that approximates .
We consider depth- networks with 1-Lipschitz, 1-positive-homogeneous activation for . Note that the network function is -positive-homogeneous. Suppose that the collection of parameters is given by matrices . For simplicity we work in the binary class setting, so the -layer network computes a real-valued score
Following notation established in this section, we denote the optimizer of by , the normalized margin of by , the max-margin solution by , and the max-margin by , assumed to be positive. Our notation emphasizes the architecture of the network.
We can define the population 0-1 loss of the network parameterized by by . We let denote the data domain and denote the largest possible norm of a single datapoint.
By combining the neural net complexity bounds of Golowich et al. with our Theorem 4.1, we can conclude that optimizing weakly-regularized logistic loss gives generalization bounds that depend on the maximum possible network margin for the given architecture.
Suppose is 1-Lipschitz and 1-positive-homogeneous. With probability at least over the draw of i.i.d. from , we can bound the test error of the optimizer of the regularized loss by
where . Note that is primarily a smaller order term, so the bound mainly scales with . Although the factor of equation D.1 decreases with depth , the margin will also tend to decrease as the constraint becomes more stringent.
Finally, we observe that the maximum normalized margin is non-decreasing with the size of the architecture. Formally, for two depth- architectures and , we say if . Theorem 4.3 states if , the max-margin over networks with architecture is at least the max-margin over networks with architecture .
Recall that denotes the maximum normalized margin of a network with architecture . If , we have
As a important consequence, the generalization error bound of Corollary 4.2 for is at least as good as that for .
This theorem is simple to prove and follows because we can directly implement any network of architecture using one of architecture , if . This highlights one of the benefits of over-parametrization: the margin does not decrease with a larger network size, and therefore Corollary 4.2 gives a better generalization bound. In Section F, we provide empirical evidence that the test error decreases with larger network size while the margin is non-decreasing.
Simulations
We empirically validate our theory with several simulations. First, we train a two-layer net on synthetic data with and without explicit regularization starting from the same initialization in order to demonstrate the effect of an explicit regularizer on generalization. We confirm that the regularized network does indeed generalize better and moves further from its initialization. For this experiment, we use a large initialization scale, so every weight . We average this experiment over 20 trials and plot the test accuracy, normalized margin, and percentage change in activation patterns in Figure 2. We compute the percentage of activation patterns changed over every possible pair of hidden unit and training example. Since a low percentage of activations change when , the unregularized neural net learns in the kernel regime. Our simulations demonstrate that an explicit regularizer improves generalization error as well as the margin, as predicted by our theory.
The data comes from a ground truth network with hidden networks, input dimension , and a ground truth unnormalized margin of at least . We use a training set of size and train for steps with learning rate , once using regularizer and once using regularization . We note that the training error hits 0 extremely quickly (within 50 training iterations). The initial normalized margin is negative because the training error has not yet hit zero.
We also compare the generalization of a regularized neural net and kernel method as the sample size increases. Furthermore, we demonstrate that for two-layer nets, the test error decreases and margin increases as the width of the hidden layer grows, as predicted by our theory. We provide figures and full details in Section F.
Conclusion
Acknowledgments
CW acknowledges the support of a NSF Graduate Research Fellowship. JDL acknowledges support of the ARO under MURI Award W911NF-11-1-0303. This is part of the collaboration between US DOD, UK MOD and UK Engineering and Physical Research Council (EPSRC) under the Multidisciplinary University Research Initiative. We also thank Nati Srebro and Suriya Gunasekar for helpful discussions in various stages of this work.
References
Appendix A Additional Notation
In this section we collect additional notations that will be useful for our proofs.
Appendix B Missing Material from Section 2
Then as the kernel is the sum of positive scalings of and , we can express
For the distribution defined in Section 2, if , with probability over drawn i.i.d. from , for all choices of , in test time the kernel prediction function will predict the sign of wrong fraction of the time:
Then with probability , there is some universal constant such that
As a result, for all choices of , we can lower bound the test error of the kernel prediction function by
For sufficiently small , with probability over the random draws of , the following holds: for all , we will have
where is the constant defined in Lemma B.2.
This will allow us to complete the proof of Theorem B.1.
By plugging Lemma B.3 into the statement of Lemma B.2, we can conclude that for sufficiently small , with probability over the random draws of , we have
for all choices of . This gives precisely Theorem B.1. ∎
It now suffices to prove Lemmas B.2 and B.3.
Let be a uniform random point from the -dimensional hypercube and be given. With probability over the choice of , we have
In the same setting as Lemma B.4, with probability over the choice of , we have
As it will be clear in the context of this proof, we use to denote the first coordinate of and to denote the second coordinate of . We prove the first inequality, as the proof for the second is identical. First, note that if ,, then we have so the inequality holds trivially. Thus, we work in the case that , .
Note that . We have:
Now we perform a Taylor expansion of around to get
for any . Note that this happens with probability by Hoeffding’s inequality. Furthermore, for , , so we get that equation B.4 can be bounded by . Next, we claim the following:
This follows simply from Taylor expansion around setting to . Substituting this into equation B.5 and using our bound on equation B.4, we get
Now we use the fact that to complete the proof. ∎
As before, it suffices to prove the first inequality in the case that , . We can compute
Now we again perform a Taylor expansion, this time of around . We get
for any . Note that with probability via straightforward concentration. It follows that
Now plugging this into equation B.6 and using the fact that gives the desired result. ∎
Now we can complete the proof of Lemma B.2.
Now with applying Lemmas B.4 and B.5 with a union bound over all , we get with probability over the choice of uniform from , for all
Now plugging into equation B.7 and applying triangle inequality gives us
with probablity over for some universal constant . An identical argument also gives us
Finally, to lower bound the quantity , we note that if
and equation B.2 hold, then and will have the same sign. However, this in turn means that one of the following must hold:
which implies an incorrect predicted sign. As , , , are all equally likely under distribution , the probability of drawing one of these examples under is at least
This gives the desired lower bound on . ∎
Then for distributed uniformly over the hypercube and some given ,
where is a uniform vector from the hypercube.
For the degree-4 polynomial defined in Lemma B.6, we define
Note that by Cauchy-Schartz, . It follows that if , we have
Now we can apply Bonami’s Lemma (see Chapter 9 of O’Donnell ) along with the fact that is a degree-4 polynomial in i.i.d. variables to obtain
Combining this with Proposition 9.4 of O’Donnell lets us conclude that if holds, with probability over the random draw of ,
holds with probability over . This gives the desired result. ∎
with and for . )Now we can observe that . Thus,
As with probability , the above is bounded in absolute value by . Finally, by Hoeffding’s inequality with probability for some universal constant . This gives the desired bound. ∎
Now note that all terms in the above sum are nonnegative by Lemma B.9 and the fact that . Thus, we can lower bound the above by the term corresponding to :
Now letting denote with rows whose indices are not in zero’ed out, it follows that
Therefore, it suffices to show with high probability. To do this, we can simply invoke Proposition 7.9 of Soltanolkotabi et al. using and the fact that the columns of are -sub-exponential (Claim B.8 to get that if for some universal constant , then with probability .
Finally, combining this with equation B.11 and equation B.10 gives the desired result. ∎
Suppose that is a uniform vector on the hypercube. Then there is a universal constant such that is -sub-exponential, where is the set of indices corresponding to squared entries of .
Now we can apply Theorem 1.1 of Rudelson et al. , using the fact that have sub-Gaussian norm to get
for some universal constant . Since this holds for all , we can conclude the claim statement using Lemma 5.5 of Soltanolkotabi et al. . ∎
The following lemma is useful for proving the lower bound in Lemma B.7.
Let for , and let be a vector sampled uniformly from the hypercube. Then for any integers ,
Furthermore, equality holds if exactly one of or is odd.
For this proof we will use double indices on the vectors, so that will denote the -th coordinate of . We will only use the symbols to index the vectors . We define the functions and , with Fourier coefficients , , respectively, and , with Fourier coefficients , . We claim that for any , .
for some positive integer depending only on . We obtained equation B.13 via symmetry and the fact that , , as they are squares of values in . Note that for . It follows that , and . Thus, , which means by equation B.12, we get
B.2 Proof of Theorem 2.1
We now complete the proof of Theorem 2.1. Note that the kernel lower bound follows from B.1, so it suffices to upper bound the generalization error of the neural net solution.
We first invoke Theorem C.2 to conclude that with , the network will have margin that is a constant factor approximation to the max-margin.
For neural nets with at least 4 hidden units, we now construct a neural net with a good normalized margin:
As this network has constant norm and margin 1, it has normalized margin , and therefore the max neural net margin is . Now we apply the generalization bound of Proposition D.1 to obtain
as desired. Choosing gives the desired result. Combined with the Theorem B.1 lower bound on the kernel method, this completes the proof. ∎
B.3 Regression Setting
Let be some two-layer neural network with hidden units parametrized by , as in Section 2. Define the -regularized squared error loss
with . Suppose there exists a width- network that fits the data perfectly. Then as , and , where is an optimizer of the following problem:
We note that , so as , and also . Now assume for the sake of contradiction that with for arbitrarily small . We define
Note that since is optimal for equation B.14. However, for arbitrarily small , a contradiction. Thus, . ∎
This formulation is equivalent to a hard-margin optimization on “convex neural networks” . Bach also study optimization and generalization of convex neural networks. Using results from , our Theorem C.1 implies that optimizing weakly-regularized logistic loss over two-layer networks is equivalent to solving equation B.15 when the size of the hidden layer is at least . Proposition B.11 states this deduction.The factor of is due the the relation that every unit-norm parameter corresponds to an in the lifted space with .
Appendix C Missing Material for Section 4
We will first state our analogue of Theorem 4.1 in the multi-class setting, as the proofs for the binary case will follow by reduction to the multi-class case.
We redefine the normalized margin of as:
Define the -max normalized margin as
and let be a parameter achieving this maximum. With these new definitions, our theorem statement for the multi-class setting is identical as the binary setting:
Assume in the multi-class setting with cross entropy loss. Then as , .
Since is typically hard to optimize exactly for neural nets, we study how accurately we need to optimize to obtain a margin that approximates up to a constant. We show that for polynomial in , and , it suffices to find achieving a constant factor multiplicative approximation of in order to have margin satisfying .
In the setting of Theorem C.1, suppose that we choose for sufficiently large (that only depends on ). For , let denote a -approximate minimizer of , so . Denote the normalized margin of by . Then
Towards proving Theorem C.1, we first prove that does indeed have a global minimizer.
In the setting of Theorems C.1 and 4.1, exists.
We will argue in the setting of Theorem C.1 where is the multi-class cross entropy loss, because the logistic loss case is analogous. We first note that is continuous in because is continuous in and the term inside the logarithm is always positive. Next, define . Then we note that for , we must have . It follows that . However, there must be a value which attains , because is a compact set and is continuous. Thus, is attained by some . ∎
Next we present the following lemma, which says that as we decrease , the norm of the solution grows.
In the setting of Theorem C.1, as , we have .
To prove Theorem C.1, we rely on the exponential scaling of the cross entropy: can be lower bounded roughly by , but also has an upper bound that scales with . By Lemma C.4, we can take large so the gap vanishes. This proof technique is inspired by that of Rosset et al. .
For any and with ,
We can also apply in order to lower bound equation C.3 and obtain
Applying equation C.4 with and , noting that , we have:
Next we lower bound by applying equation C.5,
Combining equation C.6 and equation C.7 with the fact that (by the global optimality of ), we have
Recall that by Lemma C.4, as , we have . Therefore, . Thus, we can apply Taylor expansion to the equation above with respect to and . If , then we obtain
Finally, we have by definition of . Hence, exists and equals . ∎
For the sake of contradiction, we assume that such that for any , there exists with . We will determine the choice of later and pick such that . Then the logits (the prediction before softmax) are bounded in absolute value by some constant (that depends on ), and therefore the loss function for every example is bounded from below by some constant (depending on but not .)
Taking a sufficiently small , we obtain a contradiction and complete the proof. ∎
C.2 Missing Proof for Optimization Accuracy
Choose . We can upper bound by computing
Furthermore, it holds that . Now we note that
for sufficiently large depending only on . Now using the fact that , we additionally have the lower bound . Since , we can rearrange to get
The middle inequality followed because is increasing in for , and the last because . Since we can also apply the bound to get
We will first bound . First note that
where the last inequality follows from the fact that and . Next, using the fact that , we note that
Combining equation C.8 and equation C.9, we can conclude that
Finally, we note that if is a sufficiently large constant that depends only on (which can be achieved by choosing sufficiently large) it will follow that . Thus, for sufficiently large , we can combine our bounds on and to get that
C.3 Proofs of Theorem 4.1
For completeness, we will now prove Theorem 4.1 via reduction to the multi-class cases. Recall that we now fit binary labels (as opposed to indices in ) and redefine to assign a single real-valued score (as opposed to a score for each label). We also work with the simpler logistic loss in equation 4.1.
Appendix D Generalization Bounds for Neural Nets
[Straightforward consequence of Golowich et al. [25, Theorem 1]] Suppose is 1-Lipschitz and -positive-homogeneous. With probability at least over the draw of , for all depth- networks separating the data with normalized margin ,
where and is the max norm of the data. Note that is typically small, and thus the above bound mainly scales with . Although the factor of equation D.1 decreases with depth , the margin will also tend to decrease as the constraint becomes more stringent.
We note that Proposition D.1 is stated directly in terms of the normalized margin in order to maintain consistency in our notation, whereas prior works state their results using a ratio between unnormalized margin and norms of the weight matrices . We provide the proof in the following section.
We prove the generalization error bounds stated in Proposition D.1 via Rademacher complexity and margin theory.
Assume that our data are drawn i.i.d. from ground truth distribution supported on . For some hypothesis class of real-valued functions, we define the empirical Rademacher complexity as follows:
where are independent Rademacher random variables. For a classifier , following the notation of Section 4.1 we will use to denote the population 0-1 loss of the classifier . The following classical theorem , bounds generalization error in terms of the Rademacher complexity and margin loss.
Let be drawn iid from . We work in the binary classification setting, so . Assume that for all , we have . Then with probability at least over the random draws of the data, for every and ,
We will prove Proposition D.1 by applying the Rademacher complexity bounds of Golowich et al. with Theorem D.2.
Define the hypothesis class over depth- neural networks by
Let . Recall that denotes the 0-1 population loss . Then for any classifying the training data correctly with unnormalized margin , with probability at least ,
Note the dependence on the unnormalized margin rather than the normalized margin.
We first claim that . To see this, for any ,
Furthermore, by Theorem 1 of Golowich et al. , has upper bound
Thus, we can apply Theorem D.2 to conclude that for all and all , with probability ,
In particular, by definition choosing makes the first term on the LHS vanish and gives the statement of the lemma. ∎
To conclude Corollary 4.2, we apply the above on and use Theorem 4.1.
Applying the statement of Proposition D.1, with probability , for all ,
Now we take the of both sides as :
Appendix E Missing Proofs in Section 3
We first write our regularity assumptions on , , and in more detail:
is convex, nonnegative, Lipschitz, and smooth: such that , and .
We state the version of Theorem 3.3 that collects these parameters:
Suppose that and are 2-homogeneous and Assumptions E.1, E.2, and E.3 hold. Fix a desired error threshold . Suppose that from a starting distribution , a solution to the dynamics in equation 3.2 exists. Choose
Then it must hold that .
E.2 Proof Outline of Theorem E.4
In this section, we will provide an outline of the proof of Theorem E.4. We will fill in the missing details in Section E.3.
Choose any . For all , . In particular, for all , we have , where is defined as follows:
where is defined as in equation E.1.
The proof of Lemma E.6 intuitively holds because in order for to change by a large amount, the gradient flow dynamics must have shifted by some amount, which would have resulted in some decrease of the objective . We will rely on the 2-homogeneity of to formalize this argument.
Next, we will rely on the convexity of : letting be an -approximate global optimizer of , since is convex in , we have
For the first case, we have the following guarantee that the objective decreases by a large amount:
For any time with , we have
Lemma E.7 relies on the 2-homogeneity of and and is proven via arguing that the gradient flow dynamics will result in a large shift in and therefore substantial decrease in loss.
For the second case, we will show that the noise term will cause mass to grow exponentially fast in this descent direction until we make progress in decreasing the objective.
Fix any . Choose time interval length by
Here is the constant defined in Lemma E.6 and is defined by .
Lemma E.8 is proven via the following argument: first, if is close to for all , then from the 2-homogeneity of and , the mass of in the neighborhood around will grow exponentially fast, leading to a violation of Lemma E.5. (Because of the uniform noise injected into the gradient flow dynamics, will always have some mass in the neighborhood of to start with.) Thus, it follows that must change by at least , allowing us to invoke Lemma E.6 to argue that the objective must drop.
Lemmas E.7 and E.8 are enough to ensure that the objective will always decrease a sufficient amount after some polynomial-size time interval. This allows us to complete the proof of Theorem E.4 below:
Now we bound the suboptimality of : since is convex in ,
Now let l\triangleq\frac{W_{\epsilon}^{2}}{\epsilon-2W^{2}_{\epsilon}\sigma}\big{(}2\log\frac{W_{\epsilon}^{2}}{\sigma}+2d\log\frac{4W_{\epsilon}^{2}c_{2}}{\epsilon}\big{)}, which satisfies Lemma E.8 with the value of later specified. Suppose that there is a with and , . Then . We will argue that the objective decreases when we are suboptimal:
Using equation E.6 and , we first note that
Furthermore, from Lemma E.13, and , and so combining gives
Therefore, applying Lemma E.13 again gives
For the simplicity, in the remaining computation, we will use notation to hide polynomials in the problem parameters besides . We simply write . Recall our choice . It suffices to show that our objective would have sufficiently decreased in steps. We first note that with sufficiently large, . Simplifying our expression for , we get that , so long as , which holds for sufficiently large . Now let
Again, for sufficiently large , the terms with become negligible, and . Likewise, .
Thus, if by time we have not encountered -optimal , then we will decrease the objective by in time. Therefore, a total of time is sufficient to obtain accuracy. ∎
In the following section, we will complete the proofs of Lemmas E.5, E.6, E.7, and E.8.
E.3 Missing Proofs for Theorem E.4
In this section, we complete the proofs of Lemmas E.5, E.6, E.7, and E.8. We first collect some general lemmas which will be useful in these proofs. The following general lemma computes integrals over vector field divergences.
The proof follows from integration by parts. ∎
We note that will satisfy the boundedness condition of Lemma E.9 during the course of our algorithm - starts with this property, and Lemma E.5 proves that will continue to have this property. We therefore freely apply Lemma E.9 in the remaining proofs. Now we bound the absolute value of over the sphere by .
The next lemma analyzes the decrease in due to the gradient flow dynamics.
Under the perturbed Wasserstein gradient flow
where we use Lemma E.9 with and . ∎
By combining the above Lemma with Lemma E.10, it follows that at the decrease in objective value is approximately the average velocity of all parameters under plus some additional noise on the scale of . At the end, we choose small enough so that the noise terms essentially do not matter.
We can bound by
Corollary E.12 implies that if we run the dynamics for a short time, the second moment of will grow slowly, again at a rate that is roughly the scale of the noise . This allows us to complete the proof of Lemma E.5.
Let . Integrating both sides of equation E.11, and rearranging, we get
Now since is nonnegative, we apply . We now plug this in and rearrange to get .
From the proof above, it immediately follows that , . ∎
The next statement allows us to argue that our dynamics will never increase the objective by too much.
For any with , .
From Corollary E.12, we have
Integrating from to gives the desired result. ∎
The following lemma bounds the change in expectation of a 2-homogeneous function over . At a high level, we lower bound the decrease in our loss as a function of the change in this expectation. By applying this lemma, we will be able to prove Lemma E.6.
Let . We can compute:
Note that the first two terms are bounded by by the assumptions for the lemma. For the third term, we have from Lemma E.9:
Plugging this into equation E.13, we get that
Recall that . Differentiating with respect to ,
Integrating and applying the same reasoning to gives us equation E.2. Now we apply Lemma E.14 to get
We plug this into equation E.14 and then integrate both sides to obtain
Using gives the statement in the lemma. ∎
Now we will fill in the proof of Lemma E.8. We first show that is Lipschitz on the unit ball. Recall that in the statement of Lemma E.8, we define a constant by .
Using the definition of and triangle inequality,
If is nonempty, for , .
Let . From Lemma E.15, for all with . Thus, we have
Now the statement follows by Lemma 2.3 of . ∎
Finally, the proof of Lemma E.8 will require a general lemma about the magnitude of the gradient of a 2-homogeneous function in the radial direction.
We have . Differentiating both sides with respect to and evaluating the derivative at 0, we get , as desired. ∎
For all , is nonempty.
By assumption, with . Then , so is nonempty. ∎
Let for . We now argue that this set does not shrink as increases.
For all , .
From equation E.14 and the definition of , . It follows that for
which means that . ∎
Now we show that the weight of the particles in grows very fast if is small.
Furthermore, since is nonempty by Claim E.18, we can apply Lemma E.16 and obtain
Plugging equation E.17 and equation E.18 back into equation E.16, we get
and so . ∎
Using Claim E.20 allows us to complete the proof of Lemma E.8.
If , then by rearranging the conclusion of Lemma E.6 we immediately get equation E.5.
Suppose for the sake of contradiction that . From Claim E.20, it follows that , and . Thus, in time, , a contradiction. Therefore, it must be true that .
Finally, we fill in the proof of Lemma E.7.
E.4 Discrete-Time Optimization
To circumvent the technical issue of existence of a solution to the continuous-time dynamics, we also note that polynomial time convergence holds for discrete-time updates.
Along with Assumptions E.1, E.2, E.3 additionally assume that and are and -Lipschitz, respectively. Let evolve according to the following discrete-time update:
such that .
The proof follows from a standard conversion of the continuous-time proof of Theorem E.4 to discrete time, and we omit it here for simplicity.
Appendix F Additional Simulations
In this section we provide more details on the simulations described in Section 5. The experiments were small enough to run on a standard computer, though we used a single NVIDIA TitanXp GPU. We decided the value of regularization based on the training length - longer training time meant we could use smaller .
To justify Theorem 4.3, we also plot the dependence of the test error and margin on the hidden layer size in Figure 3 for synthetic data generated from a ground truth network with hidden units and also MNIST. The plots indicate that test error is decreasing in hidden layer size while margin is increasing, as Theorem 4.3 predicts. We train the networks for a long time in this experiment: we train for 80000 passes on the synthetic data and 600 epochs for MNIST.
The left side of Figure 3 shows the experimental results for synthetic data generated from a ground truth network with hidden units, input dimension , and a ground truth unnormalized margin of at least . We train for 80000 steps with learning rate and , using two-layer networks with hidden units for ranging from 4 to 10. We perform 20 trials per hidden layer size and plot the average over trials where the training error hit 0. (At a hidden layer size of or greater, all trials fit the training data perfectly.) The right side of Figure 3 demonstrates the same experiment, but performed on MNIST with hidden layer sizes of for ranging from to . We train for 600 epochs using a learning rate of 0.01 and and use a single trial per plot point. For MNIST, all trials fit the training data perfectly. The MNIST experiments are more noisy because we run one trial per plot point for MNIST, but the same trend of decreasing test error and increasing margin still holds.
F.2 Neural Net and Kernel Generalization vs. Training Set Size
For classification we plot 0-1 error, whereas for regression we plot squared error. The plots show that two-layer nets clearly outperform the kernel method in test error as grows.