U NDERSTANDING THE G ENERALIZATION OF A DAM IN L EARNING N EURAL N ETWORKS WITH P ROPER R EGULARIZATION
A BSTRACT
Adaptive gradient methods such as Adam have gained increasing popularity in deep learning optimization.
However, it has been observed in many deep learning applications such as image classiﬁcation, Adam can converge to a different solution with a worse test error compared to (stochastic) gradient descent, even with a ﬁne-tuned regularization.
In this paper, we provide a theoretical explanation for this phenomenon: we show that in the nonconvex setting of learning over-parameterized two-layer convolutional neural networks starting from the same random initialization, for a class of data distributions (inspired from image data), Adam and gradient descent (GD) can converge to different global solutions of the training objective with provably different generalization errors, even with weight decay regularization.
In contrast, we show that if the training objective is convex, and the weight decay regularization is employed, any optimization algorithms including Adam and GD will converge to the same solution if the training is successful.
This suggests that the generalization gap between Adam and SGD in the presence of weight decay regularization is closely tied to the nonconvex landscape of deep learning optimization, which cannot be covered by the recent neural tangent kernel (NTK) based analysis.
I NTRODUCTION
Adaptive gradient methods (Duchi et al., 2011; Hinton et al., 2012; Kingma & Ba, 2015; Reddi et al., 2018) such as Adam are very popular optimizers for training deep neural networks.
By adjusting the learning rate coordinate-wisely based on historical gradient information, they are known to be able to automatically choose appropriate learning rates to achieve fast convergence in training.
Because of this advantage, Adam and its variants are widely used in deep learning.
[Table]
Despite their fast convergence, adaptive gradient methods have been observed to achieve worse generalization performance compared with gradient descent and stochastic gradient descent (SGD) (Wilson et al., 2017; Luo et al., 2019;
Chen et al., 2020; Zhou et al., 2020) in many deep learning tasks such as image classiﬁcation (we have done some simple deep learning experiments to justify this, the results are reported in
Table 1).
Even with explicit weight decay regularization, achieving good test error with adaptive gradient methods seems to be challenging.
Moreover, we have also visualized the ﬁrst layer of AlexNet trained by Adam and SGD in Figure 1, where we can also observe a clear difference between Adam and SGD: the model learned by Adam is more “noisy” than that learned by SGD.
Several recent works provided theoretical explanations of this generalization gap between Adam and GD by showing that Adam and GD have different implicit bias.
Wilson et al.
(2017); Agarwal et al.
(2019) considered a setting of linear regression, and showed that Adam can fail when learning an overparameterized linear model on certain speciﬁcally designed data, while SGD can learn the linear model to achieve zero test error.
This example in linear regression offers valuable insights into the difference between SGD and Adam.
However, there is a gap between their theoretical results and the practical observations, since they consider a convex optimization setting, and the difference between Adam and SGD will no longer be observed when adding weight decay regularization.
In fact, as we will show in this paper (Theorem 4.2), regularization can successfully correct the different implicit bias and push different algorithms to ﬁnd the same solution, since the regularized training loss function of a convex model becomes strongly convex, which exhibits one unique global optimum.
For this reason, we argue that the example in the convex setting cannot fully capture the differences between GD and Adam for training neural networks.
More recently, Zhou et al.
(2020) studied the expected escaping time of Adam and SGD from a local basin, and utilized this to explain the difference between SGD and Adam.
However, their results do not take NN architecture into consideration, and do not provide an analysis of test errors either.
In this paper, we aim at answering the following question
Why is there a generalization gap between Adam and gradient descent in learning neural networks, even with weight decay regularization?
Speciﬁcally, we study Adam and GD for training neural networks with weight decay regularization on an image-like data model, and demonstrate the different behaviors of Adam and GD based on the notion of feature learning/noise memorization decomposition.
Inspired by the experimental observation in Figure 1 where Adam tends to overﬁt the noise component of the data, we consider a model where the data are generated as a combination of feature and noise patches, and analyze the convergence and generalization of Adam and GD for training a two-layer convolutional neural network (CNN).
The contributions of this paper are summarized as follows.
• We establish global convergence guarantees for Adam and GD with weight decay regularization.
We show that, starting at the same random initialization, Adam and GD can both train a two-layer convolutional neural network to achieve zero training error after polynomially many iterations, despite the nonconvex optimization landscape.
• We further show that GD and Adam in fact converge to different global solutions with different generalization performance: when performed on the considered image-like data model, GD can achieve nearly zero test error, while the generalization performance of the model found by Adam is no better than a random guess.
In particular, we show that the reason for this gap is due to the different training behaviors of Adam and GD: Adam is more likely to ﬁt dense noises and output a model that is largely contributed by the noise patches; GD prefers to ﬁt training data using their feature patch and ﬁnds a solution that is mainly composed by the true features.
• We also show that for convex settings with weight decay regularization, both Adam and gradient descent converge to the same solution and therefore have no test error difference.
This suggests that the difference between Adam and GD cannot be fully explained by linear models or neural networks trained in the “almost convex” neural tangent kernel (NTK) regime (Jacot et al., 2018; Allen-Zhu et al., 2019b; Du et al., 2019a; Zou et al., 2019).
It also demonstrates that the inferior generalization performance of Adam is closely tied to the nonconvex landscape of deep learning optimization, and cannot be solved by adding regularization.
R ELATED W ORK
In this section we discuss the works that are closely related to our paper.
Generalization gap between Adam and SGD.
The worse generalization of Adam compared with
SGD has also been observed by some recent works and has motivated new variants of neural network training algorithms.
Keskar & Socher (2017) proposed to switch between Adam and SGD to achieve better generalization.
Merity et al.
(2018) proposed a variant of the averaged stochastic gradient method to achieve good generalization performance for LSTM language models.
Luo et al.
(2019) proposed to use dynamic bounds on learning rates to achieve a smooth transition from adaptive methods to SGD to improve generalization.
Our theoretical results for GD and Adam
can also
[Figure]
provide theoretical insights into the effectiveness of these empirical studies.
Optimization and generalization in deep learning.
Our work is also closely related to the recent line of work studying the optimization and generalization guarantees of neural networks in the neural tangent kernel (NTK) regime (Jacot et al., 2018) or
lazy training regime (Chizat et al., 2019).
In particular, recent works (Du et al., 2019b;a; Allen-Zhu et al., 2019b; Zou et al., 2019) showed that the optimization only happens within a small neighborhood region around the random initialization and proved the global convergence of GD and SGD when the neural network is sufﬁciently wide.
Moreover, the generalization ability of GD/SGD has been further studied in the same setting (AllenZhu et al., 2019a; Arora et al., 2019a;b; Ji & Telgarsky, 2020; Chen et al., 2021), which suggests that wide neural network trained by GD/SGD can learn a low-dimensional function class.
Moreover,
Allen-Zhu & Li (2019); Bai & Lee (2019) initiated the study of learning neural networks beyond the
NTK regime as it differs from the practical DNN training.
Our analysis in this paper is also beyond
NTK, and gives a detailed comparison between GD and Adam.
Feature learning by neural networks.
This paper is also closely related to several recent works that studied how neural networks can learn features.
Allen-Zhu & Li (2020a) showed that adversarial training puriﬁes the learned features by removing certain “dense mixtures” in the hidden layer weights of the network.
Allen-Zhu & Li (2020b) studied how ensemble and knowledge distillation work in deep learning when the data have “multi-view” features.
Frei et al.
(2022b) studied the feature learning for two-layer networks, and demonstrated its superior performance than linear models.
Shen et al.
(2022) explored the beneﬁt of data augmentation by showing its ability to achieve more effective feature learning.
This paper studies a different aspect of feature learning by Adam and GD, and shows that GD can learn the features while Adam may fail even with proper regularization.
P ROBLEM S ETUP AND P RELIMINARIES
We consider learning a CNN with Adam and GD based on n independent training examples { ( x i , y i ) }
ni
=1 generated from a data model D .
In the following.
we ﬁrst introduce our data model
D , and then explain our neural network model and the details of the training algorithms.
Data model.
We consider a data model where the data inputs consist of feature and noise patches.
Such a data model is motivated by image classiﬁcation problems where the label of an image usually only depends on part of an image, and the other parts of the image showing random objects, or features that belong to other classes, can be considered as noises.
When using CNN to ﬁt the data, the convolution operation is applied to each patch of the data input separately.
We claim that our data model is more practical than those considered in Wilson et al.
; Reddi et al.
(2018), which are handcrafted for showing the failure of Adam in term of either convergence or generalization (detailed illustrations of the data models in these works are deferred to the appendix).
For simplicity, we only consider the case where the data consists of one feature patch and one noise patch.
However, our result can be easily extended to cover the setting where there are multiple feature/noise patches.
The detailed deﬁnition of our data model is given in Deﬁnition 3.1 as follows.
Deﬁnition 3.1.
Each data point ( x , y ) with x ∈ R 2 d and y ∈ {− 1 , 1 } is generated as follows:
x = [ x (cid:62) 1 , x (cid:62) 2 ] (cid:62) , where one of x 1 and x
denotes the feature patch that consists of a feature vector y · v , which is assumed to be 1 -sparse, and the other one denotes the noise patch and consists of a noise vector ξ .
Without loss of generality, we assume v = [1 , 0 , . . .
, 0] (cid:62) .
The noise vector ξ is generated according to the following process:
• Randomly select s coordinates from [ d ] \{ 1 } uniformly, denoted as a vector s ∈ { 0 , 1 } d . • Generate ξ from distribution N ( 0 , σ 2 p I ) , and then mask off the ﬁrst coordinate and other d − s −coordinates, i.e., ξ = ξ (cid:12) s .
• Add feature noise to ξ , i.e., ξ = ξ − αy v , where 0 < α < 1 is the strength of the feature noise.
In particular, throughout this paper we set d = Ω( n
[Equation] [Equation]
=
[Equation]
and α = Θ (cid:0) σ p · polylog( n ) (cid:1) .
The most natural way to think of our data model is to treat x as the output of some intermediate layer of a CNN.
In literature, Papyan et al.
(2017) pointed out that the outputs of an intermediate layer of a CNN are usually sparse.
Yang (2019) also discussed the setting where the hidden nodes in such an intermediate layer are sampled independently.
This motivates us to study sparse features and entry-wisely independent noises in our model.
In this paper, we focus on the case where the feature vector v is 1 -sparse and the noise vector is s -sparse for simplicity.
However, these sparsity assumptions can be generalized to the settings where the feature and the noises are denser, as long as the sparsity gap between feature and noises exists.
Note that in Deﬁnition 3.1, each data input consists of two patches: a feature patch y v that is positively correlated with the label, and a noise patch ξ which contains the “feature noise” − αy v as well as random Gaussian noises.
Importantly, the feature noise − αy v in the noise patch plays a pivotal role in both the training and test processes, which connects the noise overﬁtting in the training process and the inferior generalization ability in the test process.
Moreover, we would like to clarify that the data distribution considered in our paper is an extreme case where we assume there is only one feature vector and all data has a feature noise, since we believe this is the simplest model that captures the fundamental difference between Adam and SGD.
With this data model, we aim to show why Adam and SGD perform differently.
Our theoretical results and analysis techniques can also be extended to more practical settings where there are multiple feature vectors and multiple patches, each data can either contain a single feature or multiple features, together with pure random noise or feature noise.
Two-layer CNN model.
We consider a two-layer CNN model F using truncated polynomial activation function σ ( z ) =
(max { 0 , z } ) q and ﬁx the weights of second layer to be all 1 ’s, where q ≥ 3 .
Given the data ( x , y ) , the j -th output of the CNN can be formulated as
[Equation]
where m is the width of the network, w j,r ∈ R d denotes the r -th CNN ﬁlter, and W is the collection of model weights.
For the ease of analysis, we set the output layer as all 1 ’s. Our analyses and results can still be applied if we use random second layer weights.
Besides, the motivation of using polynomial ReLU activation function is to guarantee that the loss function is (locally) smooth and the ampliﬁcation ability of pattern learning.
It can be replaced by a smoothed ReLU activation function (e.g., the activation function used in Allen-Zhu & Li (2020b)).
If we assume the input data distribution is Gaussian, we can also deal with ReLU activation function (Li et al., 2020).
A set of similar smoothed ReLU-type activation functions have also been widely considered to study the generalization performance of two-layer neural networks from different aspects (Frei et al., 2022a;
Cao et al., 2022;
Shen et al., 2022; Chen et al., 2022).
Moreover, we would like to emphasize that x 1 and x 2 denote two data patches, which are randomly assigned with feature vectors or noise vectors independently for each data point.
The leaner has no knowledge about which one is the feature patch (or noise patch).
In this paper we assume the width of the network is polylogarithmic in the training sample size, i.e., m = polylog( n ) .
We assume j ∈ {− 1 , 1 } in order to make the logit index be consistent with the data label.
Moreover, we assume that the each weight is initialized from a random draw of Gaussian random variable ∼ N (0 , σ 20 ) with σ
= Θ (cid:0) d − 1 / 4 (cid:1) .
Training objective.
Given the training data points { ( x i , y i ) } i =1 ,...,n , we consider to learn the model parameter W by optimizing the empirical loss function with weight decay regularization
[Equation]
where L i ( W )
= − log
[Equation]
j
[Equation]
Fj ( W , x i ) denotes the individual loss for the data point ( x i , y i ) and λ ≥ 0 is the regularization parameter.
In particular, the regularization parameter can be arbitrary as long as it satisﬁes λ ∈ (cid:0) 0 , λ 0 (cid:1) with λ 0 =
Θ (cid:0)
[Equation]
n ) (cid:1) .
We claim that the λ 0 is the largest feasible regularization parameter that the training process will not stuck at the origin point (recall that L ( W ) admits zero gradient at W = 0 .)
Training algorithms.
In this paper, we consider full-batch gradient descent and Adam 1 .
In particular, starting from W (0) = { w (0) j,r , j = {± 1 } , r ∈ [ m ] } , the gradient descent update rule is
[Equation]
where η is the learning rate.
Meanwhile, Adam store historical gradient information in the momentum m ( t ) and a vector v ( t ) as follows
[Equation]
[Equation] [Equation]
and entry-wisely adjusts the learning rate:
[Equation]
where β 1 , β 2 are the hyperparameters of Adam (a popular choice in practice is β 1 = 0 .
9 , and β 2 = 0 . 99 ), which are considered as constants in our paper, and in (3.4) and (3.5), the square ( · ) 2 , square root √· , and division · / · all denote entry-wise calculations.
We would like to clarify the original Adam paper (Kingma & Ba, 2015) considers to normalize the gradient m ( t ) j,r via [ v ( t ) j,r + (cid:15) ] 1 / 2 , while the small bias term (cid:15) is ignored in our paper.
In practice, tuning (cid:15) can help improve the generalization ability of Adam (Choi et al., 2019), as it allows to make a trade-off between the normalized gradient update and gradient update.
We remark that considering tunable (cid:15) is beyond the focus of this paper.
For the ease of analysis, we do not consider the initialization bias correction in the original Adam paper either and set m (0) j,r = ∇ w j,r L ( W (0) ) and v (0) j,r = [ ∇ w j,r L ( W (0) )] 2 .
M AIN R ESULTS
In this section we will state the main theorems in this paper.
We ﬁrst provide the learning guarantees of Adam and Gradient descent for training a two-layer CNN model in the following theorem.
Recall that in this setting the training objective is nonconvex.
Theorem 4.1 (Nonconvex setting) .
Consider a two-layer CNN deﬁned in (3.1) with d = Ω( n 4 ) and regularized training objective (3.2) with a regularization parameter λ > 0 , suppose the network width is m = polylog( n ) and the data distribution follows Deﬁnition 3.1, then we have the following guarantees on the training and test errors for the models trained by Adam and Gradient descent:
Suppose we run Adam for T = poly( n ) η iterations with η = 1 poly( n ) , then with probability at least 1 − O ( n − 1 ) , we can ﬁnd a NN model W ∗ Adam such that (cid:107)∇ L ( W ∗ Adam ) (cid:107) 1 ≤ 1 Tη .
Moreover, the model W ∗ Adam also satisﬁes
• Training error is zero: 1 n (cid:80) ni
=1 1 (cid:2) F y i
( W ∗ Adam , x i ) ≤ F − y i ( W ∗ Adam , x i ) (cid:3) = 0 .
• Test error is high: P ( x ,y ) ∼D (cid:2)
F y ( W ∗ Adam , x ) ≤ F − y
( W ∗ Adam , x ) (cid:3) ≥ 1 2 . 2.
Suppose we run gradient descent for T = poly( n ) η iterations with learning rate η = 1 poly( n ) , then with probability at least 1 − O ( n − 1 ) , we can ﬁnd a NN model W ∗ GD such that (cid:107)∇ L ( W ∗ GD ) (cid:107) 2 F ≤Tη .
Moreover, the model W ∗ GD also satisﬁes:
• Training error is zero: 1 n (cid:80) ni
=1 1 (cid:2) F y i
( W ∗ GD , x i ) ≤ F − y i
( W ∗ GD , x i ) (cid:3)
= 0 .
• Test error is nearly zero: P ( x ,y ) ∼D (cid:2)
F y ( W ∗ GD , x ) ≤ F − y ( W ∗ GD , x ) (cid:3) =
1 poly( n ) .
From the optimization perspective, Theorem 4.1 shows that both Adam and GD can be guaranteed to ﬁnd a point with a very small gradient, which can also achieve zero classiﬁcation error on the training data.
Moreover, it can be seen that given the same iteration number T and learning rate η ,
Adam can be guaranteed to ﬁnd a point with up to 1 / ( Tη ) gradient norm in (cid:96) 1 metric, while gradient descent can only be guaranteed to ﬁnd a point with up to 1 / √ Tη gradient norm in (cid:96) 2 metric.
More speciﬁcally, let (cid:15) be a sufﬁciently small quantity and ignoring other problem parameters, we can set η = O ( (cid:15) ) for Adam and η =
O ( (cid:15) 2 ) for GD, then Adam and GD will need T
= O ( (cid:15) 2 ) and
T =
O ( (cid:15) 4 ) to ﬁnd a ﬁrst-order (cid:15) -stationary point.
This suggests that Adam could enjoy a faster convergence rate compared to SGD in the training process, which is consistent with the practice ﬁndings.
We would also like to point out that there is no contradiction between our result and the recent work (Reddi et al., 2019) showing that Adam can fail to converge, as the counterexample in
Reddi et al.
(2019) is for the online version of Adam, while we study the full batch Adam.
In terms of the test performance, their generalization abilities are largely different, even with weight decay regularization.
In particular, the output of gradient descent can generalize well and achieve nearly zero test error, while the output of Adam gives nearly 1 / 2 test error.
In fact, this gap is due to two major aspects of the training process: (1)
At the early stage of training where weight decay exhibits negligible effect, Adam and GD behave very differently.
In particular, Adam prefers the denser and thus tends to ﬁt the noise vectors ξ , gradient descent prefers the data patch of larger (cid:96)norm and thus will learn the feature patch; (2) At the late stage of training where the weight decay regularization cannot be ignored, both Adam and gradient descent will be enforced to converge to a local minimum of the regularized objective, which maintains the pattern learned in the early stage.
Consequently, the model learned by Adam will be biased towards the noise patch to ﬁt the feature noise vector − αy v , which is opposite in direction to the true feature vector and therefore leads to a test error no better than a random guess.
More details about the training behaviors of Adam and GD are given in Section 5.
Experimental justiﬁcation are provided in Appendix.
Theorem 4.1 shows that when optimizing a nonconvex training objective, Adam and gradient descent will converge to different global solutions with different generalization errors, even with weight decay regularization.
In comparison, the following theorem gives the learning guarantees of Adam and gradient descent when optimizing convex and smooth training objectives (e.g., linear model
F ( w , x ) = w (cid:62) x with logistic loss).
Theorem 4.2 (Convex setting) .
For any convex and smooth training objective with positive regularization parameter λ , suppose we run Adam and gradient descent for T = poly( n ) η iterations, then with probability at least 1 − n − 1 , the obtained parameters W ∗ Adam and W ∗ GD satisfy that (cid:107)∇ L ( W ∗ Adam ) (cid:107) 1 ≤ 1 Tη and (cid:107)∇ L ( W ∗ Adam ) (cid:107) 22 ≤ 1 Tη respectively.
Moreover, let F ( W , x ) ∈ R be the output of the convex model with parameter W and input x , it holds that:
• Training errors are the same, 1 n (cid:80) n i =1 1 (cid:2) sgn (cid:0) F ( W ∗ Adam , x i ) (cid:1) (cid:54) =
sgn (cid:0) F ( W ∗ GD , x i ) (cid:3) = 0 .
• Test errors are nearly the same: P ( x ,y ) ∼D (cid:2) sgn (cid:0) F ( W ∗ Adam , x i ) (cid:1) (cid:54) = sgn (cid:0) F ( W ∗ GD , x i ) (cid:3) ≤ 1 poly( n ) .
Theorem 4.2 shows that when optimizing a convex and smooth training objective (e.g., a linear model with logistic loss) with weight decay regularization, both Adam and gradient can converge to almost the same solution and enjoy very similar generalization performance.
The proof will be relying on the strong convexity of the training objective and the convergence (to the ﬁrst-order stationary) guarantee of Adam (D´efossez et al., 2020) and GD.
Combining this result and Theorem 4.1, it is clear that the inferior generalization performance is closely tied to the nonconvex landscape of deep learning, and cannot be understood by standard weight decay regularization.
P ROOF O UTLINE OF THE M AIN R ESULTS
In this section we provide the proof sketch of Theorem 4.1 and explain the different generalization abilities of the models found by gradient descent and Adam.
Before moving to the proof of main results, we ﬁrst give the following lemma which shows that for data generated from the data distribution D in Deﬁnition 3.1, with high probability all noise vectors { ξ i } i =1 ,...,n have nearly disjoint supports.
Lemma 5.1.
Let { ( x i , y i ) } i =1 ,...,n be the training dataset generated by Deﬁnition 3.1.
Moreover, recall that x i =
[ y i v (cid:62) , ξ (cid:62) i ] (cid:62) (or x i =
[ ξ (cid:62) i , y i v (cid:62) ] (cid:62) ), let B i
=
supp ( ξ i ) \{ 1 } be the support of ξ i except the ﬁrst coordinate.
Then with probability at least 1 − n − 2 , B i ∩ B j = ∅ for all i (cid:54) =
j .
This lemma implies that the optimization of each coordinate of the model parameter W , except for the ﬁrst one, is mostly determined by only one training data.
Technically, this lemma can greatly simplify the analysis for Adam so that we can better illustrate its optimization behavior and explain the generalization performance gap between Adam and gradient descent.
Proof outline.
For both Adam and gradient descent, we will show that the training process can be decomposed into two stages.
In the ﬁrst stage, which we call pattern learning stage , the weight decay regularization will be less important and can be ignored, while the algorithms tend to learn the pattern from the training data.
In particular, we will show that in the pattern learning stage, the optimization algorithms have different algorithmic bias : Adam tends to ﬁt the noise patch while gradient descent will mainly learn the feature patch.
In the second stage, which we call it regularization stage , the effect of regularization cannot be neglected, which will regularize the algorithm to converge at some local stationary points.
However, due to the nonconvex landscape of the training objective, the pattern learned in the ﬁrst stage will remain unchanged, even when running an inﬁnitely number of iterations.
5. P ROOF SKETCH FOR A DAM
Recall that in each iteration of Adam, the model weight is updated by using a moving-averaged gradient, normalized by a moving average of the historical gradient squares.
As pointed out in
Balles & Hennig (2018); Bernstein et al.
(2018), Adam behaves similarly to sign gradient descent (signGD) when using sufﬁciently small step size or the moving average parameters β 1 , β 2 are nearly zero, which is also justiﬁed in our Lemma C.2.
Speciﬁcally, we show that when considering constant β 1 and β 2 , the Adam update on the coordinates with large gradient (e.g., |∇ L ( W ( t ) )
[ k ] | > η ) can be well approximated by the signGD update (i.e., sign( ∇ L ( W ( t ) )
[ k ]) ).
This motivates us to understand the optimization behavior of signGD and then extends it to Adam using their similarities.
In particular, signGD updates the model parameter according to the following rule:
[Equation]
Recall that each data has a feature patch and a noise patch.
By Lemma 5.1 and the data distribution (see Deﬁnition 3.1), all noise vectors { ξ i } i =1 ,...,n are supported on disjoint coordinates except the ﬁrst coordinate.
For x i , let B i denote its support excluding the ﬁrst coordinate.
In the subsequent analysis, we will always assume that those B i ’s are disjoint, i.e., B i ∩ B j = ∅ if i (cid:54) =
j .
Next we will characterize two aspects of the training process: feature learning and noise memorization .
Mathematically, we focus on two quantities: (cid:104) w ( t ) j,r , j · v (cid:105) and (cid:104) w ( t )
y i ,r , ξ i (cid:105) .
In particular, given the training data point ( x i , y i ) with x i =
[ y i v (cid:62) , ξ (cid:62) i ] (cid:62) , larger (cid:104) w ( t )
y i ,r , y i · v (cid:105) implies better feature learning and larger (cid:104) w ( t )
y i ,r , ξ i (cid:105) represents better noise memorization.
Then regarding the feature vector v that only has nonzero entry at the ﬁrst coordinate, we have the following for signGD:
[Equation] [Equation]
where (cid:96) ( t ) j,i :
= 1 y i =
j − logit j
( F, x i ) and logit j ( F, x i ) =
[Equation] [Equation]
Fk
[Equation]
W
[Equation]
x i ) .
From (5.1) we can observe three terms in the signed gradient.
Speciﬁcally, the ﬁrst term represents the gradient over the feature patch, the second term stems from the feature noise term in the noise patch (see Deﬁnition 3.1), and the last term is the gradient of the weight decay regularization.
On the other hand, the memorization of the noise vector ξ i can be described as follows.
[Equation]
Throughout the proof, we will show that the training process of Adam can be decomposed into two stages: pattern learning stage and regularization stage .
In the ﬁrst stage, the algorithm learns the pattern of training data quickly, without being affected by the regularization term.
In the second stage, the training data has already been correctly classiﬁed since the pattern has been well captured, the regularization will play an important role in the training process and guide the model to converge.
Stage I: Learning the pattern.
At the beginning of training, the neural network output is smaller than some constant for all data, and therefore all training data remain under-ﬁtted and can provide large gradient for model training.
We specify this stage of training as Stage I.
In this stage, the effect of weight decay regularization can be ignored due to our choice of λ .
We will show that in this stage the inner product (cid:104) w ( t )
y i ,r , ξ i (cid:105) grows much faster than (cid:104) w ( t ) j,r , j v (cid:105) since feature learning only makes use of the ﬁrst coordinate of the gradient, while noise memorization could take advantage of all the coordinates in B i (see (5.2), note that |B
i | =
s (cid:29) 1 ).
Lemma 5.2 (General results in Stage I) .
Suppose the training data is generated according to Deﬁnition 3.1, assume λ
= o ( σ q − 2σ p /n ) and η = 1 / poly( d ) , then for any t ≤ T 0 with T 0 = (cid:101) O (cid:0) 1 ηsσ p (cid:1) and any i ∈ [ n ] ,
[Equation]
ηsσ p ) .
Since (cid:104) w ( t ) j,r , ξ i (cid:105) enjoys a much faster increasing rate than that of (cid:104) w ( t ) j,r , j · v (cid:105) , after a certain number of iterations, the learning of noise patch will dominate the learning of feature patch (i.e., ασ (cid:48) ( (cid:104) w ( t ) j,r , ξ i (cid:105) ) > σ (cid:48)
( (cid:104) w ( t ) j,r , y
i v (cid:105) ) ).
Thus, by (5.1), the model will tend to ﬁt the feature noise in the noise patch (i.e., − αy i v ), leading to a ﬂipped feature learning phenomenon.
Lemma 5.3 (Flipping the feature learning) .
Suppose the training data is generated according to
Deﬁnition 3.1, α ≥ (cid:101) Θ (cid:0) ( sσ p ) 1 − q ∨ σ q − 1(cid:1) and σ 0 < (cid:101) O
(( sσ p ) − 1 ) , then for any t ∈ [ T r , T 0 ] with
T r = (cid:101) O (cid:0)
[Equation]
Moreover, it holds that (1) w ( T 0 )
j,r [1] = − sgn( j ) · (cid:101) Ω (cid:0) 1 sσ p (cid:1) ; (2) w ( T 0 ) j,r [ k ] = sgn( ξ i [ k ]) · (cid:101) Ω (cid:0) 1 sσ p (cid:1) or w ( T 0 ) j,r [ k ] = ± (cid:101) O ( η ) for k ∈ B i with y i =
j ; and (3) w ( T 0 ) j,r [ k ] = ± (cid:101)
O ( η ) otherwise.
From Lemma 5.3 it can be observed that at the iteration T 0 , the sign of the ﬁrst coordinate of w ( T 0 ) j,r is different from that of the true feature, i.e., j · v .
This implies that at the end of the ﬁrst training stage, the model is biased towards the noise patch to ﬁt the feature noise.
Stage II:
Regularizing the model.
In this stage, as the neural network output becomes larger, part of training data starts to be well ﬁtted and gives smaller gradient.
As a consequence, the feature learning and noise memorization processes will be slowed down and the weight decay regularization term cannot be ignored.
However, although weight decay regularization can prevent the model weight from being too large, it will maintain the pattern learned in Stage I and cannot push the model back to “forget” the noise and learn the feature and stops at some local stationary points.
We summarize these results in the following lemma.
Lemma 5.4 (Maintain the pattern) .
If α = O (cid:0) sσ 2 p /n (cid:1) and η = o ( λ ) , then let r ∗ =
arg max r ∈ [ m ] (cid:104) w ( t )
y i ,r , ξ i (cid:105) , for any t ≥ T 0 , i ∈ [ n ] , j ∈ {± 1 } and r ∈ [ m ] , it holds that (cid:104) w ( t )
y
i ,r ∗ , ξ i (cid:105) = (cid:101) Θ(1) , (cid:88) k ∈B i |
[Equation]
[Equation] [Equation]
r ∗
[Equation]
] | · | ξ i [
[Equation]
] | = (cid:101) Θ(1) , (cid:104) w ( t ) j,r , sgn( j ) · v (cid:105) ∈ [ − o (1) , O ( λ − 1 η )] .
Lemma 5.4 shows that in the second stage, (cid:104) w ( t )
y i ,r , ξ i (cid:105) will always be large while (cid:104) w ( t ) y
i ,r , y i · v (cid:105) is still negative, or positive but extremely small.
Next we will show that within polynomial steps, the algorithm can be guaranteed to ﬁnd a point with small gradient.
Lemma 5.5 (Convergence guarantee) .
If η = O ( d − 1 / 2 ) , then for any t it holds that
[Equation]
Lemma 5.5 shows that we can pick a sufﬁciently small η and T = poly( n ) /η to ensure that the algorithm can ﬁnd a point with up to O (1 / ( Tη )) in (cid:96) 1 norm.
Then we can show that given the results in Lemma 5.4, the formula of the algorithm output W ∗ can be precisely characterized, which we can show that (cid:104) w ∗
y
i ,r , y i · v (cid:105) < 0 .
This implies that the output model will be biased to ﬁt the feature noise − αy v
but not the true one v .
Then when it comes to a fresh test example the model will fail to recognize its true feature.
Also note that the noise in the test data is nearly independent of the noise in training data.
Consequently, the model will not be able to identify the label of the test data and therefore cannot be better than a random guess.
5. P ROOF SKETCH FOR GRADIENT DESCENT
Similar to the proof for Adam, we also decompose the entire training process into two stages.
Stage I: Learning the pattern.
In this stage the gradient from training loss function is large and and the effect of regularization can be ignored.
Unlike Adam that is sensitive to the sparsity of the feature vector or noise vector, gradient descent is more focusing on the (cid:96) 2 norm of them, where the vector (which can be either feature or noise) with larger (cid:96) 2 norm is more likely to be discovered and learned by GD.
Note that the feature vector has a larger (cid:96) 2 norm than the noise, we can show that gradient descent will learn the feature vector very quickly, while barely memorize the noise.
Lemma 5.6.
Let Λ ( t )
j
[Equation]
and Γ ( t
[Equation]
= max i : y i =
j Γ ( t ) j,i .
Let T j be the iteration number that Λ ( t ) j reaches Θ(1 /m )
= (cid:101) Θ(1) , then we have
T j = (cid:101) Θ( σ 2 − q) for all j ∈ {− 1 , 1 } .
Moreover, let T 0 = max j { T j } , then for all t ≤ T 0 it holds that Γ ( t ) j = (cid:101)
O ( σ 0 ) for all j ∈ {− 1 , 1 } .
Stage II:
Regularizing the model.
Similar to Lemma 5.4, we show that in the second stage at which the impact of weight decay regularization cannot be ignored, the pattern of the training data learned in the ﬁrst stage will remain unchanged.
Lemma 5.7.
If η ≤ O ( σ 0 ) , it holds that Λ ( t )
j = (cid:101) Θ(1) and Γ ( t )
j = (cid:101)
O ( σ 0 )
for all t ≥ min j T j .
The following lemma further shows that within polynomial steps, gradient descent is guaranteed to ﬁnd a point with small gradient.
Lemma 5.8.
If the learning rate satisﬁes η = o (1) , then for any t ≥ 0 it holds that
[Equation]
Lemma 5.8 shows that we can pick a sufﬁciently small η and T = poly( n ) /η to ensure that gradient descent can ﬁnd a point with up to O (1 / ( Tη ) 1 / 2 ) in (cid:96) 2 norm.
By Lemma 5.7, it is clear that the output model of GD can well learn the feature vector while memorizing nearly nothing from the noise vectors, which can therefore achieve nearly zero test error.
Experiments.
We perform experiments on synthetic data (generated according to Deﬁnition 3.1) to validate our theoretical ﬁndings: Adam performs stronger noise memorization than feature learning while GD performs stronger feature learning than noise memorization, when conducted on the data distribution constructed in Deﬁnition 3.1.
We consider both the two-layer CNN model studied in this paper and a 5 -layer CNN model for further justiﬁcation.
Experimental setup and results are deferred to Appendix A due to the page limit.
C ONCLUDING R EMARKS AND F UTURE W ORK
In this paper, we study the generalization of Adam and compare it with gradient descent.
We show that when training neural networks, Adam and GD starting from the same initialization can converge to different global solutions of the training objective with signiﬁcantly different generalization errors, even with proper regularization.
Our analysis reveals the fundamental difference between
Adam and GD in learning features or noise, and demonstrates that this difference is closely tied to the nonconvex landscape of neural networks.
We would also like to remark several important research directions.
First, our current result is for two-layer networks.
Extending the results to deep networks could be an important next step, where we will not only look at the input data but also consider the output of each intermediate layer as “input”.
Second, our current data model is motivated by the image data (i.e., sparse feature and denser noise), where Adam has been observed to perform worse than SGD in terms of generalization.
In fact, our theoretical analysis can lead to an opposite conclusion on the generalization comparison between Adam and GD if the noise is sparse and the feature is denser.
Therefore, it would also be interesting to explore whether this is the case in other machine learning tasks such as natural language processing, where Adam is often observed to perform better than SGD.
A CKNOWLEDGEMENTS
We thank the anonymous reviewers and area chair for their helpful comments.
YL is supported by the National Science Foundation CCF-2145703.
QG is supported in part by the National Science
Foundation CAREER Award 1906169, IIS-2008981 and the Sloan Research Fellowship
A E XPERIMENTS A. E XPERIMENT D ETAILS FOR F IGURE
The experiments in Figure 1 are performed by running (stochastic gradient) Adam and SGD in training AlexNet on the CIFAR-10 dataset.
Speciﬁcally, the ﬁrst layer of AlexNet is set as: kernel size=11, stride=4, padding=2, in order to match the size of CIFAR-10 image.
In terms of the input data, we use standard random crop and horizontal ﬂip data augmentations.
In terms of the model training, we set the batch size as 64 , the epoch number as 100 , the regularization parameter as λ = 5 × 10 − 4 .
Besides, we set the learning rate η = 0 .
01 for SGD and η = 1 × 10 − 5 for Adam, where β 1 and β 2 are set as their default values in pytorch.
A. N UMERICAL E XPERIMENTS ON S YNTHETIC D ATA
In this section we perform numerical experiments on the synthetic data generated according to Definition 3.1 to verify our main results.
In particular, we set the problem dimension d = 1000 , the training sample size n = 200 ( 100 positive examples and 100 negative examples), feature vector v = [1 , 0 , . . .
, 0] (cid:62) , noise sparsity s = 0 .
1 d = 100 , standard deviation of noise σ p = 1 /s 1 / 2 = 0 .
1 , feature noise strength α = 0 .
2 , initialization scaling σ 0 = 0 .
01 , regularization parameter λ
= 1 × 10 − 5 .
Two-layer CNN model.
We ﬁrst consider the exact two-layer CNN model studied in the paper.
We set the network width m = 20 , activation function σ ( z ) = max { 0 , z } 3 , total iteration number
T = 1 × 10 4 , and the learning rate η = 5 × 10 − 5 for Adam (default choices of β 1 and β 2 in pytorch), η = 0 .
02 for GD.
We ﬁrst report the training error and test error achieved by the solutions found by SGD and Adam in
Table 2, where the test error is calculated on a test dataset of size 10 4 .
It is clear that both Adam and
SGD can achieve zero training error, while they have entirely different results on the test data: SGD generalizes well and achieve zero test error; Adam generalizes worse than SGD and gives > 0 .
5 test error, which veriﬁes our main result (Theorem 4.1).
[Table]
Moreover, we also calculate the inner products: max r (cid:104) w 1 ,r , v (cid:105) and min i max r (cid:104) w 1 ,r , ξ i (cid:105) , representing feature learning and noise memorization respectively, to verify our key lemmas.
Here we only consider positive examples as the results for negative examples are similar.
The results are reported in Figure 2.
For Adam, from Figure 2(a), it can be seen that the algorithm will perform feature learning in the ﬁrst few iterations and then entirely forget the feature (but ﬁt feature noise), i.e., the feature learning is ﬂipped, which veriﬁes Lemma 5.3.
In the meanwhile, the noise memorization happens in the entire training process and enjoys much faster rate than feature learning, which veriﬁes Lemma 5.2.
In addition, we can also observe that there are two stages for the increasing of min i max r (cid:104) w 1 ,r , ξ i (cid:105) : in the ﬁrst stage min i max r (cid:104) w 1 ,r , ξ i (cid:105) increases linearly, and in the second stage its increasing speed gradually slows down and min i max r (cid:104) w 1 ,r , ξ i (cid:105) will remain in a constant order.
This veriﬁes Lemma 5.2 and Lemma 5.4.
For GD, from Figure 2(b), it can be seen that the feature learning will dominate the noise memorization: feature learning will increase to a constant in the ﬁrst stage and then remain in a constant order in the second stage; noise memorization will keep in a low level which is nearly the same as that at the initialization.
This veriﬁes Lemmas 5.
and 5.7.
5 -Layer CNN model.
We further perform numerical simulations for the deep neural network models.
In particular, we consider a 5 -layer CNN model: the ﬁrst layer is exactly the same as the twolayer CNN model, followed by a 4 -layer MLP with ReLU activation.
The number of neurons is set [Figure] [Figure] as m = 20 for all layers.
The total iteration number is T =
×
4 , the learning rate is η = 5 × 10 −for Adam and η = 0 .
1 for GD.
We then show the feature learning and noise memorization of the ﬁrst layer of this neural network model by calculating the inner products: max r (cid:104) w 1 ,r , v (cid:105) and min i max r (cid:104) w 1 ,r , ξ i (cid:105) , where w 1 ,r denotes the weights of the r -th neuron in the ﬁrst layer.
The results are shown in Figure 3.
It can be observed that, when applied on the data distribution in Deﬁnition 3.1, Adam tends to perform stronger noise memorization than feature learning, while GD performs stronger feature learning and nearly negligible noise memorization.
Moreover, we also visualize the ﬁrst layer of the 5-layer CNN trained by Adam and GD in Figure 4.
It can be seen that the CNN model found by Adam is clearly more “noisy” than that found by GD.
This is consistent with our theoretical ﬁndings and empirical observation on the real-world dataset (i.e., Figure 1).
B E XTENSIONS TO M INI - BATCH S TOCHASTIC G RADIENTS
One natural extension of our paper is proving the separation between mini-batch SGD (without replacement) and mini-batch Adam, which we believe is not difﬁcult.
In particular, let I t of size B be the set of indices of the mini-batch data used in the t -th iteration, the update rule of SGD is
[Equation]
[Figure]
The update rule of mini-batch Adam is
[Equation]
and
[Equation]
Here the bias term is set as (cid:15) =
(cid:101) Θ( λσ 0 ) .
We claim that this parameter is introduced to guarantee that the regularization term will not dominate the training process when using stochastic gradients in Adam.
Then we will take a deeper look at the speeds of feature learning and noise learning for mini-batch
SGD and Adam, where we focus on the period that |(cid:104) w ( t ) j,r , v (cid:105)| , |(cid:104) w ( t ) j,r , ξ i (cid:105)| =
o (1) for all j , i , and r (i.e., the pattern learning stage).
This further implies that | (cid:96) ( t ) j,i | = 0 .
5 ± o (1) for all j , i , and t .
Thus in the following, we will assume that all | (cid:96) ( t ) j,i | has nearly the same quantity.
Feature Learning.
First, according to Deﬁnition 3.1, we know that the feature vector v and feature noise are the same for all data, which implies that the learning pattern of the feature coordinate will be largely the same as that of full-batch algorithms.
In particular, for mini-batch Adam, we can show that the update of the ﬁrst coordinate (i.e., feature coordinate) is similar to sign-GD when using sufﬁciently small learning rate η = 1 / poly( d ) since all stochastic gradients ∇ L i ( W ( t ) ) have the same component in this coordinate.
Then using the fact that | (cid:96) ( t ) j,i | ’s are nearly the same for all i , we have
[Equation]
which is the same as full-batch Adam (see (5.1)).
For SGD, using the fact that | (cid:96) ( t ) j,i | ’s are nearly the same for all i , we can get that
[Equation]
[Table]
which is also the same as that of GD (see (C.28)).
Noise Memorization.
Note that due to the normalization term v ( t ) j,r in the Adam update, all coordinates will be updated with nearly the same amount.
Therefore, we only need to count the number of coordinates that are updated by full-batch Adam and mini-batch Adam.
Recall that we have shown that using mini-batch gradients will not affect the feature learning.
However, the noise memorization will be slightly different, since in each iteration, full-batch Adam can update Θ( ns ) coordinates while mini-batch Adam can only update (cid:101) Θ( Bs ) coordinates.
To show this, we note that for any coordinate k (cid:54)
= 1 , the gradient momentum of full-batch Adam is
[Equation]
while for mini-batch Adam,
[Equation]
where we only maintain the recent ¯ τ = polylog( n ) gradients since for τ ≤ t − ¯ τ , the decaying terms ( β 1 ) τ ≤ ( β i )
¯ τ becomes negligible.
Therefore, by comparing the above two equations and applying Deﬁnition 3.1, it is clear that for full-batch Adam can update all noise coordinates, i.e., k ∈ ∪ i ∈ [ n ] B i , which is of size Θ( ns ) .
In contrast, mini-batch Adam can only update a subset of noise coordinates, i.e., k ∈ ∪ τ ∈ [¯ τ ] ∪ i ∈ [ I t − τ ] B i , which is of size ¯ τBs = (cid:101)
Θ( Bs ) .
This further implies that in each epoch (one pass of the data, Θ( n/B ) steps), the noise coordinates in B i will be updated by mini-batch Adam in at most ¯ τ = (cid:101) Θ(1) steps, while within the same amount of iterations, the noise coordinates in B i will be updated by full-batch Adam for Θ( n/B ) steps, suggesting that mini-batch
Adam admits a slower rate of noise memorization by a (cid:101) Θ( n/B ) factor.
For SGD, it is easy to show that the rate of noise memorization will still be nearly the same as that of GD.
In particular, during each training epoch ( Θ( n/B ) steps), SGD will learn the noise vector ξ i in only one step with the mini-batch gradient 1 B ∇ L i ( W ( τ ) ) for some τ in this epoch, while within the same amount of steps, GD will learn the noise vector ξ i in all Θ( n/B ) steps but with strengthn ∇ L i ( W ( τ ) ) , giving the same total learning ability.
This suggests that SGD admits a nearly the same rate of noise memorization compared to GD.
Overall, we are able to deliver the following lemmas that characterize the feature learning and noise memorization of SGD and stochastic gradient Adam in training Stage I.
Lemma B.1 (SGD, Informal) .
Suppose the training data is generated according to Deﬁnition 3.1, then given proper conﬁgurations of λ and (cid:15) and sufﬁciently small learning rate η , deﬁne Λ ( t ) j = max r ∈ [ m ] (cid:104) w ( t ) j,r , j · v (cid:105) and Γ ( t ) j,i = max r ∈
[ m ] (cid:104) w ( t ) j,r , ξ i (cid:105) , for any t 0 satisfying Λ ( t 0 )
j , Γ ( t 0 ) j,i =
o (1 / polylog( n )) , we have the following one-epoch update of feature learning and noise memorization for SGD
[Equation]
Lemma B.2 (Stochastic gradient Adam, Informal) .
Suppose the training data is generated according to Deﬁnition 3.1, then given proper conﬁgurations of λ and (cid:15) , for any t 0 ≤ T 0 with T
= (cid:101) O (cid:0)
[Equation]
(cid:1) and any i ∈ [ n ] , we have the following one-epoch update of feature learning and noise memorization (cid:104) w ( t 0 + [Equation]
n/B
[Equation]
j,r
[Equation]
j
[Equation]
To sum up, we have shown that (1) mini-batch SGD and mini-batch Adam will not change the learning speed of feature vector v compared to their full-batch counterparts, i.e., Lemma C.3 and (C.31) (needs to covert to (cid:98) n/B (cid:99) iterations); (2) mini-batch Adam reduces the noise memorization speed of full-batch Adam by a (cid:101) Θ( n/B ) factor, while mini-batch SGD has nearly the same noise memorization speed compared to full-batch GD, by comparing to Lemma C.3 and (C.32)).
Additionally, recall that in our paper, the separation between Adam and GD is characterized by a poly( d ) factor: the speed of feature learning in Adam and GD, and the rate of noise memorization in GD are both in the order of O ( η ) (in each step), while the rate of noise memorization in Adam is proportional to the number of nonzero entries, which is in the order of η · poly( d ) .
Therefore, the separation between mini-batch SGD and mini-batch Adam in terms of the generalization error can still hold under a stronger over-parameterization condition sσ p =
Θ (cid:0) d 1 / 4 / ( n polylog( n )) (cid:1) =
ω ( n/B ) (in contrast, the over-parameterization condition for full-batch Adam is sσ
p = ω (1) ).
C P ROOF OF T HEOREM 4.1: N ONCONVEX C ASE
In the beginning of the proof we ﬁrst present the following useful lemma.
C. P RELIMINARIES
We ﬁrst recall the magnitude of all parameters:
[Equation]
Here poly( n ) denotes a polynomial function of n with degree of a sufﬁciently large constant, poly( n ) denotes a polynomial function of log( n ) with degree of a sufﬁciently large constant.
Based on the parameter conﬁguration, we claim that the following equations hold, which will be frequently used in the subsequent proof.
[Equation]
Lemma C.1 (Non-overlapping support) .
Let { ( x i , y i ) } i =1 ,...,n be the training dataset sampled according to Deﬁnition 3.1.
Moreover, let B i =
supp ( ξ i ) \{ 1 } be the support of x i except the ﬁrst coordinate 2 .
Then with probability at least 1 − n − 2 , B i ∩ B j = ∅ for all i, j ∈ [ n ] .
Proof of Lemma C.1.
For any ﬁxed k ∈ [ n ] and j ∈ supp ( ξ k ) \{ 1 } , by the model assumption we have
[Equation]
for all i ∈ [ n ] \{ k } .
Therefore by the fact that the data samples are independent, we have
[Equation]
Applying a union bound over all k ∈ [ n ] and j ∈ supp ( ξ k ) \{ 1 } , we obtain
P ( ∃ k ∈ [ n ] , j ∈ supp ( ξ k ) \{ 1 } , i ∈ [ n ] \{ k } : ( ξ i ) j (cid:54) = 0) ≤ n · s · { 1 − [1 − s/ ( d − 1)] n } .
(C.1)
By the data distribution assumption we have s ≤ √ d/ (2 n 2 ) , which clearly implies s/ ( d − 1) ≤ 1 / 2 .
Therefore we have
[Equation]
d ) n ] = n · s · { 1 − exp[ n log(1 − s/ ( d − 1))] } ≤ n · s · [1 − exp( n · 2 s/ ( d − 1))] ≤ n · s · [1 − exp( n · 4 s/d )] ≤ n · s · (4 ns/d ) = 4 n 2 s 2 /d ≤ n − 2 , where the ﬁrst inequality follows by the inequalities log(1 − z ) ≥ − 2 z for z ∈ [0 , 1 / 2] , the second inequality follows by s/ ( d − 1) ≥ 2 s/d , the third inequality follows by the inequality 1 − exp( − z )
≤ z for z ∈ R , and the last inequality follows by the assumption that s ≤ √ d/ (2 n 2 ) .
Plugging the bound above into (C.1) ﬁnishes the proof.
C. P ROOF FOR A DAM
Before moving to the detailed proof [Equation] we ﬁrst state the update rules of feature learning and noise memorization when the sign gradient is applied.
[Equation]
where (cid:96) ( t ) j,i :
= 1 y i =
j − logit j
( F, x i ) and logit j ( F, x i ) = [Equation] Fk ( W [Equation]
x
[Equation]
From (C.2) we can observe three terms in the signed gradient.
Speciﬁcally, the ﬁrst term represents the gradient over the feature patch, the second term stems from the feature noise term in the noise patch (see Deﬁnition 3.1) [Equation] and the last term is the gradient of the weight decay regularization.
On the other hand, the memorization of the noise vector ξ i can be described by the following update rule,
[Equation]
In this subsection we ﬁrst provide the following lemma that shows for most of the coordinate (with slightly large gradient), the Adam update is similar to signGD update (up to some constant factors).
In the remaining proof for Adam, we will largely apply this lemma to get a signGD-like result for
Adam (similar to the technical lemmas in Section 5).
Besides, the proofs for all lemmas in Sectioncan be viewed as a simpliﬁed version of the proofs for technical lemmas for Adam, thus are omitted in the paper.
Lemma C.2 (Closeness to SignGD) .
Recall the update rule of Adam, let W ( t ) be the t -th iterate of the Adam algorithm.
Suppose that (cid:104) w ( t ) j,r , v (cid:105) , (cid:104) w ( t ) j,r , ξ i (cid:105) =
(cid:101) Θ(1) for all j ∈ {± 1 } and r ∈ [ m ] .
Then if β 2 ≥ β 21 , we have
• For all k ∈ [ d ] ,
[Equation]
(cid:113)
[Equation]
t )
[Equation]
k ]
[Equation]
≤ Θ(1) .
• For every k / ∈ ∪ ni =1 B i (including k = 1 ) we have either |∇ w j,r L ( W ( t ) )
[ k ] | ≤ (cid:101) Θ( η ) or [Equation] r
[Equation]
• For every k ∈ B i , we have |∇ w j,r L ( W ( t ) )
[ k ] | ≤ (cid:101) Θ (cid:0) ηn − 1 sσ p | (cid:96) ( t ) j,i | (cid:1) ≤ (cid:101) Θ( ηsσ p ) or m ( t ) j,r [ k ] (cid:113) v ( t ) j,r [ k ] = sgn (cid:0) ∇ w j,r L ( W ( t ) )
[ k ] (cid:1) · Θ(1) .
Proof.
First recall that the gradient ∇ w j,r L ( W ( t ) ) can be calculated as ∇ w j,r L ( W ( t ) [Equation] = − 1 n (cid:20) n (cid:88) i = y
[Equation]
(cid:96) (
[Equation]
[Equation] ,i [Equation] (cid:48) ( (cid:104) w ( t ) j,r
[Equation] y i v (cid:105) ) · v + n (cid:88)
i
=
(cid:96) ( t ) j,i · σ (cid:48)
[Equation]
More speciﬁcally, for the ﬁrst coordinate of ∇ w j,r L ( W ( t ) ) , we have
[Equation]
For any k ∈ B i , by Lemma [-C.
-]C.1 we know that the gradient over this coordinate only depends on the training data ξ i , therefore, we have
[Equation]
For the remaining coordinates, we have
[Equation]
Now let us focus on the moving averaged gradient m ( t ) j,r and squared gradient v ( t ) j,r .
We ﬁrst show that for all k ∈ [ d ] , it holds that
[Equation]
By the update rule of m ( t ) j,r , we have
[Equation]
Similarly, we also have
[Equation]
Then by Cauchy-Schwartz inequality we have
[Equation]
Let α 2 τ
=
[ β τ 1 (1 − β 1 )] 2 β τ 2 (1 − β 2 ) , which forms an exponentially decaying sequence if β 2 ≥ β 21 .
Therefore, we have (cid:80) tτ =
α 2 τ = Θ(1) and the above inequality implies that
[Equation]
which proves (C.7).
Now we are going to prove the main argument of this lemma.
Note that m ( t ) j,r , which is a weighted average of all historical gradients, where the weights decay exponentially fast, then we can take on a threshold ¯ τ = polylog( η − 1 ) such that (cid:80) tτ =
¯ τ β τ 1 (1 − β 1 ) =
1 poly( η − 1 ) .
Then for each k ∈ [ d ] we have
[Equation]
[Equation]
where in the last equality we use the fact that |∇ w j,r L ( W ( t − τ ) )
[ k ] | = (cid:101) O
(1) for all k ∈ [ d ] .
Similarly, we can also have the following on v ( t ) j,r ,
[Equation]
Here we slightly abuse the notation by using the same ¯ τ .
Then we have
[Equation]
In order to prove the main argument of this lemma, the key is to show that within ¯ τ iterations, the gradient ∇ w j,r L ( W ( t ) )
[ k ] barely changes.
In particular, by (C.7), we have the update of each coordinate in one step is at most Θ( η ) .
This implies that
[Equation]
Then applying the fact that |(cid:104) w ( τ ) j,r , v (cid:105)| ≤ (cid:101) Θ(1) and |(cid:104) w ( τ ) j,r , ξ i (cid:105)| ≤ (cid:101) Θ(1) , we further have
[Equation]
where we use the fact that m = (cid:101) Θ(1) and sσ p = ω (1) .
Then it holds that
[Equation]
where we use the fact that (cid:101) Θ( η ¯ τsσ p )
=
o (1) .
Similarly, we can also show that (cid:96) ( τ ) j,i ≥ sgn
( (cid:96) ( t ) j,i ) ·
Θ( | (cid:96) ( t ) j,i | ) , which further implies
[Equation]
| ) for all τ ∈ [ t − ¯ τ, t ] .
Note that | (cid:96) ( τ ) j,i | ≤ 1 , then it holds that
[Equation]
We can also similarly derive the following
[Equation]
Combining the above results, applying (C.4), (C.5)
[Equation]
and (C.6)
[Equation]
we can show that for the ﬁrst coordinate
[Equation]
we have
[Equation]
for any k ∈ B i , we have
[Equation]
and for remaining coordinates, we have
[Equation]
Now we can plug the above results into the formula of m ( t ) j,r and v ( t ) j,r .
Using the fact that ¯ τ = (cid:101) Θ(1) , λ = o (1) , and | (cid:96) ( t ) j,i | ≤ 1 , we have for all k = 1 or k / ∈ B i for any i ,
[Equation]
k ]
[Equation]
For k ∈ B i we have
[Equation]
Then, we can conclude that for all k = 1 or k / ∈ B i for any i , we have either |∇ w j,r L ( W ( t ) )
[ k ] | ≤ (cid:101) Θ( η ) or
[Equation]
For any k ∈ B i , we have either |∇ w j,r L ( W ( t ) )
[ k ] | ≤ (cid:101) Θ (cid:0) ηn − 1 sσ p | (cid:96) ( t ) j,i | + λη (cid:1) or
[Equation]
This completes the proof.
Lemma C.3 (Lemma 5.2, restated) .
Suppose the training data is generated according to Deﬁnition 3.1, assume λ
= o ( σ q − 2σ p /n ) and η = 1 / poly( d ) , then for any t ≤ T 0 with T 0 = (cid:101) O (cid:0) 1 ηsσ p (cid:1) and any i ∈ [ n ] , (cid:104) w ( t +1)
j,r , j · v (cid:105) ≤ (cid:104) w ( t ) j,r , j · v (cid:105)
+ Θ( η ) , (cid:104) w ( t +1)
y i ,r , ξ i (cid:105) =
(cid:104) w ( t )
y i ,r , ξ i (cid:105) + (cid:101) Θ( ηsσ p ) .
Proof.
At the initialization, we have |(cid:104) w (0) j,r , v (cid:105)| = (cid:101) Θ( σ 0 ) , | [Equation] =
[Equation]
s 1 /
[Equation]
α
[Equation]
= (cid:101) Θ( s 1 /
[Equation]
σ p σ 0 ) , w (0) j,r [ k ] = (cid:101) Θ( σ 0 ) , which also imply that | (cid:96) (0) j,i | = Θ(1) .
Then recalling that λ
= o ( σ q − 2σ p /n ) , α = o (1) , s 1 / 2 σ p = (cid:101) O
(1) , we have sgn
[Equation]
=
[Equation]
nσ
[Equation] [Equation]
p
[Equation]
[Equation]
[Equation]
σ p )
[Equation]
= sgn( j ) .
Since v is 1 -sparse, then by Lemma C.2, we have
[Equation]
Now suppose that the ﬁrst inequality holds for iterations 0 , . . .
, t − 1 .
Then we have
[Equation]
Besides, note that (cid:96) ( t ) j,i = 1 j = y
i − logit j ( F ( t ) , x i ) , we have
[Equation]
, where we recall that j ∈ {− 1 , 1 } .
Therefore, given that λ
= o ( σ q −
[Equation]
(cid:101) O (1) , and assume (cid:96) ( t )
j,i = Θ(1) (which will be veriﬁed later),
[Equation]
Since v is 1 -sparse, then by Lemma C.2, the following inequality naturally holds,
[Equation]
Additionally, in terms of the memorization of noise, we ﬁrst consider the iterate in the initialization.
By the condition that η = o (1 /d )
=
o (1 / ( sσ p )) and note that for a sufﬁciently large fraction of k ∈ B i (e.g., 0 . 99 ), we have | ξ i [ k ] | ≥ (cid:101)
Θ( σ p ) ≥ (cid:101) Θ
( ηn − 1 sσ p | (cid:96) (0) j,i | ) and thus sgn (cid:0)
[Equation]
yi,r
[Equation]
W
[Equation] [Equation]
=
[Equation]
Therefore
[Equation]
by Lemma C.2 we have the following according to (C.3),
[Equation]
where in the ﬁrst inequality the term O ( ηsσ p ) represents the coordinates that | ξ i [ k ] | ≤ O ( σ p )
(so that we cannot use the sign information of ∇ y i ,r L ( W (0) ) but directly bound it by Θ(1) ) and the last inequality is due to the fact that |B i | ≥ s − 1 and α = o (1) .
For general t , we will consider the following induction hypothesis:
[Equation]
which has already been veriﬁed for t = 0 .
By Hypothesis (C.9)
[Equation]
the following holds at time t ,
[Equation]
In the meanwhile
[Equation]
we have the following upper bound for | w ( t ) j,r [ k ] | , | w ( t ) j,r [ k ] | ≤ | w ( t − 1) j,r [ k ] | + η | sign( ∇ w j,r L ( W ( t − 1) ))
| ≤ | w (0) j,r [ k ] | + tη = (cid:101)
Θ( σ 0 + tη ) .
(C.10)
Besides, it is also easy to verify that for any t ≤ T
= (cid:101) Θ (cid:0)
[Equation]
, we have
[Equation]
w
[Equation]
t )
y i ,r , ξ i (cid:105) ,
[Equation]
w ( t )
y
i ,r , j · v (cid:105) <
Θ(1 /m ) and thus | (cid:96) ( t ) j,i | = Θ(1) .
Then similar to (C.8), we have
[Equation]
This further implies that
[Equation]
where the term − O ( η 2 s 2 σ 2 p ) is contributed by the gradient coordinates that are smaller than Θ( ηsσ p ) .
This veriﬁes Hypothesis (C.9) at time t and thus completes the proof.
From Lemma C.3, note that sσ p = ω (1) , then it can be seen that (cid:104) w ( t ) j,r , j · v (cid:105) increases much faster than (cid:104) w ( t ) j,r , j · v (cid:105) .
By looking at the update rule of (cid:104) w ( t ) j,r , j · v (cid:105) (see (C.2)), it will keeps increasing only when, roughly speaking, σ (cid:48)
( (cid:104) w ( t ) j,r , j · v (cid:105) )
>
ασ (cid:48)
( (cid:104) w ( t ) j,r , ξ i (cid:105) ) .
Since (cid:104) w ( t ) j,r , ξ i (cid:105) increases much faster than (cid:104) w ( t ) j,r , j · v (cid:105) , it can be anticipated after a certain number of iterations, (cid:104) w ( t ) j,r , j · v (cid:105) will start to decrease.
In the following lemma, we provide an upper bound on the iteration number such that this decreasing occurs.
Lemma C.4 (Lemma C.4, restated) .
Suppose the training data is generated according to Deﬁnition 3.1, α ≥ (cid:101) Θ (cid:0)
( sσ p ) 1 − q ∨ σ q − 1(cid:1) and σ 0 < (cid:101) O
(( sσ p ) − 1 ) , then for any t ∈ [ T r , T 0 ] with
T r = (cid:101) O (cid:0)
[Equation]
T 0 ,
[Equation]
Moreover, it holds that
[Equation]
sgn
[Equation]
ξ i [ k ]
[Equation] [Equation]
Ω (cid:0) 1 sσ p (cid:1) or ± (cid:101) O ( η ) , k ∈ B i , with y i =
j, ± (cid:101) O ( η ) , otherwise .
Proof.
Recall from Lemma C.3 that for any t ≤ T 0 we have
[Equation]
Besides, by Lemma C.2 we also have | w ( t ) j,r [ k ] | ≤ | w (0) j,r [ k ] | + O ( tη ) .
Then it can be veriﬁed that for some T r = (cid:101) O (cid:0) σ 0 ηsσ p
α 1 / ( q − 1) (cid:1) , we have for all i ∈ [ n ] and t ∈ [ T r , T 0 ]
[Equation]
for some constant C .
This further implies that
[Equation]
where we use the fact that sgn( y i (cid:96) ( t ) j,i ) = sgn
( j ) for all i ∈ [ n ] .
Then by Lemma C.2 and (C.2), we have for all t ∈
[ T r , T 0 ] ,
[Equation]
Then at iteration T 0 , for the ﬁrst coordinate we have
[Equation]
For any k ∈ B i with y i
=
j , we have either the coordinate will increase at a rate of Θ(1) or fall into 0 .
As a consequence we have either w ( T 0 ) j,r [ k ] ∈ [ − (cid:101) Θ( η ) , (cid:101) Θ
[Equation]
η
[Equation]
] or
[Equation]
For the remaining coordinate, its update will be determined by the regularization term, which will ﬁnally fall into the region around zero since we have T 0 η = ω ( σ 0 ) .
By Lemma C.2 it is clear that
[Equation] [Equation]
Θ( η ) , (cid:101) Θ( η )] .
Lemma C.5 (Lemma 5.4, restated) .
If α = O (cid:0) sσ 2 p n (cid:1) and
η = o ( λ ) , then let r ∗ =
arg max r ∈ [ m ] (cid:104) w ( t )
y i ,r , ξ i (cid:105) , for any t ≥ T 0 , i ∈ [ n ] , j ∈ [2] and r ∈ [ m ] , it holds that (cid:104)
[Equation]
( t
[Equation]
i
[Equation]
(cid:1)
[Equation]
Proof.
The proof will be relying on the following three induction hypothesis:
[Equation]
which we assume they hold for all τ ≤ t and r ∈
[ m ] , i ∈ [ n ] , and j ∈ [2] .
It is clear that all hypothesis hold when
t = T 0 according to Lemma C.4.
Verifying Hypothesis (C.12) .
We ﬁrst verify Hypothesis (C
[Equation]
Recall that the update rule for (cid:104) w ( t )
y
i ,r , ξ i (cid:105) is given as follows,
[Equation]
(C.15)
Note that for any a and b we have sgn( a − b ) · a ≥ | a | − 2 | b | .
Then it follows that
[Equation]
where the last inequality follows from Hypothesis (C.12) and (C.13).
Further recall that λ
= o ( σ q − 2σ p /n ) , plugging the above inequality to (C.15) gives
[Equation]
Then it is clear that (cid:104) w ( t )
y i ,r , ξ i (cid:105) will increase by (cid:101) Θ( ηsσ p ) if (cid:96) ( t )
y
i ,i is larger than some constant of order (cid:101) Ω( nλsσ 2 p ) =
(cid:101) Ω( σ q − 2 0 sσ p ) .
We will ﬁrst show that as soon as there is a iterate W ( τ ) satisfying (cid:96) ( τ ) y
i ,i ≤ (cid:101) O (cid:0) nλsσ 2 p (cid:1) for some τ ≤ t , then it must hold that (cid:96) ( τ (cid:48) )
y i ,i will also be smaller than some constant in the order of (cid:101) O (cid:0) nλsσ 2 p (cid:1) for all τ (cid:48) ∈
[ τ, t + 1] .
To prove this, we ﬁrst note that if (cid:96) ( t )
y i ,i reaches some constant in the order of (cid:101) O (cid:0) nλsσ 2 p (cid:1) , we have for all r ∈ [ m ] by (C.16)
[Equation]
Therefore
[Equation]
we have
[Equation]
where inequality follows from (C.17).
Therefore, this implies that as long as (cid:96) ( t )
y i ,i is larger than some constant b = (cid:101) O (cid:0) nλsσ 2 p (cid:1) , then the adam algorithm will prevent it from further increasing.
Besides, since mησ 2 p =
o (1) , then we must have (cid:96) ( t +1)
y i ,i ∈ [0 . 5 (cid:96) ( t )
y i ,i , 2 (cid:96) ( t )
y i ,i ] .
As a consequence, we can deduce that (cid:96) ( t )
y i ,i cannot be larger than 2 b , since otherwise there must exists a iterate W ( τ ) with τ ≤ t such that (cid:96) ( τ ) y
i ,i ∈ [ b, 2 b ] and (cid:96) ( τ +1)
y i ,i ≥ (cid:96) ( τ ) y
i ,i , which contradicts the fact that (cid:96) ( τ ) y i ,i should decreases if (cid:96) ( τ ) y
i ,i ≥ b .
Therefore, we can claim that if (cid:96) ( τ ) y i ,i ≤
[Equation]
=
[Equation]
O
[Equation]
nλsσ 2 p (cid:1) for some τ ≤ t , then we have
[Equation]
for all τ (cid:48) ∈ [ τ, t + 1] .
Then further note that
[Equation]
where in the last inequality we use Hypothesis (C.14).
Then by the fact that (cid:96) ( t +1) y i ,i ≤
[Equation]
O (cid:0) nλsσ
[Equation]
p (cid:1) =
o (1) and m = (cid:101) Θ(1)
, it is clear that exp (cid:0) − Θ (cid:0) m max r ∈
[ m ] σ ( (cid:104) w ( t +1)
y i ,r , ξ i (cid:105) )
(cid:1)(cid:1)
=
o (1) so that max r ∈ [ m ] (cid:104) w ( t +1)
y i ,r , ξ i (cid:105) =
(cid:101) Ω(1) .
This veriﬁes Hypothesis (C.12).
Verifying Hypothesis (C.13) .
Now we will verify Hypothesis (C.13).
First, note that we have already shown that (cid:104) w ( t +1)
y i ,r ∗ , ξ i (cid:105) =
(cid:101) Ω(1) so it holds that
[Equation]
By Hypothesis (C.14), we have | w ( t +1)
y i ,r ∗ [1] | ≤ | w ( t )
y i ,r ∗ [1] | + η
= o (1) .
Besides, since each coordinate in ξ i is a Gaussian random variable, then max k ∈B i | ξ i
[ k ] | = (cid:101) O ( σ p ) .
This immediately implies that
[Equation]
Then we will prove the upper bound of (cid:80)
k ∈B i | w ( t +1)
y i ,r [ k ] | · | ξ i [ k ] | .
Recall that by Lemma C.2, for any k ∈ B i such that ∇ w yi,r L ( W ( t ) )
[ k ] ≥ (cid:101)
Θ( n − 1 ηsσ p (cid:96) ( t )
y i ,i ) , we have
[Equation]
Note that by Lemma C.4, for every k ∈ B i , we have either w ( T 0 )
y i ,r [ k ] = sgn( ξ i [ k ]) · (cid:101) Θ (cid:0) 1 sσ p (cid:1) or | w ( T 0 )
y i ,r [ k ] | ≤ η .
Then during the training process after T 0 , we have either sgn( w ( t ) y
i ,r [ k ]) = sgn( ξ i [ k ]) or sgn( ξ i [ k ]) · w ( t ) y
i ,r ≥ − (cid:101) O ( η ) since if for some iteration number t (cid:48) that we have sgn( w ( t (cid:48) )
y i ,r [ k ])
= − sgn( ξ i [ k ]) but sgn( w ( t (cid:48) − 1)
y i ,r [ k ]) = sgn( ξ i [ k ]) , then after ¯ τ = (cid:101) O (1) steps (see the proof of Lemma C.2 for the deﬁnition of ¯ τ ) in the constant number of steps the gradient will must be in the same direction of ξ i [ k ] , which will push w y i ,r [ k ] back to zero or become positive along the direction of ξ i [ k ] .
Therefore, based on this property we have the following regarding the inner product (cid:104) w ( t )
y i ,r , ξ i (cid:105) ,
[Equation]
where the second inequality follows from the fact that the entry w ( t ) y i ,r [ k ] that has different sign of ξ i [ k ] satisﬁes | w ( t )
y i ,r [ k ] | ≤ (cid:101) O ( η ) .
Then let B ( t )
i
[Equation]
| ξ i [ k ] | , which satisﬁes B ( T 0 )
i = (cid:101) Θ(1) by Lemma C.4.
Then assume B ( t ) i keeps increasing and reaches some value in the order of Θ (cid:0) log( dnη − 1 ) (cid:1) , it holds that according to the inequality above
[Equation]
− (cid:101) Θ( ηsσ p ) =
Θ (cid:0) log( dnη − 1 ) (cid:1) , where we use the condition that η = O (cid:0) ( sσ p ) − 1 (cid:1) .
Then by Hypothesis (C.12) and (C.14) we know that |(cid:104) w ( t ) j,r , v (cid:105)| =
o (1) , (cid:104) w ( t )
y i ,r ∗ , ξ i (cid:105) =
(cid:101) Ω(1) , and |(cid:104) w ( t ) − y i ,r ∗ , ξ i (cid:105)| = (cid:101) O
( dη )+ α |(cid:104) w ( t ) − y i ,r ∗ , v (cid:105)| =
o (1) then similar to (C.19), it holds that
[Equation]
≤ poly
[Equation]
d
[Equation]
, n
[Equation]
, η
[Equation]
Therefore, at this time we have for all k ∈ B i , (cid:96)
[Equation]
t )
y i ,i σ (cid:104) ( w ( t ) y
i ,r , ξ i (cid:105) )
ξ i [ k ] ≤ poly( d − 1 , n − 1 , η ) · Θ (cid:0) log q − 1 ( dnη − 1 ) (cid:1) ·
(cid:101) Θ( σ p ) ≤ nλη.
Then for all | w ( t ) y i ,r [ k ] | ≥ (cid:101) O ( η ) , the sign of the gradient satisﬁes
[Equation]
Then note that |∇ w yi,r L ( W ( t ) )
[ k ] | =
Θ( | λ w ( t )
y i ,r [ k ] | ) ≥ Θ (cid:0) n − 1 ηsσ p (cid:96) ( t )
y i ,i + λη (cid:1) , by the update rule of w ( t )
y i ,r [ k ] and Lemma C.2, we know the sign gradient will dominate the update process.
Then we have | w ( t +1)
y i ,r [ k ] | = | w ( t )
y
i ,r [ k ] − Θ( η ) · sgn( w ( t )
y i ,r [ k ]) | ≤ | w ( t ) y i ,r [ k ] | , which implies that (cid:12)(cid:12) w ( t )
y i ,r [ k ] · 1 ( | w
[Equation]
y
i
[Equation]
r [ k ] | ≥ (cid:101) O ( η )) (cid:12)(cid:12) decreases so that B ( t ) i also decreases.
Therefore, we can conclude that B ( t ) i will not exceed Θ (cid:0) log( dnη − 1 ) (cid:1) .
Then combining the results for all i ∈ [ n ] gives (cid:88)
[Equation]
where in the ﬁrst inequality we again use the condition that
η
=
o
(1 /d )
=
o (cid:0) ( sσ p ) − 1 (cid:1) .
This veriﬁes
Hypothesis (C.13).
Notably, this also implies that (cid:104) w ( t )
y
i
[Equation]
r ∗
[Equation] [Equation]
Verifying Hypothesis (C.14) .
In order to verify Hypothesis (C.14), let us ﬁrst recall the update rule of (cid:104) w ( t ) j,r , v (cid:105) :
[Equation]
Then by Lemma C.2, we know that if |∇ w j,r L ( W ( t ) )
[1] | ≤ (cid:101) Θ( η ) , then | m ( t ) j,r / (cid:113) v ( t ) j,r | ≤ Θ(1) and otherwise
[Equation]
(cid:113)
[Equation]
i
[Equation]
y
[Equation]
(cid:96) ( t ) j,i σ (cid:48)
( (cid:104) w ( t ) j,r , ξ i (cid:105) )
− nλ w ( t ) j,r [1] (cid:19) · Θ(1) .
Without loss of generality we assume j = 1 , then by Lemma C.4 we know that w ( T 0 ) 1 ,r [1] = − (cid:101) Ω (cid:0) 1 sσ p (cid:1) .
In the remaining proof, we will show that either w ( t +1) 1 ,r [1] ∈ [0 , (cid:101) Θ( λ − 1 η )] or w ( t +1) 1 ,r [1] ∈ (cid:2) − (cid:101) O (cid:0) nαsσ 2 p (cid:1) , 0 (cid:1) .
First we will show that w ( t +1) 1 ,r [1] ∈
[0 , (cid:101) Θ
( λ − 1 η )] for all r .
Note that in the beginning of this stage, we have w ( T 0 ) 1 ,r [1] < 0 .
In order to make the sign of w ( t (cid:48) ) 1 ,r [1] ﬂip, we must have, in some iteration t (cid:48)
≤ t that satisﬁes w ( t (cid:48) ) 1 ,r [1] ∈ [0 , (cid:101) Θ( λ − 1 η )] , therefore − n ∇
[Equation]
( W
[Equation]
[1] = n (cid:88) i =
[Equation]
α n (cid:88) i = y
[Equation]
(cid:48) )
[Equation]
(cid:48)
[Equation] [Equation]
(cid:48) )
[Equation] [Equation]
, ξ
[Equation]
(cid:105) )
−
[Equation] [Equation]
where the second inequality holds since η = o ( λ ( q − 1)
/ ( q − 2) ) .
Note that |∇ w 1 ,r L ( W ( t (cid:48) ) )
[1] | ≥ (cid:101) Θ( η ) , then by Lemma C.2 we know that Adam is similar to sign gradient descent and thus w ( t (cid:48)
+1) 1 ,r [1] = w ( t
[Equation]
) 1 ,r [1] − Θ( η ) which starts to decrease.
This implies that if w ( t +1) 1 ,r [1] is positive, then it cannot exceed (cid:101) Θ( λ − 1 η ) =
o (1) .
Then we can prove that if w ( t +1) 1 ,r [1] is negative, then | w ( t +1) 1 ,r [1] | = (cid:101) O (cid:0) nαsσ 2 p (cid:1) .
In this case we have for all t (cid:48) ≤ t ,
[Equation]
[Table]
[Equation]
where in the inequality we use Hypothesis (C.13) and (C.14) to get that
[Equation]
Recall from (C.18) that we have | (cid:96) ( t (cid:48) )
j,i | = (cid:101) O (cid:0) nλsσ 2 p (cid:1) , therefore we have if w ( t (cid:48) )
j,r [1] is smaller than some value in the order of − (cid:101) Θ (cid:0) nα sσ 2 p (cid:1) · polylog( d ) , then
[Equation]
which by Lemma C.2 implies that w ( t (cid:48) )
j,r [1] will increase.
Therefore, we can conclude that w ( t +1) ∈ (cid:2) −
[Equation]
O
[Equation]
nαsσ 2 p (cid:1) , 0 (cid:1) in this case, which veriﬁes Hypothesis (C.14).
Lemma C.6 (Lemma 5.5, restated) .
If the step size satisﬁes η = O ( d − 1 / 2 ) , then for any t it holds that
[Equation]
Proof.
Let ∆ F j,i = F j ( W ( t +1) , x i ) − F j ( W ( t ) , x i ) .
Then regarding the loss function
[Equation]
It is clear that the function L i ( W ) is 1 -smooth with respect to the vector
[ F − 1 ( W , x i ) , F 1 ( W , x i )] .
Then based on the deﬁnition of ∆ F j,i , we have
[Equation]
Moreover, note that
[Equation]
By the results that (cid:104) w ( t ) j,r , v (cid:105) ≤ (cid:101) Θ(1) and (cid:104) w ( t ) j,r , ξ (cid:105) ≤ (cid:101) Θ(1) , for any η = O
( d − 1 / 2 ) , we have (cid:104) w ( t +1)
j,r , v (cid:105) ≤ (cid:104) w ( t ) j,r , v (cid:105)
[Equation]
(cid:101)
[Equation] [Equation]
[Equation] [Equation]
, which implies that the smoothness parameter of the functions σ ( (cid:104) w ( t ) j,r , y i v (cid:105) ) and σ ( (cid:104) w ( t ) j,r , ξ i (cid:105) ) are at most (cid:101) Θ(1) for any w in the path between w ( t ) j,r and w ( t +1)
j,r .
Then we can apply ﬁrst Taylor expansion on σ ( (cid:104) w ( t ) j,r , y i v (cid:105) ) and σ ( (cid:104) w ( t ) j,r , ξ i (cid:105) ) and bound the second-order error as follows,
[Equation]
C.
[Equation]
where the last inequality is due to Lemma C.2 that
[Equation]
Similarly
[Equation]
we can also show that
[Equation]
Combining the above bounds on the second-order errors
[Equation]
we have
[Equation]
where the last equation is due to our assumption that m = (cid:101) Θ(1) .
Besides, by (C.21) and (C.22) the convexity property of the function σ ( x )
[Equation]
we also have
[Equation]
These bounds further imply that
[Equation]
Now we can plug (C.23) and (C.24) into (C.20) and get
L i
[Equation]
W
[Equation]
t +1) )
− L i
[Equation]
W
[Equation] [Equation]
where in the second inequality we use the fact that L i ( W ) is 1 -Lipschitz with respect to F j ( W , x i ) and the last equation is due to our assumption that σ p
=
O
( s − 1 / 2 ) so that (cid:101) Θ(( ηsσ p + η 2 d ) 2 ) = (cid:101)
O ( η 2 d ) .
Now we are ready to characterize the behavior on the entire training objective L ( W ) = n −
[Equation]
ni =
1 L i
[Equation]
W )
+ λ
[Equation]
W (cid:107) 2 F .
Note that λ (cid:107) W (cid:107) 2 F is 2 λ -smoothness, where λ
= o (1) .
Then applying (C.25) for all i ∈ [ n ] gives
[Equation]
where the second equation uses the fact
that (cid:107) W ( t +1) − W ( t ) (cid:107) 2 F = (cid:101) Θ( η 2 d ) .
Recall that we have
[Equation]
Then by Lemma C.2, we know that m ( t ) j,r [ k ] / (cid:113) v ( t ) j,r [ k ] is close to sign gradient if ∇ L ( w ( t ) )
[ k ] is large.
Then we have
[Equation]
where the second and last terms on the R.H.S. of the ﬁrst inequality are contributed by the small gradient coordinates k / ∈ ∪ ni =
1 B i and k ∈ ∪ ni =1 B i respectively, and the last inequality is by the fact that ns 2 σ p
= O ( d ) .
Therefore, based on this fact (C.25) further leads to
[Equation]
which completes the proof.
Lemma C.7 (Generalization Performance of Adam) .
Let
[Equation]
Then for all training data, we have
[Equation]
Moreover, in terms of the test data ( x , y ) ∼ D , we have
[Equation]
Proof.
By Lemma C.6, we know that the algorithm will converge to a point with very small gradient (up to O ( ηd ) in (cid:96) 1 norm).
Then in terms of a noise vector ξ i , we have
[Equation]
C
[Equation] [Equation]
Note that
[Equation]
where (cid:96) ∗ y
i ,i = 1 − logit y
i ( F ∗ , x i ) .
Then by triangle inequality and (C.26), we have for any r ∈ [ m ] , (cid:12)(cid:12)
[Equation]
k
[Equation]
i
[Equation]
Then by Lemma C.5, let r ∗ = arg max r ∈
[ m ] (cid:104) w ∗ y i ,r , ξ i (cid:105) , we have (cid:104) w y i ,r ∗ , ξ i (cid:105) =
(cid:101) Θ(1) and (cid:80) k ∈B
i | w ∗
y
i ,r ∗ [ k ] | · | ξ i [ k ] | = (cid:101) Θ(1) .
Note that | ξ i
[ k ] | = (cid:101) O ( σ p ) , we have (cid:80) k ∈B
i | w ∗
y
i ,r ∗ [ k ] | ≥ (cid:101) Θ(1 /σ p ) .
Then according to the inequality above, it holds that
[Equation]
where the second inequality is due to our choice of η .
This further implies that | (cid:96) ∗ y
i ,i | = | (cid:96) ∗− y i ,i | =
(cid:101) Θ (cid:0) nλ sσ 2 p (cid:1) by combining the above results with (C.18).
Then let us move to the gradient with respect to the ﬁrst coordinate.
In particular, since (cid:107)∇ L ( W ∗ ) (cid:107) 1 ≤ O ( ηd ) , we have
[Equation]
[Table]
(C.27)
Then note that sgn( y i (cid:96) ∗ j,i ) =
sgn( j ) , it is clear that w ∗ j,r ∗ [1] · j ≤ 0 since otherwise
[Equation]
Ω( nηd ) , which contradicts (C.27).
Therefore, using the fact that w ∗ j,r ∗ [1] · j ≤ 0 , we have
[Equation]
Then applying (C.27)and using the fact that | (cid:96) ∗ y
i
[Equation]
i | = |
[Equation]
nλsσ 2 p (cid:1) for all i ∈ [ n ] , it is clear that
[Equation]
where the second equality is due to our choice of σ p and α .
Then combining with Lemma C.5 and the fact that w ∗ j,r ∗ [1] · j < 0 , we have
[Equation]
Now we are ready to evaluate the training error and test error.
In terms of training error, it is clear that by Lemma C.5, we have
[Equation]
w ∗ y i ,r ∗ , ξ i
[Equation]
≥
[Equation]
Θ
[Equation]
1) , (cid:104) w ∗ y i ,r , ξ i
[Equation]
≥ − o (1) , and |(cid:104) w ∗ y
i ,r , v (cid:105)| =
o (1) , |(cid:104) w ∗−
y i ,r , ξ i (cid:105)| =
o (1) .
Then we have for any training data ( x i , y i ) ,
[Equation]
which directly implies that the NN model W ∗ can correctly classify all training data and thus achieve zero training error.
In terms of the test data ( x , y ) where x = [ y v , ξ ] , which is generated according to Deﬁnition 3.1.
Note that for each neural, its weight w ∗ j,r can be decomposed into two parts: the ﬁrst coordinate and the rest d − 1 coordinates.
As previously discussed, for any j ∈ [2] and r = r ∗ , we have sgn( j ) · w ∗ j,r [1] ≤ − (cid:101) Θ (cid:0) nα/ ( sσ 2 p ) (cid:1) and sgn( j ) · w ∗ j,r [1] ≤ (
cid:101) Θ( λ − 1 η ) for r (cid:54) =
r ∗ .
Therefore, using the fact that (cid:101) Θ (cid:0) nα/ ( sσ 2 p ) (cid:1) = ω ( λ − 1 η ) and Lemma C.5, given the test data ( x , y ) , we have
[Equation]
where the random variables ζ y,r and ζ y,r are symmetric and independent of v .
Besides, note that α = o (1) , it can be clearly shown that α · nα/ ( sσ 2 p ) (cid:28) nα/ ( sσ 2 p ) .
Therefore, if the random noise ζ y,r and ζ − y,r are dominated by the feature noise term (cid:104) w ∗ − y,r ∗ , y v (cid:105) , we can directly get that
F y ( W ∗ , x ) ≤ F − y
W ∗ , x ))
(recall that m = (cid:101) Θ(1) ), which implies that the model has been biased by the feature noise and the true feature vector in the test dataset will not give any “positive” effect to the classiﬁcation.
Also note that ζ y and ζ − y are also independent of v , which implies that if the random noise dominates the feature noise term, the model W ∗ will give at least 0 .
5 error on test data.
In sum, we can conclude that with probability at least 1 / 2 it holds that F y ( W ∗ , x ) ≤ F − y ( W ∗ , x ) , which implies that the output of Adam achieves 1 / 2 test error.
C. P ROOF FOR G RADIENT D ESCENT
Recall the feature learning and noise memorization of gradient descent can be formulated by
[Equation]
Then similar to the analysis for Adam
[Equation]
we decompose the gradient descent process into multiple stages and characterize the algorithmic behaviors separately.
The following lemma characterizes the ﬁrst training stage, i.e., the stage where all outputs F j ( W ( t ) , x i ) remain in the constant level for all j and i .
Lemma C.8.
[Lemma 5.6, restated] Suppose the training data is generated according to Deﬁnition 3.1 and λ
= o ( σ q − 2σ p /n ) .
Let Λ ( t ) j = max r ∈ [ m ] (cid:104) w ( t +1)
j,r , j · v (cid:105) , Γ ( t ) j,i = max r ∈ [ m ] (cid:104) w ( t ) j,r , ξ i (cid:105) , and Γ ( t ) j = max i : y i =
j Γ ( t ) j,i .
Then let T j be the iteration number that Λ ( t )
j reaches Θ(1 /m ) , we have
[Equation]
j ∈ {
[Equation] [Equation]
Moreover, let T 0 =
min
j ∈{± 1 } { T j } , then for all t ≤ T 0 it holds that Γ ( t ) j = (cid:101) O
( σ 0 ) for all j ∈ {− 1 , 1 } .
We ﬁrst provide the following useful lemma.
Lemma C.9.
Let { x t , y t } t =1 ,... be two positive sequences that satisfy
[Equation]
, for some A = Θ(1) and B =
o (1) .
Then for any q ≥ 3 and suppose y
= O ( x 0 ) and η < O ( x 0 ) , we have for every C ∈ [ x 0 , O (1)] , let T x be the ﬁrst iteration such that x t ≥ C , then we have
T x η = Θ( x 2 − q)
and y T x ≤ O ( x 0 ) .
Proof.
By Claim C.20 in Allen-Zhu & Li (2020b), we have T x η = Θ( x 2 − q) .
Then we will show y t ≤ 2 xfor all t ≤ T x .
In particular, let T x η = C (cid:48)
x 2 − qfor some absolute constant C (cid:48) and assume
C (cid:48) B 2 q − 1 < 1 (this is true since B
= o (1) ), we ﬁrst made the following induction hypothesis on y t for all t ≤ T a ,
[Equation]
Note that for any t ≤ T 0 , this hypothesis clearly implies that
[Equation]
Then we are able to verify the hypothesis at time t +1 based on the recursive upper bound of y t , i.e.,
[Equation]
Therefore, we can conclude that y t ≤ 2 x 0 for all t ≤ T x .
This completes the proof.
Now we are ready to complete the proof of Lemma C.8.
Proof of Lemma C.8.
Note that at the initialization, we have |(cid:104) w (0) j,r , v (cid:105)| = (cid:101) Θ( σ 0 ) and |(cid:104) w (0) j,r , ξ i (cid:105)| = (cid:101)
Θ( s 1 / 2 σ p σ 0 ) .
Then based on the parameter scaling summarized in Appendix C.1, we have
[Equation]
for all j ∈ {− 1 , 1 } .
Then we have
[Equation]
Then we will consider the training period where | (cid:96) ( t )
j
[Equation]
i | = Θ(1) for all j , i , and t .
Besides, note that sgn( y i (cid:96) ( t ) j,i ) =
j .
Therefore, let r ∗ = arg max r (cid:104) w ( t − 1) j,r
[Equation]
j
[Equation] [Equation]
C.28) implies that
[Equation] [Equation]
(C.29)
Similarly
[Equation]
let r ∗ = arg max r (cid:104) w ( t )
y i ,r , ξ i (cid:105)
[Equation]
we also have the following according to (C.28) Γ ( t )
y i ,i = (cid:104) w ( t )
y i ,r ∗ , ξ i (cid:105)
[Equation]
Then by our deﬁnition of Γ ( t ) j = max i ∈ [ n ] Γ ( t ) j,i , we further get the following for all j ∈ {− 1 , 1 } ,
[Equation]
where the last equation is by our assumption
that α = (cid:101) O ( sσ 2 p /n ) .
Then we will prove the main argument for general t , which is based on the following two induction hypotheses
[Equation]
Note that when t = 0 , we have already veriﬁed these two hypotheses in (C.29) and (C.30), where we use the fact that λ
= o ( σ q − 2σ p /n ) ≤ (cid:0) Λ (0) j (cid:1)
q − 2 and α = o (1) .
Suppose that (C.29) and (C.30) hold for iterations τ ≤ t .
At time t + 1 , for all τ ≤ t , we have Γ ( τ ) j ≤ O (Λ ( τ ) j ) , as sσ 2 /n
=
o (1) and Λ ( t ) j increases faster than Γ ( t ) j .
Besides, we can also show that λ Γ ( t ) j ≤ (cid:0) Γ ( t ) j (cid:1) q − 1 , which has been veriﬁed at time t = 0 , since Γ ( t ) j keeps increasing.
Therefore, we have
[Equation]
and hence (C.29) implies
[Equation]
which veriﬁes Hypothesis (C.31) at t + 1 .
Additionally, (C.30) implies Γ ( t
[Equation]
[Equation]
which veriﬁes Hypothesis (C.32) at t
+ 1 .
Then by Lemma C.9, we have that Λ ( t )
j = (cid:101) O
(1) for all t ≤ T 0 = (cid:101) Θ (cid:0) (Λ (0) j ) 2 − q /η (cid:1) =
(cid:101) Θ( σ 2 − q/η ) .
Moreover, Lemma C.9 also shows that Γ ( t +1) j
=
O (Λ (0) j ) =
(cid:101)
O ( σ 0 ) .
This completes the proof.
Lemma C.10.
For all i ∈ [ n ] and t ≤ T − y i , it holds that (cid:104) w ( t ) − y i ,r , ξ i (cid:105) ≤ (
cid:101) Θ( α ) .
Proof.
First of all, for j ∈ {± 1 } , by the deﬁnition of T j , we have
[Equation]
Moreover, with the same proof as Lemma C.8, it is clear that −(cid:104) w ( t ) j,r , j · v (cid:105) is decreasing in t for t ≤ T j .
Therefore, by the fact that |(cid:104) w (0) j,r , v (cid:105)| ≤ (cid:101) Θ(1) , we have
[Equation]
for all t ≤ T j .
Now by the update form of GD, we have for any k ∈ B i ,
[Equation]
Note that (cid:96) ( t ) − y
i ,i σ (cid:48) ( (cid:104) w ( t ) − y i ,r , ξ i (cid:105) )
< 0 , which implies that w ( t ) − y i ,r [ k ] · ξ i [ k ] is decreasing in t .
Therefore, for all r and i , we have
[Equation]
k ∈B i w
[Equation]
where the third inequality follows by (C.33).
This completes the proof.
Note that for different j , the iteration numbers when Λ ( t ) j reaches (cid:101) Θ(1 /m ) are different.
Without loss of generality, we can assume T 1 ≤ T − 1 .
Lemma C.8 has provided a clear understanding about how Λ ( t ) j varies within the iteration range [0 , T j ] .
However, it remains unclear how Γ ( t ) 1 varies within the iteration range [ T 1 , T − 1 ] since in this period we no longer have | (cid:96) ( t ) j,i | = Θ(1) and the effect of gradient descent on the feature learning (i.e., increase of (cid:104) w j,r , j · v (cid:105) ) becomes weaker.
In the following lemma we give a characterization of Λ ( t ) 1 for every t ∈ [ T 1 , T − 1 ] .
Lemma C.11 (Stage I of GD: part II) .
Without loss of generality assuming T 1 < T − 1 .
Then it holds that Λ ( t )
= (cid:101) Θ(1) for all t ∈
[ T 1 , T − 1 ] .
Proof.
Recall from (C.29) that we have the following general lower bound for the increase of Λ ( t )
j
[Equation] [Equation]
where the last inequality is by Lemma C.10.
Note that by Lemma C.8, we have Γ ( t )
j = (cid:101)
O ( σ 0 ) for all t ≤ T − 1 and .
Then the above inequality leads to
[Equation]
C
[Equation] [Equation]
where we use the fact that α = ω ( σ 0 ) .
The the remaining proof consists of two parts: (1) proving Λ ( t ) j ≥ Θ(1 /m )
= (cid:101) Θ(1) and (2) Λ ( t ) j ≤ Θ(log(1 /λ )) .
Without loss of generality we consider j = 1 .
Regarding the ﬁrst part, we ﬁrst note that Lemma C. implies that Λ ( T 1 )≥ Θ(1 /m ) .
Then we consider the case when Λ ( t ) 1 ≤ Θ(log(1 /α ) /m ) , it holds that for all y i = 1 ,
[Equation]
i =
[Equation]
(cid:3)(cid:19)(cid:33) ≥
[Equation]
≥ exp( − Θ(log(1 /α )))
= (cid:101) Θ( α ) .
Then (C.35) implies that if Γ ( t ) 1 ≤ Θ(log(1 /σ 0 ) /m ) , we have
[Equation]
where the second inequality is due to λ
= o ( α ) .
This implies that Λ ( t ) 1 will keep increases in this case so that it is impossible that Λ ( t ) 1 ≤ Θ(1 /m ) , which completes the proof of the ﬁrst part.
For the second part, (C.28) implies that
[Equation]
Consider the case when Γ ( t ) 1 ≥ Θ(log( d )) , then for all y i = 1 ,
[Equation]
=
[Equation]
= exp
[Equation]
≤ exp (cid:0) − Θ(Λ ( t ) 1 ) (cid:1) ≤ exp( − Θ(log(1 /λ ))
= (cid:101) Θ(poly
( λ )) .
Then (C.36) further implies that
[Equation]
which implies that Λ ( t ) 1 will decrease.
As a result, we can conclude that λ ( t ) 1 will not exceed Θ(log(1 /λ )) , this completes the proof of the second part.
Lemma C.12 (Lemma 5.7, restated) .
If η ≤ O ( σ 0 ) , it holds that Λ ( t ) j
[Equation]
for all t ∈
[ T − 1 , T ] .
Proof.
We will prove the desired argument based on the following three induction hypothesis:
[Equation]
In terms of Hypothesis (C.37), we can apply Hypothesis (C.38) and (C.39) to (C.34) and get that Λ ( t +1)
j
[Equation]
where the last inequality we use the fact that α ≥ σ 0 .
This veriﬁes Hypothesis (C.37)
[Equation]
In order to verify Hypothesis (C.38)
[Equation]
we have the following according to (C.37),
[Equation]
where the last equality holds since α = o (1) .
Recursively applying the above inequality from T −to t gives (cid:88)
[Equation]
Then by Hypothesis (C.39) we have
[Equation]
Now let us look at the rate of memorizing noises.
By (C.28) and use the fact that α 2 ≤ O ( sσ 2 p /n ) , we have
[Equation]
which veriﬁes Hypothesis (C.38).
Given Hypothesis (C.37) and (C.38), the veriﬁcation of (C.39) is straightforward by applying the same proof technique of Lemma C.11 and thus we omit it here.
Lemma C.13 (Lemma 5.8, restated) .
If the step size satisﬁes, then for any t ≥ T − 1 it holds that
[Equation]
Proof.
The proof of this lemma is similar to that of Lemma C.6, which is basically relying the smoothness property of the loss function L ( W ) given certain constraints on the inner products (cid:104) w j,r , v (cid:105) and (cid:104) w j,r , ξ i (cid:105) .
Let ∆ F j,i = F j ( W ( t +1) , x i ) − F j ( W ( t ) , x i ) , we can get the following Taylor expansion on the loss function L i ( W ( t +1) ) ,
[Equation]
In particular, by Lemma C.12, we know that (cid:104) w ( t ) j,r , y
i v (cid:105) ≤ (cid:101) Θ(1) and (cid:104) w ( t ) j,r , ξ i (cid:105) ≤ (cid:101)
[Equation]
( σ
[Equation]
≤ (cid:101) Θ(1) .
Then similar to (C.21), we can apply ﬁrst-order Taylor expansion to F j ( W ( t +1) , x i ) , which requires to characterize the second-order error of the Taylor expansions on σ ( (cid:104) w ( t +1)
j,r , y i v (cid:105) ) and σ ( (cid:104) w ( t +1)
j,r , ξ i (cid:105) ) ,
[Equation]
(cid:12)
[Equation]
( (cid:104)
[Equation]
[Equation] [Equation]
[Equation] [Equation]
[Equation] [Equation]
t )
[Equation]
r
[Equation]
≤ (cid:101) Θ
[Equation]
w
[Equation]
t
[Equation]
1) j
[Equation]
r
[Equation]
(cid:12)(cid:12)
[Equation]
t
[Equation]
r
[Equation]
(cid:104)
[Equation]
( t )
j
[Equation]
(cid:105)
[Equation]
( t
[Equation] [Equation]
r
[Equation]
(C.41)
Then combining the above bounds for every r ∈ [ m ] , we can get the following bound for ∆ F j,i (cid:12)(cid:12)
[Equation]
F j
[Equation]
i −
[Equation]
W F j ( W ( t )
[Equation]
x i )
[Equation]
W ( t +1) − W ( t )
[Equation]
≤
[Equation]
Θ (cid:18) η 2 (cid:88) r
[Equation] [Equation]
[Equation] [Equation]
(C.42)
Moreover, since (cid:104) w ( t ) j,r , y i v (cid:105) ≤ (cid:101) Θ(1) and (cid:104) w ( t ) j,r , ξ i (cid:105) ≤ (cid:101) Θ(1) and σ ( · ) is convex, then we have | σ ( (cid:104) w ( t +1)
j,r , y i v (cid:105) )
− σ ( (cid:104) w ( t ) j,r , y i v (cid:105) )
| ≤ max (cid:8) | σ (cid:48) ( (cid:104) w ( t +1)
j,r , y i v (cid:105) )
| , | σ (cid:48) ( (cid:104) w ( t ) j,r , y i v (cid:105) )
| (cid:9) · |(cid:104) v , w ( t +1)
j,r − w ( t ) j,r (cid:105)| ≤ (cid:101) Θ (cid:0) (cid:107) w ( t +1)
j,r − w ( t ) j,r (cid:107) 2 (cid:1) .
Similarly we also have
[Equation]
Combining the above inequalities for every r ∈ [ m ]
[Equation]
we have
[Equation]
Now we can plug (C.42) and (C.43) into (C.40)
[Equation]
which gives
[Equation]
Taking sum over i ∈ [ n ] and applying the smoothness property of the regularization function λ (cid:107) W (cid:107) 2 F , we can get
[Equation]
where the last inequality is due to our choice of step size η = o (1) so that gives η − (cid:101) Θ( η 2 ) ≥ η/ 2 .
This completes the proof.
Lemma C.14 (Generalization Performance of GD) .
Let
[Equation]
Then for all training data, we have
[Equation]
Moreover, in terms of the test data ( x , y ) ∼ D , we have
[Equation]
Proof.
By Lemma C.12 it is clear that all training data can be correctly classiﬁed so that the training error is zero.
Besides, for test data ( x , y ) with x =
[ y v (cid:62) , ξ (cid:62) ] (cid:62) , it is clear that with high probability (cid:104) w ∗ y,r , y v (cid:105) = (cid:101) Θ(1) and [ (cid:104) w ∗ y,r , ξ (cid:105) ] + ≤ (cid:101) O ( σ 0 ) , then
F y
[Equation] [Equation]
If j = − y , we have with probability at least 1 − 1 / poly( n ) , (cid:104) w ∗− y,r , y v (cid:105) ≤ 0 and [ w ∗− y,r , ξ (cid:105) ] + ≤ (cid:101) O
( α ) , which leads to
[Equation]
This implies that GD can also achieve nearly at most 1 / poly( n ) test error.
This completes the proof.
D P ROOF OF T HEOREM 4.2: C ONVEX C ASE
Theorem D.1 (Convex setting, restated) .
Assume the model is over-parameterized.
Then for any convex and smooth training objective with positive regularization parameter λ , suppose we run Adam and gradient descent for T = poly( n ) η iterations, then with probability at least 1 − n − 1 , the obtained parameters W ∗ Adam and W ∗ GD satisfy that (cid:107)∇ L ( W ∗ Adam ) (cid:107) 1 ≤ 1 Tη and (cid:107)∇ L ( W ∗ Adam ) (cid:107) 22 ≤ 1 Tη respectively.
Moreover, it holds that:
• Training errors are the same:
[Equation]
• Test errors are nearly the same:
[Equation]
Proof.
The proof is straightforward by applying the same proof technique used for Lemmas C. and C.13, where we only need to use the smoothness property of the loss function.
Then it is clear that both Adam and GD can provably ﬁnd a point with a sufﬁciently small gradient.
Note that the training objective becomes strongly convex when adding weight decay regularization, implying that the entire training objective only has one stationary point, i.e., point with a sufﬁciently small gradient.
This further implies that the points found by Adam and GD must be exactly the same and thus GD and Adam must have nearly the same training and test performance.
Besides, when the problem is sufﬁciently over-parameterized, with proper regularization (feasibly small), we can still guarantee zero training errors.
E D ISCUSSION ON THE D ATA M ODELS IN W ILSON ET AL . (2017); R EDDI ET AL . (2018)
Data model in Wilson et al.
In particular, given the binary label y i ∈ {− 1 , 1 } , the feature vector x i is set as
[Equation]
Data model in Reddi et al.
In particular, Reddi et al.
(2018) considers a one-dimensional optimization objective.
Besides, in each iteration of Adam, the stochastic gradient is taken based on the function f t ( x ) deﬁned as follows:
[Equation]
Then it can be seen that in these two prior works, each coordinate of the feature vector (or the objective function) is hard coded.
In contrast, our data model allows randomness in the data generation process.
This implies that our theory can hold for the data points generated from a certain distribution, while these prior works can only cover one particular data or optimization objective.