SGD L EARNS O VER - PARAMETERIZED N ETWORKS THAT P ROVABLY G ENERALIZE ON L INEARLY S EPARABLE D ATA
A BSTRACT
Neural networks exhibit good generalization behavior in the over-parameterized regime, where the number of network parameters exceeds the number of observations.
Nonetheless, current generalization bounds for neural networks fail to explain this phenomenon.
In an attempt to bridge this gap, we study the problem of learning a two-layer over-parameterized neural network, when the data is generated by a linearly separable function.
In the case where the network has Leaky
ReLU activations and only the ﬁrst layer is trained, we provide both optimization and generalization guarantees for over-parameterized networks.
Speciﬁcally, we prove convergence rates of SGD to a global minimum, and provide generalization guarantees for this global minimum that are independent of the network size.
Therefore, our result clearly shows that the use of SGD for optimization both ﬁnds a global minimum, and avoids overﬁtting despite the high capacity of the model.
This is the ﬁrst theoretical demonstration that SGD can avoid overﬁtting, when learning over-speciﬁed neural network classiﬁers.
I NTRODUCTION
Neural networks have achieved remarkable performance in many machine learning tasks.
Although recently there have been numerous theoretical contributions to understand their success, it is still largely unexplained and remains a mystery.
In particular, it is not known why in the overparameterized setting, in which there are far more parameters than training points, stochastic gradient descent (SGD) can learn networks that generalize well, as been observed in practice (Neyshabur et al., 2014; Zhang et al., 2016).
In such over-parameterized settings, the loss function can contain multiple global minima that generalize poorly.
Therefore, learning can in principle lead to models with low training error, but high test error.
However, as often observed in practice, SGD is in fact able to ﬁnd models with low training error and good generalization performance.
This suggests that the optimization procedure, which depends on the optimization method (SGD) and the training data, introduces some form of inductive bias which directs it towards a low complexity solution.
Thus, in order to explain the success of neural networks, it is crucial to characterize this inductive bias and understand what are the guarantees for generalization of over-parameterized neural networks.
In this work, we address these problems in a binary classiﬁcation setting where SGD optimizes a two-layer over-parameterized network with the goal of learning a linearly separable function.
We study a relatively simple case of SGD where the weights of the second layer are ﬁxed throughout the training process, and only the weights of the ﬁrst layer are updated.
Clearly, an over-parameterized network is not necessary for classifying linearly separable data, since this is possible with linear classiﬁers (e.g., with the Perceptron algorithm) which also have good generalization guarantees (Shalev-Shwartz & Ben-David, 2014).
But, the key question which we address here is whether a large network will overﬁt in such a case or not.
As we shall see, it turns out that although the networks we consider are rich enough to considerably overﬁt the data, this does not happen when
SGD is used for optimization.
In other words, SGD introduces an inductive bias which allows it to learn over-parameterized networks that can generalize well.
Therefore, this setting serves as a good test bed for studying the effect of over-paramaterization.
P ROBLEM F ORMULATION
Deﬁne X
= { x ∈ R
d : (cid:107) x (cid:107) ≤ 1 } , Y = {± 1 } .
We consider a distribution over linearly separable points.
Formally, let D be a distribution over X × Y such that there exists w ∗ ∈ R d for which P ( x ,y )
∼D ( y (cid:104) w ∗ , x (cid:105) ≥ 1)
= 1 .
1 Let S =
{ ( x 1 , y 1 ) , . . .
, ( x n , y n ) } ⊆
X
× Y be a training set sampled i.i.d.
from D .
Consider the following two-layer neural network, with 2 k > 0 hidden units.
The network parameters are W ∈ R 2 k × d , v ∈ R 2 k , which we denote jointly by W =
( W, v ) .
The network output is given by the function N W : R d → R deﬁned as:
[Equation]
where σ is a non-linear activation function applied element-wise.
We deﬁne the empirical loss over S to be the mean hinge-loss:
[Equation]
Note that for convenience of analysis, we will sometimes refer to L S as a function over a vector.
Namely, for a matrix W ∈ R 2 k × d , we will consider instead its vectorized version (cid:126)W ∈ R 2 kd (where the rows of W are concatenated) and deﬁne, with abuse of notation, that L S ( (cid:126)W ) =
L S ( W ) .
In our setting we ﬁx the second layer to be v = (
[Equation]
v, k
[Equation]
− v · · · − v ) such that v > 0 and only learn the weight matrix W .
We will consider only positive homogeneous activations (Leaky ReLU and
ReLU) and thus the network we consider with 2 k hidden neurons is as expressive as networks with k hidden neurons and any vector v in the second layer.
Hence, we can ﬁx the second layer without limiting the expressive power of the two-layer network.
Although it is relatively simpler than the case where the second layer is not ﬁxed, the effect of over-parameterization can be studied in this setting as well.
Hence, the objective of the optimization problem is to ﬁnd:
[Equation]
where min W ∈ R 2 k × d L S ( W ) = 0 holds for the activations we will consider (Leaky ReLU and ReLU).
of v
Our results hold case where the ﬁrst bias standard argument of i .
Then, we can express this network with the network deﬁned in Eq.
1 as follows.
For each i such that v i > 0 , we deﬁne a neuron in the new network with incoming weight vector v i w i and outgoing weight 1 .
Similarly, if v i < 0 , we deﬁne a neuron in the new network with incoming weight vector − v i w i and outgoing weight − 1 .
For all other neurons in the new network we deﬁne an incoming zero weight vector.
Due to the positive homogeneity, it follows that this network is equivalent to the network with k hidden neurons.
We focus on the case where L S ( W ) is minimized using an SGD algorithm with batch of size 1 , and where only the weights of the ﬁrst layer (namely W ) are updated.
At iteration t , SGD randomly chooses a point ( x t , y t ) ∈ S and updates the weights with a constant learning rate η .
Formally, let
W t =
( W t , v ) be the parameters at iteration t , then the update at iteration t is given by
[Equation]
We deﬁne a non-zero update at iteration t if it holds that ∂∂W L { ( x t ,y t ) } ( W t − 1 ) (cid:54)
= 0 .
Finally, we will need the following notation.
For 1 ≤ i ≤ k , we denote by w ( i ) t ∈ R
d the incoming weight vector of neuron i at iteration t .
6 Similarly, for 1 ≤ i ≤ k we deﬁne u ( i ) t ∈
R
d to be the incoming weight vector of neuron k
+ i at iteration t .
M AIN R ESULT
We now present our main results, for the case where σ is the Leaky ReLU function.
Namely, σ ( z ) = max { αz, z }
where 0 < α < 1 .
First, we show that SGD can ﬁnd a global optimum of L S ( W ) .
Note that this is by no means obvious, since L S ( W ) is a non-convex function (see Proposition 1).
Speciﬁcally, we show that
SGD converges to such an optimum while making at most:
[Equation]
non-zero update steps (see Corollary 3).
In particular, the bound is independent of the number of neurons 2 k .
To the best of our knowledge, this is the ﬁrst convergence guarantee of SGD for neural networks with the hinge loss.
Furthermore, we prove a lower bound of Ω (cid:16) (cid:107) w ∗ (cid:107) η + (cid:107) w ∗ (cid:107) 2 (cid:17) for the number of non-zero updates (see Theorem 4).
Next, we address the question of generalization.
As noted earlier, since the network is large, it can in principle overﬁt.
Indeed, there are parameter settings for which the network will have arbitrarily bad test error (see Section 6.2).
However, as we show here, this will not happen in our setting where SGD is used for optimization.
In Theorem 6 we use a compression bound to show that the model learned by SGD will have a generalization error of O (cid:16) M log n n (cid:17) .
This implies that for any network size, given a sufﬁciently large number of training samples that is independent of the network size, SGD converges to a global minimum with good generalization behaviour.
This is despite the fact that for sufﬁciently large k there are multiple global minima which overﬁt the training set (see Section 6.2).
This implies that SGD is biased towards solutions that can be expressed by a small set of training points and thus generalizes well.
To summarize, when the activation is the Leaky ReLU and the data is linearly separable, we provide provable guarantees of optimization, generalization and expressive power for over-parameterized networks.
This allows us to provide a rigorous explanation of the performance of over-parameterized networks in this setting.
This is a ﬁrst step in unraveling the mystery of the success of overparameterized networks in practice.
We further study the same over-parameterized setting where the non-linear activation is the ReLU function (i.e., σ ( z ) = max { 0 , z } ).
Surprisingly, this case has different properties.
Indeed, we show that the loss contains spurious local minima and thus the previous convergence result of SGD to a global minimum does not hold in this case.
Furthermore, we show an example where overparameterization is favorable from an optimization point of view.
Namely, for a sufﬁciently small number of hidden neurons, SGD will converge to a local minimum with high probability, whereas for a sufﬁciently large number of hidden neurons, SGD will converge to a global minimum with high probability.
The paper is organized as follows.
We discuss related work in Section 4 .
In Section 5 we prove the convergence bounds, in Section 6 we give the generalization guarantees and in Section 7 the results for the ReLU activation.
We conclude our work in Section 8.
R ELATED W ORK
The generalization performance of neural networks has been studied extensively.
Earlier results (Anthony & Bartlett, 2009) provided bounds that depend on the VC dimension of the network, and the VC dimension was shown to scale linearly with the number of parameters.
More recent works, study alternative notions of complexity, such as Rademacher compexity (Bartlett & Mendelson, 2002; Neyshabur et al., 2015; Bartlett et al., 2017; Kawaguchi et al., 2017), Robustness (Xu & Mannor, 2012) and PAC-Bayes (Neyshabur et al., 2017b).
However, all of these notions do not provide provable guarantees for the generalization performance of over-parameterized networks trained with gradient based methods (Neyshabur et al., 2017a).
The main disadvantage of these approaches, is that they do not depend on the optimization method (e.g., SGD), and thus do not capture its role in the generalization performance.
In a recent paper, Dziugaite & Roy (2017) numerically optimize a PAC-Bayes bound of a stochastic over-parameterized network in a binary classiﬁcation task and obtain a nonvacuous generalization bound.
However, their bound is effective only when optimization succeeds, which their results do not guarantee.
In our work, we give generalization guarantees based on a compression bound that follows from convergence rate guarantees of SGD, and thus take into account the effect of the optimization method on the generalization performance.
This analysis results in generalization bounds that are independent of the network size and thus hold for over-parameterized networks.
Stability bounds for SGD in non-convex settings were given in Hardt et al.
; Kuzborskij &
Lampert (2017).
However, their results hold for smooth loss functions, whereas the loss function we consider is not smooth due to the non-smooth activation functions (Leaky ReLU, ReLU).
Other works have studied generalization of neural networks in a model recovery setting, where assumptions are made on the underlying model and the input distribution (Brutzkus & Globerson, 2017; Zhong et al., 2017; Li & Yuan, 2017; Du et al., 2017; Tian, 2017).
However, in their works the neural networks are not over-parameterized as in our setting.
Soltanolkotabi et al.
(2017) analyze the optimization landscape of over-parameterized networks and give convergence guarantees for gradient descent to a global minimum when the data follows a
Gaussian distribution and the activation functions are differentiable.
The main difference from our work is that they do not provide generalization guarantees for the resulting model.
Furthermore, we do not make any assumptions on the distribution of the feature vectors.
In a recent work, Nguyen & Hein (2017) show that if training points are linearly separable then under assumptions on the rank of the weight matrices of a fully-connected neural network, every critical point of the loss function is a global minimum.
Their work extends previous results in
Gori & Tesi (1992); Frasconi et al.
; Yu & Chen (1995).
Our work differs from these in several respects.
First, we show global convergence guarantees of SGD, whereas they only analyze the optimization landscape, without direct implications on performance of optimization methods.
Second, we provide generalization bounds and their focus is solely on optimization.
Third, we consider non-differentiable activation functions (Leaky ReLU, ReLU) while their results hold only for continuously differentiable activation functions.
C ONVERGENCE A NALYSIS
In this section we consider the setting of Section 2 with a leaky ReLU activation function.
In Section 5.1 we show SGD will converge to a globally optimal solution, and analyze the rate of convergence.
In Section 5.1 we also provide lower bounds on the rate of convergence.
The results in this section are interesting for two reasons.
First, they show convergence of SGD for a non-convex objective.
Second, the rate of convergence results will be used to derive generalization bounds in Section 6.
5. U PPER B OUND
Before proving convergence of SGD to a global minimum, we show that every critical point is a global minimum and the loss function is non-convex.
The proof is deferred to the appendix.
Proposition 1.
L S ( W ) satisﬁes the following properties:
Every critical point is a global minimum. 2)
It is non-convex.
Let (cid:126)W t = ( w (1) t . . .
w ( k ) t u (1) t . . .
u ( k ) t ) ∈
R
kd be the vectorized version of W t and N t :=
N W t where W t =
( W t , v ) (see Eq. 1).
Since we will show an upper bound on the number of non-zero updates, we will assume for simplicity that for all t we have a non-zero update at iteration t .
We assume that SGD is initialized such that the norms of all rows of W 0 are upper bounded by some constant R > 0 .
Namely for all 1 ≤ i ≤ k it holds that:
[Equation]
We give an upper bound on the number of non-zero updates SGD makes until convergence to a critical point (which is a global minimum by Proposition 1).
The result is summarized in the following theorem.
Theorem 2.
SGD converges to a global minimum after performing at most M k non-zero updates.
We will brieﬂy sketch the proof of Theorem 2.
The full proof is deferred to the Appendix (see
Section 9.1.2).
The analysis is reminiscent of the Perceptron convergence proof (e.g. in ShalevShwartz & Ben-David (2014)), but with key modiﬁcations due to the non-linear architecture.
Concretely, assume SGD performed t non-zero updates.
We consider the vector (cid:126)W t and the vector (cid:126)W ∗ =
( k (cid:122) (cid:125)(cid:124)
[Equation]
[Equation] [Equation]
− w ∗ · · · − w ∗ ) ∈ R 2 kd which is a global minimum of L S .
We deﬁne
F ( W t ) =
(cid:68) (cid:126)W t , (cid:126)W ∗ (cid:69) and G ( W t )
= (cid:107) (cid:126)W t (cid:107) .
Then, we give an upper bound on G ( W t ) in terms of G ( W t − 1 ) and by a recursive application of inequalities we show that G ( W t ) is bounded from above by a square root of a linear function of t .
Similarly, by a recursive application of inequalities, we show that F ( W t ) is bounded from below by a linear function of t .
Finally, we use the
Cauchy-Schwartz inequality,
[Equation]
To obtain a simpler bound than the one obtained in Theorem 2, we use the fact that we can set R, v arbitrarily, and choose:
[Equation]
Then by Theorem 2 we get the following.
The derivation is given in the Appendix (Section 9.1.3).
Corollary 3.
Let R = v = 1 √ 2 k , then SGD converges to a global minimum after perfoming at most
M k =
[Equation]
(cid:107) w ∗ (cid:107)min { η, √ η } (cid:33) non-zero updates.
Thus the bound consists of two terms, the ﬁrst which only depends on the margin (via (cid:107) w ∗ (cid:107) ) and the second which scales inversely with η .
More importantly, the bound is independent of the network size.
5. L OWER B OUND
We use the same notations as in Section 5.1.
The lower bound is given in the following theorem, which is proved in the Appendix (Section 9.1.4).
Theorem 4.
Assume SGD is initialized according to Eq.
6, then for any d there exists a sequence of linearly separable points on which SGD will make at least Ω (cid:16) (cid:107) w ∗ (cid:107)
η + (cid:107)
[Equation]
∗
[Equation]
2 (cid:17) mistakes.
Although this lower bound is not tight, it does show that the upper bound in Corollary 3 cannot be much improved.
Furthermore, the example presented in the proof of Theorem 4, demonstrates that η → ∞ can be optimal in terms of optimization and generalization, i.e., SGD makes the minimum number of updates ( (cid:107) w ∗ (cid:107) 2 ) and the learned model is equivalent to the true classiﬁer w ∗ .
We will use this observation in the discussion on the dependence of the generalization bound in Theoremon η
(see Remark 1).
5. E XTENSIONS - U PDATING BOTH LAYERS
The bounds we provide in this section rely on the assumption that the weights of the second layer remain constant throughout the training process.
Although this does not limit the expressive power of the network, updating both layers effectively changes the dynamics of the problem, and it may not be clear why the above bounds apply to this case as well.
To answer this concern we show the following.
First, we run the same experiments as in Figure 1, but with both layers trained.
We show in Figure 2 that the training and generalization performance remain the same.
Second, in the complete proof of the upper bound given in Section 9.1.2, we relax the assumption that the weights of the second layer are ﬁxed, and only assume that they do not change signs during the training process, and that their absolute values are bounded from below and from above.
This results in a similar bound, up to a constant factor.
We corroborate our theoretical result with experiments and show in
Figure 3 that by choosing an appropriate constant learning rate, this in fact holds when updating both layers - the weights of the last layer do not change their sign, and are correctly bounded.
Furthermore, the performance of SGD is not affected by the choice of the learning rate.
A complete theoretical analysis of training both layers is left for future work.
G ENERALIZATION
In this section we give generalization guarantees for SGD learning of over-parameterized networks with Leaky ReLU activations.
These results are obtained by combining Theorem 2 with a compression generalization bound (see Section 6.1).
In Section 6.2 we show that over-parameterized networks are sufﬁciently expressive to contain global minima that overﬁt the training set.
Taken together, these results show that although there are models that overﬁt, SGD effectively avoids these, and ﬁnds the models that generalize well.
6. C OMPRESSION B OUND
Given the bound in Theorem 2 we can invoke compression bounds for generalization guarantees with respect to the 0 - 1 loss (Littlestone & Warmuth, 1986) .
Denote by N k a two-layer neural network with 2 k hidden neurons deﬁned in Section 1 where σ is the Leaky ReLU.
Let SGD k ( S, W 0 ) be the output of running SGD for training this network on a set S and initialized with W 0 that satisﬁes
Eq. 5.
Deﬁne H k to be the set of all possible hypotheses that SGD k ( S, W 0 ) can output for any S and W 0 which satisﬁes Eq. 5.
Now, ﬁx an initialization W 0 .
Then the key observation is that by Theorem 2 we have
SGD k ( S, W 0 )
=
B W 0 ( x i 1 , ..., x i ck ) for c k ≤ M k , some function B W 0 :
X c k
→ H k and ( i 1 , ..., i c k ) ∈ [ n ] c k .
Equivalently, SGD k ( · , W 0 ) and B W 0 deﬁne a compression scheme of size c k for hypothesis class H k
(see Deﬁnition 30.4 in Shalev-Shwartz & Ben-David (2014)).
Denote by
V = { x j : j / ∈ { i 1 , ..., i c k }} the set of examples which were not selected to deﬁne SGD k ( S, W 0 ) .
Let L 0 − 1 D
( SGD k ( S, W 0 )) and L 0 − 1 V (
SGD k ( S, W 0 )) be the true risk of SGD k ( S, W 0 ) and empirical risk of SGD k ( S, W 0 ) on the set V , respectively.
Then by Theorem 30.2 and Corollary 30.
in Shalev-Shwartz & Ben-David (2014) we can easily derive the following theorem.
The proof is deferred to the Appendix (Section 9.2.1).
Theorem 5.
Let n ≥ 2 c k , then with probability of at least 1 − δ over the choice of S and W
we have
[Equation]
[Figure]
Since L 0 − 1 V ( SGD k ( S, W 0 ))
= 0 holds at a global minimum of L S , then by Combining the results of Corollary 3 and Theorem 5, we get the following theorem.
Theorem 6.
If n ≥ 2 c k and assuming the initialization deﬁned in Eq.
6, then with probability at least 1 − δ over the choice of S and W 0 , SGD converges to a global minimum of L S with 0 - 1 test error at most
[Equation]
Thus for ﬁxed (cid:107) w ∗ (cid:107) and η we obtain a sample complexity guarantee that is independent of the network size (See Remark 1 for a discussion on the dependence of the bound on η ).
This is despite the fact that for sufﬁciently large k , the network has global minima that have arbitrarily high test errors, as we show in the next section.
Thus, SGD and the linearly separable data introduce an inductive bias which directs SGD to the global minimum with low test error while avoiding global minima with high test error.
In Figure 1 we demonstrate this empirically for a linearly separable data set (from a subset of MNIST) learned using over-parameterized networks.
The ﬁgure indeed shows that SGD converges to a global minimum which generalizes well.
Remark 1.
The generelization bound in Eq.
7 holds for η → ∞ , which is unique for the setting that we consider, and may seem surprising, given that a choice of large η often fails in practice.
Furthermore, the bound is optimal for η → ∞ .
To support this theoretical result, we show in
Theorem 4 an example where indeed η → ∞ is optimal in terms of the number of updates and generalization.
On the other hand, we note that in practice, it may not be optimal to use large η in our setting, since this bound results from a worst-case analysis of a sequence of examples encountered by SGD.
Finally, the important thing to note is that the bound holds for any η , and is thus applicable to realistic applications of SGD.
6. E XPRESSIVENESS
Let X ∈ R
d
× n be the matrix with the points
x i in its columns, y ∈ {− 1 , 1 } n the corresponding vector of labels and let N W ( X ) = v (cid:62) σ ( WX ) be the network deﬁned in Eq.
1 applied on the matrix
X .
By Theorem 8 in (Soudry & Hoffer, 2017)
we immediately get the following.
For completeness, the proof is given in the Appendix (Section 9.2.2).
Theorem 7.
Assume that k ≥ 2 (cid:108) n 2 d − 2 (cid:109) .
Then for any y ∈ {− 1 , 1 } n and for almost any X ,there exist ˜ W
=
( ˜ W, ˜ v ) where ˜ W ∈ R 2 k × d and ˜ v = ( k (cid:122) (cid:125)(cid:124) (cid:123)
˜ v . . .
˜ v, k (cid:122) (cid:125)(cid:124) (cid:123) − ˜ v · · · − ˜ v ) ∈
R 2 k , ˜ v >
such that
y = N ˜ W
( X ) .
Theorem 7 implies that for sufﬁciently large networks, the optimization problem (2) can have arbitrarely bad global minima with respect to a given test set, i.e., ones which do not generalize well on a given test set.
R E LU- S UCCESS AND F AILURE C ASES
In this section we consider the same setting as in section 5, but with the ReLU activation function σ ( x ) = max { 0 , x } .
In Section 7.1 we show that the loss function contains arbitrarely bad local minima.
In Section 7.2 we give an example where for a sufﬁciently small network, with high probability SGD will converge to a local minimum.
On the other hand, for a sufﬁciently large network, with high probability SGD will converge to a global minimum.
7. E XISTENCE OF B AD L OCAL M INIMA
The result is summarized in the following theorem and the proof is deferred to the Appendix (Section 9.3.1).
The main idea is to construct a network with weight paramater W such that for at least | S |points ( x , y ) ∈ S it holds that (cid:104) w , x (cid:105) < 0 for each neuron with weight vector w .
Furthermore, the remaining points satisfy yN W ( x ) > 1 and thus the gradient is zero and L S ( W ) > 12 .
Theorem 8.
Fix v
=
[Equation]
− 1 · · · − 1) ∈
R 2 k .
Then, for every ﬁnite set of examples S ⊆
X × Y that is linearly separable, i.e., for which there exists w ∗ ∈ R d such that for each ( x , y ) ∈ S we have y (cid:104) w ∗ , x (cid:105) ≥ 1 , there exists W ∈ R 2 k × d such that W is a local minimum point with L S ( W ) > 12 .
7. O RTHOGONAL V ECTORS - S IMPLE C ASE A NALYSIS
In this section we assume that S = { e 1 . . .
e d } × { 1 } ⊆
X × Y where { e 1 , . . .
, e d } is the standard basis of R d .
We assume all examples are labeled with the same label for simplicity, as the same result holds for the general case.
Let N W t be the network obtained at iteration t , where W t =
( W t , v ) .
Assume we initialize with ﬁxed v =
( k (cid:122) (cid:125)(cid:124) (cid:123) 1 . . .
1 , k (cid:122) (cid:125)(cid:124) (cid:123) − 1 · · · − 1) , and W 0 ∈ R 2 k × d is randomly initialized from a continuous symmetric distribution with bounded norm, i.e | [ W 0 ] i,j | ≤ C for some C > 0 .
The main result of this section is given in the following theorem.
The proof is given in the Appendix (Section 9.3.2).
The main observation is that the convergence to non-global minimum depends solely on the initialization and occurs if and only if there exists a point x such that for all neurons, the corresponding initialized weight vector w satisﬁes (cid:104) w , x (cid:105) ≤ 0 .
Theorem 9.
Fix δ > 0 and assume we run SGD with examples from S
= { e 1 . . .
e d } × { 1 } .
If k ≤ log 2 ( d − ln( δ ) ) , then with probability of at least 1 − δ , SGD will converge to a non global minimum point.
On the other hand, if k ≥ log 2 ( 2 dδ ) , then with probability of at least 1 − δ , SGD will converge to a global minimum point after (cid:100) max { dCη , dη }(cid:101) iterations.
Note that in the ﬁrst part of the theorem, we can make the basin of attraction of the non-global minimum exponentially large by setting δ =
e − αd for α ≤ 12 .
C ONCLUSION
Understanding the performance of over-parameterized neural networks is essential for explaining the success of deep learning models in practice.
Despite a plethora of theoretical results for generalization of neural networks, none of them give guarantees for over-parameterized networks.
In this work, we give the ﬁrst provable guarantees for the generalization performance of over-parameterized networks, in a setting where the data is linearly separable and the network has Leaky ReLU activations.
We show that SGD compresses its output when learning over-parameterized networks, and thus exhibits good generalization performance.
The analysis for networks with Leaky ReLU activations does not hold for networks with ReLU activations, since in this case the loss contains spurious local minima.
However, due to the success of over-parameterized networks with ReLU activations in practice, it is likely that similar results hold here as well.
It would be very interesting to provide convergence guarantees and generalization bounds for this case.
Another direction for future work is to show that similar results hold under different assumptions on the data.
A CKNOWLEDGMENTS
This research is supported by the Blavatnik Computer Science Research Fund, ISF F.I.R.S.T.
(Bikura) grant and the European Research Council (TheoryDL project).
A PPENDIX 9. M ISSING P ROOFS FOR S ECTION9.1. P ROOF OF P ROPOSITION
Denote by (cid:126)W = (cid:0) w (1) . . .
w ( k ) u (1) . . .
u ( k ) (cid:1) ∈
R
kd the vector of all parameters where each w ( i ) , u ( i ) ∈ R d .
Let ( x , y ) ∈ S , then if yN W ( x ) < 1 , it holds that (cid:28) ∂
[Equation]
w
[Equation]
{ ( x ,y ) } ( (cid:126)W ) , w
[Equation]
(cid:29) =
(cid:68) − yσ (cid:48)
(cid:16)(cid:68) w ( i
[Table]
and similarly,
[Equation]
< 0 .
Hence if we deﬁne (cid:126)W
[Equation] [Equation]
(cid:123)
[Equation]
R
[Equation]
, then
[Equation]
Otherwise, if yN W ( x ) ≥ 1 , then the gradient vanishes and thus
[Equation]
It follows that if there exists ( x , y ) ∈ S , such that yN W ( x ) < 1 , then we have
[Equation]
and thus ∂∂(cid:126)W L S ( (cid:126)W ) (cid:54) = 0 .
Therefore, for
any critical point it holds that yN W ( x ) ≥ 1 for all ( x , y ) ∈ S , which implies that it is a global minimum. 2.
For simplicity consider the function f x ( w , u ) =
σ ( (cid:104) w , x (cid:105) )
− σ ( (cid:104) u , x (cid:105) ) for x (cid:54) = 0 .
Deﬁne w 1 = w 2 = u 1 = x and u 2 = − x .
Then f x ( w 1 , u 1 ) =
f x ( w 2 , u 2 ) =
(1 + α ) (cid:107) x (cid:107)and f x ( w 1 + w , u 1 + u ) = (cid:107) x
(cid:107)and thus f x ( w 1 + w 2, u 1 + u 2) > 12 f x ( w 1 , u 1 ) + 12 f x ( w 2 , u 2 ) which implies that the function is not convex.
9.1. P ROOF OF T HEOREM
We will start by analyzing a case with more relaxed assumptions - namely, we do not assume that the weights of the second layer are ﬁxed, but rather that they do not change signs, and are bounded in absolute value.
Formally, let v ( i ) t be the weight of the second layer neuron corresponding to the weight vector w ( i ) t , and ˆ v ( i ) t the weight corresponding to u ( i ) t .
Then we assume there exist c, C >such that:
[Equation] [Equation]
And note that we take v ( i )
= − ˆ v ( i )
= v .
Assume SGD performed t non-zero updates.
We will show that t ≤ M k .
We note that if there is no ( x , y ) ∈ S such that the corresponding update is non-zero, then SGD has reached a critical point of
L S (which is a global minimum by Proposition 1).
Let (cid:126)W ∗
[Equation]
and note that L S ( (cid:126)W ∗ ) = 0 , i.e., (cid:126)W ∗ is a global minimum.
Deﬁne the following two functions:
[Equation]
Then, from Cauchy-Schwartz inequality we have
[Equation]
Since the update at iteration t is non-zero
[Equation]
we have y t N t − 1 ( x t ) < 1 and the update rule is given by
[Equation]
where p ( i ) t = 1 if (cid:68) w ( i ) t − 1 , x t (cid:69) ≥ 0 and p ( i ) t
= α otherwise.
Similarly q ( i ) t = 1 if (cid:68) u
( i ) t − 1 ,
x t (cid:69) ≥and
q ( i ) t
= α otherwise.
It follows that:
[Equation]
<
[Equation]
where the second inequality follows since y t (cid:16)(cid:80)
ki
=1 (cid:68) w ( i ) t − 1 , x t (cid:69) v ( i ) t p
( i ) t − (cid:80)
ki =1 (cid:68)
u
( i ) t − 1 , x t (cid:69) ˆ v ( i ) t q ( i ) t (cid:17) =
y t N t − 1 ( x t ) < 1 .
Using the above recursively, we obtain:
[Equation]
On the other hand,
F ( W t )
=
k (cid:88)
i
[Equation]
where the inequality follows since (cid:104)
y t x t , w ∗ (cid:105) ≥ 1 .
This implies that
[Equation]
By combining equations Eq. 9, Eq. 11 and Eq.
12 we get,
[Equation]
Using √ a + b ≤ √ a + √ b the above implies,
[Equation]
Since (cid:107) w ( i )
(cid:107) , (cid:107) u
( i )
(cid:107) ≤
R we have G ( W 0 ) ≤ √ 2 kR .
Noting that (cid:107) (cid:126)W ∗ (cid:107) = √ 2 k (cid:107) w ∗ (cid:107) we get, at ≤
[Equation]
√ t + c where a = 2 kηcvα , b = (cid:112) (4 k 2 η 2 C 2 v 2 + 4 ηk ) (cid:107) w ∗ (cid:107) and c = 4 kR (cid:107) w ∗ (cid:107) .
By inspecting the roots of the parabola P ( x ) = x 2 − ba x − ca we conclude that
[Equation]
[Figure]
The setting of Figure 1 is implemented, but now the second layer is trained as well.
The second layer is initialized as in Figure 1, i.e., all the weights are initialized to 1 √ 2 k or − 1 √ 2 k .
The training and generalization performance are similar to the performance in the case where only the ﬁrst layer is trained (see Figure 1).
[Figure]
setting of Figure 2 is implemented, but learning rate is chosen for each network size, in order to satisfy the conditions of the proof in Section 9.1.2.
Figures (a) and (b) are train and test errors of MNIST classiﬁcation for different network sizes and the chosen learning rates.
In this setting, SGD exhibits similar training and generalization performance as in Figure 2.
Figure (c) shows the minimal and maximal value of the second layer weights divided by their initial value (denoted as c, C respectively in Section 9.1.2).
It can be seen that these values remain above zero, which implies that the weights do not ﬂip signs during the training process (namely they satisfy the sign condition in Section 9.1.2) and that they behave similarly for different network sizes.
Notice that when assuming that the weights of the second layer are ﬁxed, we get c
= C =
and the above is simply equal to M k .
Otherwise, if c, C are independent constants, we get a similar bound, up to a constant factor.
9.1. P ROOF OF C OROLLARY
Since R v = 1 , we have by Theorem 2 and the inequality √ a + b ≤ √ a + √ b ,
[Equation]
9.1. P ROOF OF T HEOREM
We will prove a more general theorem.
Theorem 4 follows by setting R = v = 1 √ 2 k .
Theorem 10.
For any d there exists a sequence of linearly separable points on which SGD will make at least
[Equation]
updates, where
[Equation]
and
[Equation]
Proof.
Deﬁne a sequence S of size d , ( e 1 , 1) , ( e 2 , 1) , ..., ( e d , 1) where { e i } is the standard basis of R d and let w ∗ =
(1 , 1 , ..., 1) ∈ R d .
Note that d = (cid:107) w ∗ (cid:107)and (cid:104) w ∗ , e i (cid:105) ≥ 1 for all 1 ≤ i ≤ d .
We will consider the case where SGD runs on a sequence of examples which consists of multiple copies of S one after the other.
Assume SGD is initialized with
[Equation]
for all 1 ≤ i ≤ k .
Note that (cid:107) w ( i )
(cid:107) , (cid:107) u
( i )
(cid:107) ≤ R for all 1 ≤ i ≤ k .
Since w ( i )=
w ( j ) 0 and u ( i )=
u ( j ) 0 for all i (cid:54)
=
j , we have by induction that w ( i ) t = w ( j ) t and u ( i ) t = u ( j ) t for all i (cid:54) =
j and t > 0 .
Hence, we will denote w t = w ( i ) t and u t = u ( i ) t for all 1 ≤ i ≤ d and t > 0 .
Then for all 1 ≤ j ≤ d we have N W t ( e j ) =
kvσ (cid:48) ( (cid:104) w t , e j (cid:105) )
(cid:104) w t , e j (cid:105)
− kvσ (cid:48)
( (cid:104) u t , e j (cid:105) )
(cid:104) u t , e j (cid:105) .
At the global minumum N W t , v ( e j ) ≥ 1 for all 1 ≤ j ≤ d , thus it follows that a necessary condition for convergence to a global minimum is that there exists an iteration t in which either kvσ (cid:48)
( (cid:104) w t , e d (cid:105) )
(cid:104) w t , e d (cid:105) ≥ 12 or − kvσ (cid:48)
( (cid:104) u t , e d (cid:105) )
(cid:104) u t , e d (cid:105) ≥ 12 .
Equivalently, either (cid:104) w t , e d (cid:105) ≥ 12 kv or (cid:104)
u t , e d (cid:105) ≤ − 1 2 αkv .
Since (cid:104) w 0 , e d (cid:105)
= − R √ d , then by the gradient updates (Eq. 10) it follows that after at least
R ηvα √ d copies of S , or equivalently, after at least
Rd ηvα √ d iterations we will have 0 ≤ (cid:104) w t , e d (cid:105) ≤ ηvα .
Then, after at least d min { 12 kv − ηvα, 0 } ηv iterations we have (cid:104) w t , e d (cid:105) ≥ 1 2 kv .
Thus, in total, after at least
R (cid:107) w ∗ (cid:107) ηvα + min { (cid:107) w ∗ (cid:107) 2 2 ηkv 2 − α (cid:107) w ∗ (cid:107) 2 , 0 } iterations, we have (cid:104) w t , e d (cid:105) ≥ 12 kv .
By the same reasoning, we have (cid:104) u t , e d (cid:105) ≤ − 1 2 αkv after at least R (cid:107) w ∗ (cid:107) ηv +min { (cid:107) w ∗ (cid:107) 2
α 2 ηkv 2 − (cid:107) w ∗ (cid:107) 2 α , 0 } iterations.
Finally, SGD must update on at least d points in order to converge to the global minimum.
The claim now follows.
9. M ISSING P ROOFS FOR S ECTION9.2. P ROOF OF T HEOREM
By Theorem 30.2 and Corollary 30.3 in Shalev-Shwartz & Ben-David (2014), for n ≥ 2 c k we have that with probability of at least 1 − δ over the choice of S
[Equation]
The above result holds for a ﬁxed initialization W 0 .
We will show that the same result holds with high probability over S and W 0 , where W 0 is chosen independently of S and satisﬁes Eq. 5.
Deﬁne
B to be the event that the inequality Eq.
15 does not hold.
Then we know that P S ( B| W 0 )
≤ δ for any ﬁxed initialization W 0 .
Hence, by the law of total expectation,
[Equation]
9.2. P ROOF OF T HEOREM
We can easily extend Theorem 8 in (Soudry & Hoffer, 2017) to hold for labels in {− 1 , 1 } .
By the theorem we can construct networks N W 1 and N W 2 such that for all i :
N W 1 ( x i )
=
if y i
=
and N W 1 ( x i )
= 0 otherwise.
N W 2 ( x i )
=
if y i = − 1 and N W 2 ( x i )
=
otherwise.
Then ( N W 1 − N W 2 )( x i ) =
y i and N W 1 − N W 2 = N ˜ W for ˜ W
=
( ˜ W, ˜ v ) where ˜ W ∈ R 2 k × d and ˜ v = ( k (cid:122) (cid:125)(cid:124) (cid:123)
˜ v . . .
˜ v, k (cid:122) (cid:125)(cid:124)
(cid:123) − ˜ v · · · − ˜ v ) ∈ R 2 k , ˜ v > 0 .
9. M ISSING P ROOFS FOR S ECTION9.3. P ROOF OF T HEOREM
We ﬁrst need the following lemma.
Lemma 11.
There exists ˆ w ∈ R d that satisﬁes the following:
There exists α > 0 such that for each ( x , y ) ∈ S we have | (cid:104) x , ˆ w (cid:105) | > α . 2.
# { ( x , y ) ∈ S : (cid:104) ˆ w , x (cid:105) < 0 } > 12 | S | .
Proof.
Consider the set V = { v ∈ R d : ∃ ( x ,y ) ∈ S (cid:104) v , x (cid:105) = 0 } .
Clearly, V is a ﬁnite union of hyperplanes and therefore has measure zero, so there exists ˆ w ∈ R d \ V .
Let β = min ( x,y ) ∈ S {|(cid:104) ˆ w , x (cid:105)|} , and since S is ﬁnite we clearly have α > 0 .
Finally, if
[Equation]
we can choose ˆ w and α = β 2 and we are done.
Otherwise, choosing − ˆ w and α = β 2 satisﬁes all the assumptions of the lemma.
We are now ready to prove the theorem.
Choose ˆ w ∈ R d
that satisﬁes the assumptions in Lemma 11.
Now, let c > (cid:107) w ∗ (cid:107) α , and let w = c ˆ w + w ∗ and u = c ˆ w − w ∗ .
Deﬁne
[Equation]
Let ( x
, y ) ∈ S be an arbitrary example.
If (cid:104) ˆ w , x (cid:105) >
α
, then
[Equation]
It follows that
[Equation]
Therefore yN W ( x ) >
[Equation]
so we get zero loss for this example
[Equation]
and therefore the gradient of the loss will also be zero.
If, on the other hand, (cid:104) ˆ w , x (cid:105) < − α
[Equation]
then
[Equation]
and therefore
[Equation]
In this case the loss on the example would be max { 1 − yN W ( x ) , 0 } = 1 , but the gradient will also be zero.
Along with assumption 2, we would conclude that:
[Equation]
Notice that since all the inequalities are strong, the following holds for all W (cid:48)
∈ R 2 k ×
d that satisﬁes (cid:107) W (cid:48) − W (cid:107) < (cid:15) , for a small enough (cid:15) > 0 .
Therefore, W ∈ R 2 k × d is indeed a local minimum.
9.3. P ROOF OF T HEOREM
Denote W t =
[ w (1) t . . .
w ( k ) t u (1) t . . .
u ( k ) t ] and deﬁne K t
= { e j : ∀ i ∈ [ k ] (cid:68) w
( i ) t , e j (cid:69) ≤ 0 } .
We ﬁrst prove the following lemma.
Lemma 12.
For every t we get K t +1 =
K t .
Proof.
Let e j be the example seen in time t .
If N W t ( e j ) ≥ 1 then there is no update and we are done.
Otherwise, if e j ∈ K t then for each i ∈
[ k ] we have ∂ ∂ w ( i ) t N W t ( e j )
=
and therefore the update does not change the value of w ( i ) t , and thus K t +1 =
K t .
If e j / ∈ K t then there exists i ∈
[ k ] such that (cid:68) w ( i ) t , e j (cid:69) > 0 .
In that case, we update w ( i ) t +1 ← w ( i ) t + η e j .
Now, note that
[Equation]
and therefore e j / ∈ K t +1 .
Furthermore, for each e (cid:96) where (cid:96) (cid:54) =
j , by the orthogonality of the vectors we know that for each i ∈
[ k ] it holds that
[Equation]
Thus e (cid:96) ∈ K t
if and only if e (cid:96) ∈ K t +1 and this concludes the lemma.
We can now prove the theorem.
For each j ∈ [ d ] , by the symmetry of the initialization, with probability 12 over the initialization of w ( i ) 0 , we get that (cid:68) w ( i ) 0 , e j (cid:69) ≤ 0 .
Since all w i ’s are initialized independently, we get that:
[Equation]
Now, assuming k ≤ log 2 ( d − ln( δ ) ) , from the independence of the initialization of w ( i ) 0 ’s coordinates we get
[Equation]
Therefore, with probability at least 1 − δ , there exists j ∈ [ k ] for which e j ∈ K 0 .
By Lemma 12, this implies that for all t ∈ N we will get e j ∈ K t , and therefore N W t ( e j ) ≤ 0 .
Since e j is labeled 1 , this implies that L S ( W ) > 0 .
By the separability of the data, and by the convergence of the SGD algorithm, this implies that the algorithm converges to a stationary point that is not a global minimum.
Note that convergence to a saddle point is possible only if we deﬁne σ (cid:48) (0) = 0 , and for all i ∈
[ k ] we have at the time of convergence (cid:68)
w ( i ) t , e j (cid:69) = 0 .
This can only happen if (cid:68) w ( i ) 0 , e j (cid:69) = ηN for some N ∈ N , which has probability zero over the initialization of w ( i ) t .
Therefore, the convergence is almost surely to a non-global minimum point.
On the other hand, assuming k ≥ log 2 ( dδ ) , using the union bound we get:
[Equation]
So with probability at least 1 − δ , we get K 0 = ∅
and by Lemma 12 this means K t = ∅ for all t ∈ N .
Now, if e j / ∈ K t for all t ∈ N , then there exists i ∈
[ k ] such that (cid:68) w ( i ) t , e j (cid:69) > 0 for all t ∈ N .
If after performing T update iterations we have updated N > max { Cη , 1 η } times on e j , then clearly:
[Equation]
∀
[Equation] [Equation]
and therefore N W t ( e j ) > 1 , which implies that L { ( e j , 1) } ( W t ) = 0 .
From this, we can conclude that for each j ∈ [ d ] , we perform at most (cid:100) max { Cη , 1 η }(cid:101) update iterations on e j before reaching zero loss, and therefore we can perform at most (cid:100) max { dCη , dη }(cid:101) update iterations until convergence.
Since we show that we never get stuck with zero gradient on an example with loss greater than zero, this means