Title: DOMAIN-INDEPENDENT DOMINANCE OF ADAPTIVE METHODS Anonymous authors Paper under double-blind review

Abstract: From a simplified analysis of adaptive methods, we derive AvaGrad, a new optimizer which outperforms SGD on vision tasks when its adaptability is properly tuned. We observe that the power of our method is partially explained by a decoupling of learning rate and adaptability, greatly simplifying hyperparameter search. In light of this observation, we demonstrate that, against conventional wisdom, Adam can also outperform SGD on vision tasks, as long as the coupling between its learning rate and adaptability is taken into account. In practice, AvaGrad matches the best results, as measured by generalization accuracy, delivered by any existing optimizer (SGD or adaptive) across image classification (CIFAR, ImageNet) and character-level language modelling (Penn Treebank) tasks. This later observation, alongside of AvaGrad's decoupling of hyperparameters, could make it the preferred optimizer for deep learning, replacing both SGD and Adam.

1. INTRODUCTION:

Deep network architectures are becoming increasingly complex, often containing parameters that can be grouped according to multiple functionalities, such as gating, attention, convolution, and generation. Such parameter groups should arguably be treated differently during training, as their gradient statistics might be highly distinct. Adaptive gradient methods designate parameter-wise learning rates based on gradient histories, treating such parameters groups differently and, in principle, promise to be better suited for training complex neural network architectures.

Nonetheless, advances in neural architectures have not been matched by progress in adaptive gradient descent algorithms. SGD is still prevalent, in spite of the development of seemingly more sophisticated adaptive alternatives, such as RMSProp (Dauphin et al., 2015) and Adam (Kingma & Ba, 2015) . Such adaptive methods have been observed to yield poor generalization compared to SGD in classification tasks (Wilson et al., 2017) , and hence have been mostly adopted for training complex models (Vaswani et al., 2017; Arjovsky et al., 2017) . For relatively simple architectures, such as ResNets (He et al., 2016a) and DenseNets (Huang et al., 2017) , SGD is still the dominant choice.

At a theoretical level, concerns have also emerged about the current crop of adaptive methods. Recently, Reddi et al. (2018) has identified cases, even in the stochastic convex setting, where Adam (Kingma & Ba, 2015) fails to converge. Modifications to Adam that provide convergence guarantees have been formulated, but have shortcomings. AMSGrad (Reddi et al., 2018) requires non-increasing learning rates, while AdamNC (Reddi et al., 2018) and AdaBound (Luo et al., 2019) require that adaptivity be gradually eliminated during training. Moreover, while most of the recently proposed variants do not provide formal guarantees for non-convex problems, the few current convergence rate analyses in the literature (Zaheer et al., 2018; Chen et al., 2019) do not match SGD's. Section 3 fully details the convergence rates of the most popular Adam variants, along with their shortcomings.

Our contribution is marked improvements to adaptive optimizers, from both theoretical and practical perspectives. At the theoretical level, we focus on convergence guarantees, deriving new algorithms:

• Delayed Adam. Inspired by Zaheer et al. (2018) 's analysis of Adam, Section 4 proposes a simple modification for adaptive gradient methods which yields a provable convergence rate of O(1/ √ T ) in the stochastic non-convex setting -the same as SGD. Our modification can be implemented by swapping two lines of code and preserves adaptivity without incurring extra memory costs. To illustrate these results, we present a non-convex problem where Adam fails to converge to a stationary point, while Delayed Adam -Adam with our proposed modification -provably converges with a rate of O(1/ √ T ).

• AvaGrad. Inspecting the convergence rate of Delayed Adam, we show that it would improve with an adaptive global learning rate, which self-regulates based on global statistics of the gradient second moments. Following this insight, Section 5 proposes a new adaptive method, AvaGrad, whose hyperparameters decouple learning rate and adaptability.

Through extensive experiments, Section 6 demonstrates that AvaGrad is not merely a theoretical exercise. AvaGrad performs as well as both SGD and Adam in their respectively favored usage scenarios. Along this experimental journey, we happen to disprove some conventional wisdom, finding adaptive optimizers, including Adam, to be superior to SGD for training CNNs. The caveat is that, excepting AvaGrad, these methods are sensitive to hyperparameter values. AvaGrad is a uniquely attractive adaptive optimizer, yielding near best results over a wide range of hyperparameters.

2. PRELIMINARIES:

2.1 NOTATION

For vectors a = [a 1 , a 2 , . . . ], b = [b 1 , b 2 , . . . ] ∈ R d , we use the following notation: 1 a for element- wise division ( 1 a = [ 1 a1 , 1 a2 , . . . ]), √ a for element-wise square root ( √ a = [ √ a 1 , √ a 2 , . . . ]), a + b for element-wise addition (a + b = [a 1 + b 1 , a 2 + b 2 , . . . ]), a b for element-wise multiplication (a b = [a 1 b 1 , a 2 b 2 , . . . ]).

Moreover, a is used to denote the 2 -norm: other norms will be specified whenever used (e.g., a ∞ ).

For subscripts and vector indexing, we adopt the following convention: the subscript t is used to denote an object related to the t-th iteration of an algorithm (e.g., w t ∈ R d denotes the iterate at time step t); the subscript i is used for indexing:

w i ∈ R denotes the i-th coordinate of w ∈ R d . When used together, t precedes i: w t,i ∈ R denotes the i-th coordinate of w t ∈ R d .

2.2. STOCHASTIC NON-CONVEX OPTIMIZATION:

In the stochastic non-convex setting, we are concerned with the optimization problem:

EQUATION

where D is a probability distribution over a set S of "data points". We also assume that f is M -smooth in w, as is typically done in non-convex optimization:

∀ w, w f (w ) ≤ f (w) + ∇f (w), w -w + M 2 w -w 2 (2)

Methods for stochastic non-convex optimization are evaluated in terms of number of iterations or gradient evaluations required to achieve small loss gradients. This differs from the stochastic convex setting where convergence is measured w.r.t. suboptimality f (w) -min w∈R d f (w). We assume that the algorithm takes a sequence of data points S = (s 1 , . . . , s T ) from which it deterministically computes a sequence of parameter settings w 1 , . . . , w T together with a distribution P over {1, . . . , T }.

We say an algorithm has a convergence rate of O(g(T

)) if E S∼D T t∼P(t|S) ∇f (w t ) 2 ≤ O(g(T ))

where, as defined above,

f (w) = E s∼D [f s (w)].

We also assume that the functions f s have bounded gradients: there exists some G ∞ such that ∇f s (w) ∞ ≤ G ∞ for all s ∈ S and w ∈ R d . Throughout the paper, we also let G 2 denote an upper bound on ∇f s (w) .

3. RELATED WORK:

Here we present a brief overview of optimization methods commonly used for training neural networks, along with their convergence rate guarantees for stochastic smooth non-convex problems.

We consider methods which, at each iteration t, receive or compute a gradient estimate:

g t := ∇f st (w t ), s t ∼ D (3)

and perform an update of the form:

w t+1 = w t -α t • η t m t (4)

where α t ∈ R is the global learning rate, η t ∈ R d are the parameter-wise learning rates, and m t ∈ R d is the update direction, typically defined as:

EQUATION

Non-momentum methods such as SGD, AdaGrad, and RMSProp (Dauphin et al., 2015; Duchi et al., 2011) have m t = g t (i.e., β 1,t = 0), while momentum SGD and Adam (Kingma & Ba, 2015) have β 1,t ∈ (0, 1). Note that while α t can always be absorbed into η t , representing the update in this form will be convenient throughout the paper.

SGD uses the same learning rate for all parameters, i.e., η t = 1. Although SGD is simple and offers no adaptation, it has a convergence rate of O(1/ √ T ) with either constant, increasing, or decreasing learning rates (Ghadimi & Lan, 2013) , and is widely used when training deep networks, especially CNNs (He et al., 2016a; Huang et al., 2017) . At the heart of its convergence proof is the fact that

E st [α t • η t g t ] = α t • ∇f (w t ).

Popular adaptive methods such as RMSProp (Dauphin et al., 2015) , AdaGrad (Duchi et al., 2011), and Adam (Kingma & Ba, 2015) have η t = 1 √ vt+ , where v t ∈ R d is given by:

EQUATION

As v t is an estimate of the second moments of the gradients, the optimizer designates smaller learning rates for parameters with larger uncertainty in their stochastic gradients. However, in this setting η t and s t are no longer independent, hence

E st [α t • η t g t ] = α t • E st [η t ] ∇f (w t ).

This "bias" can cause RMSProp and Adam to present convergence issues, even in the stochastic convex setting (Reddi et al., 2018) .

Recently, Zaheer et al. (2018) showed that, with a constant learning rate, RMSProp and Adam have a convergence rate of O(σ 2 + 1/T ), where σ 2 = sup w∈R d E s∼D ∇f s (w) -∇f (w) 2 , hence their result does not generally guarantee convergence. Chen et al. (2019) showed that AdaGrad and AMSGrad enjoy a convergence rate of O(log T / √ T ) when a decaying learning rate is used. Note that both methods constrain η t in some form, the former with β 2,t = 1 -1/t (adaptability diminishes with t), and the latter explicitly enforces v t ≥ v j for all j < t (η t is point-wise non-increasing). In both cases, the method is less adaptive than Adam, and yet analyses so far have not delivered a convergence rate that matches SGD's.

4. SGD-LIKE CONVERGENCE WITHOUT CONSTRAINED RATES:

Algorithm 1 DELAYED ADAM Input: w 1 ∈ R d , α t , > 0, β 1,t , β 2,t ∈ [0, 1) 1: Set m 0 = 0, v 0 = 0 2: for t = 1 to T do 3: Draw s t ∼ D 4:

Compute g t = ∇f st (w t )

5:

m t = β 1,t m t-1 + (1 -β 1,t )g t 6: η t = 1 √ vt-1+ 7: w t+1 = w t -α t • η t m t 8: v t = β 2,t v t-1 + (1 -β 2,t )g 2 t 9: end for

We first take a step back to note the following: to show that Adam might not converge in the stochastic convex setting, Reddi et al. ( 2018) provide a stochastic linear problem where Adam fails to converge w.r.t. suboptimality. Since non-convex optimization is evaluated w.r.t. norm of the gradients, a different instance is required to characterize Adam's behavior in this setting.

The following result shows that even for a quadratic problem, Adam indeed does not converge to a stationary point: Theorem 1. For any ≥ 0 and constant β 2,t = β 2 ∈ [0, 1), there is a stochastic convex optimization problem for which Adam does not converge to a stationary point.

Proof. The full proof is given in Appendix A. The argument follows closely from Reddi et al. ( 2018), where we explicitly present a stochastic optimization problem:

EQUATION

We show that, for large enough C (as a function of δ, , β 2 ), Adam will move towards w = 1 where ∇f (1) = δ, and that the constraint w ∈ [0, 1] does not make w = 1 a stationary point.

This result, like the one in Reddi et al. ( 2018), relies on the fact that η t and s t are correlated: upon a draw of the rare sample C w 2 2 , the learning rate η t decreases significantly and Adam takes a small step in the correct direction. On the other hand, a sequence of common samples increases η t and Adam moves faster towards w = 1.

Instead of enforcing η t to be point-wise non-increasing in t (Reddi et al., 2018) , which forces the optimizer to take small steps even for a long sequence of common samples, we propose to simply have η t be independent of s t . As an extra motivation for this approach, note that successful proof strategies (Zaheer et al., 2018) to analyzing adaptive methods include the following step:

E st [η t g t ] = E st [(η t-1 + η t -η t-1 ) g t ] = η t-1 ∇f (w t ) + E st [(η t -η t-1 ) g t ] (8) where bounding E st [(η t -η t-1 ) g t ],

seen as a form of bias, is a key part of recent convergence analyses. Replacing η t by η t-1 in the update equation of Adam removes this bias and can be implemented by simply swapping lines of code (updating η after w), yielding a simple convergence analysis without hindering the adaptability of the method in any way. Algorithm 1 provides pseudocode when applying this modification, highlighted in red, to Adam, yielding Delayed Adam. The following Theorem shows that this modification is enough to guarantee a SGD-like convergence rate of O(1/ √ T ) in the stochastic non-convex setting for general adaptive gradient methods. Theorem 2. Consider any optimization method which updates parameters as follows:

w t+1 = w t -α t • η t g t (9

) where g t := ∇f st (w t ), s t ∼ D, and α t , η t are independent of s t .

Assume that f (w:

1 ) -f (w ) ≤ D, f (w) = E s∼D [f s (w)] is M -smooth, and ∇f s (w) ∞ ≤ G ∞ for all s ∈ S, w ∈ R d . Moreover, let Z = T t=1 α t min i η t,i . For α t = γ t 2D T M G 2 ∞ , if p(Z|s t ) = p(Z)

for all s t ∈ S, then:

EQUATION

where P assigns probabilities p(t) ∝ α t • min i η t,i .

Proof. The full proof is given in Appendix B, along with analysis for the case with momentum β 1,t ∈ (0, 1) in Appendix B.1, and in particular β 1,t = β 1 / √ t, which yields a similar rate.

The convergence rate depends on η t and min i η t,i , which are random variables for Adam-like algorithms. However, if there are constants H and L such that 0 < L ≤ η t,i ≤ H < ∞ for all i and t, then a rate of O(1/ √ T ) is guaranteed. This is the case for Delayed Adam, where 1/(G 2 + ) ≤ η t,i ≤ 1/ for all t and i. Theorem 2 also requires that α t and η t are independent of s t , which can be assured to hold by applying a "delay" to their respective computations, if necessary (i.e., replacing η t by η t-1 , as in Delayed Adam).

Additionally, the assumption that p(Z|s t ) = p(Z), meaning that a single sample should not affect the distribution of Z = T t=1 α t min i η t,i , is required since P is conditioned on the samples S (unlike in standard analysis, where Z = T t=1 α t and α t is deterministic), and is expected to hold as T → ∞. Practitioners typically use the last iterate w T or perform early-stopping: in this case, whether the assumption holds or not does not affect the behavior of the algorithm. Nonetheless, we also show in Appendix B.2 a similar rate that does not require this assumption to hold, which also yields a O(1/ √ T ) convergence rate taken that the parameter-wise learning rates are bounded from above and below.

5. AVAGRAD: AN ADAPTIVE METHOD WITH ADAPTIVE VARIANCE:

Algorithm 2 AVAGRAD Input: w 1 ∈ R d , α t , > 0, β 1,t , β 2,t ∈ [0, 1) 1: Set m 0 = 0, v 0 = 0 2: for t = 1 to T do 3: Draw s t ∼ D 4:

Compute g t = ∇f st (w t )

5:

m t = β 1,t m t-1 + (1 -β 1,t )g t 6: η t = 1 √ vt-1+ 7: w t+1 = w t -α t • ηt ηt/ √ d 2 m t 8: v t = β 2,t v t-1 + (1 -β 2,t )g 2 t 9

: end for Now, we consider the implications of Theorem 2 for Delayed Adam, where η t = 1 √ v t-1 + , and hence 1/(G 2 + ) ≤ η t,i ≤ 1/ for all t and i.

For a fixed γ t = γ, chosen a-priori (that is, without knowledge of the realization of {η t } T t=1 ), we can optimize γ to minimize the worst-case rate using η t 2 ≤ d/ 2 and min i η t,i ≥ G 2 + . This yields γ * = O( ), and a convergence rate of O(1/ ), suggesting that, at least in the worst case, should be chosen to be as large as possible, and the learning rate α should scale linearly with (hence, also being large).

What if we allow γ t to vary in each time step? For example, choosing γ t = √ d/ η t yields a convergence rate with a linear dependence on = 1, while for fixed γ we get a dependence on T t=1 1+γ 2 η 2 t T t=1 γηt , which again can be large if η t is either large or small. Lastly, multiplying the learning rate by √ d/ η t removes its dependence on in the worst-case setting, making the two hyperparameters more separable.

1 T T t=1 mini ηt,i ηt -1 ≤ 1 T √ d T t=1 mini ηt,i maxi ηt,i -1 . While using 1/(G 2 + ) ≤ η t,i ≤ 1/

The choice of γ t = √ d/ η t , motivated by the above facts, yields a method which we name AvaGrad -Adaptive VAriance Gradients, presented as pseudo-code in Algorithm 2 with the proposed scaling highlighted in red. We call it an "adaptive variance" method since, if we scale up or down the variance of the gradients, and hence also v t and η t , the convergence guarantee in Theorem 2 does not change, while for a fixed learning rate (as is not uncommonly done in practice, except for discrete decays during training (Zagoruyko & Komodakis, 2016; Merity et al., 2018) ) it can get arbitrarily bad.

6. EXPERIMENTS:



6.1. SYNTHETIC DATA:

To illustrate empirically the implications of Theorem 1 and Theorem 2, we set up a synthetic stochastic optimization problem with the same form as the one used in the proof of Theorem 1:

EQUATION

This function has a stationary point w = 1-0.002 999•0.002 ≈ 1 2 , and it satisfies Theorem 1 for β 1 = 0, β 2 = 0.99, = 10 -8 . We proceed to perform stochastic optimization with Adam, AMSGrad, and Delayed Adam, with constant learning rate α t = 10 -5 . For simplicity, we let P be uniform over (1, . . . , T ), since α t is constant.

Figure 1 shows the progress of We use a validation set of 5,000 images to evaluate the performance of SGD and different adaptive gradient methods: Adam, AMSGrad, AdaBound (Luo et al., 2019) , AdaShift (Zhou et al., 2019) , and our proposed algorithm, AvaGrad. Additionally, we also assess whether performing weight decay as proposed in Loshchilov & Hutter (2019) instead of standard L 2 regularization positively impacts the performance of adaptive methods: we do this by also evaluating AdamW and AvaGradW.

We run each adaptive method with different powers of 10 for , from its default value = 10 -8 up to = 100, which is large enough such that adaptability should be almost completely removed from the algorithm. We also vary the learning rate α of each method with different powers of 10, multiplied by 1 and 5 (e.g., 0.05, 0.1, 0.5, 1.0, . . . ). Figure 2 shows the results for Adam and AvaGrad. Our main findings are twofold:

• The optimal for every adaptive method is considerably larger than the values typically used in practice, ranging from 0.1 (Adam, AMSGrad, AvaGradW) to 10.0 (AvaGrad, AdamW). For Adam and AMSGrad, the optimal learning rate is α = = 0.1, a value 100 times larger than the default. • All adaptive methods, except for AdaBound, outperform SGD in terms of validation performance.

Note that for SGD the optimal learning rate is α = 0.1, matching the value used in work such as He et al. (2016a) ; Zagoruyko & Komodakis (2016) ; Xie et al. (2017) , which presented state-of-the-art results at time of publication.

However, the fact that adaptive methods outperform SGD in this setting is not conclusive, since they are executed with more hyperparameter settings (varying as well as α). Moreover, the main motivation for adaptive methods is to be less sensitive to hyperparameter values; performing an extensive grid search defeats their purpose.

Aiming for a fair comparison between SGD and adaptive methods, we also train a Wide ResNet 28-10 on both CIFAR-10 and CIFAR-100, evaluating the test performance of each adaptive method with its optimal values for α and found in the previous experiment. For SGD, we confirmed that ). We believe these results are surprising, as they show that adaptive methods can yield state-of-the-art performance when training CNNs as long as their adaptability is correctly controlled with .

As a final evaluation of the role of adaptability when training convolutional networks, we repeat the previous experiment on the ImageNet dataset (Russakovsky et al., 2015) , training a ResNet 50 (He et al., 2016b) with SGD and different adaptive methods, transferring the hyperparameters from our original CIFAR-10 results. Training follows Gross & Wilber (2016) : the network is trained for 100 epochs with a batch size of 256, the learning rate is decayed by a factor of 10 at epochs 30, 60 and 90, and a weight decay of 0.0001 is applied. SGD yields 24.01% top-1 validation error, underperforming Adam (23.45%), AMSGrad (23.46%), AvaGrad (23.58%) and AvaGradW (23.49%). Again, note that the hyperparameters used for SGD match the ones in He et al. (2016a) , He et al. (2016b) and Gross & Wilber (2016) : an initial learning rate of 0.1 with a momentum of 0.9. Table 1 summarizes.

Adam AvaGrad:

Figure 3 : Validation bits-per-character (lower is better) of a 3-layer LSTM with 300 hidden units, trained on the Penn Treebank dataset with Adam (left) and AvaGrad (right), for different values of the learning rate α and parameter , where larger yields less adaptability. Best performance is achieved with high adaptability ( < 0.0001).

6.3. LANGUAGE MODELLING WITH RNNS:

It is perhaps not very surprising that to perform optimally in the image classification tasks studied previously, adaptive gradient methods required large values of , and hence were barely adaptive.

Here, we consider a task where state-of-the-art results are typically achieved by adaptive methods with low values for : language modelling with recurrent networks. In particular, we perform character-level language modelling on Penn Treebank dataset (Marcus et al., 1994; Mikolov et al., 2010) with LSTMs, following Merity et al. (2018) . The model is trained for 500 epochs, and the learning rate is decayed by 10 at epochs 300 and 400. A batch size of 128, a BPTT length of 150, and weight decay of 1.2 × 10 -6 are used, along with dropout.

We evaluate the validation performance of SGD, Adam, AMSGrad, AdaShift, AdaBound, AdamW, AvaGrad and AvaGradW with varying learning rate α and adaptability parameter , when training a 3-layer LSTM with 300 hidden units in each layer. Figure 3 shows that, in this task, smaller values for are indeed optimal: Adam, AMSGrad and AvaGrad performed best with = 10 -8 . The optimal learning rates for both Adam and AMSGrad, α = 0.002, agree with the value used in Merity et al. (2018) . Both AvaGrad and AvaGradW performed best with α = 200: the former with = 10 -8 , the latter with = 10 -5 .

Next, we train a 3-layer LSTM with 1000 hidden units per layer (the same model used in Merity et al. (2018) , where it was trained with Adam), choosing values for α, which yielded the best validation performance in the previous experiment. For SGD, we again confirmed that a learning rate of 20 performed best on the validation set. Table 1 (right column) reports all results.

In this setting, AvaGrad and AvaGradW outperform Adam, achieving bit-per-characters of 1.179 and 1.175 compared to 1.182.

6.4. HYPERPARAMETER SEPARABILITY AND DOMAIN-INDEPENDENCE:

One of the main motivations behind AvaGrad is that it removes the dependence between the learning rate α and the adaptability parameter , at least in the worst-case rate of Theorem 2. Observing the heatmaps in Figure 2 and 3, we can see that indeed AvaGrad offers more separability between α and , when compared to Adam. For example, for ≥ 0.0001, it has little to no interaction with the learning rate α, as opposed to Adam where the optimal α increases linearly with . For language modelling on Penn Treebank, the optimal learning rate for AvaGrad was α = 200 for every choice of , while for image classification on CIFAR-10, we had α = 1.0 for all values of except for ∈ {10 -5 , 100}. This suggests that AvaGrad enables a grid search over α and (with quadratic complexity) to be broken into two line searches over α and separately (linear complexity).

7. CONCLUSION:

As neural architectures become more complex, with parameters having highly heterogeneous roles, parameter-wise learning rates are often necessary for training. However, adaptive methods have both theoretical and empirical gaps, with SGD outperforming them in some tasks and having stronger theoretical convergence guarantees. In this paper, we close this gap, by first providing a convergence rate guarantee that matches SGD's, and by showing that, with proper hyperparameter tuning, adaptive methods can dominate in both computer vision and natural language processing tasks. Key to our finding is AvaGrad, our proposed optimizer whose adaptability is decoupled from its learning rate.

Our experimental results show that proper tuning of the learning rate together with the adaptability of the method is necessary to achieve optimal results in different domains, where distinct neural network architectures are used across tasks. By enabling this tuning to be performed in linear time, AvaGrad takes a leap towards efficient domain-agnostic training of general neural architectures.

EQUATION

where C > 1-p p > 1 + w1 1-β2 . Note that ∇f (w) = pCw -(1 -p), and f is minimized at w = 1-p Cp = C-δ C(1+δ) . The proof follows closely from Reddi's linear example for convergence in suboptimality. We assume w.l.o.g. that β 1 = 0. Consider:

EQUATION

where the expectation is over all the randomness in the algorithm up to time t, as all expectations to follow in the proof. Note that T 1 = 0 for w t = 0. For w t > 0 we bound T 1 as follows:

T 1 ≥ -Cw t (1 -β 2 )C 2 w 2 t = -1 √ 1 -β 2 (15) Hence, T 1 ≥ min(0, -1 √ 1-β2 ) = -1 √ 1-β2

. As for T 2 , we have, from Jensen's inequality:

EQUATION

and thus:

E [T 2 ] ≥ 1 β 2 (1 + δ)C + 1 -β 2 + (18)

Plugging in the bounds for T 1 and T 2 in Equation 14:

E [∆ t ] η ≥ 1 + δ C + 1 -1 √ 1 -β 2 + 1 - 1 + δ C + 1 1 β 2 (1 + δ)C + -β 2 + (19)

Hence, for large enough C, and C δ, w ≈ 1 1+δ while the above quantity becomes nonnegative, and hence E [w t ] ≥ w 1 . In other words, Adam will, in expectation, drift away from the stationary point, towards w = 1, at which point ∇f (1) 2 = δ. For example, δ = 1 implies that

lim T →∞ 1 T T t=1 E ∇f (w t ) 2 = 1.

To see that w = 1 is not a stationary point due to the feasibility constraints, check that ∇f (1) = 1 > 0: that is, the negative gradient points towards the feasible region.

B PROOF OF THEOREM 2:

Proof. Throughout the proof we use the following notation for clarity:

EQUATION

We start from the fact that f is M -smooth:

EQUATION

and use the update

w t+1 = w t -α t • η t m t : f (w t+1 ) ≤ f (w t ) -α t ∇f (w t ), m t η t + α 2 t M 2 m t η t 2 ≤ f (w t ) -α t ∇f (w t ), m t η t + α 2 t M G 2 ∞ η t 2 2 ≤ f (w t ) -α t β 1,t ∇f (w t ), m t-1 η t -α t (1 -β 1,t ) ∇f (w t ), g t η t + α 2 t M G 2 ∞ η t 2 2 ≤ f (w t ) + α t β 1,t ∇f (w t ) • m t-1 η t -α t (1 -β 1,t ) ∇f (w t ), g t η t + α 2 t M G 2 ∞ η t 2 2 ≤ f (w t ) + α t β 1,t G 2 2 H t -α t (1 -β 1,t ) ∇f (w t ), g t η t + α 2 t M G 2 ∞ η t 2 2 (22)

where in the first step we used the fact that m t η t

2 = d i=1 m 2 t,i η 2 t,i ≤ max j m 2 t,j d i=1 η 2 t,i ≤ G 2 ∞ η t 2

, in the second we used m t = β 1,t m t-1 +(1-β 1,t )g t , in the third we used Cauchy-Schwarz, and in the fourth we used ∇f

(w t ) ≤ G 2 , along with m t-1 η t = d i=1 m 2 t-1,i η 2 t,i ≤ max j η t,j d i=1 m 2 t-1,i ≤ G 2 H t .

Now, taking the expectation over s t , and using the fact that E st [g t ] = ∇f (w t ), and that η t , α t are both independent of s t :

E st [f (w t+1 )] ≤ f (w t ) + α t β 1,t G 2 2 H t -α t (1 -β 1,t ) ∇f (w t ), ∇f (w t ) η t + α 2 t M G 2 ∞ η t 2 2 ≤ f (w t ) + α t β 1,t G 2 2 H t -α t (1 -β 1 ) ∇f (w t ) 2 L t + α 2 t M G 2 ∞ η t 2 2 (23)

where in the second step we used β 1,t ≤ β 1 and ∇f (w t ), ∇f (w t )

η t = d i=1 ∇f (w) 2 i η t,i ≥ min j η t,j d i=1 ∇f (w) 2 i = L t ∇f (w) 2 .

Re-arranging, we get:

EQUATION

Now, defining p(t) = αtLt Z , where Z = T t=1 α t L t , dividing by Z(1 -β 1 ) and summing over t:

T t=1 p(t) ∇f (w t ) 2 ≤ 1 Z(1 -β 1 ) T t=1 f (w t ) -st [f (w t+1 )] + α t β 1,t G 2 2 H t + α 2 t M G 2 ∞ η t 2 2 (25)

Now, taking the conditional expectation over all samples S given Z:

E S T t=1 p(t) ∇f (w t ) 2 Z ≤ 1 Z(1 -β 1 ) T t=1 E S [f (w t )|Z] -E S [E st [f (w t+1 )] |Z] + T t=1 E α t β 1,t G 2 2 H t + α 2 t M G 2 ∞ η t 2 2 Z ≤ 1 Z(1 -β 1 ) T t=1 E S [f (w t )|Z] -E S [f (w t+1 )|Z] + T t=1 E α t β 1,t G 2 2 H t + α 2 t M G 2 ∞ η t 2 2 Z = 1 Z(1 -β 1 ) f (w 1 ) -E S [f (w T +1 )|Z] + T t=1 E α t β 1,t G 2 2 H t + α 2 t M G 2 ∞ η t 2 2 Z (26)

where in the second step we used E S [E st [f (w t+1 )] |Z] = E S [f (w t+1 )] which follows from the assumption that p(Z|s t ) = p(Z), and the third step follows from a telescoping sum, along with the fact that E S [f (w 1 )] = f (w 1 ). Now, using f (w

EQUATION

Then, taking the expectation over Z:

E S T t=1 p(t) ∇f (w t ) 2 ≤ E 1 Z(1 -β 1 ) T t=1 D T + α t β 1,t G 2 2 H t + α 2 t M G 2 ∞ η t 2 2 (28) Now, let α t = γ t 2D T M G 2 ∞ : E S T t=1 p(t) ∇f (w t ) 2 ≤ E S 1 Z(1 -β 1 ) T t=1 D T + γ t β 1,t G 2 2 H t 2D T M G 2 ∞ + D T γ 2 t η t 2 ≤ E D T • Z(1 -β 1 ) T t=1 1 + γ t β 1,t H t 2dT G 2 2 M D + γ 2 t η t 2 (29)

where we used the fact that G 2 ≤ G ∞ √ d.

Under review as a conference paper at ICLR 2020 Now, recall that Z =

EQUATION

Setting β 1,t = β 1 = 0 and checking that T t=1 p(t) ∇f (w t ) 2 = E t∼P(t|S) ∇f (w t ) 2 :

EQUATION

Recalling that L t = min i η t,i proves the claim.

B.1 THE CASE WITH FIRST-ORDER MOMENTUM:

For the case β 1,t > 0, assume that β 1,t = β1 √ t in Equation 30:

E S T t=1 p(t) ∇f (w t ) 2 ≤ 1 (1 -β 1 ) M DG 2 ∞ 2T • E S     T t=1 1 + γ t H t β1 √ t 2dT G 2 2 M D + γ 2 t η t 2 t=1 γ t L t     ≤ 1 (1 -β 1 ) M DG 2 ∞ 2T • E S    β 1 2dT G 2 2 M D (max t γ t H t )

T t=1

EQUATION

where in the last step we used T t=1

1 √ t ≤ 2 √ T .

Similarly to the guarantee in Equation 31, we can show a O(1/ √ T ) convergence rate if we further assume that there exist constants H and L such that 0 < L ≤ η t,i ≤ H < ∞ for all i and t (i.e., the parameter-wise learning rates are bounded away from zero and also from above), and that γ t is bounded similarly. For example, having γ t = γ yields:

E S T t=1 p(t) ∇f (w t ) 2 ≤ 1 (1 -β 1 ) M DG 2 ∞ 2T • E S   2T Hγβ 1 2dG 2 2 M D + T t=1 1 + γ 2 dH 2 t=1 γL   = 1 L(1 -β 1 ) M DG 2 ∞ 2T • γ -1 + 2Hβ 1 2dG 2 2 M D + γdH 2 (33)

where in the first step we used η t 2 ≤ dH 2 , H t ≤ H, and L t ≥ L.

Note that for any constant γ the above is O(1/ √ T ).

we measure validation performance for the small-scale experiments, and test performance for the large-scale ones.

More specifically, we train a 3-layer LSTM (Hochreiter & Schmidhuber, 1997) with an embedding size of 200, and decay the learning rate by a factor of 10 at epochs 300 and 400, while the model is trained for a total of 500 epochs. We use a batch size of 128 and BPTT length of 150. The model regularized with a weight decay of 1.2 × 10 -6 , a weight dropout (Merity et al., 2017) of p = 0.5, and a dropout (Srivastava et al., 2014) of p = 0.1 for the input and output layers and p = 0.25 for the hidden-layer.

:



Figures and Tables:

Figure 2: Validation error of a Wide ResNet 28-4 trained on the CIFAR-10 dataset with Adam (left) and AvaGrad (right), for different values of the learning rate α and parameter , where larger yields less adaptability. Best performance is achieved with small adaptability ( > 0.001).

Adam fails to converge to the stationary point w , while both AMSGrad and Delayed Adam converge. Note that Delayed Adam converges significantly faster, likely because it has no constraint on the learning rates. Plots of Adam, AMSGrad, and Delayed Adam trained on the synthetic example in Equation11, with a stationary point at w ≈ 0.5. Left: The expected iterate sampled uniformly from {w 1 , . . . , w t }, for each iteration t. As predicted by our theoretical results, Adam moves towards w = 1 with ∇f (w) = 1, while Delayed Adam converges to w . Right: The expected norm squared of the gradient, for w randomly sampled from {w 1 , . . . , w t }. Delayed Adam converges significantly faster than AMSGrad, while Adam fails to converge.

Table content: <table><tr><td/><td>1.0</td><td/><td/><td/><td/><td/><td/><td/><td/><td>1.0</td><td/><td/><td/><td/><td/></tr><tr><td/><td>0.8</td><td/><td/><td/><td/><td/><td/><td/><td/><td>0.8</td><td/><td/><td/><td/><td/></tr><tr><td>1 t t t = 1 w t</td><td>0.0 0.2 0.4 0.6</td><td>0</td><td>1</td><td>2</td><td>t</td><td>3</td><td colspan="2">4 AMSGrad w Delayed Adam 1e7 5 Adam</td><td>1 t t t = 1 || f(w t )|| 2</td><td>0.0 0.2 0.4 0.6</td><td>0</td><td>1</td><td>2</td><td>t</td><td>3</td><td>4 AMSGrad Adam Delayed Adam 1e7 5</td></tr><tr><td colspan="2">Figure 1:</td><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/></tr><tr><td/><td/><td/><td/><td/><td/><td/><td>1 t</td><td colspan="2">t t =1 w t and 1 t</td><td colspan="3">t t =1 ∇f (w t )</td><td/><td/><td/></tr></table>



Table content: <table><tr><td>Method</td><td>CIFAR-10 (Test Err %)</td><td>CIFAR-100 (Test Err %)</td><td>ImageNet (Top-1 Val Err %)</td><td>Penn Treebank (Test Bits per Character)</td></tr><tr><td>SGD</td><td colspan="2">3.86 (0.08) 19.05 (0.24)</td><td>24.01</td><td>1.238</td></tr><tr><td>Adam</td><td colspan="2">3.64 (0.06) 18.96 (0.21)</td><td>23.45</td><td>1.182</td></tr><tr><td>AMSGrad</td><td colspan="2">3.90 (0.17) 18.97 (0.09)</td><td>23.46</td><td>1.187</td></tr><tr><td>AdaBound</td><td colspan="2">5.40 (0.24) 22.76 (0.17)</td><td>27.99</td><td>2.863</td></tr><tr><td>AdaShift</td><td colspan="2">4.08 (0.11) 18.88 (0.06)</td><td>N/A</td><td>1.274</td></tr><tr><td>AdamW</td><td colspan="2">4.11 (0.17) 20.13 (0.22)</td><td>27.10</td><td>1.230</td></tr><tr><td>AvaGrad</td><td colspan="2">3.80 (0.02) 18.76 (0.20)</td><td>23.58</td><td>1.179</td></tr><tr><td colspan="3">AvaGradW 3.97 (0.02) 19.04 (0.37)</td><td>23.49</td><td>1.175</td></tr><tr><td colspan="5">the learning rate α = 0.1 still yielded the best validation performance with the new architecture,</td></tr><tr><td colspan="5">hence the fact that we transfer hyperparameters from the Wide ResNet 28-4 runs does not unfairly</td></tr><tr><td colspan="5">advantage adaptive methods in the comparison with SGD. With a larger network and a different task</td></tr><tr><td colspan="5">(CIFAR-100), this experiment should also capture how hyperparameters of adaptive methods transfer</td></tr><tr><td colspan="2">between tasks and models.</td><td/><td/><td/></tr><tr><td colspan="5">On CIFAR-10, SGD achieves 3.86% test error (reported as 4% in Zagoruyko &amp; Komodakis (2016))</td></tr><tr><td colspan="5">and is outperformed by both Adam (3.64%) and AvaGrad (3.80%). On CIFAR-100, SGD (19.05%)</td></tr><tr><td colspan="5">is outperformed by Adam (18.96%), AMSGrad (18.97%), AdaShift (18.88%), AvaGrad (18.76%),</td></tr><tr><td colspan="2">and AvaGradW (19.04%</td><td/><td/><td/></tr></table>

Peer review (iclr2020):
Summary: This paper proposes a new adaptive method, which is called AvaGrad. The authors first show that Adam may not converge to a stationary point for a stochastic convex optimization in Theorem1, which is closely related to [1]. They then show that by simply making to be independent of the sample , Adam is able to converge just like SGD in Theorem2. Theorem2 follows the standard SGD techniques. Next, they propose AVAGRAD, which is based on the idea of getting rid of the effect of . Strength: The experiment results are impressive. They show that Adam can outperform SGD on vision tasks. Recently, people have found out that is a very sensitive hyper-parameter. It is good to see some research directly addresses this problem. Weakness: The word *domain* is confusing. If the Adam-type algorithms are the delayed version in Table 1? It is not compatible with AdamW. The results on the image datasets seem too good to be true. Implementation Issue: ***Many implementation details in the below discussion are different from the paper (e.g. hyperparameters and network architecture). So the following experiment results may not be used for assessment of the quality of the proposed method.*** I tried the proposed Delayed Adam on CIFAR-10 using the codebase in (https://github.com/LiyuanLucasLiu/RAdam/tree/master/cifar_imagenet). The performance seems the same as Adam. Delayed Adam even leads to a *divergence* problem, especially with a large learning rate (0.03). The divergence problem never happens when using Adam and AdamW with the same hyperparameters. Implementation details: 1. Replace the optimizer with the original PyTorch Adam implementation. (https://github.com/pytorch/pytorch/blob/master/torch/optim/adam.py) 2. Swap line 96 and 108 as suggested in the paper. 3. Modified line 89 (bias_correction2=1 - beta2 ** (state[*step*]-1)) 4. Do not run line 97-107 when state[*step*]==1. 5. Run the following code: python cifar.py -a resnet --depth 20 --epochs 164 --schedule 81 122 --gamma 0.1 --wd 1e-4 --optimizer adam --beta1 0.9 --beta2 0.999 --checkpoint ./logdir --gpu-id 0 --model_name adam_003 --lr 0.03 If the authors can provide more implementation details, I would promote my rating. e.g., 1. Are you still using bias correction in the proposed method? If so how do you use them? 2. Do you update the model for the first step? Reference: [1] On the convergence of adam and beyond