Year: 2021

Abstract:
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 classification, Adam can converge to a different solution with a worse test error compared to (stochastic) gradient descent, even with a fine-tuned regularization. In this paper, we provide a theoretical explanation for this phenomenon: we show that in the nonconvex setting of learning overparameterized 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 explicit regularization is fundamentally tied to the nonconvex landscape of deep learning optimization, which cannot be covered by the recent neural tangent kernel (NTK) based analysis.

heading: 1 INTRODUCTION
text: 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 ratethis 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. 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 classification (we have done some simple deep learning experiments to justify this, the results are reported in Table 1). Even with proper regularization, achieving good test error with adaptive gradient methods seems to be challenging.
Several recent works provided theoretical explanations of this generalization gap between Adam and GD. 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 specifically designed data, while SGD can learn the linear model to achieve zero test error. This ex-
ample in linear regression offers valuable insights into the difference between SGD and Adam. However, it is under a convex optimization setting, and as we will show in this paper (Theorem 4.2), the performance difference between Adam and GD can be easily avoided by adding an arbitrarily small regularization term, because the regularized training loss function is strongly convex and all algorithms will converge to the same unique global optimum. For this reason, we argue that the example in the convex setting cannot capture the fundamental differences between GD and Adam. 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 proper regularization?
Specifically, we study Adam and GD for training neural networks with weight decay regularization on an image-like data model, and demonstrate the difference between Adam and GD from a feature learning perspective. We consider a model where the data are generated as a combination of feature and noise patches under certain sparsity conditions, 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 proper 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: 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 fit noises in the data and output a model that is largely contributed by the noise patches of the training data; GD prefers to fit training data based on their feature patch and finds a solution that is mainly composed by the true features. We also illustrate such different training processes in Figure 1, where it can be seen that the model trained by Adam is clearly more “noisy” than that trained by SGD. • We also show that for convex settings with weight decay regularization, both Adam and gradient descent converge to the exact 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); Allen-Zhu et al. (2019a); Arora et al. (2019a;b); Cao & Gu (2019); Ji & Telgarsky (2020); Chen et al. (2021). It also demonstrates that the inferior generalization performance of Adam is fundamentally tied to the nonconvex landscape of deep learning optimization, and cannot be solved by adding regularization.
Notation. For a scalar x, we use [x]+ to denote max{x, 0}. For a vector v = (v1, . . . , vd)>, we denote by ‖v‖2 := (∑d j=1 v 2 j )1/2 its `2-norm, and use supp(v) := {j : vj 6= 0} to denote its support.

heading: 2 RELATED WORK
text: In this section, we discuss the works that are mostly related to our paper.
Generalization gap between Adam and (stochastic) gradient descent. 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 provide theoretical insights into the effectiveness of these empirical studies.
Optimization and generalization guarantees in deep learning. Our work is also closely related to the recent line of work studying the optimization and generalization guarantees of neural networks. A series of results have shown the convergence (Jacot et al., 2018; Li & Liang, 2018; Du et al., 2019b; Allen-Zhu et al., 2019b; Du et al., 2019a; Zou et al., 2019) and generalization (Allen-Zhu et al., 2019c;a; Arora et al., 2019a;b; Cao & Gu, 2019; Ji & Telgarsky, 2020; Chen et al., 2021) guarantees in the so-called “neural tangent kernel” (NTK) regime, where the neural network function is approximately linear in its parameters. Allen-Zhu & Li (2019); Bai & Lee (2019); Allen-Zhu & Li (2020a); Li et al. (2020) studied the learning of neural networks beyond the NTK regime. 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 (2020b) showed that adversarial training purifies the learned features by removing certain “dense mixtures” in the hidden layer weights of the network. Allen-Zhu & Li (2020c) studied how ensemble and knowledge distillation work in deep learning when the data have “multi-view” features. 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.

heading: 3 PROBLEM SETUP AND PRELIMINARIES
text: We consider learning a CNN with Adam and GD based on n independent training examples {(xi, yi)}ni=1 generated from a data model D. In the following. we first 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 classification 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 fit 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. (2017); Reddi et al. (2018), which are handcrafted for showing the failure of Adam in term of either convergence or generalization. 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 definition of our data model is given in Definition 3.1 as follows.
Definition 3.1. Let d = Ω(n4), each data (x, y) with x ∈ R2d and y ∈ {−1, 1} is generated as follows,
x = [x>1 ,x > 2 ] >,
where one of x1 and x2 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]>. The noise vector ξ is generated according to the following process:
1. Randomly select s coordinates from [d]\{1} with equal probabilities, which is denoted as a vector s ∈ {0, 1}d.
2. Generate ξ from distributionN (0, σ2pI), and then mask off the first coordinate and other d− s− 1 coordinates, i.e., ξ = ξ s.
3. Add feature noise to ξ, i.e., ξ = ξ − αyv, where 0 < α < 1 is the strength of the feature noise.
In particular, throughout this paper we set s = Θ ( d1/2
n2
) , σ2p = Θ ( 1 s·polylog(n) ) and α = Θ ( σp ·
polylog(n) ) .
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.
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 fixed the weights of second layer to be all 1’s, where q ≥ 3. Mathematically, given the data (x, y), the j-th output of the CNN can be formulated as
Fj(W,x) = m∑ r=1 [ σ(〈wj,r,x1〉) + σ(〈wj,r,x2〉) ] = m∑ r=1 [ σ(〈wj,r, y · v〉) + σ(〈wj,r, ξ〉) ] , (3.1)
where m is the width of the network, wj,r ∈ Rd denotes the weight at the r-th neuron, and W is the collection of model weights. Here the use of the polynomial ReLU activation function is for simplifying our analysis. It can be replaced by a smoothed ReLU activation function (e.g., the activation function used in Allen-Zhu & Li (2020c)). If we assume the input data distribution is Gaussian, we can also deal with ReLU activation function (Li et al., 2020). Moreover, we would like to emphasize that x1 and x2 denote two data patches, which are randomly assigned with feature vector or noise vector 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 σ0 = Θ ( d−1/4 ) .
Training objective. Given the training data {(xi, yi)}i=1,...,n, we consider to learn the model parameter W by optimizing the empirical loss function with weight decay regularization
L(W) = 1
n n∑ i=1 Li(W) + λ 2 ‖W‖2F , (3.2)
where Li(W) = − log e Fyi (W,xi)∑ j∈{−1,1} e Fj(W,xi) denotes the individual loss for the data (xi, yi) and λ ≥ 0 is the regularization parameter. In particular, the regularization parameter can be arbitrary as long as it satisfies λ ∈ ( 0, λ0 ) with λ0 = Θ ( 1
d(q−1)/4n·polylog(n)
) . 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 gradient descent and Adam with full gradient. In particular, starting from initialization W(0) = {w(0)j,r , j = {±1}, r ∈ [m]}, the gradient descent update rule is
w (t+1) j,r = w (t) j,r − η · ∇wj,rL(W (t)),
where η is the learning rate. Meanwhile, Adam store historical gradient information in the momentum m(t) and a vector v(t) as follows
m (t+1) j,r = β1m (t) j,r + (1− β1) · ∇wj,rL(W (t)), (3.3)
v (t+1) j,r = β2v (t) j,r + (1− β2) · [∇wj,rL(W (t))]2, (3.4)
and entry-wisely adjusts the learning rate:
w (t+1) j,r = w (t) j,r − η ·m (t) j,r/
√ v
(t) j,r, (3.5)
where β1, β2 are the hyperparameters of Adam (a popular choice in practice is β1 = 0.9, and β2 = 0.99), and in (3.4) and (3.5), the square (·)2, square root √ ·, and division ·/· all denote entrywise calculations. We do not consider the initialization bias correction in the original Adam paper (Kingma & Ba, 2015) for the ease of analysis.

heading: 4 MAIN RESULTS
text: In this section we will state the main theorems in this paper. We first 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 defined in (3.1) with d = Ω(n4) and regularized training objective (3.2) with a regularization parameter λ > 0, suppose the network width is m = polylog(n) and the data distribution follows Definition 3.1, then we have the following guarantees on the training and test errors for the models trained by Adam and Gradient descent:
1. Suppose we run Adam for T = poly(n)η iterations with η = 1 poly(n) , then with probability at least 1−O(n−1), we can find a NN model W∗Adam such that ‖∇L(W∗Adam)‖1 ≤ 1Tη . Moreover, the model W∗Adam also satisfies:
• Training error is zero: 1n ∑n i=1 1 [ Fyi(W ∗ Adam,xi) ≤ F−yi(W∗Adam,xi) ] = 0.
• Test error is high: P(x,y)∼D [ Fy(W ∗ Adam,x) ≤ F−y(W∗Adam,x) ] ≥ 12 .
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 find a NN model W∗GD such that ‖∇L(W∗GD)‖2F ≤ 1 Tη . Moreover, the model W ∗ GD also satisfies:
• Training error is zero: 1n ∑n i=1 1 [ Fyi(W ∗ GD,xi) ≤ F−yi(W∗GD,xi) ] = 0.
• Test error is nearly zero: P(x,y)∼D [ Fy(W ∗ GD,x) ≤ F−y(W∗GD,x) ] = 1poly(n) .
From the optimization perspective, Theorem 4.1 shows that both Adam and GD can be guaranteed to find a point with a very small gradient, which can also achieve zero classification 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 find a point with up to 1/(Tη) gradient norm in `1 metric, while gradient descent can only be guaranteed to find a point with up to 1/ √ Tη gradient norm in `2 metric. This suggests that Adam could enjoy a faster convergence rate compared to SGD in the training process, which is consistent with the practice findings. 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 data patch of lower sparsity and thus tends to fit the noise vectors ξ, gradient descent prefers the data patch of larger `2 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 fit the feature noise vector −αyv, 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 gradient descent are given in Section 5.
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>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 ‖∇L(W∗Adam)‖1 ≤ 1Tη and ‖∇L(W ∗ Adam)‖22 ≤ 1Tη 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 both zero:
1
n n∑ i=1 1 [ sgn ( F (W∗Adam,xi) ) 6= yi ] = 1 n n∑ i=1 1 [ sgn ( F (W∗GD,xi) ) 6= yi ] = 0.
• Test errors are nearly the same: P(x,y)∼D [ sgn ( F (W∗Adam,xi) ) 6= y ] = P(x,y)∼D [ sgn ( F (W∗GD,x) ) 6= y ] ± 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. 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.

heading: 5 PROOF OUTLINE OF THE MAIN RESULTS
text: 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 first give the following lemma which shows that for data generated from the data distribution D in Definition 3.1, with high probability all noise vectors {ξi}i=1,...,n have nearly disjoint supports. Lemma 5.1. Let {(xi, yi)}i=1,...,n be the training dataset generated by Definition 3.1. Moreover, recall that xi = [yiv>, ξ>i ] > (or xi = [ξ>i , yiv >]>), let Bi = supp(ξi)\{1} be the support of ξi except the first coordinate. Then with probability at least 1− n−2, Bi ∩ Bj = ∅ for all i 6= j.
This lemma implies that the optimization of each coordinate of the model parameter W, except for the first 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 first 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 the patterns learned by these two algorithms are different: Adam tends to fit 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 first stage will remain unchanged, even when running an infinitely number of iterations.

heading: 5.1 PROOF SKETCH FOR ADAM
text: 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 sufficiently small step size or the moving average parameters β1, β2 are nearly zero. This motivates us to study the optimization behavior of signGD and then extends it to Adam using their similarities. In particular, sign gradient descent updates the model parameter according to the
following rule:
w (t+1) j,r = w (t+1) j,r − η · sgn(∇wj,rL(W (t))).
Recall that each data has two patches: feature patch and noise patch. By Lemma 5.1 and the data distribution (see Definition 3.1), we know that all noise vectors {ξi}i=1,...,n are supported on disjoint coordinates, except the first one. For data point xi, let Bi denote its support, except the first coordinate. In the subsequent analysis, we will always assume that those Bi’s are disjoint, i.e., Bi ∩ Bj = ∅ if i 6= j. Next we will characterize two aspects of the training process: feature learning and noise memorization. Mathematically, we will focus on two quantities: 〈w(t)j,r, j · v〉 and 〈w (t) yi,r, ξi〉. In particular, given the training data (xi, yi) with xi = [yiv>, ξ>i ] >, larger 〈w(t)yi,r, yi · v〉 implies better feature learning and larger 〈w(t)yi,r, ξi〉 represents better noise memorization. Stage I: Learning the pattern. Mathematically, the first stage is defined as the iterations that the neural network output is smaller than some constant. In this stage, all training data remains underfitted and can provide large gradient for model training, and the effect of weight decay regularization can be ignored due to our choice of λ. We will show that in this stage the inner product 〈w(t)yi,r, ξi〉 grows much faster than 〈w(t)j,r, jv〉 since feature learning only makes use of the first coordinate of the gradient, while noise memorization could take advantage of all the coordinates in Bi (note that |Bi| = s 1). Lemma 5.2 (General results in Stage I). Suppose the training data is generated according to Definition 3.1, assume λ = o(σq−20 σp/n) and η = 1/poly(d), then for any t ≤ T0 with T0 = Õ ( 1
ηsσp ) and any i ∈ [n],
〈w(t+1)j,r , j · v〉 ≤ 〈w (t) j,r, j · v〉+ Θ(η),
〈w(t+1)yi,r , ξi〉 = 〈w (t) yi,r, ξi〉+ Θ̃(ηsσp).
Since 〈w(t)j,r, ξi〉 enjoys much faster increasing rate than that of 〈w (t) j,r, j · v〉, after a certain number of iterations, the learning of noise patch will dominate the learning of feature patch. Thus, the model will tend to fit the feature noise in the noise patch, leading to a flipped feature learning phenomenon.
Lemma 5.3 (Flipping the feature learning). Suppose the training data is generated according to Definition 3.1, α ≥ Θ̃ ( (sσp) 1−q ∨ σq−10 )
and σ0 < Õ((sσp)−1), then for any t ∈ [Tr, T0] with Tr = Õ ( σ0
ηsσpα1/(q−1)
) ≤ T0,
〈w(t+1)j,r , j · v〉 = 〈w (t) j,r, j · v〉 −Θ(η).
Moreover, it holds that
w (T0) j,r [k] =  −sgn(j) · Ω̃ ( 1 sσp ) , k = 1, sgn(ξi[k]) · Ω̃ ( 1 sσp ) or ± Õ(η), k ∈ Bi, with yi = j,
±Õ(η), otherwise.
From Lemma 5.3 it can be observed that at the iteration T0, the sign of the first coordinate of w (T0) j,r is different from that of the true feature, i.e., j · v. This implies that at the end of the first training stage, the model is biased towards the noise patch to fit 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 fitted 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 ( sσ2p/n ) and η = o(λ), then let r∗ = arg maxr∈[m]〈w (t) yi,r, ξi〉, for any t ≥ T0, i ∈ [n], j ∈ [2] and r ∈ [m], it holds that
〈w(t)yi,r∗ , ξi〉 = Θ̃(1), ∑ k∈Bi |w(t)yi,r∗ [k]| · |ξi[k]| = Θ̃(1),
∀r ∈ [m], 〈w(t)j,r, sgn(j) · v〉 ∈ [−o(1), O(λ −1η)].
Lemma 5.4 shows that in the second stage, 〈w(t)yi,r, ξi〉 will always be large while 〈w (t) yi,r, yi · v〉 is still negative, or positive but extremely small. Next we will show that within polynomial steps, the algorithm can be guaranteed to find a point with small gradient.
Lemma 5.5 (Convergence guarantee). If η = O(d−1/2), then for any t it holds that
L(W(t+1))− L(W(t)) ≤ −η‖∇L(W(t))‖1 + Θ̃(η2d).
Lemma 5.5 shows that we can pick a sufficiently small η and T = poly(n)/η to ensure that the algorithm can find a point with up to O(1/(Tη)) in `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 〈w∗yi,r, yi · v〉 < 0. This implies that the output model will be biased to fit the feature noise −αyv 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.

heading: 5.2 PROOF SKETCH FOR GRADIENT DESCENT
text: 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 `2 norm of them, where the vector (which can be either feature vector or noise vector) with larger `2 norm is more likely to be discovered and learnt by GD. Note that the feature vector has a larger `2 norm than the noise, we can show that, in the following lemma, gradient descent will learn the feature vector very quickly, while barely tend to memorize the noise.
Lemma 5.6. Let Λ(t)j = maxr∈[m]〈w (t+1) j,r , j · v〉, Γ (t) j,i = maxr∈[m]〈w (t) j,r, ξi〉, and Γ (t) j = maxi:yi=j Γ (t) j,i . Let Tj be the iteration number that Λ (t) j reaches Θ(1/m) = Θ̃(1), then we have
Tj = Θ̃(σ 2−q 0 ) for all j ∈ {−1, 1}.
Moreover, let T0 = maxj{Tj}, then for all t ≤ T0 it holds that Γ(t)j = 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 first stage will remain unchanged.
Lemma 5.7. If η ≤ O(σ0), it holds that Λ(t)j = Θ̃(1) and Γ (t) j = Õ(σ0) for all t ≥ minj Tj .
The following lemma further shows that within polynomial steps, gradient descent is guaranteed to find a point with small gradient. Lemma 5.8. If the learning rate satisfies η = o(1), then for any t ≥ 0 it holds that
L(W(t+1))− L(W(t)) ≤ −η 2 ‖∇L(W(t))‖2F .
Lemma 5.8 shows that we can pick a sufficiently small η and T = poly(n)/η to ensure that gradient descent can find a point with up to O(1/(Tη)1/2) in `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.

heading: 6 EXPERIMENTS
text: 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]>, noise sparsity s = 0.1d = 100, standard deviation of noise σp = 1/s1/2 = 0.1, feature noise strength α = 0.2, initialization scaling σ0 = 0.01, regularization parameter λ = 1 × 10−5, network width m = 20, activation function σ(z) = max{0, z}3, total iteration number T = 1× 104, and the learning rate η = 5× 10−5 for Adam (default choices of β1 and β2 in pytorch), η = 0.02 for GD.
We first 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 104. 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 verifies our main result (Theorem 4.1).
Moreover, we also calculate the inner products: maxr〈w1,r,v〉 and mini maxr〈w1,r, ξi〉, 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 first few iterations and then entirely forget
the feature (but fit feature noise), i.e., the feature learning is flipped, which verifies Lemma 5.3. In the meanwhile, the noise memorization happens in the entire training process and enjoys much faster rate than feature learning, which verifies Lemma 5.2. In addition, we can also observe that there are two stages for the increasing of mini maxr〈w1,r, ξi〉: in the first stage mini maxr〈w1,r, ξi〉 increases linearly, and in the second stage its increasing speed gradually slows down and mini maxr〈w1,r, ξi〉 will remain in a constant order. This verifies 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 increases to a constant in the first stage and then remains 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 verifies Lemmas 5.6 and 5.7.

heading: 7 CONCLUSION AND FUTURE WORK
text: 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 significantly different generalization errors, even with proper regularization. Our analysis reveals the fundamental difference between Adam and GD in learning features, and demonstrates that this difference is tied to the nonconvex optimization landscape of neural networks. Built up on the results in this paper, there are 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, where Adam has been observed to perform worse than SGD in terms of generalization. Studying other types of data such as natural language data, where Adam is often observed to perform better than SGD, is another future work direction.
ETHICS STATEMENT
This paper mainly concerns the theoretical understanding of the behaviors of different optimization algorithms in deep learning. We don’t see any potential ethical issues in our work.
REPRODUCIBILITY STATEMENT
Our theoretical results can be reproduced according to the assumptions and problem set up stated in Section 3 and the detailed proof provided in the appendix. The experimental results shown in Table 1 and Figure 1 are obtained via standard training (using SGD or Adam) on CIFAR-10 dataset (Krizhevsky et al., 2009). Our experimental results in Figure 2 and Table 2 can also be reproduced according to hyperparameters described in Section 6.

heading: A DISCUSSIONS
text: In this section, we would like to reflect on some possible extensions of our work to more general settings.
Mini-batch stochastic gradients. One natural extension of our paper is proving the separation between mini-batch SGD and mini-batch Adam, which we believe is not difficult. In particular, it can be shown that the learning behavior of SGD will be largely similar to that of GD since using mini-batch stochastic gradients does not change the rates of feature learning and noise memorization. In contrast, compared to full-batch Adam, the rate of mini-batch Adam in memorizing noise will be scaled down by at most n times (due to the preconditioning in Adam), while the rate of feature learning remains the same. However, the difference between SGD and mini-batch Adam still exists (though the difference might be smaller). This is because, 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). In contrast, using mini-batch stochastic gradients can only reduce the difference by at most an O(n) factor, which is still dominated by the poly(d) separation as long as the dimension d is sufficiently large (overparameterized).
Learnable second layer. Our results and analyses can also be extended to the case where the second layer is trained. The reason behind this is that the difference between Adam and GD comes from the learning of the hidden layer, while the second layer weights will not affect which patch and neuron is more likely to be learned by different optimization algorithms. Consequently, we can still get the result that GD tends to learn the feature patch while Adam tends to learn the noise patch.

heading: B PROOF OF THEOREM 4.1: NONCONVEX CASE
text: In the beginning of the proof we first present the following useful lemma.
B.1 PRELIMINARIES
We first recall the magnitude of all parameters:
d = poly(n), η = 1
poly(n) , s = Θ
( d1/2
n2
) , σ2p = Θ ( 1
s · polylog(n)
) , σ20 = Θ ( 1
d1/2
) ,
m = polylog(n), α = Θ ( σp · polylog(n) ) , λ = O
( 1
d(q−1)/4n · polylog(n)
) .
Here poly(n) denotes a polynomial function of n with degree of a sufficiently large constant, poly(n) denotes a polynomial function of log(n) with degree of a sufficiently large constant. Based on the parameter configuration, we claim that the following equations hold, which will be frequently used in the subsequent proof.
λ = o ( σq−20 σp n ) , α = ω ( (sσp) 1−qσq−10 ) , σ0 = o ( 1
sσp
) , α = o ( sσ2p n ) , η = o ( λσq0σ q p ) .
Lemma B.1 (Non-overlap support). Let {(xi, yi)}i=1,...,n be the training dataset sampled according to Definition 3.1. Moreover, let Bi = supp(ξi)\{1} be the support of xi except the first coordinate1. Then with probability at least 1− n−2, Bi ∩ Bj = ∅ for all i, j ∈ [n].
Proof of Lemma B.1. For any fixed k ∈ [n] and j ∈ supp(ξk)\{1}, by the model assumption we have
P{(ξi)j 6= 0} = s/(d− 1), for all i ∈ [n]\{k}. Therefore by the fact that the data samples are independent, we have
P(∃i ∈ [n]\{k} : (ξi)j 6= 0) = 1− [1− s/(d− 1)]n. 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 6= 0) ≤ n · s · {1− [1− s/(d− 1)]n}. (B.1)
1Recall that all data inputs have nonzero first coordinate by Definition 3.1
By the data distribution assumption we have s ≤ √ d/(2n2), which clearly implies s/(d− 1) ≤ 1/2. Therefore we have
n · s · [1− (1− s/d)n] = n · s · {1− exp[n log(1− s/(d− 1))]} ≤ n · s · [1− exp(n · 2s/(d− 1))] ≤ n · s · [1− exp(n · 4s/d)] ≤ n · s · (4ns/d) = 4n2s2/d
≤ n−2,
where the first inequality follows by the inequalities log(1 − z) ≥ −2z for z ∈ [0, 1/2], the second inequality follows by s/(d − 1) ≥ 2s/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/(2n2). Plugging the bound above into (B.1) finishes the proof.
B.2 PROOF FOR ADAM
Before moving to the detailed proof, we first state the update rules of feature learning and noise memorization when the sign gradient is applied.
〈w(t+1)j,r , jv〉 = 〈w (t) j,r, jv〉 − η · 〈 sgn ( ∇wj,rL(W(t)) ) , jv 〉
= 〈w(t)j,r, jv〉+ jη · sgn ( n∑ i=1 yi` (t) j,i [ σ′(〈w(t)j,r, yiv〉)− ασ ′(〈w(t)j,r, ξi〉) ] − nλw(t)j,r[1] ) ,
(B.2)
where `(t)j,i := 1yi=j −logitj(F,xi) and logitj(F,xi) = e Fj(W,xi)∑
k∈{−1,1} e Fk(W,xi)
. From (B.2) we can
observe three terms in the signed gradient. Specifically, the first term represents the gradient over the feature patch, the second term stems from the feature noise term in the noise patch (see Definition 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 by the following update rule,
〈w(t+1)yi,r , ξi〉 = 〈w (t) yi,r, ξi〉 − η · 〈 sgn ( ∇wyi,rL(W (t)) ) , ξi 〉
= 〈w(t)yi,r, ξi〉+ η · ∑ k∈Bi 〈 sgn ( ` (t) yi,i σ′(〈w(t)yi,r, ξi〉)ξi[k]− nλw (t) yi,r[k] ) , ξi[k] 〉
− αyiη · sgn ( n∑ i=1 yi` (t) yi,i [ σ′(〈w(t)yi,r, yiv〉)− ασ ′(〈w(t)yi,r, ξi〉) ] − nλw(t)yi,r[1] ) .
(B.3)
In this subsection we first 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 Section 5 can be viewed as a simplified version of the proofs for technical lemmas for Adam, thus are omitted in the paper.
Lemma B.2 (Closeness to SignGD). Recall the update rule of Adam, let W(t) be the t-th iterate of the Adam algorithm. Suppose that 〈w(t)j,r,v〉, 〈w (t) j,r, ξi〉 = Θ̃(1) for all j ∈ {±1} and r ∈ [m]. Then if β2 ≥ β21 , we have
• For all k ∈ [d], ∣∣∣∣ m(t)j,r[k]√ v
(t) j,r[k]
∣∣∣∣ ≤ Θ(1).
• For every k /∈ ∪ni=1Bi (including k = 1) we have either |∇wj,rL(W(t))[k]| ≤ Θ̃(η) or
m (t) j,r[k]√ v
(t) j,r[k]
= sgn ( ∇wj,rL(W(t))[k] ) ·Θ(1).
• For every k ∈ Bi, we have |∇wj,rL(W(t))[k]| ≤ Θ̃ ( ηn−1sσp|`(t)j,i | ) ≤ Θ̃(ηsσp) or
m (t) j,r[k]√ v
(t) j,r[k]
= sgn ( ∇wj,rL(W(t))[k] ) ·Θ(1).
Proof. First recall that the gradient∇wj,rL(W(t)) can be calculated as
∇wj,rL(W(t)) = − 1
n [ n∑ i=1 yi` (t) j,iσ ′(〈w(t)j,r, yiv〉) · v + n∑ i=1 ` (t) j,i · σ ′(〈w(t)j,r, yiξi〉) · ξi ] + λw (t) j,r.
More specifically, for the first coordinate of∇wj,rL(W(t)), we have
∇wj,rL(W(t))[1] = − 1
n [ n∑ i=1 yi` (t) j,iσ ′(〈w(t)j,r, yiv〉)− α n∑ i=1 yi` (t) j,i · σ ′(〈w(t)j,r, ξi〉) ] + λw (t) j,r[1].
(B.4)
For any k ∈ Bi, by Lemma B.1 we know that the gradient over this coordinate only depends on the training data ξi, therefore, we have
∇wj,rL(W(t))[k] = − 1
n ` (t) j,iσ ′(〈w(t)j,r, ξi〉)ξi[k] + λw (t) j,r[k]. (B.5)
For the remaining coordinates, we have
∇wj,rL(W(t))[k] = λw (t) j,r[k]. (B.6)
Now let us focus on the moving averaged gradient m(t)j,r and squared gradient v (t) j,r. We first show that for all k ∈ [d], it holds that ∣∣m(t)j,r[k]∣∣√ v
(t) j,r[k]
≤ Θ(1). (B.7)
By the update rule of m(t)j,r, we have
m (t) j,r[k] = β1m (t−1) j,r [k] + (1− β1) · ∇wj,rL(W (t))[k]
= t∑ τ=0 βτ1 (1− β1) · ∇wj,rL(W(t−τ))[k].
Similarly, we also have
v (t) j,r[k] = t∑ τ=0 βτ2 (1− β2) · ∇wj,rL(W(t−τ))[k]2.
Then by Cauchy-Schwartz inequality we have( m
(t) j,r[k] )2 ≤ ( t∑ τ=0 [βτ1 (1− β1)]2 α2τ · ∇wj,rL(W(t−τ))[k]2 ) · ( t∑ τ=0 α2τ ) .
Let α2τ = [βτ1 (1−β1)] 2
βτ2 (1−β2) , which forms an exponentially decaying sequence if β2 ≥ β21 . Therefore, we have ∑t τ=0 α
2 τ = Θ(1) and the above inequality implies that(
m (t) j,r[k] )2 ≤ v(t)j,r[k] ·Θ(1),
which proves (B.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 ∑t τ=τ̄ β τ 1 (1− β1) = 1poly(η−1) . Then for each k ∈ [d] we have
m (t) j,r[k] = τ̄∑ τ=0 βτ1 (1− β1) · ∇wj,rL(W(t−τ))[k] + t∑ τ=τ̄ βτ1 (1− β1) · ∇wj,rL(W(t−τ))[k]
= τ̄∑ τ=0 βτ1 (1− β1) · ∇wj,rL(W(t−τ))[k]± 1 poly(η−1) ,
where in the last inequality we use the fact that |∇wj,rL(W(t−τ))[k]| = Õ(1) for all k ∈ [d]. Similarly, we can also have the following on v(t)j,r,
v (t) j,r[k] = τ̄∑ τ=0 βτ2 (1− β2) · ∇wj,rL(W(t−τ))[k]2 ± 1 poly(η−1) .
Here we slightly abuse the notation by using the same τ̄ . Then we have
m (t) j,r[k]√ v
(t) j,r[k]
=
∑τ̄ τ=0 β
τ 1 (1− β1) · ∇wj,rL(W(t−τ))[k]± 1poly(η−1)√∑τ̄
τ=τ̄ β τ 2 (1− β2) · ∇wj,rL(W(t−τ))[k]2 ± 1poly(η−1)
.
In order to prove the main argument of this lemma, the key is to show that within τ̄ iterations, the gradient ∇wj,rL(W(t))[k] barely changes. In particular, by (B.7), we have the update of each coordinate in one step is at most Θ(η). This implies that∣∣〈w(t)j,r,v〉 − 〈w(τ)j,r ,v〉∣∣ ≤ Θ(ητ̄),∣∣〈w(t)j,r, ξi〉 − 〈w(τ)j,r , ξi〉∣∣ ≤ Θ(ητ̄sσp),
|w(t)j,r[k]−w (τ) j,r [k]| ≤ Θ(ητ̄).
Then applying the fact that |〈w(τ)j,r ,v〉| ≤ Θ̃(1) and |〈w (τ) j,r , ξi〉| ≤ Θ̃(1), we further have∣∣Fj(W(τ),xi)− Fj(W(t),xi)∣∣ ≤ Θ(mητ̄sσp) = Θ̃(ητ̄sσp),
where we use the fact that m = Θ̃(1) and sσp = ω(1). Then it holds that
` (τ) j,i =
eFj(W (τ),xi)∑
k∈{−1,1} e Fk(W(τ),xi)
≤ e Fj(W
(t),xi)+Θ̃(ητ̄sσp)
eFj(W (τ),xi)+Θ̃(ητ̄sσp) + eF−j(W (t),xi)−Θ̃(ητ̄sσp)
= sgn(` (t) j,i ) ·Θ(|` (t) j,i |),
where we use the fact that Θ̃(ητ̄sσp) = o(1). Similarly, we can also show that ` (τ) j,i ≥ sgn(` (t) j,i ) · Θ(|`(t)j,i |), which further implies
` (τ) j,i = sgn(` (t) j,i ) ·Θ(|` (t) j,i |)
for all τ ∈ [t− τ̄ , t]. Note that |`(τ)j,i | ≤ 1, then it holds that
` (τ) j,i σ ′(〈w(τ)j,r ,v〉) = sgn(` (t) j,i ) ·Θ(|` (t) j,i |) · σ ′(〈w(τ)j,r ,v〉)
≤ sgn(`(t)j,i ) ·Θ(|` (t) j,i |) · σ ′(〈w(t)j,r,v〉) + Θ(|` (t) j,i |) · Θ̃(ητ̄).
We can also similarly derive the following
` (τ) j,i σ ′(〈w(τ)j,r ,v〉) ≥ sgn(` (t) j,i ) ·Θ(|` (t) j,i |) · σ ′(〈w(t)j,r,v〉)−Θ(|` (t) j,i |) · Θ̃(ητ̄),
` (τ) j,i σ ′(〈w(τ)j,r , ξi〉) ≤ sgn(` (t) j,i ) ·Θ(|` (t) j,i |) · σ ′(〈w(t)j,r, ξi〉) + Θ(|` (t) j,i |) · Θ̃(ητ̄sσp),
` (τ) j,i σ ′(〈w(τ)j,r , ξi〉) ≥ sgn(` (t) j,i ) ·Θ(|` (t) j,i |) · σ ′(〈w(t)j,r, ξi〉)−Θ(|` (t) j,i |) · Θ̃(ητ̄sσp).
Combining the above results, applying (B.4), (B.5), and (B.6), we can show that for the first coordinate, we have
∇wj,rL(W(τ))[1] = Θ ( ∇wj,rL(W(t))[1] ) ±Θ ( 1
n n∑ i=1 |`(t)j,i | ) · Õ(ητ̄)±Θ(λητ̄);
for any k ∈ Bj , we have
∇wj,rL(W(τ))[k] = Θ ( ∇wj,rL(W(t))[k] ) ±Θ ( |`(t)j,i | n ) · Õ(ητ̄sσp)±Θ(λητ̄);
and for remaining coordinates, we have ∇wj,rL(W(τ))[k] = Θ ( ∇wj,rL(W(t))[k] ) ±Θ(λητ̃).
Now we can plug the above results into the formula of m(t)j,r and v (t) j,r. Using the fact that τ̄ = Θ̃(1), λ = o(1), and |`(t)j,i | ≤ 1, we have for all k = 1 or k /∈ Bi for any i,
m (t) j,r[k]√ v
(t) j,r[k]
= ∇wj,rL(W(t))[k]± Θ̃(η) Θ ( |∇wj,rL(W(t))[k]| ) ± Θ̃(η)) .
For k ∈ Bi we have
m (t) j,r[k]√ v
(t) j,r[k]
= ∇wj,rL(W(t))[k]± Θ̃
( ηsσp|`(t)j,i |
n
) ± Θ̃(λη)
Θ ( |∇wj,rL(W(t))[k]| ) ± Θ̃ ( ηsσp|`(t)j,i |
n
) ± Θ̃(λη) .
Then, we can conclude that for all k = 1 or k /∈ Bi for any i, we have either |∇wj,rL(W(t))[k]| ≤ Θ̃(η) or
m (t) j,r[k]√ v
(t) j,r[k]
= sgn ( ∇wj,rL(W(t))[k] ) ·Θ(1).
For any k ∈ Bi, we have either |∇wj,rL(W(t))[k]| ≤ Θ̃ ( ηn−1sσp|`(t)j,i |+ λη ) or
m (t) j,r[k]√ v
(t) j,r[k]
= sgn ( ∇wj,rL(W(t))[k] ) ·Θ(1).
This completes the proof.
Lemma B.3 (Lemma 5.2, restated). Suppose the training data is generated according to Definition 3.1, assume λ = o(σq−20 σp/n) and η = 1/poly(d), then for any t ≤ T0 with T0 = Õ
( 1
ηsσp
) and
any i ∈ [n],
〈w(t+1)j,r , j · v〉 ≤ 〈w (t) j,r, j · v〉+ Θ(η),
〈w(t+1)yi,r , ξi〉 = 〈w (t) yi,r, ξi〉+ Θ̃(ηsσp).
Proof. At the initialization, we have
|〈w(0)j,r ,v〉| = Θ̃(σ0), |〈w (0) j,r , ξi〉| = Θ̃(s 1/2σpσ0 + α) = Θ̃(s 1/2σpσ0), w (0) j,r [k] = Θ̃(σ0),
which also imply that |`(0)j,i | = Θ(1). Besides, note that ` (t) j,i = 1j=yi −logitj(F (t),xi), we have
sgn ( yi` (t) j,i ) = sgn(j),
where we recall that j ∈ {−1, 1}. Therefore, given that λ = o(σq−10 ), α = o(1), s1/2σp = Õ(1), and assume `(t)j,i = Θ(1) (which will be verified later),
sgn ( n∑ i=1 yi` (t) j,iσ ′(〈w(t)j,r, yiv〉)− α n∑ i=1 yi` (t) j,iσ ′(〈w(t)j,r, ξi〉)− nλw (t) j,r[1] ) = sgn [ j · Θ̃(nσq−10 )− j · Θ̃(αn(s1/2σpσ0)q−1)± o ( σq−10 σp)
] = sgn(j).
Since v is 1-sparse, then by Lemma B.2, the following inequality naturally holds,
〈w(t+1)j,r , j · v〉 ≤ 〈w (t) j,r, j · v〉 − η
〈 m
(t) j,r/
√ v
(t) j,r, j · v 〉 ≤ 〈w(t)j,r, j · v〉+ Θ(η).
Additionally, in terms of the memorization of noise, we first consider the iterate in the initialization. By the condition that η = o(1/d) = o(1/(sσp)) and note that for a sufficiently large fraction of k ∈ Bi (e.g., 0.99), we have |ξi[k]| ≥ Θ̃(σp) ≥ Θ̃(ηn−1sσp|`(0)j,i |) and thus sgn ( ∇wyi,rL(W (0))[k] ) = sgn ( ` (t) yi,i σ′(〈w(t)yi,r, ξi〉)ξi[k]− nλw (0) yi,r[k]
) = −sgn [ Θ̃ ( (d1/2σpσ0) q−1σp · sgn(ξi[k]) ) ± o(σq−10 σp) ] = −sgn(ξi[k]).
(B.8)
Therefore, by Lemma B.2 we have the following according to (B.3),
〈w(1)yi,r, ξi〉 = 〈w (0) yi,r, ξi〉 − η
〈 m
(t) j,r/
√ v (t) yi,r, ξi 〉 ≥ 〈w(0)yi,r, ξi〉+ Θ(η) ·
∑ k∈Bi 〈sgn(ξi[k]), ξi[k]〉 −O(ηsσp)−O(ηα)
= 〈w(0)yi,r, ξi〉+ Θ̃(ηsσp),
where in the first inequality the term O(ηsσp) represents the coordinates that |ξi[k]| ≤ O(σp) (so that we cannot use the sign information of∇yi,rL(W(0)) but directly bound it by Θ(1)) and the last inequality is due to the fact that |Bi| ≥ s − 1 and α = o(1). For general t, we will consider the following induction hypothesis:
〈w(t+1)yi,r , ξi〉 = 〈w (t) yi,r, ξi〉+ Θ̃(ηsσp), (B.9)
which has already been verified for t = 0. By Hypothesis (B.9), the following holds at time t,
〈w(t)yi,r, ξi〉 = 〈w (0) yi,r, ξi〉+ Θ̃(tηsσp) = Θ̃(s 1/2σpσ0 + tηsσp).
In the meanwhile, we have the following upper bound for |w(t)j,r[k]|,
|w(t)j,r[k]| ≤ |w (t) j,r[k]|+ η| sign(∇wj,rL(W (t)))| ≤ |w(0)j,r [k]|+ tη = Θ̃(σ0 + tη). (B.10)
Besides, it is also easy to verify that for any t ≤ T0 = Θ̃ (
1 sσpηm
) = Θ̃ ( 1
sσpη
) , we have
〈w(t)yi,r, ξi〉, 〈w (t) yi,r, j · v〉 < Θ(1/m) and thus |` (t) j,i | = Θ(1). Then similar to (B.8), we have
sgn ( ∇wyi,rL(W (t))[k] )
= sgn ( ` (t) yi,i σ′(〈w(t)yi,r, ξi〉)ξi[k]− nλw (0) yi,r[k] )
= −sgn ( Θ̃ [ (s1/2σpσ0 + tηsσp) q−1σp · sgn(ξi[k]) ) ± o ( σq−20 σp · (σ0 + tη) )] = −sgn(ξi[k]). (B.11)
This further implies that
〈w(t+1)yi,r , ξi〉 ≥ 〈w (t) yi,r, ξi〉 −Θ(η) · ∑ k∈Bi 〈sgn ( ∇wyi,rL(W (t))[k] ) , ξi[k]〉 −O(η2s2σ2p)−O(ηα)
= 〈w(t)yi,r, ξi〉+ Θ̃(ηsσp),
where the term−O(η2s2σ2p) is contributed by the gradient coordinates that are smaller than Θ(ηsσp). This verifies Hypothesis (B.9) at time t and thus completes the proof.
From Lemma B.3, note that sσp = ω(1), then it can be seen that 〈w(t)j,r, j · v〉 increases much faster than 〈w(t)j,r, j · v〉. By looking at the update rule of 〈w (t) j,r, j · v〉 (see (B.2)), it will keeps increasing only when, roughly speaking, σ′(〈w(t)j,r, j · v〉) > ασ′(〈w (t) j,r, ξi〉). Since 〈w (t) j,r, ξi〉 increases much faster than 〈w(t)j,r, j · v〉, it can be anticipated after a certain number of iterations, 〈w (t) j,r, j · v〉 will start to decrease. In the following lemma, we provide an upper bound on the iteration number such that this decreasing occurs. Lemma B.4 (Lemma B.4, restated). Suppose the training data is generated according to Definition 3.1, α ≥ Θ̃ ( (sσp) 1−q ∨ σq−10 )
and σ0 < Õ((sσp)−1), then for any t ∈ [Tr, T0] with Tr = Õ (
σ0 ηsσpα1/(q−1)
) ≤ T0,
〈w(t+1)j,r , j · v〉 = 〈w (t) j,r, j · v〉 −Θ(η).
Moreover, it holds that
w (T0) j,r [k] =  −sgn(j) · Ω̃ ( 1 sσp ) , k = 1, sgn(ξi[k]) · Ω̃ ( 1 sσp ) or ± Õ(η), k ∈ Bi, with yi = j,
±Õ(η), otherwise.
Proof. Recall from Lemma B.3 that for any t ≤ T0 we have
〈w(t+1)j,r , j · v〉 ≤ 〈w (t) j,r, j · v〉+ Θ(η) ≤ 〈w (0) j,r , j · v〉+ Θ(tη),
〈w(t+1)ys,r , ξs〉 = 〈w (t) ys,r, ξs〉+ Θ̃(ηsσp) ≤ 〈w (0) ys,r, ξs〉+ Θ̃(tηsσp).
Besides, by Lemma B.2 we also have |w(t)j,r[k]| ≤ |w (0) j,r [k]|+O(tη). Then it can be verified that for some Tr = Õ (
σ0 ηsσpα1/(q−1)
) , we have for all i ∈ [n] and t ∈ [Tr, T0]
ασ′(〈w(t)yi,r, ξi〉) ≥ C · [ σ′(〈w(t)j,r, j · v〉) + λn|w (t) j,r[1]| ] for some constant C. This further implies that
sgn ( ∇wj,rL(W(t))[1] ) = −sgn
( n∑ i=1 yi` (t) j,iσ ′(〈w(t)j,r, yiv〉)− α n∑ i=1 yi` (t) j,iσ ′(〈w(t)j,r, ξi〉)− nλw (t) j,r[1] )
= −sgn [ − α n∑ i=1 yi` (t) j,iσ ′(〈w(t)j,r, ξi〉) ] = sgn(j),
where we use the fact that sgn(yi` (t) j,i ) = sgn(j) for all i ∈ [n]. Then by Lemma B.2 and (B.2), we have for all t ∈ [Tr, T0],
〈w(t+1)j,r , j · v〉 = 〈w (t) j,r, j · v〉 −Θ(η) · sgn(j) · sgn ( ∇wj,rL(W(t))[1] ) = 〈w(t)j,r, j · v〉 −Θ(η).
Then at iteration T0, for the first coordinate we have
w (T0) j,r [1] = w (0) j,r [1] + sgn(j) ·Θ(Trη)− sgn(j) ·Θ((T0 − Tr)η) ≥ −sgn(j) · Ω̃
( 1
sσp ) For any k ∈ Bi with yi = j, we have either the coordinate will increase at a rate of Θ(1) or fall into 0. As a consequence we have either w(T0)j,r [k] ∈ [−Θ̃(η), Θ̃(η)] or
w (T0) j,r [k] = w (0) j,r [k] + sgn(ξi[k]) ·Θ(T0η) ≥ sgn(ξi[k]) · Ω̃
( 1
sσp
) .
For the remaining coordinate, its update will be determined by the regularization term, which will finally fall into the region around zero since we have T0η = ω(σ0). By Lemma B.2 it is clear that w
(T0) j,r [k] ∈ [−Θ̃(η), Θ̃(η)].
Lemma B.5 (Lemma 5.4, restated). If α = O ( sσ2p n ) and η = o(λ), then let r∗ = arg maxr∈[m]〈w (t) yi,r, ξi〉, for any t ≥ T0, i ∈ [n], j ∈ [2] and r ∈ [m], it holds that
〈w(t)yi,r∗ , ξi〉 = Θ̃(1), ∑ k∈Bi |w(t)yi,r∗ [k]| · |ξi[k]| = Θ̃(1),
∀r ∈ [m], 〈w(t)j,r, sgn(j) · v〉 ∈ [−Õ ( nα sσ2p ) , O(λ−1η)].
Proof. The proof will be relying on the following three induction hypothesis:
〈w(t)yi,r∗ , ξi〉 = Ω̃(1), (B.12)∑ k∈Bi |w(t+1)yi,r∗ [k]| · |ξi[k]| = Θ̃(1), (B.13)
∀r ∈ [m], 〈w(t)j,r, sgn(j) · v〉 ∈ [ − Õ ( nα sσ2p ) , O(λ−1η) ] , (B.14)
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 = T0 according to Lemma B.4.
Verifying Hypothesis (B.12). We first verify Hypothesis (B.12). Recall that the update rule for 〈w(t)yi,r, ξi〉 is given as follows,
〈w(t+1)yi,r , ξi〉
= 〈w(t)yi,r, ξi〉 − η · 〈 m(t)yi,r/ √ v (t) yi,r, ξi 〉 ≥ 〈w(t)yi,r, ξi〉 −Θ(η) · 〈 sgn ( ∇wyi,rL(W (t)) ) , ξi 〉 − Θ̃(η2s2σ2p)
= 〈w(t)yi,r, ξi〉+ Θ(η) · ∑ k∈Bi 〈 sgn ( ` (t) yi,i σ′(〈w(t)yi,r, ξi〉)ξi[k]− nλw (t) yi,r[k] ) , ξi[k] 〉
− αyiΘ(η) · sgn ( n∑ i=1 yi` (t) j,iσ ′(〈w(t)j,r, yiv〉)− α n∑ i=1 yi` (t) j,iσ ′(〈w(t)j,r, ξi〉)− nλw (t) j,r[1] ) − Θ̃(η2s2σ2p). (B.15)
Note that for any a and b we have sgn(a− b) · a ≥ |a| − 2|b|. Then it follows that∑ k∈Bi 〈 sgn ( ` (t) yi,i σ′(〈w(t)yi,r, ξi〉)ξi[k]− nλw (t) yi,r[k] ) , ξi[k] 〉 ≥ ∑ k∈Bi ( |ξi[k]| − 2nλ|w(t)yi,r[k]| ` (t) yi,i σ′(〈w(t)yi , ξi〉) ) ≥ Θ̃(sσp)− Θ̃ ( nλ
` (t) yi,i σp
) ,
where the last inequality follows from Hypothesis (B.12) and (B.13). Further recall that λ = o(σq−20 σp/n), plugging the above inequality to (B.15) gives
〈w(t+1)yi,r , ξi〉 ≥ 〈w (t) yi,r, ξi〉+ Θ̃(ηsσp)− Θ̃
( ηnλ
` (t) yi,i σp
) − Θ̃(η2s2σ2p)
≥ 〈w(t)yi,r, ξi〉+ Θ̃(ηsσp)−Θ(αη)− Θ̃ ( ησq−20
` (t) yi,i
) . (B.16)
Then it is clear that 〈w(t)yi,r, ξi〉 will increase by Θ̃(ηsσp) if ` (t) yi,i is larger than some constant of order Ω̃( nλsσ2p ) = Ω̃( σq−20 sσp ). We will first show that as soon as there is a iterate W(τ) satisfying ` (τ) yi,i ≤ Õ ( nλ sσ2p ) for some τ ≤ t, then it must hold that `(τ ′) yi,i will also be smaller than some constant
in the order of Õ ( nλ sσ2p ) for all τ ′ ∈ [τ, t+ 1]. To prove this, we first note that if `(t)yi,i reaches some
constant in the order of Õ ( nλ sσ2p ) , we have for all r ∈ [m] by (B.16)
〈w(t+1)yi,r , ξi〉 ≥ 〈w (t) yi,r, ξi〉+ Θ̃(ηsσp),
〈w(t+1)−yi,r, ξi〉 ≤ 〈w (t) −yi,r, ξi〉+O(αη),
|〈w(t+1)j,r ,v〉| ≤ |〈w (t) j,r,v〉|+O(η). (B.17)
Therefore, we have
` (t+1) yi,i
= eF−yi (W (t+1),xi)∑ j∈{−1,1} e Fj(W(t+1),xi)
= 1 1 + exp [∑m
r=1
[ σ(〈w(t+1)yi,r ,v〉) + σ(〈w (t+1) yi,r , ξi〉)− σ(〈w (t+1) −yi,r,v〉)− σ(〈w (t+1) −yi,r, ξi〉) ] ≤ 1
1 + exp [∑m
r=1
[ σ(〈w(t)yi,r,v〉) + σ(〈w (t) yi,r, ξi〉)− σ(〈w (t) −yi,r,v〉)− σ(〈w (t) −yi,r, ξi〉) ] + Θ̃(ηsσ2p) ] ≤ 1
1 + exp [∑m
r=1
[ σ(〈w(t)yi,r,v〉) + σ(〈w (t) yi,r, ξi〉) ] − σ(〈w(t)−yi,r,v〉)− σ(〈w (t) −yi,r, ξi〉) ]] = `
(t) yi,i ,
where inequality follows from (B.17). Therefore, this implies that as long as `(t)yi,i is larger than some constant b = Õ ( nλ sσ2p ) , then the adam algorithm will prevent it from further increasing. Besides, since mησ2p = o(1), then we must have ` (t+1) yi,i ∈ [0.5`(t)yi,i, 2` (t) yi,i ]. As a consequence, we can deduce that ` (t) yi,i
cannot be larger than 2b, since otherwise there must exists a iterate W(τ) with τ ≤ t such that ` (τ) yi,i ∈ [b, 2b] and `(τ+1)yi,i ≥ ` (τ) yi,i , which contradicts the fact that `(τ)yi,i should decreases if ` (τ) yi,i ≥ b.
Therefore, we can claim that if `(τ)yi,i ≤ b = Õ ( nλ sσ2p ) for some τ ≤ t, then we have
` (τ ′) yi,i ≤ Õ
( nλ
sσ2p
) (B.18)
for all τ ′ ∈ [τ, t+ 1]. Then further note that
2` (t+1) yi,i ≥ `(t)yi,i = eF−yi (W (t),xi)∑ j∈{−1,1} e Fj(W(t),xi)
≥ exp ( − m∑ r=1 [ σ(〈w(t)yi,r, yiv〉) + σ(〈w (t) yi,r, ξi〉) ]) ≥ exp ( −Θ
( m max r∈[m] σ(〈w(t)yi,r, ξi〉) )) , (B.19)
where in the last inequality we use Hypothesis (B.14). Then by the fact that `(t+1)yi,i ≤ Õ ( nλ sσ2p ) =
o(1) and m = Θ̃(1), it is clear that exp ( − Θ ( mmaxr∈[m] σ(〈w (t+1) yi,r , ξi〉) )) = o(1) so that maxr∈[m]〈w (t+1) yi,r , ξi〉 = Ω̃(1). This verifies Hypothesis (B.12).
Verifying Hypothesis (B.13). Now we will verify Hypothesis (B.13). First, note that we have already shown that 〈w(t+1)yi,r∗ , ξi〉 = Ω̃(1) so it holds that∑
k∈Bi
|w(t+1)yi,r∗ [k]| · |ξi[k]|+ α|w (t+1) yi,r∗ [1]| ≥ 〈w (t+1) yi,r∗ , ξi〉 = Ω̃(1).
By Hypothesis (B.14), we have |w(t+1)yi,r∗ [1]| ≤ |w (t) yi,r∗ [1]|+ η = o(1). Besides, since each coordinate in ξi is a Gaussian random variable, then maxk∈Bi |ξi[k]| = Õ(σp). This immediately implies that∑ k∈Bi |w(t+1)yi,r∗ [k]| · |ξi[k]| = Ω̃(1).
Then we will prove the upper bound of ∑ k∈Bi |w (t+1) yi,r [k]| · |ξi[k]|. Recall that by Lemma B.2, for any k ∈ Bi such that∇wyi,rL(W (t))[k] ≥ Θ̃(n−1ηsσp`(t)yi,i), we have
w(t+1)yi,r [k] = w (t) yi,r[k] + Θ(η) · sgn ( ` (t) yi,i σ′(〈w(t)yi,r, ξi〉)ξi[k]− nλw (t) yi,r[k] ) .
Note that by Lemma B.4, for every k ∈ Bi, we have either w(T0)yi,r [k] = sgn(ξi[k]) · Θ̃ ( 1 sσp ) or |w(T0)yi,r [k]| ≤ η. Then during the training process after T0, we have either sgn(w (t) yi,r[k]) = sgn(ξi[k]) or sgn(ξi[k]) ·w(t)yi,r ≥ −Õ(η) since if for some iteration number t′ that we have sgn(w (t′) yi,r[k]) = −sgn(ξi[k]) but sgn(w(t ′−1)
yi,r [k]) = sgn(ξi[k]), then after τ̄ = Õ(1) steps (see the proof of Lemma B.2 for the definition of τ̄ ) in the constant number of steps the gradient will must be in the same direction of ξi[k], which will push wyi,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 〈w(t)yi,r, ξi〉,
〈w(t)yi,r, ξi〉 = ∑
k∈Bi∪{1}
w(t)yi,r[k] · ξi[k]
≥ ∑
k∈Bi∪{1}
|w(t)yi,r[k]| · |ξi[k]| − Õ(η) · ∑
k∈Bi∪{1}
|ξi[k]|
= ∑
k∈Bi∪{1}
|w(t)yi,r[k]| · |ξi[k]| − Õ(ηsσp),
where the second inequality follows from the fact that the entry w(t)yi,r[k] that has different sign of ξi[k] satisfies |w(t)yi,r[k]| ≤ Õ(η). Then let B (t) i = ∑ j∈Bi∪{1} ∣∣w(t)yi,r[k] · 1(|w(t)yi,r[k]| ≥ Õ(η))∣∣ · |ξi[k]|, which satisfies B(T0)i = Θ̃(1) by Lemma B.4. Then assume B (t) i keeps increasing and reaches some
value in the order of Θ ( log(dnη−1) ) , it holds that according to the inequality above
〈w(t)yi,r, ξi〉 = Θ ( log(dnη−1) ) − Θ̃(ηsσp) = Θ ( log(dnη−1) ) ,
where we use the condition that η = O ( (sσp) −1). Then by Hypothesis (B.12) and (B.14) we know that |〈w(t)j,r,v〉| = o(1), 〈w (t) yi,r∗ , ξi〉 = Ω̃(1), and |〈w (t) −yi,r∗ , ξi〉| = Õ(dη)+α|〈w (t) −yi,r∗ ,v〉| = o(1) then similar to (B.19), it holds that
` (t) yi,i
= eF−yi (W (t),xi)∑ j∈{−1,1} e Fj(W(t),xi) ≤ exp
( −Θ ( σ(〈w(t)yi,r∗ , ξi〉) )) ≤ poly(d−1, n−1, η).
Therefore, at this time we have for all k ∈ Bi,
` (t) yi,i σ〈(w(t)yi,r, ξi〉)ξi[k] ≤ poly(d
−1, n−1, η) ·Θ ( logq−1(dnη−1) ) · Θ̃(σp) ≤ nλη.
Then for all |w(t)yi,r[k]| ≥ Õ(η), the sign of the gradient satisfies
sgn ( ∇wyi,rL(W (t))[k] ) = −sgn ( ` (t) yi,i σ′(〈w(t)yi,r, ξi〉)ξi[k]− nλw (t) yi,r[k] ) = sgn(nλη −w(t)yi,r[k])
= sgn(w(t)yi,r[k]).
Then note that |∇wyi,rL(W (t))[k]| = Θ(|λw(t)yi,r[k]|) ≥ Θ
( n−1ηsσp` (t) yi,i + λη ) , by the update
rule of w(t)yi,r[k] and Lemma B.2, we know the sign gradient will dominate the update process. Then we have |w(t+1)yi,r [k]| = |w (t) yi,r[k] − Θ(η) · sgn(w (t) yi,r[k])| ≤ |w
(t) yi,r[k]|, which implies that∣∣w(t)yi,r[k] · 1(|w(t)yi,r[k]| ≥ Õ(η))∣∣ decreases so that B(t)i also decreases. Therefore, we can conclude
that B(t)i will not exceed Θ ( log(dnη−1) ) . Then combining the results for all i ∈ [n] gives∑
k∈Bi
|w(t)yi,r∗ [k]| · |ξi[k]| ≤ B (t) i + Õ(sησp) ≤ Θ
( log(dnη−1) ) +O(1) = Θ̃(1),
where in the first inequality we again use the condition that η = o(1/d) = o ( (sσp) −1). This verifies Hypothesis (B.13). Notably, this also implies that 〈w(t)yi,r∗ , ξi〉 = maxr∈[m]〈w (t) yi,r, ξi〉 ≤ Θ̃(1).
Verifying Hypothesis (B.14). In order to verify Hypothesis (B.14), let us first recall the update rule of 〈w(t)j,r,v〉:
〈w(t+1)j,r ,v〉 = 〈w (t) j,r,v〉 − η
〈 m
(t) j,r√ v
(t) j,r
,v 〉 .
Then by Lemma B.2, we know that if |∇wj,rL(W(t))[1]| ≤ Θ̃(η), then |m (t) j,r/ √ v (t) j,r| ≤ Θ(1) and otherwise〈 m
(t) j,r√ v
(t) j,r
,v 〉 = −sgn ( n∑ i=1 yi` (t) j,iσ ′(〈w(t)j,r, yiv〉)− α n∑ i=1 yi` (t) j,iσ ′(〈w(t)j,r, ξi〉)− nλw (t) j,r[1] ) ·Θ(1).
Without loss of generality we assume j = 1, then by Lemma B.4 we know that w(T0)1,r [1] = −Ω̃ ( 1 sσp ) . In the remaining proof, we will show that either w(t+1)1,r [1] ∈ [0, Θ̃(λ−1η)] or w (t+1) 1,r [1] ∈ [ −
Õ ( nα sσ2p ) , 0 ) .
First we will show that w(t+1)1,r [1] ∈ [0, Θ̃(λ−1η)] for all r. Note that in the beginning of this stage, we have w(T0)1,r [1] < 0. In order to make the sign of w (t′) 1,r [1] flip, we must have, in some iteration t′ ≤ t that satisfies w(t ′)
1,r [1] ∈ [0, Θ̃(λ−1η)], therefore
−n∇w1,rL(W(t ′))[1] = n∑ i=1 yi` (t′) j,i σ ′(〈w(t ′) j,r , yiv〉)− α n∑ i=1 yi` (t′) j,i σ ′(〈w(t ′) j,r , ξi〉)− nλw (t′) j,r [1]
≤ n [( w (t′) j,r [1] )q−2 − λ] ·w(t′)j,r [1] ≤ −Θ̃(nη) ≤ 0, where the second inequality holds since η = o(λ(q−1)/(q−2)). Note that |∇w1,rL(W(t
′))[1]| ≥ Θ̃(η), then by Lemma B.2 we know that Adam is similar to sign gradient descent and thus w(t ′+1) 1,r [1] = w (t′) 1,r [1] − Θ(η) which starts to decrease. This implies that if w (t+1) 1,r [1] is positive, then it cannot exceed Θ̃(λ−1η) = o(1).
Then we can prove that if w(t+1)1,r [1] is negative, then |w (t+1) 1,r [1]| = Õ ( nα sσ2p ) . In this case we have for all t′ ≤ t,
−n∇ w (t) 1,r L(W(t
′))[1] = n∑ i=1 yi` (t′) 1,i σ ′(〈w(t ′) 1,r , yiv〉)− α n∑ i=1 yi` (t′) 1,i σ ′(〈w(t ′) 1,r , ξi〉)− nλw (t′) 1,r [1]
≥ − ∑ i:yi=1 |`(t ′) 1,i | · Θ̃(α) + nλ|w (t′) 1,r [1]|+ ∑ i:yi=−1 |`(t ′) 1,i | · |w (t′) 1,r [1]|q−1,
≥ − ∑ i:yi=1 |`(t ′) 1,i | · Θ̃(α) + nλ|w (t′) 1,r [1]|,
where in the inequality we use Hypothesis (B.13) and (B.14) to get that
〈w(t ′) yi,r, ξi〉 ≤ ∑ k∈Bi |w(t ′) yi,r[k]| ·maxk∈Bi |ξi[k]|+ α|〈w(t ′) yi,r,v〉| = Θ̃(1).
Recall from (B.18) that we have |`(t ′) j,i | = Õ ( nλ sσ2p ) , therefore we have if w(t ′) j,r [1] is smaller than some
value in the order of −Θ̃ ( nα sσ2p ) · polylog(d), then
−n∇ w (t) 1,r L(W(t
′))[1] ≥ −Θ̃ ( αn2λ
sσ2p
) + Θ̃ ( nλ · nα sσ2p ) · polylog(d) ≥ Θ̃(nη),
which by Lemma B.2 implies that w(t ′) j,r [1] will increase. Therefore, we can conclude that w (t+1) ∈[ − Õ ( nα sσ2p ) , 0 ) in this case, which verifies Hypothesis (B.14).
Lemma B.6 (Lemma 5.5, restated). If the step size satisfies η = O(d−1/2), then for any t it holds that
L(W(t+1))− L(W(t)) ≤ −η‖∇L(W(t))‖1 + Θ̃(η2d).
Proof. Let ∆Fj,i = Fj(W(t+1),xi)− Fj(W(t),xi). Then regarding the loss function
Li(W) = − log eFyi (W,xi)∑ j e Fj(W,xi)
= −Fyi(W,xi) + log (∑
j
eFj(W,xi) ) .
It is clear that the function Li(W) is 1-smooth with respect to the vector [F−1(W,xi), F1(W,xi)]. Then based on the definition of ∆Fj,i, we have
Li(W (t+1))− Li(W(t)) ≤ ∑ j ∂Li(W (t)) ∂Fj(W(t),xi) ·∆Fj,i + ∑ j (∆Fj,i) 2. (B.20)
Moreover, note that
Fj(W (t),xi) = m∑ r=1 [ σ(〈w(t)j,r, yiv〉) + σ(〈w (t) j,r, ξi〉) ] .
By the results that 〈w(t)j,r,v〉 ≤ Θ̃(1) and 〈w (t) j,r, ξ〉 ≤ Θ̃(1), for any η = O(d−1/2), we have
〈w(t+1)j,r ,v〉 ≤ 〈w (t) j,r,v〉+ η ≤ Θ̃(1), 〈w (t+1) j,r , ξi〉 ≤ 〈w (t) j,r, ξi〉+ Θ̃(ηs 1/2) ≤ Θ̃(1),
which implies that the smoothness parameter of the functions σ(〈w(t)j,r, yiv〉) and σ(〈w (t) j,r, ξi〉) are at most Θ̃(1) for any w in the path between w(t)j,r and w (t+1) j,r . Then we can apply first Taylor expansion on σ(〈w(t)j,r, yiv〉) and σ(〈w (t) j,r, ξi〉) and bound the second-order error as follows,∣∣σ(〈w(t+1)j,r , yiv〉)− σ(〈w(t)j,r, yiv〉)− 〈∇wj,rσ(〈w(t)j,r, yiv〉),w(t+1)j,r −w(t)j,r〉∣∣
≤ Θ̃ ( ‖w(t+1)j,r −w (t) j,r‖ 2 2 ) = Θ̃(η2d), (B.21)
where the last inequality is due to Lemma B.2 that
[w (t+1) j,r −w (t) j,r] 2 = η2 ∥∥∥∥∥ m (t) j,r√ v
(t) j,r
∥∥∥∥∥ 2
2
≤ Θ(η2d).
Similarly, we can also show that∣∣σ(〈w(t+1)j,r , ξi〉)− σ(〈w(t)j,r, ξi〉)− 〈∇wj,rσ(〈w(t)j,r, ξi〉),w(t+1)j,r −w(t)j,r〉∣∣ ≤ Θ(η2d). (B.22) Combining the above bounds on the second-order errors, we have∣∣∆Fj,i − 〈∇WFj(W(t),xi),W(t+1) −W(t)〉∣∣ ≤ Θ̃(mη2d) = Θ̃(η2d), (B.23) where the last equation is due to our assumption that m = Θ̃(1). Besides, by (B.21) and (B.22) the convexity property of the function σ(x), we also have∣∣σ(〈w(t+1)j,r , yiv〉)− σ(〈w(t)j,r, yiv〉)∣∣ ≤ |〈∇wj,rσ(〈w(t)j,r, yiv〉),w(t+1)j,r −w(t)j,r〉|+ Θ̃(η2d)
= Θ̃ ( η|σ′(〈w(t+1)j,r , yiv〉)| · ‖v‖1 ) + Θ̃(η2d)
= Θ̃(η + η2d);∣∣σ(〈w(t+1)j,r , ξi〉)− σ(〈w(t)j,r, ξi〉)∣∣ ≤ |〈∇wj,rσ(〈w(t)j,r, ξi〉),w(t+1)j,r −w(t)j,r〉|+ Θ̃(η2d) = Θ̃ ( η|σ′(〈w(t+1)j,r , ξi〉)| · ‖ξ‖1 ) + Θ̃(η2d)
= Θ̃(ηsσp + η 2d).
These bounds further imply that |∆Fj,i| ≤ Θ̃ ( m · (ηsσp + η2d) ) = Θ̃ ( ηsσp + η 2d ) . (B.24)
Now we can plug (B.23) and (B.24) into (B.20) and get
Li(W (t+1))− Li(W(t)) ≤ ∑ j ∂Li(W (t)) ∂Fj(W(t),xi) ·∆Fj,i + ∑ j (∆Fj,i) 2
≤ ∑ j ∂Li(W (t)) ∂Fj(W(t),xi) · 〈∇WFj(W(t),xi),W(t+1) −W(t)〉
+ Θ̃(η2d) + Θ̃ ( (ηsσp + η 2d)2 )
= 〈∇Li(W(t)),W(t+1) −W(t)〉+ Θ̃(η2d), (B.25)
where in the second inequality we use the fact that Li(W) is 1-Lipschitz with respect to Fj(W,xi) and the last equation is due to our assumption that σp = O(s−1/2) so that Θ̃((ηsσp + η2d)2) = Õ(η2d).
Now we are ready to characterize the behavior on the entire training objective L(W) = n−1 ∑n i=1 Li(W)+λ‖W‖2F . Note that λ‖W‖2F is 2λ-smoothness, where λ = o(1). Then applying (B.25) for all i ∈ [n] gives
L(W(t+1))− L(W(t)) = 1 n n∑ i=1 [ Li(W (t+1))− Li(W(t)) ] + λ ( ‖W(t+1)‖2F − ‖W(t)‖2F ) ≤ 〈∇L(W(t)),W(t+1) −W(t)〉+ Θ̃(η2d),
where the second equation uses the fact that ‖W(t+1) −W(t)‖2F = Θ̃(η2d). Recall that we have
w (t+1) j,r −w (t) j,r = −η · m (t) j,r√ v
(t) j,r
.
Then by Lemma B.2, we know that m(t)j,r[k]/ √ v (t) j,r[k] is close to sign gradient if ∇L(w(t))[k] is large. Then we have〈 ∇wj,rL(W(t)),
m (t) j,r√ v
(t) j,r
〉 ≥ Θ (∥∥∇wj,rL(W(t))∥∥1)− Θ̃(d · η)− Θ̃(ns · ηsσp)
≥ Θ (∥∥∇wj,rL(W(t))∥∥1)− Θ̃(dη),
where the second and last terms on the R.H.S. of the first inequality are contributed by the small gradient coordinates k /∈ ∪ni=1Bi and k ∈ ∪ni=1Bi respectively, and the last inequality is by the fact that ns2σp = O(d). Therefore, based on this fact (B.25) further leads to
L(W(t+1))− L(W(t)) ≤ −η‖∇L(W(t))‖1 + Θ̃(η2d),
which completes the proof.
Lemma B.7 (Generalization Performance of Adam). Let
W∗ = argmin W∈{W(1),...,W(T )} ‖∇L(W)‖1.
Then for all training data, we have
1
n n∑ i=1 1 [ Fyi(W ∗,xi) ≤ F−yi(W∗,xi) ] = 0.
Moreover, in terms of the test data (x, y) ∼ D, we have
P(x,y)∼D [ Fy(W ∗,x) ≤ F−y(W∗,x) ] ≥ 1
2 .
Proof. By Lemma B.6, we know that the algorithm will converge to a point with very small gradient (up to O(ηd) in `1 norm). Then in terms of a noise vector ξi, we have∑
k∈Bi ∣∣∇wyi,rL(W∗)[k]∣∣ ≤ O(ηd). (B.26) Note that
n∇wyi,rL(W ∗)[k] = `∗yi,iσ ′(〈w∗yi,r, ξi〉)ξi[k]− nλw ∗ yi,r[k],
where `∗yi,i = 1− logityi(F ∗,xi). Then by triangle inequality and (B.26), we have for any r ∈ [m],∣∣∣∣ ∑
k∈Bi
|`∗yi,i|σ ′(〈w∗yi,r, ξi〉)|ξi[k]| − nλ ∑ k∈Bi |w∗yi,r[k]| ∣∣∣∣ ≤ n∑ k∈Bi ∣∣∇wyi,rL(W∗)[k]∣∣ ≤ O(nηd). Then by Lemma B.5, let r∗ = arg maxr∈[m]〈w∗yi,r, ξi〉, we have 〈wyi,r∗ , ξi〉 = Θ̃(1) and∑ k∈Bi |w ∗ yi,r∗ [k]| · |ξi[k]| = Θ̃(1). Note that |ξi[k]| = Õ(σp), we have ∑ k∈Bi |w ∗ yi,r∗ [k]| ≥ Θ̃(1/σp). Then according to the inequality above, it holds that
|`∗yi,i| · Θ̃(sσp) ≥ Θ̃ ( nλ ∑ k∈Bi |w∗yi,r[k]| − nηd ) ≥ Θ̃ ( nλ σp ) ,
where the second inequality is due to our choice of η. This further implies that |`∗yi,i| = |` ∗ −yi,i| = Θ̃ ( nλ sσ2p ) by combining the above results with (B.18). Then let us move to the gradient with respect to the first coordinate. In particular, since ‖∇L(W∗)‖1 ≤ O(ηd), we have
|n∇wj,rL(W∗)[1]| = ∣∣∣∣ n∑ i=1 yi` ∗ j,iσ ′(〈w∗j,r, yiv〉)− α n∑ i=1 yi` ∗ j,iσ ′(〈w∗j,r, ξi〉)− nλw∗j,r[1] ∣∣∣∣ ≤ O(nηd). (B.27)
Then note that sgn(yi`∗j,i) = sgn(j), it is clear that w ∗ j,r∗ [1] · j ≤ 0 since otherwise
|n∇wj,r∗L(W ∗)[1]| ≥ ∣∣∣∣α n∑ i=1 yi` ∗ j,i [ σ′(〈w∗j,r∗ , ξi〉)− σ′(〈w∗j,r∗ , yiv〉) ]∣∣∣∣ ≥ Θ̃(αn2λsσ2p ) ≥ Ω̃(nηd),
which contradicts (B.27). Therefore, using the fact that w∗j,r∗ [1] · j ≤ 0, we have
|n∇wj,r∗L(W ∗)[1]| = ∣∣∣∣α n∑ i:yi=j yi` ∗ j,iσ ′(〈w∗j,r∗ , ξi〉)− n∑ i:yi=−j yi` ∗ j,iσ ′(|w∗j,r∗ [1]|) ] − nλ|w∗j,r∗ [1]| ∣∣∣∣. Then applying (B.27)and using the fact that |`∗yi,i| = |` ∗ −yi,i| = Θ̃ ( nλ sσ2p ) for all i ∈ [n], it is clear that
|w∗j,r∗ [1]| ≥ Θ̃ ( α1/(q−1) ∧ nα
sσ2p
) ≥ Θ̃ ( nα
sσ2p
) ,
where the second equality is due to our choice of σp and α. Then combining with Lemma B.5 and the fact that w∗j,r∗ [1] · j < 0, we have
w∗j,r∗ [1] · j ≤ −Θ̃ ( nα
sσ2p
) .
Now we are ready to evaluate the training error and test error. In terms of training error, it is clear that by Lemma B.5, we have 〈w∗yi,r∗ , ξi〉 ≥ Θ̃(1), 〈w ∗ yi,r, ξi〉 ≥ −o(1), and |〈w ∗ yi,r,v〉| = o(1), |〈w∗−yi,r, ξi〉| = o(1). Then we have for any training data (xi, yi),
Fyi(W ∗,xi) = m∑ r=1 [ σ(〈w∗yi,r, yiv〉) + σ(〈w ∗ yi,r, ξi〉) ] = Θ̃(1),
F−yi(W ∗,xi) = m∑ r=1 [ σ(〈w∗−yi,r,−yiv〉) + σ(〈w ∗ −yi,r, ξi〉) ] = o(1),
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 = [yv, ξ], which is generated according to Definition 3.1. Note that for each neural, its weight w∗j,r can be decomposed into two parts: the first 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] ≤ −Θ̃ ( nα/(sσ2p) ) and sgn(j) ·w∗j,r[1] ≤ Θ̃(λ−1η) for r 6= r∗. Therefore, using
the fact that Θ̃ ( nα/(sσ2p) ) = ω(λ−1η) and Lemma B.5, given the test data (x, y), we have
Fy(W ∗,x) = m∑ r=1 [ σ(〈w∗y,r, yv〉) + σ(〈w∗y,r, ξ〉) ] ≤
m∑ r=1 Θ̃ ([ α · nα sσ2p + ζy,r ]q + ) ,
F−y(W ∗,x)) = m∑ r=1 [ σ(〈w∗−y,r, yv〉) + σ(〈w∗−y,r, ξ〉) ] ≥ Θ̃ [ |w∗−y,r∗ [1]|q + [ζ−y,r∗ ] q +
] ≥ Θ ([ nα
sσ2p ]q + + [ζ−y,r∗ ] q + ) ,
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σ2p) nα/(sσ2p). Therefore, if the random noise ζy,r and ζ−y,r are dominated by the feature noise term 〈w∗−y,r∗ , yv〉, we can directly get that Fy(W
∗,x) ≤ F−y(W∗,x)) (recall that m = Θ̃(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 classification. 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 Fy(W∗,x) ≤ F−y(W∗,x), which implies that the output of Adam achieves 1/2 test error.
B.3 PROOF FOR GRADIENT DESCENT
Recall the feature learning and noise memorization of gradient descent can be formulated by
〈w(t+1)j,r , j · v〉 = (1− ηλ) · 〈w (t) j,r, j · v〉
+ η
n · j · ( n∑ i=1 yi` (t) j,iσ ′(〈w(t)j,r, yiv〉)− α n∑ i=1 yi` (t) j,iσ ′(〈w(t)j,r, ξi〉) ) ,
〈w(t+1)yi,r , ξi〉 = (1− ηλ) · 〈w (t) yi,r, ξi〉+
η n · ∑ k∈Bi ` (t) yi,i σ′(〈w(t)yi,r, ξi〉) · ξi[k] 2
+ ηα n · ( α n∑ s=1 `(t)yi,sσ ′(〈w(t)yi,r, ξs〉)− n∑ s=1 ys` (t) yi,sσ ′(〈w(t)yi,r, ysv〉) ) . (B.28)
Then similar to the analysis for Adam, we decompose the gradient descent process into multiple stages and characterize the algorithmic behaviors separately. The following lemma characterizes the first training stage, i.e., the stage where all outputs Fj(W(t),xi) remain in the constant level for all j and i. Lemma B.8. [Lemma 5.6, restated] Suppose the training data is generated according to Definition 3.1, assume λ = o(σq−20 σp/n). Let Λ (t) j = maxr∈[m]〈w (t+1) j,r , j · v〉, Γ (t) j,i = maxr∈[m]〈w (t) j,r, ξi〉, and Γ(t)j = maxi:yi=j Γ (t) j,i . Then let Tj be the iteration number that Λ (t) j reaches Θ(1/m), we have
Tj = Θ̃(σ 2−q 0 /η) for all j ∈ {−1, 1}.
Moreover, let T0 = maxj{Tj}, then for all t ≤ T0 it holds that Γ(t)j = Õ(σ0) for all j ∈ {−1, 1}.
We first provide the following useful lemma. Lemma B.9. Let {xt, yt}t=1,... be two positive sequences that satisfy
xt+1 ≥ xt + η ·Axq−1t , yt+1 ≤ yt + η ·Byq−1t ,
for some A = Θ(1) and B = o(1). Then for any q ≥ 3 and suppose y0 = O(x0) and η < O(x0), we have for every C ∈ [x0, O(1)], let Tx be the first iteration such that xt ≥ C, then we have Txη = Θ(x 2−q 0 ) and
yTx ≤ O(x0).
Proof. By Claim C.20 in Allen-Zhu & Li (2020c), we have Txη = Θ(x 2−q 0 ). Then we will show
yt ≤ 2x0
for all t ≤ Tx. In particular, let Txη = C ′x2−q0 for some absolute constantC ′ and assumeC ′B2q−1 < 1 (this is true since B = o(1)), we first made the following induction hypothesis on yt for all t ≤ Ta,
yt ≤ y0 + tηB′(2x0)q−1.
Note that for any t ≤ T0, this hypothesis clearly implies that
yt ≤ y0 + TxηB′2q−1xq−10 ≤ x0 + CB2q−1x 2−q 0 · x q−1 0 ≤ 2x0.
Then we are able to verify the hypothesis at time t+ 1 based on the recursive upper bound of yt, i.e.,
yt+1 ≤ yt + η ·Byq−1t ≤ y0 + tηB(2x0)q−1 + η ·Byq−1t ≤ y0 + (t+ 1)ηB(2x0)q−1.
Therefore, we can conclude that yt ≤ 2x0 for all t ≤ Tx. This completes the proof.
Now we are ready to complete the proof of Lemma B.8.
Proof of Lemma B.8. Note that at the initialization, we have |〈w(0)j,r ,v〉| = Θ̃(σ0) and |〈w (0) j,r , ξi〉| = Θ̃(s1/2σpσ0). Then it can be shown that
Fj(W (0),xi) = m∑ r=1 [ σ(〈w(0)j,r , yiv〉) + σ(〈w (0) j,r , ξi〉) ] = o(1)
for all j ∈ {−1, 1}. Then we have
|`(0)j,i | = eFj(W (0),xi)∑ j e Fj(W(0),xi) = Θ(1).
Then we will consider the training period where |`(t)j,i | for all j, i, and t. Besides, note that sgn(yi` (t) j,i ) = j. Therefore, let r ∗ = arg maxr〈w(t−1)j,r , j · v〉, (B.28) implies that
Λ (t) j ≥ 〈w (t−1) j,r∗ , j · v〉
= (1− ηλ) · 〈w(t−1)j,r∗ , j · v〉
+ η n · ( n∑ i=1 |`(t−1)j,i |σ ′(〈w(t−1)j,r∗ , yiv〉)− α n∑ i=1 |`(t−1)j,i |σ ′(〈w(t−1)j,r∗ , ξi〉) ) ≥ (1− ηλ) · 〈w(t−1)j,r∗ , j · v〉+ Θ(η) · [ σ′(〈w(t−1)j,r∗ , j · v〉)− ασ ′(Γ (t−1) j )
] ≥ (1− ηλ)Λ(t−1)j + η ·Θ ( (Λ (t−1) j )
q−1)− η ·Θ(α(Γ(t−1)j )q−1). (B.29) Similarly, let r∗ = arg maxr〈w(t)yi,r, ξi〉, we also have the following according to (B.28)
Γ (t) yi,i = 〈w(t)yi,r∗ , ξi〉 ≤ (1− ηλ)〈w (t−1) yi,r∗ , ξi〉+ Θ̃ ( ηsσ2p n ) · σ′(〈w(t−1)yi,r∗ , ξi〉)
+ Θ
( ηα2
n ) · n∑ s=1 σ′(〈w(t−1)yi,r∗ , ξs〉)
≤ Γ(t−1)yi,i + Θ̃
( ηsσ2p ( Γ (t−1) yi,i )q−1 n ) + Θ ( ηα2 n · n∑ s=1 ( Γ(t−1)yi,s )q−1) .
Then by our definition of Γ(t)j = maxi∈[n] Γ (t) j,i , we further get the following for all j ∈ {−1, 1},
Γ (t) j ≤ Γ (t−1) j + Θ̃
( ηsσ2p + nηα 2
n · ( Γ (t−1) j )q−1) = Γ (t−1) j + Θ ( ηsσ2p n · ( Γ (t−1) j )q−1) ,
(B.30)
where the last equation is by our assumption that α = Õ(sσ2p/n).
Then we will prove the main argument for general t, which is based on the following two induction hypothesis
Λ (t) j ≥ Λ (t−1) j + η ·Θ
( (Λ
(t−1) j ) q−1), (B.31) Γ
(t) j ≤ Γ (t−1) j + Θ ( ηsσ2p n · ( Γ (t−1) j )q−1) . (B.32)
Note that when t = 0, we have already verified this two hypothesis in (B.29) and (B.30), where we use the fact that λ = o(σq−20 σp/n) ≤ ( Λ (0) j )q−2 and α = o(1). Then at time t, based on Hypothesis (B.31) and (B.32) 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 ≤(
Γ (t) j )q−1 , which has been verified at time t = 0, since Γ(t)j keeps increasing. Therefore, (B.29)
implies
Λ (t+1) j ≥ (1− ηλ)Λ (t) j + η ·Θ
( (Λ
(t) j ) q−1)− η ·Θ(α(Γ(t)j )q−1)
≥ Λ(t)j + η ·Θ ( (Λ (t) j ) q−1), which verifies Hypothesis (B.31) at t+ 1. Additionally, (B.30) implies
Γ (t+1) j ≤ Γ (t) j + Θ ( ηsσ2p n · ( Γ (t) j )q−1) ,
which verifies Hypothesis (B.32) at t + 1. Then by Lemma B.9, we have that Λ(t)j = Õ(1) for all t ≤ T0 = Θ̃ ( (Λ (0) j ) 2−q/η ) = Θ̃(σ2−q0 /η). Moreover, Lemma B.9 also shows that Γ (t+1) j = O(Λ (0) j ) = Õ(σ0). This completes the proof.
Lemma B.10 (Off-diagonal correlations). For any data (xi, yi) and for any t ≤ T−yi , it holds that 〈w(t)−yi,r, ξi〉 ≤ Θ̃(α).
Proof. By the update form of GD, we have for any k ∈ Bi,
w (t+1) −yi,r[k] · ξi[k] = (1− ηλ) ·w (t) −yi,r[k] · ξi[k] +
η n · ∑ k∈Bi ` (t) −yi,iσ ′(〈w(t)−yi,r, ξi〉) · ξi[k] 2,
which keeps decreasing. Therefore, for all r and i, we have
〈w(t)−yi,r, ξi〉 ≤ |w (t) −yi,r[1] · ξi[1]|+ ∣∣∣∣ ∑ k∈Bi w (0) −yi,r[k]ξi[k] ∣∣∣∣ ≤ Θ̃(α) + Θ̃(σ0σps1/2) = Θ̃(α),
where the second inequality follows from the fact that |〈w(t)j,r,v〉| ≤ Θ̃(1) for all t ≤ Tj . This completes the proof.
Note that for different j, the iteration numbers when Λ(t)j reaches Θ̃(1/m) are different. Without loss of generality, we can assume T1 ≤ T−1. Lemma B.8 has provided a clear understanding about how Λ(t)j varies within the iteration range [0, Tj ]. However, it remains unclear how Γ (t) 1 varies within the iteration range [T1, T−1] since in this period we no longer have |`(t)j,i | = Θ(1) and the effect of gradient descent on the feature learning (i.e., increase of 〈wj,r, j · v〉) becomes weaker. In the following lemma we give a characterization of Λ(t)1 for every t ∈ [T1, T−1]. Lemma B.11 (Stage I of GD: part II). Without loss of generality assuming T1 < T−1. Then it holds that Λ(t)1 = Θ̃(1) for all t ∈ [T1, T−1].
Proof. Recall from (B.29) that we have the following general lower bound for the increase of Λ(t)j
Λ (t+1) j ≥ (1− ηλ) · 〈w (t) j,r∗ , j · v〉+
η n · ( n∑ i=1 |`(t)j,i |σ ′(〈w(t)j,r∗ , yiv〉)− α n∑ i=1 |`(t)j,i |σ ′(〈w(t)j,r∗ , ξi〉) ) ≥ (1− ηλ)Λ(t)j + Θ ( η
n ) · ∑ i:yi=j |`(t)j,i | · ( Λ (t) j )q−1 −Θ(αη) · (Γ(t)j ∨ Θ̃(α))q−1, (B.33) where the last inequality is by Lemma B.10. Note that by Lemma B.8, we have Γ(t)j = Õ(σ0) for all t ≤ T−1 and . Then the above inequality leads to
Λ (t+1) j ≥ (1− ηλ)Λ (t) j + Θ
( η
n ) · ∑ i:yi=j |`(t)j,i | · ( Λ (t) j )q−1 −Θ(αqη), (B.34) where we use the fact that α = ω(σ0). The the remaining proof consists of two parts: (1) proving Λ
(t) j ≥ Θ(1/m) = Θ̃(1) and (2) Λ (t) j ≤ Θ(log(1/λ)).
Without loss of generality we consider j = 1. Regarding the first part, we first note that Lemma B.8 implies that Λ(T1)1 ≥ Θ(1/m). Then we consider the case when Λ (t) 1 ≤ Θ(log(1/α)/m), it holds that for all yi = 1,
` (t) 1,i =
eF−1(W (t),xi)∑
j∈{−1,1} e Fj(W(t),xi)
= exp ( Θ ( m∑ r=1 [ σ(〈w(t)−1,r, yiv〉) + σ(〈w (t) −1,r, ξi〉) ] − m∑ r=1 [ σ(〈w(t)1,r, yiv〉) + σ(〈w (t) 1,r, ξi〉) ])) ≥ exp ( −Θ(mΛ(t)1 )
) ≥ exp(−Θ(log(1/α))) = Θ̃(α).
Then (B.34) implies that if Γ(t)1 ≤ Θ(log(1/σ0)/m), we have
Λ (t+1) 1 ≥ (1− ηλ)Λ (t) 1 + Θ(ηα) · Λ (t) 1 −Θ(αqη) ≥ Λ (t) 1 + Θ(ηα) · Λ (t) 1 ≥ Λ (t) 1 ,
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 first part. For the second part, (B.28) implies that
Λ (t+1) 1 ≤ (1− ηλ)Λ (t) 1 + Θ
( η
n ) · ∑ i:yi=1 |`(t)1,i| · ( Λ (t) 1 )q−1 . (B.35)
Consider the case when Γ(t)1 ≥ Θ(log(d)), then for all yi = 1,
` (t) 1,i =
eF−1(W (t),xi)∑
j∈{−1,1} e Fj(W(t),xi)
= exp ( Θ ( m∑ r=1 [ σ(〈w(t)−1,r, yiv〉) + σ(〈w (t) −1,r, ξi〉) ] − m∑ r=1 [ σ(〈w(t)1,r, yiv〉) + σ(〈w (t) 1,r, ξi〉) ])) ≤ exp ( −Θ(Λ(t)1 )
) ≤ exp(−Θ(log(1/λ)) = Θ̃(poly(λ)).
Then (B.35) further implies that
Λ (t+1) 1 ≤ (1− ηλ)Λ (t) 1 + Θ
( η
poly(d)
) · ( Λ
(t) 1 )q−1 ≤ Λ(t)1 −Θ ( ηΛ (t) 1 ) · ( λ− poly(λ) · ( Λ (t) 1
)q−2) ≤ Λ(t)1 , 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 B.12 (Lemma 5.7, restated). If η ≤ O(σ0), it holds that Λ(t)j = Θ̃(1) and Γ (t) j = Õ(σ0) for all t ∈ [T−1, T ].
Proof. We will prove the desired argument based on the following three induction hypothesis:
Λ (t+1) j ≥ (1− λη)Λ (t) j + Θ̃
( η
n ) ∑ i:yi=j |`(t)j,i | − Θ̃(α qη) · 1 n n∑ i=1 |`(t)j,r|, (B.36)
Γ (t) j = Õ(σ0), (B.37)
Λ (t) j = Θ̃(1). (B.38)
In terms of Hypothesis (B.36), we can apply Hypothesis (B.37) and (B.38) to (B.33) and get that
Λ (t+1) j ≥ (1− ηλ)Λ (t) j + Θ
( η
n ) · ∑ i:yi=j |`(t)j,i | · ( Λ (t) j )q−1 −Θ(αη) · (Γ(t)j ∨ Θ̃(α))q−1 · 1n n∑ i=1 |`(t)j,r|
≥ (1− λη)Λ(t)j + Θ̃ ( η
n ) ∑ i:yi=j |`(t)j,i | − Θ̃(α qη) · 1 n n∑ i=1 |`(t)j,r|.
where the last inequality we use the fact that α ≥ σ0. This verifies Hypothesis (B.36). In order to verify Hypothesis (B.37), we have the following according to (B.36),∑
j∈{−1,1}
Λ (t+1) j ≥ (1− λη) ∑ j∈{−1,1}
[ Λ
(t) j + Θ̃
( η
n ) n∑ i=1 |`(t)j,i | − Θ̃(α qη) · 1 n n∑ i=1 |`(t)j,r| ]
= (1− λη) ∑
j∈{−1,1}
[ Λ
(t) j + Θ̃
( η
n ) n∑ i=1 |`(t)j,i | ] ,
where the last equality holds since α = o(1). Recursively applying the above inequality from T−1 to t gives
∑ j∈{−1,1} Λ (t) j ≥ (1− λη) t−T−1 ∑ j∈{−1,1}
[ Λ
(T−1) j + Θ̃
( η
n ) · t−T−1−1∑ τ=0 (1− λη)τ n∑ i=1 |`(t−1−τ)j,i | ] .
Then by Hypothesis (B.38) we have
Θ̃
( η
n ) · t−T−1−1∑ τ=0 (1− λη)τ n∑ i=1 |`(t−1−τ)j,i | ≤ Θ̃(1).
Now let us look at the rate of memorizing noises. By (B.28) and use the fact that α2 ≤ O(sσ2p/n), we have
Γ (t) j ≤ (1− ηλ)Γ (t−1) j + Θ̃ ( ηsσ2p n ) · ∑ i=1 |`j,i| · ( Γ (t−1) j )q−1 ≤ (1− ηλ)Γ(t−1)j + Θ̃ ( ηsσ2pσ q−1 0
n
) · ∑ i=1 |`j,i|
≤ Γ(T−1)j + Θ̃ ( ηsσ2pσ q−1 0
n
) · t−T−1−1∑ τ=0 (1− λη)τ n∑ i=1 |`(t−1−τ)j,i |
≤ Θ̃ ( σ0 + sσ 2 pσ q−1 0 ) ≤ Θ̃(σ0),
which verifies Hypothesis (B.37).
Given Hypothesis (B.36) and (B.37), the verification of (B.38) is straightforward by applying the same proof technique of Lemma B.11 and thus we omit it here.
Lemma B.13 (Lemma 5.8, restated). If the step size satisfies, then for any t ≥ T−1 it holds that
L(W(t+1))− L(W(t)) ≤ −η 2 ‖∇L(W(t))‖2F .
Proof. The proof of this lemma is similar to that of Lemma B.6, which is basically relying the smoothness property of the loss function L(W) given certain constraints on the inner products 〈wj,r,v〉 and 〈wj,r, ξi〉.
Let ∆Fj,i = Fj(W(t+1),xi)−Fj(W(t),xi), we can get the following Taylor expansion on the loss function Li(W(t+1)),
Li(W (t+1))− Li(W(t)) ≤ ∑ j ∂Li(W (t)) ∂Fj(W(t),xi) ·∆Fj,i + ∑ j (∆Fj,i) 2. (B.39)
In particular, by Lemma B.12, we know that 〈w(t)j,r, yiv〉 ≤ Θ̃(1) and 〈w (t) j,r, ξi〉 ≤ Θ̃(σ0) ≤ Θ̃(1). Then similar to (B.21), we can apply first-order Taylor expansion to Fj(W(t+1),xi), which requires to characterize the second-order error of the Taylor expansions on σ(〈w(t+1)j,r , yiv〉) and σ(〈w(t+1)j,r , ξi〉),∣∣σ(〈w(t+1)j,r , yiv〉)− σ(〈w(t)j,r, yiv〉)− 〈∇wj,rσ(〈w(t)j,r, yiv〉),w(t+1)j,r −w(t)j,r〉∣∣
≤ Θ̃ ( ‖w(t+1)j,r −w (t) j,r‖ 2 2 ) = Θ̃(η2‖∇wj,rL(W(t))‖22),∣∣σ(〈w(t+1)j,r , ξi〉)− σ(〈w(t)j,r, ξi〉)− 〈∇wj,rσ(〈w(t)j,r, ξi〉),w(t+1)j,r −w(t)j,r〉∣∣
≤ Θ̃ ( ‖w(t+1)j,r −w (t) j,r‖ 2 2 ) = Θ̃(η2‖∇wj,rL(W(t))‖22). (B.40)
Then combining the above bounds for every r ∈ [m], we can get the following bound for ∆Fj,i∣∣∆Fj,i − 〈∇WFj(W(t),xi),W(t+1) −W(t)〉∣∣ ≤ Θ̃(η2 ∑ r∈[m] ‖∇wj,rL(W(t))‖22 )
= Θ̃ ( η2‖∇L(W(t))‖2F ) . (B.41)
Moreover, since 〈w(t)j,r, yiv〉 ≤ Θ̃(1) and 〈w (t) j,r, ξi〉 ≤ Θ̃(1) and σ(·) is convex, then we have
|σ(〈w(t+1)j,r , yiv〉)− σ(〈w (t) j,r, yiv〉)| ≤ max { |σ′(〈w(t+1)j,r , yiv〉)|, |σ ′(〈w(t)j,r, yiv〉)| } · |〈v,w(t+1)j,r −w (t) j,r〉|
≤ Θ̃ ( ‖w(t+1)j,r −w (t) j,r‖2 ) .
Similarly we also have
|σ(〈w(t+1)j,r , ξi〉)− σ(〈w (t) j,r, ξi〉)| ≤ Θ̃ ( ‖w(t+1)j,r −w (t) j,r‖2 ) .
Combining the above inequalities for every r ∈ [m], we have∣∣∆Fj,i∣∣2 ≤ Θ̃([ ∑ r∈[m] ‖w(t+1)j,r −w (t) j,r‖2 ]2) ≤ Θ̃ ( mη2‖∇L(W(t))‖2F ) = Θ̃ ( η2‖∇L(W(t))‖2F ) .
(B.42)
Now we can plug (B.41) and (B.42) into (B.39), which gives
Li(W (t+1))− Li(W(t)) ≤ ∑ j ∂Li(W (t)) ∂Fj(W(t),xi) ·∆Fj,i + ∑ j (∆Fj,i) 2
= 〈∇Li(W(t)),W(t+1) −W(t)〉+ Θ̃(η2‖∇L(W(t))‖2F ). (B.43)
Taking sum over i ∈ [n] and applying the smoothness property of the regularization function λ‖W‖2F , we can get
L(W(t+1))− L(W(t)) = 1 n n∑ i=1 [ Li(W (t+1))− Li(W(t)) ] + λ ( ‖W(t+1)‖2F − ‖W(t)‖2F ) ≤ 〈∇L(W(t)),W(t+1) −W(t)〉+ Θ̃(η2‖∇L(W(t))‖2F ) = − ( η − Θ̃(η2) ) · ‖∇L(W(t))‖2F
≤ −η 2 ‖∇L(W(t))‖2F ,
where the last inequality is due to our choice of step size η = o(1) so that gives η − Θ̃(η2) ≥ η/2. This completes the proof.
Lemma B.14 (Generalization Performance of GD). Let
W∗ = arg min {W(1),...,W(T )} ‖∇L(W(t))‖F .
Then for all training data, we have
1
n n∑ i=1 1 [ Fyi(W ∗,xi) ≤ F−yi(W∗,xi) ] = 0.
Moreover, in terms of the test data (x, y) ∼ D, we have P(x,y)∼D [ Fy(W ∗,x) ≤ F−y(W∗,x) ] = o(1).
Proof. By Lemma B.12 it is clear that all training data can be correctly classified so that the training error is zero. Besides, for test data (x, y) with x = [yv>, ξ>]>, it is clear that with high probability 〈w∗y,r, yv〉 = Θ̃(1) and [〈w∗y,r, ξ〉]+ ≤ Õ(σ0), then
Fy(W ∗,x) = m∑ r=1 [ σ(〈w∗y,r, yv〉) + σ(〈w∗y,r, ξ〉) ] ≥ Ω̃(1).
If j = −y, we have with probability at least 1− 1/poly(n), 〈w∗−y,r, yv〉 ≤ 0 and [w∗−y,r, ξ〉]+ ≤ Õ(α), which leads to
F−y(W ∗,x) = m∑ r=1 [ σ(〈w∗−y,r, yv〉) + σ(〈w∗−y,r, ξ〉) ] ≤ Õ(mαq) = Õ(αq) = o(1).
This implies that GD can also achieve nearly at most 1/poly(n) test error. This completes the proof.

heading: C PROOF OF THEOREM 4.2: CONVEX CASE
text: Theorem C.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 ‖∇L(W∗Adam)‖1 ≤ 1Tη and ‖∇L(W ∗ Adam)‖22 ≤ 1Tη respectively. Moreover, it holds that:
• Training errors are both zero:
1
n n∑ i=1 1 [ sgn ( F (W∗Adam,xi) ) 6= yi ] = 1 n n∑ i=1 1 [ sgn ( F (W∗GD,xi) ) 6= yi ] = 0.
• Test errors are nearly the same: P(x,y)∼D [ sgn ( F (W∗Adam,xi) ) 6= y ] = P(x,y)∼D [ sgn ( F (W∗GD,x) ) 6= y ] ± o(1).
Proof. The proof is straightforward by applying the same proof technique used for Lemmas B.6 and B.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 find a point with sufficiently 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 sufficiently small gradient. This further imply that the points found by Adam and GD must be exactly same and thus GD and Adam must have nearly same training and test performance.
Besides, note that the problem is also sufficiently over-parameterized, thus with proper regularization (feasibly small), we can still guarantee zero training errors.

Review summaries:
This paper propose a non convex optimization problem where the batch version of Adam has worse generalization than GD. Both methods achieve 0 training loss asymptotically but GD has a zero loss on the test set, while Adam has a large loss.  The paper studies a simplified CNN model with only two patches. The two layers are multiplied with the same weight matrix, fed into the activation function and then summed. A cross entropy loss is used for the classification. The activation function must be of the form $\max(0, x^q)$ for $q \geq 3$. Note that the second layer weights are not learnable and fixed to 1.  The dataset is built as follow: the label is y in {-1, 1}. One of the patch is just $x_1 = [y, 0, 0, ...]$. The second patch is $x_2 = [-\alpha y, \text{sparse gaussian noise}]$ ($0 <\alpha < 1$). The sparsity level is so high that no two examples have the same features.  The idea is that Adam will use a much larger effective learning rate for the sparse noise features than SGD, and grow the coordinates quickly. At some point the dot product with the noise in $x_2$ will be larger than the dot product with $x_1$. Because the activation function is of the form $x^q$ with $q \geq3$, this means the gradient from $x_2$ will overtake the one from $x_1$ and the weight for the first dimension will be negative (while a positive weight is the best thing to classify from $x_1$). So Adam will focus on the weaker signal from $x_2$ (remember $\alpha < 1$).  To summarize further, one patch has the right answer, the second path has the right answer (but with opposite sign) + noise. Adam will focus on the second patch which has lower signal, while GD will focus on the first patch and ignore the noise.  The authors provide experimental verification of this fact. 

This paper proposes a new perspective to explain the difference in generalization ability between Adam and SGD. The main contribution of this paper is that it analyzes the behavior of Adam and SGD training on a two-layer network and a very special dataset, and the authors claim that Adam generalizes poorly while SGD generalizes well. The authors also provide analysis for convex functions and some experimental results to validate their claims.

This paper aims to explain why there is a generalization gap between Adam and gradient descent in learning neural networks, even with proper regularization. To this end, the authors construct an artificial dataset in attempt to capture the basic properties of real image datasets that can lead to the generalization gap. Based on this dataset, the authors prove that Adam is more likely to fit noise in data, while GD tends to fit real features. The theoretical results are verified by experiments on the proposed dataset.