On the insufficiency of existing momentum schemes for Stochastic Optimization

Rahul Kidambi, Praneeth Netrapalli, Prateek Jain, Sham M. Kakade

Introduction

First order optimization methods, which access a function to be optimized through its gradient or an unbiased approximation of its gradient, are the workhorses for modern large scale optimization problems, which include training the current state-of-the-art deep neural networks. Gradient descent (Cauchy, 1847) is the simplest first order method that is used heavily in practice. However, it is known that for the class of smooth convex functions as well as some simple non-smooth problems (Nesterov, 2012a)), gradient descent is suboptimal (Nesterov, 2004) and there exists a class of algorithms called fast gradient/momentum based methods which achieve optimal convergence guarantees. The heavy ball method (Polyak, 1964) and Nesterov’s accelerated gradient descent (Nesterov, 1983) are two of the most popular methods in this category.

On the other hand, training deep neural networks on large scale datasets have been possible through the use of Stochastic Gradient Descent (SGD) (Robbins and Monro, 1951), which samples a random subset of training data to compute gradient estimates that are then used to optimize the objective function. The advantages of SGD for large scale optimization and the related issues of tradeoffs between computational and statistical efficiency was highlighted in Bottou and Bousquet (2007).

The above mentioned theoretical advantages of fast gradient methods (Polyak, 1964; Nesterov, 1983) (albeit for smooth convex problems) coupled with cheap to compute stochastic gradient estimates led to the influential work of Sutskever et al. (2013), which demonstrated the empirical advantages possessed by SGD when augmented with the momentum machinery. This work has led to widespread adoption of momentum methods for training deep neural nets; so much so that, in the context of neural network training, gradient descent often refers to momentum methods.

But, there is a subtle difference between classical momentum methods and their implementation in practice – classical momentum methods work in the exact first order oracle model (Nesterov, 2004), i.e., they employ exact gradients (computed on the full training dataset), while in practice (Sutskever et al., 2013), they are implemented with stochastic gradients (estimated from a randomly sampled mini-batch of training data). This leads to a natural question:

“Are momentum methods optimal even in the stochastic first order oracle (SFO) model, where we access stochastic gradients computed on a small constant sized minibatches (or a batchsize of 11?)”

Even disregarding the question of optimality of momentum methods in the SFO model, it is not even known if momentum methods (say, Polyak (1964); Nesterov (1983)) provide any provable improvement over SGD in this model. While these are open questions, a recent effort of Jain et al. (2017) showed that improving upon SGD (in the stochastic first order oracle) is rather subtle as there exists problem instances in SFO model where it is not possible to improve upon SGD, even information theoretically. Jain et al. (2017) studied a variant of Nesterov’s accelerated gradient updates (Nesterov, 2012b) for stochastic linear regression and show that their method improves upon SGD wherever it is information theoretically admissible. Through out this paper, we refer to the algorithm of Jain et al. (2017) as Accelerated Stochastic Gradient Method (ASGD) while we refer to a stochastic version of the most widespread form of Nesterov’s method (Nesterov, 1983) as NAG; HB denotes a stochastic version of the heavy ball method (Polyak, 1964). Critically, while Jain et al. (2017) shows that ASGD improves on SGD in any information-theoretically admissible regime, it is still not known whether HB and NAG can achieve a similar performance gain.

A key contribution of this work is to show that HB does not provide similar performance gains over SGD even when it is informationally-theoretically admissible. That is, we provide a problem instance where it is indeed possible to improve upon SGD (and ASGD achieves this improvement), but HB cannot achieve any improvement over SGD. We validate this claim empirically as well. In fact, we provide empirical evidence to the claim that NAG also do not achieve any improvement over SGD for several problems where ASGD can still achieve better rates of convergence.

This raises a question about why HB and NAG provide better performance than SGD in practice (Sutskever et al., 2013), especially for training deep networks. Our conclusion (that is well supported by our theoretical result) is that HB and NAG’s improved performance is attributed to mini-batching and hence, these methods will often struggle to improve over SGD with small constant batch sizes. This is in stark contrast to methods like ASGD, which is designed to improve over SGD across both small or large mini-batch sizes. In fact, based on our experiments, we observe that on the task of training deep residual networks (He et al., 2016a) on the cifar-10 dataset, we note that ASGD offers noticeable improvements by achieving 57%5-7\% better test error over HB and NAG even with commonly used batch sizes like 128128 during the initial stages of the optimization.

The contributions of this paper are as follows.

In Section 3, we prove that HB is not optimal in the SFO model. In particular, there exist linear regression problems for which the performance of HB (with any step size and momentum) is either the same or worse than that of SGD while ASGD improves upon both of them.

Experiments on several linear regression problems suggest that the suboptimality of HB in the SFO model is not restricted to special cases – it is rather widespread. Empirically, the same holds true for NAG as well (Section 5).

The above observations suggest that the only reason for the superiority of momentum methods in practice is mini-batching, which reduces the variance in stochastic gradients and moves the SFO closer to the exact first order oracle. This conclusion is supported by empirical evidence through training deep residual networks on cifar-10, with a batch size of 88 (see Section 5.3).

We present an intuitive and easier to tune version of ASGD (see Section 4) and show that ASGD can provide significantly faster convergence to a reasonable accuracy than SGD, HB, NAG, while still providing favorable or comparable asymptotic accuracy as these methods, particularly on several deep learning problems.

Hence, the take-home message of this paper is: HB and NAG are not optimal in the SFO model. The only reason for the superiority of momentum methods in practice is mini-batching. ASGD provides a distinct advantage in training deep networks over SGD, HB and NAG.

Notation

Algorithm 1 provides a pseudo-code of HB method (Polyak, 1964). wtwt1w_{t}-w_{t-1} is the momentum term and α\alpha denotes the momentum parameter. Next iterate wt+1w_{t+1} is obtained by a linear combination of the SGD update and the momentum term. Algorithm 2 provides pseudo-code of a stochastic version of the most commonly used form of Nesterov’s accelerated gradient descent (Nesterov, 1983).

Suboptimality of Heavy Ball Method

In this section, we show that there exists linear regression problems where the performance of HB (Algorithm 1) is no better than that of SGD, while ASGD significantly improves upon SGD’s performance. Let us now describe the problem instance.

Let wtSGDw_{t}^{SGD} be the ttht^{\textrm{th}} iterate of SGD on the above problem with starting point w0w_{0} and stepsize 1cσ12\frac{1}{c\sigma_{1}^{2}}. The error of wtSGDw_{t}^{SGD} can be bounded as,

On the other hand, ASGD achieves the following superior rate.

Let wtASGDw_{t}^{ASGD} be the ttht^{\textrm{th}} iterate of ASGD on the above problem with starting point w0w_{0} and appropriate parameters. The error of wtASGDw_{t}^{ASGD} can be bounded as,

Let wtHBw_{t}^{HB} be the ttht^{\textrm{th}} iterate of HB (Algorithm 1) on the above problem with starting point w0w_{0}. For any choice of stepsize δ\delta and momentum α\alpha\in, T\exists T large enough such that tT\forall t\geq T, we have,

where C(κ,δ,α)C(\kappa,\delta,\alpha) depends on κ,δ\kappa,\delta and α\alpha (but not on tt).

Thus, to obtain w^\widehat{w} s.t. w^wϵ\|\widehat{w}-w^{*}\|\leq\epsilon, HB requires Ω(κlog1ϵ)\Omega(\kappa\log\frac{1}{\epsilon}) samples and iterations. On the other hand, ASGD can obtain ϵ\epsilon-approximation to ww^{*} in O(κlogκlog1ϵ)\mathcal{O}(\sqrt{\kappa}\log{\kappa}\log\frac{1}{\epsilon}) iterations. We note that the gains offered by ASGD are meaningful when κ>O(c)\kappa>\mathcal{O}(c) (Jain et al., 2017); otherwise, all the algorithms including SGD achieve nearly the same rates (upto constant factors). While we do not prove it theoretically, we observe empirically that for the same problem instance, NAG also obtains nearly same rate as HB and SGD. We conjecture that a lower bound for NAG can be established using a similar proof technique as that of HB (i.e. Proposition 3). We also believe that the constant in the lower bound described in proposition 3 can be improved to some small number (5\leq 5).

Algorithm

We will now present and explain an intuitive version of ASGD (pseudo code in Algorithm 3). The algorithm takes three inputs: short step δ\delta, long step parameter κ\kappa and statistical advantage parameter ξ\xi. The short step δ\delta is precisely the same as the step size in SGD, HB or NAG. For convex problems, this scales inversely with the smoothness of the function. The long step parameter κ\kappa is intended to give an estimate of the ratio of the largest and smallest curvatures of the function; for convex functions, this is just the condition number. The statistical advantage parameter ξ\xi captures trade off between statistical and computational condition numbers – in the deterministic case, ξ=κ\xi=\sqrt{\kappa} and ASGD is equivalent to NAG, while in the high stochasticity regime, ξ\xi is much smaller. The algorithm maintains two iterates: descent iterate wtw_{t} and a running average wˉt\bar{w}_{t}. The running average is a weighted average of the previous average and a long gradient step from the descent iterate, while the descent iterate is updated as a convex combination of short gradient step from the descent iterate and the running average. The idea is that since the algorithm takes a long step as well as short step and an appropriate average of both of them, it can make progress on different directions at a similar pace. Appendix B shows the equivalence between Algorithm 3 and ASGD as proposed in Jain et al. (2017). Note that the constant 0.70.7 appearing in Algorithm 3 has no special significance. Jain et al. (2017) require it to be smaller than 1/6\sqrt{1/6} but any constant smaller than 11 seems to work in practice.

Experiments

We now present our experimental results exploring performance of SGD, HB, NAG and ASGD. Our experiments are geared towards answering the following questions:

Even for linear regression, is the suboptimality of HB restricted to specific distributions in Section 3 or does it hold for more general distributions as well? Is the same true of NAG?

What is the reason for the superiority of HB and NAG in practice? Is it because momentum methods have better performance that SGD for stochastic gradients or due to mini-batching? Does this superiority hold even for small minibatches?

How does the performance of ASGD compare to that of SGD, HB and NAG, when training deep networks?

Section 5.1 and parts of Section 5.2 address the first two questions. Section 5.2 and 5.3 address Question 2 partially and the last question. We use Matlab to conduct experiments presented in Section 5.1 and use PyTorch (pytorch, 2017) for our deep networks related experiments. Pytorch code implementing the ASGD algorithm can be found at https://github.com/rahulkidambi/AccSGD.

In this section, we will present results on performance of the four optimization methods (SGD, HB, NAG, and ASGD) for linear regression problems. We consider two different class of linear regression problems, both in two dimensions. For a given condition number κ\kappa, we consider the following two distributions:

Discrete: a=e1a=e_{1} w.p. 0.50.5 and a=2κe2a=\frac{2}{\kappa}\cdot e_{2} with 0.50.5; eie_{i} is the ithi^{th} standard basis vector.

Unlike ASGD and SGD, we do not know optimal learning rate and momentum parameters for NAG and HB in the stochastic gradient model. So, we perform a grid search over the values of the learning rate and momentum parameters. In particular, we lay a 10×1010\times 10 grid in ×\times for learning rate and momentum and run NAG and HB. Then, for each grid point, we consider the subset of 100100 trials that converged and computed the final error using these. Finally, the parameters that yield the minimal error are chosen for NAG and HB, and these numbers are reported. We measure convergence performance of a method using:

We compute the rate (1) for all the algorithms with varying condition number κ\kappa. Given a rate vs κ\kappa plot for a method, we compute it’s slope (denoted as γ\gamma) using linear regression. Table 1 presents the estimated slopes (i.e. γ\gamma) for various methods for both the discrete and the Gaussian case. The slope values clearly show that the rate of SGD, HB and NAG have a nearly linear dependence on κ\kappa while that of ASGD seems to scale linearly with κ\sqrt{\kappa}.

2 Deep Autoencoders for MNIST

In this section, we present experimental results on training deep autoencoders for the mnist dataset, and we follow the setup of Hinton and Salakhutdinov (2006). This problem is a standard benchmark for evaluating optimization algorithms e.g., Martens (2010); Sutskever et al. (2013); Martens and Grosse (2015); Reddi et al. (2017). The network architecture follows previous work (Hinton and Salakhutdinov, 2006) and is represented as 7841000500250302505001000784784-1000-500-250-30-250-500-1000-784 with the first and last 784784 nodes representing the input and output respectively. All hidden/output nodes employ sigmoid activations except for the layer with 3030 nodes which employs linear activations and we use MSE loss. We use the initialization scheme of Martens (2010), also employed in Sutskever et al. (2013); Martens and Grosse (2015). We perform training with two minibatch sizes 1-1 and 88. The runs with minibatch size of 11 were run for 3030 epochs while the runs with minibatch size of 88 were run for 5050 epochs. For each of SGD, HB, NAG and ASGD, a grid search over learning rate, momentum and long step parameter (whichever is applicable) was done and best parameters were chosen based on achieving the smallest training error in the same protocol followed by Sutskever et al. (2013). The grid was extended whenever the best parameter fell at the edge of a grid. For the parameters chosen by grid search, we perform 1010 runs with different seeds and averaged the results. The results are presented in Figures 2 and 3. Note that the final loss values reported are suboptimal compared to the published literature e.g., Sutskever et al. (2013); while Sutskever et al. (2013) report results after 750000750000 updates with a large batch size of 200200 (which implies a total of 750000×200=150750000\times 200=150M gradient evaluations), whereas, ours are after 1.81.8M updates of SGD with a batch size 11 (which is just 1.81.8M gradient evaluations).

Effect of minibatch sizes: While HB and NAG decay the loss faster compared to SGD for a minibatch size of 88 (Figure 2), this superior decay rate does not hold for a minibatch size of 11 (Figure 3). This supports our intuitions from the stochastic linear regression setting, where we demonstrate that HB and NAG are suboptimal in the stochastic first order oracle model.

Comparison of ASGD with momentum methods: While ASGD performs slightly better than NAG for batch size 88 in the training error (Figure 2), ASGD decays the error at a faster rate compared to all the three other methods for a batch size of 11 (Figure 3).

3 Deep Residual Networks for CIFAR-10

We will now present experimental results on training deep residual networks (He et al., 2016b) with pre-activation blocks He et al. (2016a) for classifying images in cifar-10 (Krizhevsky and Hinton, 2009); the network we use has 4444 layers (dubbed preresnet-44). The code for this section was downloaded from preresnet (2017). One of the most distinct characteristics of this experiment compared to our previous experiments is learning rate decay. We use a validation set based decay scheme, wherein, after every 33 epochs, we decay the learning rate by a certain factor (which we grid search on) if the validation zero one error does not decrease by at least a certain amount (precise numbers are provided in the appendix since they vary across batch sizes). Due to space constraints, we present only a subset of training error plots. Please see Appendix C.3 for some more plots on training errors.

Effect of minibatch sizes: Our first experiment tries to understand how the performance of HB and NAG compare with that of SGD and how it varies with minibatch sizes. Figure 4 presents the test zero one error for minibatch sizes of 88 and 128128. While training with batch size 88 was done for 4040 epochs, with batch size 128128, it was done for 120120 epochs. We perform a grid search over all parameters for each of these algorithms. See Appendix C.3 for details on the grid search parameters. We observe that final error achieved by SGD, HB and NAG are all very close for both batch sizes. While NAG exhibits a superior rate of convergence compared to SGD and HB for batch size 128128, this superior rate of convergence disappears for a batch size of 88.

Comparison of ASGD with momentum methods: The next experiment tries to understand how ASGD compares with HB and NAG. The errors achieved by various methods when we do grid search over all parameters are presented in Table 2. Note that the final test errors for batch size 128128 are better than those for batch size 88 since the former was run for 120120 epochs while the latter was run only for 4040 epochs (due to time constraints).

While the final error achieved by ASGD is similar/favorable compared to all other methods, we are also interested in understanding whether ASGD has a superior convergence speed. For this experiment, we need to address the issue of differing learning rates used by various algorithms and different iterations where they decay learning rates. So, for each of HB and NAG, we choose the learning rate and decay factors by grid search, use these values for ASGD and do grid search only over long step parameter κ\kappa and momentum α\alpha for ASGD. The results are presented in Figures 5 and 6. For batch size 128128, ASGD decays error at a faster rate compared to both HB and NAG. For batch size 88, while we see a superior convergence of ASGD compared to NAG, we do not see this superiority over HB. The reason for this turns out to be that the learning rate for HB, which we also use for ASGD, turns out to be quite suboptimal for ASGD. So, for batch size 88, we also compare fully optimized (i.e., grid search over learning rate as well) ASGD with HB. The superiority of ASGD over HB is clear from this comparison. These results suggest that ASGD decays error at a faster rate compared to HB and NAG across different batch sizes.

Related Work

First order oracle methods: The primary method in this family is Gradient Descent (GD) (Cauchy, 1847). As mentioned previously, GD is suboptimal for smooth convex optimization (Nesterov, 2004), and this is addressed using momentum methods such as the Heavy Ball method (Polyak, 1964) (for quadratics), and Nesterov’s Accelerated gradient descent (Nesterov, 1983).

Stochastic first order methods and noise stability: The simplest method employing the SFO is SGD (Robbins and Monro, 1951); the effectiveness of SGD has been immense, and its applicability goes well beyond optimizing convex objectives. Accelerating SGD is a tricky proposition given the instability of fast gradient methods in dealing with noise, as evidenced by several negative results which consider statistical (Proakis, 1974; Polyak, 1987; Roy and Shynk, 1990), numerical (Paige, 1971; Greenbaum, 1989) and adversarial errors (d’Aspremont, 2008; Devolder et al., 2014). A result of Jain et al. (2017) developed the first provably accelerated SGD method for linear regression which achieved minimax rates, inspired by a method of Nesterov (2012b). Schemes of Ghadimi and Lan (2012, 2013); Dieuleveut et al. (2016), which indicate acceleration is possible with noisy gradients do not hold in the SFO model satisfied by algorithms that are run in practice (see Jain et al. (2017) for more details).

While HB (Polyak, 1964) and NAG (Nesterov, 1983) are known to be effective in case of exact first order oracle, for the SFO, the theoretical performance of HB and NAG is not well understood.

Understanding Stochastic Heavy Ball: Understanding HB’s performance with inexact gradients has been considered in efforts spanning several decades, in many communities like controls, optimization and signal processing. Polyak (1987) considered HB with noisy gradients and concluded that the improvements offered by HB with inexact gradients vanish unless strong assumptions on the inexactness was considered; an instance of this is when the variance of inexactness decreased as the iterates approach the minimizer. Proakis (1974); Roy and Shynk (1990); Sharma et al. (1998) suggest that the improved non-asymptotic rates offered by stochastic HB arose at the cost of worse asymptotic behavior. We resolve these unquantified improvements on rates as being just constant factors over SGD, in stark contrast to the gains offered by ASGD. Loizou and Richtárik (2017) state their method as Stochastic HB but require stochastic gradients that nearly behave as exact gradients; indeed, their rates match that of the standard HB method (Polyak, 1964). Such rates are not information theoretically possible (see Jain et al. (2017)), especially with a batch size of 11 or even with constant sized minibatches.

Accelerated and Fast Methods for finite-sums: There have been developments pertaining to faster methods for finite-sums (also known as offline stochastic optimization): amongst these are methods such as SDCA (Shalev-Shwartz and Zhang, 2012), SAG (Roux et al., 2012), SVRG (Johnson and Zhang, 2013), SAGA (Defazio et al., 2014), which offer linear convergence rates for strongly convex finite-sums, improving over SGD’s sub-linear rates (Rakhlin et al., 2012). These methods have been improved using accelerated variants (Shalev-Shwartz and Zhang, 2014; Frostig et al., 2015a; Lin et al., 2015; Defazio, 2016; Allen-Zhu, 2016). Note that these methods require storing the entire training set in memory and taking multiple passes over the same for guaranteed progress. Furthermore, these methods require computing a batch gradient or require memory requirements (typically Ω( training data points)\Omega(|\text{ training data points}|)). For deep learning problems, data augmentation is often deemed necessary for achieving good performance; this implies computing quantities such as batch gradient (or storage necessities) over this augmented dataset is often infeasible. Such requirements are mitigated by the use of simple streaming methods such as SGD, ASGD, HB, NAG. For other technical distinctions between the offline and online stochastic methods refer to Frostig et al. (2015b).

Practical methods for training deep networks: Momentum based methods employed with stochastic gradients (Sutskever et al., 2013) have become standard and popular in practice. These schemes tend to outperform standard SGD on several important practical problems. As previously mentioned, we attribute this improvement to effect of mini-batching rather than improvement offered by HB or NAG in the SFO model. Schemes such as Adagrad (Duchi et al., 2011), RMSProp (Tieleman and Hinton, 2012), Adam (Kingma and Ba, 2014) represent an important and useful class of algorithms. The advantages offered by these methods are orthogonal to the advantages offered by fast gradient methods; it is an important direction to explore augmenting these methods with ASGD as opposed to standard HB or NAG based acceleration schemes.

Chaudhari et al. (2017) proposed Entropy-SGD, which is an altered objective that adds a local strong convexity term to the actual empirical risk objective, with an aim to improve generalization. However, we do not understand convergence rates for convex problems or the generalization ability of this technique in a rigorous manner. Chaudhari et al. (2017) propose to use SGD in their procedure but mention that they employ the HB/NAG method in their implementation for achieving better performance. Naturally, we can use ASGD in this context. Path normalized SGD (Neyshabur et al., 2015) is a variant of SGD that alters the metric on which the weights are optimized. As noted in their paper, path normalized SGD could be improved using HB/NAG (or even the ASGD method).

Conclusions and Future Directions

In this paper, we show that the performance gain of HB over SGD in stochastic setting is attributed to mini-batching rather than the algorithm’s ability to accelerate with stochastic gradients. Concretely, we provide a formal proof that for several easy problem instances, HB does not outperform SGD despite large condition number of the problem; we observe this trend for NAG in our experiments. In contrast, ASGD (Jain et al., 2017) provides significant improvement over SGD for these problem instances. We observe similar trends when training a resnet on cifar-10 and an autoencoder on mnist. This work motivates several directions such as understanding the behavior of ASGD on domains such as NLP, and developing automatic momentum tuning schemes (Zhang et al., 2017).

Sham Kakade acknowledges funding from Washington Research Foundation Fund for Innovation in Data-Intensive Discovery and the NSF through awards CCF-16373601637360, CCF-17035741703574 and CCF-17405511740551.

References

Appendix A Suboptimality of HB: Proof of Proposition 3

Before proceeding to the proof, we introduce some additional notation. Let θt+1(j)\bm{\theta}_{t+1}^{(j)} denote the concatenated and centered estimates in the jthj^{\textrm{th}} direction for j=1,2j=1,2.

Since the distribution over xx is such that the coordinates are decoupled, we see that θt+1(j)\bm{\theta}_{t+1}^{(j)} can be written in terms of θt(j)\bm{\theta}_{t}^{(j)} as:

We prove Proposition 3 by showing that for any choice of stepsize and momentum, either of the two holds:

B(1)\mathcal{B}^{(1)} has an eigenvalue larger than 11, or,

the largest eigenvalue of B(2)\mathcal{B}^{(2)} is greater than 1500κ1-\frac{500}{\kappa}.

This is formalized in the following two lemmas.

If the stepsize δ\delta is such that δσ122(1α2)c+(c2)α\delta\sigma_{1}^{2}\geq\frac{2\left(1-\alpha^{2}\right)}{c+(c-2)\alpha}, then B(1)\mathcal{B}^{(1)} has an eigenvalue 1\geq 1.

If the stepsize δ\delta is such that δσ12<2(1α2)c+(c2)α\delta\sigma_{1}^{2}<\frac{2\left(1-\alpha^{2}\right)}{c+(c-2)\alpha}, then B(2)\mathcal{B}^{(2)} has an eigenvalue of magnitude 1500κ\geq 1-\frac{500}{\kappa}.

The analysis goes via computation of the characteristic polynomial of B\mathcal{B} and evaluating it at different values to obtain bounds on its roots.

The characteristic polynomial of B\mathcal{B} is:

We first begin by writing out the expression for the determinant:

expanding along the first column, we have:

Expanding the terms yields the expression in the lemma. ∎

The next corollary follows by some simple arithmetic manipulations.

Substituting z=1τz=1-\tau in the characteristic equation of Lemma 6, we have:

The first observation necessary to prove the lemma is that the characteristic polynomial D(z)D(z) approaches \infty as zz\to\infty, i.e., limzD(z)=+\lim_{z\to\infty}D(z)=+\infty.

Next, we evaluate the characteristic polynomial at 11, i.e. compute D(1)D(1). This follows in a straightforward manner from corollary (7) by substituting τ=0\tau=0 in equation (7), and this yields,

As α<1\alpha<1, x=δσ2>0x=\delta\sigma^{2}>0, we have the following by setting D(1)0D(1)\leq 0 and solving for xx:

Since D(1)0D(1)\leq 0 and D(z)0D(z)\geq 0 as zz\rightarrow\infty, there exists a root of D()D(\cdot) which is 1\geq 1. ∎

The above characterization is striking in the sense that for any c>1c>1, increasing the momentum parameter α\alpha naturally requires the reduction in the step size δ\delta to permit the convergence of the algorithm, which is not observed when fast gradient methods are employed in deterministic optimization. For instance, in the case of deterministic optimization, setting c=1c=1 yields δσ12<2(1+α)\delta\sigma_{1}^{2}<2(1+\alpha). On the other hand, when employing the stochastic heavy ball method with x(j)=2σj2x^{(j)}=2\sigma_{j}^{2}, we have the condition that c=2c=2, and this implies, δσ12<2(1α2)2=1α2\delta\sigma_{1}^{2}<\frac{2(1-\alpha^{2})}{2}=1-\alpha^{2}.

We now prove Lemma 5. We first consider the large momentum setting.

When the momentum parameter α\alpha is set such that 1450/κα11-450/{\kappa}\leq\alpha\leq 1, B\mathcal{B} has an eigenvalue of magnitude 1450κ\geq 1-\frac{450}{{\kappa}}.

This follows easily from the fact that det(B)=α4=j=14λj(B)(λmax(B))4\text{det}(\mathcal{B})=\alpha^{4}=\prod_{j=1}^{4}\lambda_{j}(\mathcal{B})\leq(\lambda_{\max}(\mathcal{B}))^{4}, thus implying 1450/καλmax(B)1-450/{\kappa}\leq\alpha\leq\left|{\lambda_{\max}(\mathcal{B})}\right|. ∎

Note that the above lemma holds for any value of the learning rate δ\delta, and holds for every eigen direction of H\mathbf{H}. Thus, for “large” values of momentum, the behavior of stochastic heavy ball does degenerate to the behavior of stochastic gradient descent.

We now consider the setting where momentum is bounded away from 11.

Consider B(2)\mathcal{B}^{(2)}, by substituting τ=l/κ\tau=l/{\kappa}, x=δλmin=c(δσ12)/κx=\delta\lambda_{\min}=c(\delta\sigma_{1}^{2})/{\kappa} in equation (7) and accumulating terms in varying powers of 1/κ1/{\kappa}, we obtain:

Let 2<c<30002<c<3000, 0α1450κ0\leq\alpha\leq 1-\frac{450}{{\kappa}}, l=1+2c(δσ12)1αl=1+\frac{2c(\delta\sigma_{1}^{2})}{1-\alpha}. Then, G(l)0G(l)\leq 0.

Since (δσ12)2(1α2)c+(c2)α(\delta\sigma_{1}^{2})\leq\frac{2(1-\alpha^{2})}{c+(c-2)\alpha}, this implies (δσ12)1α2(1+α)c+(c2)α4c\frac{(\delta\sigma_{1}^{2})}{1-\alpha}\leq\frac{2(1+\alpha)}{c+(c-2)\alpha}\leq\frac{4}{c}, thus implying, 1l91\leq l\leq 9.

Substituting the value of ll in equation (11), the coefficient of O(1/κ)\mathcal{O}(1/{\kappa}) is (1α)3(1+α)-(1-\alpha)^{3}(1+\alpha).

We will bound this term along with (34αα2+2α3)l2/κ2=(1α)2(3+2α)l2/κ2(3-4\alpha-\alpha^{2}+2\alpha^{3})l^{2}/{\kappa}^{2}=(1-\alpha)^{2}(3+2\alpha)l^{2}/{\kappa}^{2} to obtain:

where, we use the fact that α<1\alpha<1, l9l\leq 9. The natural implication of this bound is that the terms that are lower order, such as O(1/κ4)\mathcal{O}(1/{\kappa}^{4}) and O(1/κ5)\mathcal{O}(1/{\kappa}^{5}) will be negative owing to the large constant above. Let us verify that this is indeed the case by considering the terms having powers of O(1/κ4)\mathcal{O}(1/{\kappa}^{4}) and O(1/κ5)\mathcal{O}(1/{\kappa}^{5}) from equation (11):

The expression above evaluates to 0\leq 0 given an upperbound on the value of cc. The expression above follows from the fact that l9,κ1l\leq 9,{\kappa}\geq 1.

Next, consider the terms involving O(1/κ3)\mathcal{O}(1/{\kappa}^{3}) and O(1/κ2)\mathcal{O}(1/{\kappa}^{2}), in particular,

In both these cases, we used the fact that α1450κ\alpha\leq 1-\frac{450}{{\kappa}} implying (1α)450κ-(1-\alpha)\leq\frac{-450}{{\kappa}}. Finally, other remaining terms are negative. ∎

Before rounding up the proof of the proposition, we need the following lemma to ensure that our lower bounds on the largest eigenvalue of B\mathcal{B} indeed affect the algorithm’s rates and are true irrespective of where the algorithm is begun. Note that this allows our result to be much stronger than typical optimization lowerbounds that rely on specific initializations to ensure a component along the largest eigendirection of the update operator, for which bounds are proven.

For any starting iterate w0w\mathbf{w}_{0}\neq\mathbf{w}^{*}, the HB method produces a non-zero component along the largest eigen direction of B\mathcal{B}.

Now, since we note that Φj\bm{\Phi}_{j} is a symmetric 2×22\times 2 matrix, D\mathcal{D} should contain two identical rows implying that it has an eigenvalue that is zero and a corresponding eigenvector that is [01/21/(2)0]\begin{bmatrix}0&-1/\sqrt{2}&1/\sqrt{(}2)&0\end{bmatrix}^{\top}. It turns out that this is also an eigenvector of B\mathcal{B} with an eigenvalue α\alpha. Note that det(B)=α4\text{det}(\mathcal{B})=\alpha^{4}. This implies there are two cases that we need to consider: (i) when all eigenvalues of B\mathcal{B} have the same magnitude (=α=\alpha). In this case, we are already done, because there exists at least one non zero eigenvalue of D\mathcal{D} and this should have some component along one of the eigenvectors of B\mathcal{B} and we know that all eigenvectors have eigenvalues with a magnitude equal to λmax(B)\lambda_{\max}(\mathcal{B}). Thus, there exists an iterate which has a non-zero component along the largest eigendirection of B\mathcal{B}. (ii) the second case is the situation when we have eigenvalues with different magnitudes. In this case, note that det(B)=α4<(λmax(B))4\text{det}(\mathcal{B})=\alpha^{4}<(\lambda_{\max}(\mathcal{B}))^{4} implying λmax(B)>α\lambda_{\max}(\mathcal{B})>\alpha. In this case, we need to prove that D\mathcal{D} spans a three-dimensional subspace; if it does, it contains a component along the largest eigendirection of B\mathcal{B} which will round up the proof. Since we need to understand whether D\mathcal{D} spans a three dimensional subspace, we can consider a different (yet related) matrix, which we call R\mathcal{R} and this is defined as:

Given the expressions for {θj}j=03\{\bm{\theta}_{j}\}_{j=0}^{3} (by definition of θ0\bm{\theta}_{0} and using equation A.1), we can substitute to see that R\mathcal{R} has the following expression:

If we compute and prove that det(R)0\text{det}(\mathcal{R})\neq 0, we are done since that implies that R\mathcal{R} has three non-zero eigenvalues.

This implies, we first define the following: let qγ=(tγ)2+(c1)x2q_{\gamma}=(t-\gamma)^{2}+(c-1)x^{2}. Then, R\mathcal{R} can be expressed as:

Note: (i) qα1=(tα)21+(c1)x2=(1x)21+(c1)x2=2x+x2+(c1)x2=2x+cx2q_{\alpha}-1=(t-\alpha)^{2}-1+(c-1)x^{2}=(1-x)^{2}-1+(c-1)x^{2}=-2x+x^{2}+(c-1)x^{2}=-2x+cx^{2}. (ii) tα1=xt-\alpha-1=-x (iii) α(qα(tα))=α((tα)2(tα)+(c1)x2)=α((1x)(x)+(c1)x2)=αx(1+cx)\alpha(q_{\alpha}-(t-\alpha))=\alpha((t-\alpha)^{2}-(t-\alpha)+(c-1)x^{2})=\alpha((1-x)(-x)+(c-1)x^{2})=\alpha x(-1+cx) (iv) q0qα=t2(tα)2=α(2tα)=2tαα2q_{0}-q_{\alpha}=t^{2}-(t-\alpha)^{2}=\alpha(2t-\alpha)=2t\alpha-\alpha^{2}. Then,

Note that this determinant can be zero when

We show this is not possible by splitting our argument into two parts, one about the convergent regime of the algorithm (where, δσ12<2(1α2)c+(c2)α\delta\sigma_{1}^{2}<\frac{2(1-\alpha^{2})}{c+(c-2)\alpha}) and the other about the divergent regime.

Let us first provide a proof for the convergent regime of the algorithm. For this regime, let the chosen δ\delta be represented as δ+\delta^{+}. Now, for the smaller eigen direction, x=δ+λmin=cδ+σ12/κx=\delta^{+}\lambda_{\min}=c\delta^{+}\sigma_{1}^{2}/{\kappa}. Suppose α\alpha was chosen as per equation 5,

We will now prove that δ+σ12=κc(1cαc2)\delta^{+}\sigma_{1}^{2}=\frac{{\kappa}}{c}(\frac{1}{c}-\frac{\alpha}{c-2}) is much larger than one allowed by the convergence of the HB updates, i.e., δσ12<2(1α2)c+(c2)α2(1α2)c\delta\sigma_{1}^{2}<\frac{2(1-\alpha^{2})}{c+(c-2)\alpha}\leq\frac{2(1-\alpha^{2})}{c}. In particular, if we prove that κc(1cαc2)>2(1α2)c\frac{{\kappa}}{c}(\frac{1}{c}-\frac{\alpha}{c-2})>\frac{2(1-\alpha^{2})}{c} for any admissible value of α\alpha, we are done.

The two roots of this quadratic equation are α+=κ2c1\alpha^{+}=\frac{{\kappa}}{2c}-1 and α=1\alpha^{-}=1. Note that κκ~=c{\kappa}\geq\widetilde{\kappa}=c; note that there is not much any method gains over SGD if κ=O(c){\kappa}=\mathcal{O}(c). And, for any κ4c{\kappa}\geq 4c, note, α+>α\alpha^{+}>\alpha^{-}, indicating that the above equation holds true if α>α+=κ2c1\alpha>\alpha^{+}=\frac{{\kappa}}{2c}-1 or if α<α=1\alpha<\alpha^{-}=1. The latter condition is true and hence the proposition that δ+σ12>2(1α2)c+(c2)α\delta^{+}\sigma_{1}^{2}>\frac{2(1-\alpha^{2})}{c+(c-2)\alpha} is true.

We need to prove that the determinant does not vanish in the divergent regime for rounding up the proof to the lemma.

Now, let us consider the divergent regime of the algorithm, i.e., when, δσ12>2(1α2)c+(c2)α\delta\sigma_{1}^{2}>\frac{2(1-\alpha^{2})}{c+(c-2)\alpha}. Furthermore, for the larger eigendirection, the determinant is zero when δσ12=1cαc2c=1cαc2\delta\sigma_{1}^{2}=\frac{1-\frac{c\alpha}{c-2}}{c}=\frac{1}{c}-\frac{\alpha}{c-2} (obtained by substituting x=δσ12x=\delta\sigma_{1}^{2} in equation 5). If we show that 2(1α2)c+(c2)α>1cαc2\frac{2(1-\alpha^{2})}{c+(c-2)\alpha}>\frac{1}{c}-\frac{\alpha}{c-2} for all admissible values of cc, we are done. We will explore this in greater detail:

considering the quadratic in the left hand size and solving it for cc, we have:

Which is true automatically since c>2c>2. This completes the proof of the lemma. ∎

Combining Lemmas 9 and 12, we see that no matter what stepsize and momentum we choose, B(j)\mathcal{B}^{(j)} has an eigenvalue of magnitude at least 1500κ1-\frac{500}{\kappa} for some j{1,2}j\in\{1,2\}. This proves the lemma. ∎

Appendix B Equivalence of Algorithm 3 and ASGD

We begin by writing out the updates of ASGD as written out in Jain et al. (2017), which starts with two iterates a^0\widehat{a}_{0} and d^0\widehat{d}_{0}, and from time t=0,1,...T1t=0,1,...T-1 implements the following updates:

Next, we specify the step sizes β1=c32/κκ~\beta_{1}=c_{3}^{2}/\sqrt{{\kappa}\widetilde{\kappa}}, α1=c3/(c3+β)\alpha_{1}=c_{3}/(c_{3}+\beta), γ1=β/(c3λmin)\gamma_{1}=\beta/(c_{3}\lambda_{\min}) and δ1=1/R2\delta_{1}=1/R^{2}, where κ=R2/λmin{\kappa}=R^{2}/\lambda_{\min}. Note that the step sizes in the paper of Jain et al. (2017) with c1c_{1} in their paper set to 11 yields the step sizes above. Now, substituting equation 8 in equation 9 and substituting the value of γ1\gamma_{1}, we have:

We see that d^t+1\widehat{d}_{t+1} is precisely the update of the running average wˉt+1\bar{w}_{t+1} in the ASGD method employed in this paper.

We now update b^t\widehat{b}_{t} to become b^t+1\widehat{b}_{t+1} and this can be done by writing out equation 6 at t+1t+1, i.e:

By substituting the value of α1\alpha_{1} we note that this is indeed the update of the iterate as a convex combination of the current running average and a short gradient step as written in this paper. In this paper, we set c3c_{3} to be equal to 0.70.7, and any constant less than 11 works. In terms of variables, we note that α\alpha in this paper’s algorithm description maps to 1β11-\beta_{1}.

Appendix C More details on experiments

In this section, we will present more details on our experimental setup.

We now detail the range of parameters explored for these results: the condition number κ\kappa was varied from {24,25,..,228}\{2^{4},2^{5},..,2^{28}\} for all the optimization methods and for both the discrete and gaussian problem. For each of these experiments, we draw 10001000 samples and compute the empirical estimate of the fourth moment tensor. For NAG and HB, we did a very fine grid search by sampling 5050 values in the interval (0,1](0,1] for both the learning rate and the momentum parameter and chose the parameter setting that yielded the smallest λmax(B)\lambda_{\max}(\mathcal{B}) that is less than 11 (so that it falls in the range of convergence of the algorithm). As for SGD and ASGD, we employed a learning rate of 1/31/3 for the Gaussian case and a step size of 0.90.9 for the discrete case. The statistical advantage parameter of ASGD was chosen to be 3κ/2\sqrt{3\kappa/2} for the Gaussian case and 2κ/3\sqrt{2\kappa/3} for the Discrete case, and the a long step parameters of 3κ3\kappa and 2κ2\kappa were chosen for the Gaussian and Discrete case respectively. The reason it appears as if we choose a parameter above the theoretically maximal allowed value of the advantage parameter is because the definition of κ\kappa is different in this case. The κ\kappa we speak about for this experiment is λmax/λmin\lambda_{\max}/\lambda_{\min} unlike the condition number for the stochastic optimization problem. In a manner similar to actually running the algorithms (the results of whose are presented in the main paper), we also note that we can compute the rate as in equation 1 and join all these rates using a curve and estimate its slope (in the log\log scale). This result is indicated in table 3.

Figure 7 presents these results, where for each method, we did grid search over all parameters and chose parameters that give smallest λmax\lambda_{\textrm{max}}. We see the same pattern as in Figure 1 from actual runs – SGD,HB and NAG all have linear dependence on condition number κ\kappa, while ASGD has a dependence of κ\sqrt{\kappa}.

C.2 Autoencoders for MNIST

We begin by noting that the learning rates tend to vary as we vary batch sizes, which is something that is known in theory (Jain et al., 2016). Furthermore, we extend the grid especially whenever our best parameters of a baseline method tends to land at the edge of a grid. The parameter ranges explored by our grid search are:

Batch Size 11: (parameters chosen by running for 2020 epochs)

SGD: learning rate: {0.01,0.0110,0.1,0.110,1,10,5,10,20,1010,40,60,80,100\{0.01,0.01\sqrt{10},0.1,0.1\sqrt{10},1,\sqrt{10},5,10,20,10\sqrt{10},40,60,80,100.

NAG/HB: learning rate: {0.0110,0.1,0.110,1,10,10}\{0.01\sqrt{10},0.1,0.1\sqrt{10},1,\sqrt{10},10\}, momentum {0,0.5,0.75,0.9,0.95,0.97}\{0,0.5,0.75,0.9,0.95,0.97\}.

ASGD: learning rate: {2.5,5}\{2.5,5\}, long step {100.0,1000.0}\{100.0,1000.0\}, advantage parameter {2.5,5.0,10.0,20.0}\{2.5,5.0,10.0,20.0\}.

Batch Size 88: (parameters chosen by running for 5050 epochs)

SGD: learning rate: {0.001,0.00110.0,0.01,0.0110,0.1,0.110,1,10,5,10,1010,40,60,80,100,120,140}\{0.001,0.001\sqrt{10.0},0.01,0.01\sqrt{10},0.1,0.1\sqrt{10},1,\sqrt{10},5,10\\ ,10\sqrt{10},40,60,80,100,120,140\}.

NAG/HB: learning rate: {5.0,10.0,20.0,1010,40,60}\{5.0,10.0,20.0,10\sqrt{10},40,60\}, momentum {0,0.25,0.5,0.75,0.9,0.95}\{0,0.25,0.5,0.75,0.9,0.95\}.

ASGD: learning rate {40,60}\{40,60\}. For a long step of 100100, advantage parameters of {1.5,2,2.5,5,10,20}\{1.5,2,2.5,5,10,20\}. For a long step of 10001000, we swept over advantage parameters of {2.5,5,10}\{2.5,5,10\}.

C.3 Deep Residual Networks for CIFAR-10

In this section, we will provide more details on our experiments on cifar-10, as well as present some additional results. We used a weight decay of 0.00050.0005 in all our experiments. The grid search parameters we used for various algorithms are as follows. Note that the ranges in which parameters such as learning rate need to be searched differ based on batch size (Jain et al., 2016). Furthermore, we tend to extrapolate the grid search whenever a parameter (except for the learning rate decay factor) at the edge of the grid has been chosen; this is done so that we always tend to lie in the interior of the grid that we have searched on. Note that for the purposes of the grid search, we choose a hold out set from the training data and add it in to the training data after the parameters are chosen, for the final run.

Batch Size 88: Note: (i) parameters chosen by running for 4040 epochs and picking the grid search parameter that yields the smallest validation 0/10/1 error. (ii) The validation set decay scheme that we use is that if the validation error does not decay by at least 1%1\% every three passes over the data, we cut the learning rate by a constant factor (which is grid searched as described below). The minimal learning rate to use is fixed to be 6.25×1056.25\times 10^{-5}, so that we do not decay far too many times and curtail progress prematurely.

SGD: learning rate: {0.0033,0.01,0.033,0.1,0.33}\{0.0033,0.01,0.033,0.1,0.33\}, learning rate decay factor {5,10}\{5,10\}.

NAG/HB: learning rate: {0.001,0.0033,0.01,0.033}\{0.001,0.0033,0.01,0.033\}, momentum {0.8,0.9,0.95,0.97}\{0.8,0.9,0.95,0.97\}, learning rate decay factor {5,10}\{5,10\}.

ASGD: learning rate {0.01,0.0330,0.1}\{0.01,0.0330,0.1\}, long step {1000,10000,50000}\{1000,10000,50000\}, advantage parameter {5,10}\{5,10\}, learning rate decay factor {5,10}\{5,10\}.

Batch Size 128128: Note: (i) parameters chosen by running for 120120 epochs and picking the grid search parameter that yields the smallest validation 0/10/1 error. (ii) The validation set decay scheme that we use is that if the validation error does not decay by at least 0.2%0.2\% every four passes over the data, we cut the learning rate by a constant factor (which is grid searched as described below). The minimal learning rate to use is fixed to be 1×1031\times 10^{-3}, so that we do not decay far too many times and curtail progress prematurely.

SGD: learning rate: {0.01,0.03,0.09,0.27,0.81}\{0.01,0.03,0.09,0.27,0.81\}, learning rate decay factor {2,10,5}\{2,\sqrt{10},5\}.

NAG/HB: learning rate: {0.01,0.03,0.09,0.27}\{0.01,0.03,0.09,0.27\}, momentum {0.5,0.8,0.9,0.95,0.97}\{0.5,0.8,0.9,0.95,0.97\}, learning rate decay factor {2,10,5}\{2,\sqrt{10},5\}.

ASGD: learning rate {0.01,0.03,0.09,0.27}\{0.01,0.03,0.09,0.27\}, long step {100,1000,10000}\{100,1000,10000\}, advantage parameter {5,10,20}\{5,10,20\}, learning rate decay factor {2,10,5}\{2,\sqrt{10},5\}.

As a final remark, for any comparison across algorithms, such as, (i) ASGD vs. NAG, (ii) ASGD vs HB, we fix the starting learning rate, learning rate decay factor and decay schedule chosen by the best grid search run of NAG/HB respectively and perform a grid search over the long step and advantage parameter of ASGD. In a similar manner, when we compare (iii) SGD vs NAG or, (iv) SGD vs. HB, we choose the learning rate, learning rate decay factor and decay schedule of SGD and simply sweep over the momentum parameter of NAG or HB and choose the momentum that offers the best validation error.

We now present plots of training function value for different algorithms and batch sizes.

Effect of minibatch sizes: Figure 8 plots training function value for batch sizes of 128128 and 88 for SGD, HB and NAG. We notice that in the initial stages of training, NAG obtains substantial improvements compared to SGD and HB for batch size 128128 but not for batch size 88. Towards the end of training however, NAG starts decreasing the training function value rapidly for both the batch sizes. The reason for this phenomenon is not clear. Note however, that at this point, the test error has already stabilized and the algorithms are just overfitting to the data.

Comparison of ASGD with momentum methods: We now present the training error plots for ASGD compared to HB and NAG in Figures 9 and 10 respectively. As mentioned earlier, in order to see a clear trend, we constrain the learning rate and decay schedule of ASGD to be the same as that of HB and NAG respectively, which themselves were learned using grid search. We see similar trends as in the validation error plots from Figures 5 and 6. Please see the figures and their captions for more details.