A Universally Optimal Multistage Accelerated Stochastic Gradient Method
Necdet Serhat Aybat, Alireza Fallah, Mert Gurbuzbalaban, Asuman Ozdaglar
Introduction
First order optimization methods play a key role in solving large scale machine learning problems due to their low iteration complexity and scalability with large data sets. In several cases, these methods operate with noisy first order information either because the gradient is estimated from draws or subset of components of the underlying objective function or noise is injected intentionally due to privacy or algorithmic considerations . A fundamental question in this setting is to design fast algorithms with optimal convergence rate, matching the lower bounds on the oracle complexity in terms of target accuracy and other important parameters both for the deterministic and stochastic case (i.e., with or without gradient errors).
In this paper, we design an optimal first order method to solve the problem
This oracle model is commonly considered in the literature (see e.g. ). In Appendix K, we show how our analysis can be extended to the following more general noise setting, same as the one studied in , where the variance of the noise is allowed to grow linearly with the squared distance to the optimal solution:
With noise, Raginsky and Rakhlin provided the following (much larger) lower boundThe authors show this result for . Nonetheless, it can be generalized to any by scaling the problem parameters properly. on function suboptimality which also provides a lower bound on the variance term:
Several algorithms have been proposed in the recent literature attempting to achieve these lower bounds.Here we review their error bounds after iterations highlighting dependence on , , and initial point , suppressing and dependence. Xiao obtains performance guarantees in expected suboptimality for an accelerated version of the dual averaging method. Dieuleveut et al. consider quadratic objective function and develop an algorithm with averaging to achieve the error bound . Hu et al. consider general strongly convex and smooth functions and achieve an error bound with similar dependence under the assumption of bounded noise. Ghadimi and Lan and Chen et al. extend this result to the noise model in (3) by introducing the accelerated stochastic approximation algorithm (AC-SA) and optimal regularized dual averaging algorithm (ORDA), respectively. Both AC-SA and ORDA have multistage versions presented in and where authors improve the bias term of their single stage methods to the optimal by exploiting knowledge of and the optimality gap , i.e., an upper bound for , in the operation of the algorithm. Another closely related paper is which proposed AGD+ and showed under additive noise model that it admits the error bound for any where the constants grow with , and in particular, they achieve the bound for .
In this paper, we introduce the class of Multistage Accelerated Stochastic Gradient (M-ASG) methods that are universally optimal, achieving the lower bound both in the noiseless deterministic case and the noisy stochastic case up to some constants independent of and . M-ASG proceeds in stages that use a stochastic version of Nesterov’s accelerated method with a specific restart and parameterization. Given an arbitrary length and constant stepsize for the first stage together with geometrically growing lengths and shrinking stepsizes for the following stages, we first provide a general convergence rate result for M-ASG (see Theorem 3.4). Given the computational budget , a specific choice for the length of the first stage is shown to achieve the optimal error bound without requiring knowledge of the noise bound and the initial optimality gap (See Corollary 3.8). To the best of our knowledge, this is the first algorithm that achieves such a lower bound under such informational assumptions. In Table 1, we provide a comparison of our algorithm with other algorithms in terms of required assumptions and optimality of their results in both bias and variance terms. In particular, we consider ACSA , Multistage AC-SA , ORDA and Multistage ORDA , and the algorithm proposed in .
Our paper builds on an analysis of Nesterov’s accelerated stochastic method with a specific momentum parameter presented in Section 2 which may be of independent interest. This analysis follows from a dynamical system representation and study of first order methods which has gained attention in the literature recently . In Section 3, we present the M-ASG algorithm, and characterize its behavior under different assumptions as summarized in Table 1. In particular, we show that it achieves the optimal convergence rate with the given budget of iterations . In Section 4, we show how additional information such as and can be leveraged in our framework to improve practical performance. Finally, in Section 5, we provide numerical results on the comparison of our algorithm with some of the other most recent methods in the literature.
Modeling Accelerated Gradient method as a dynamical system
In this section we study Nesterov’s Accelerated Stochastic Gradient method (ASG) with the stochastic first-order oracle in (3):
where is the stepsize and is the momentum parameter. This choice of momentum parameter has already been studied in the literature, e.g., . In the next lemma, we provide a new motivation for this choice by showing that for quadratic functions and in the noiseless setting, this momentum parameter achieves the fastest asymptotic convergence rate for a given fixed stepsize . The proof of this lemma is provided in Appendix A.
for some non-negative sequence that goes to zero is Note that although this rate is asymptotic, its smaller than the non-asymptotic rate that we provide for general strongly convex functions in Theorem 2.3, as there . and it is achieved by . As a consequence, for this choice of , there exists such that and
Our analysis builds on the reformulation of a first-order optimization algorithm as a linear dynamical system. Following , we write ASG iterations as
We can also relate the state to the iterate in a linear fashion through the identity . We study the evolution of the ASG method through the following Lyapunov function which also arises in the study of deterministic accelerated gradient methods:
where is a symmetric positive semi-definite matrix. We first state the following lemma which can be derived by adapting the proof of Proposition 4.6 in to our setting with less restrictive noise assumption compared to the additive noise model of . Its proof can be found in Appendix B.
We use this lemma and derive the following theorem which characterize the behavior of ASG method for when and (see the proof in Appendix C).
This result relies on the special structure of which will also be key for our analysis in Section 3.
A class of multistage ASG algorithms
In this section, we introduce a class of multistage ASG algorithms, represented in Algorithm 1 which we denote by M-ASG. The main idea is to run ASG with properly chosen parameters at each stage for stages. In addition, each new stage is dependent on the previous stage as the first two initial iterates of the new stage are set to the last iterate of the previous stage.
To analyze Algorithm 1, we first characterize the evolution of iterates in one specific stage through the Lyapunov function in (10). The details of the proof is provided in Appendix D.
Given a computational budget of iterations, we use this result to choose a stepsize that help us achieve an approximately optimal decay in the variance term which yields the following corollary for M-ASG algorithm with stage, and its proof can be found in Appendix E.
provided that .
For subsequent analysis, given , for all , we define the state vector for –recall that , where is the number of stages. We analyze the performance of each stage with respect to a stage-dependent Lyapunov function . The following lemma relates the performance bounds with respect to consecutive choice of Lyapunov functions, building on our specific restarting mechanism (The proof can be found in Appendix F).
Now, we are ready to state and prove the main result of the paper (see proof in Appendix G):
We next define as the number of iterations needed to run M-ASG for stages, i.e., . Note for and with parameters given in Theorem 3.4,
The next theorem remarks the behavior of M-ASG after running it for iterations with the parameters in the preceding theorem, and its proof is provided in Appendix H.
Under the premise of Theorem 3.6, choosing , the suboptimality error of M-ASG after admits
Theorem 3.6 immediately yields the result in Corollary 3.7, (suboptimal with respect to dependence on initial optimality gap); see Appendix I for the proof. Similar rate results have also been obtained by AC-SA and ORDA algorithms.
We continue this section by pointing out some important special cases of our result. We first show in the next corollary how our algorithm is universally optimal and capable of achieving the lower bounds (5) and (6) simultaneously. The proof follows from (19) and .
Under the premise of Theorem 3.6, consider a computational budget of iterations. By setting for some positive constant , we obtain a bound matching the lower bounds in (5) and (6), i.e.,
We note that achieving the lower bound through the M-ASG algorithm requires the knowledge or estimation of the strong convexity constant . In some applications, may not be known a priori. However, for regularized risk minimization problems, the regularization parameter is known and it determines the strong convexity constant. It is also worth noting that, even for the deterministic case, has shown that for a wide class of algorithms including ASG, it is not possible to obtain the lower bound (5) without knowing the strong convexity parameter. In addition, in Appendix L, we show how our framework can be extended to obtain nearly optimal results in the merely convex setting; i.e. when . Finally, note that the Lipschitz constant can be estimated from data using standard line search techniques in practice, see and [32, Alg. 2].
Recall that we presented a comparison with other state-of-the-art algorithms in Table 1. In particular, this table shows that Multistage AC-SA and Multistage ORDA also achieve the lower bounds provided that noise parameters are known – note we do not make this extra assumption for M-ASG. It is also worth noting that the idea of restart, which plays a key role in achieving the lower bounds, has been studied before in the context of deterministic accelerated methods . However, a naive extension of these restart methods to the stochastic setting leads to a two-stage algorithm which switches from constant step-size to diminishing step-size when the variance term dominates the bias term. Nevertheless, implementing this technique requires the knowledge of and optimality gap to tune algorithms for achieving optimal rates in both bias and variance terms. M-ASG, on the other hand, achieves the optimal rates using a specific multistage scheme that does not require the knowledge of the parameter . In the supplementary material, we also discuss how M-ASG is related to AC-SA and Multistage AC-SA algorithms proposed in .
M-ASG∗: An improved bias-variance trade-off
In section 3, we described a universal algorithm that do not require the knowledge of neither initial suboptimality gap nor the noise magnitude to operate. However, as we will argue in this section, our framework is flexible in the sense that additional information about the magnitude of or can be leveraged to improve practical performance. We first note that several algorithms in the literature assume that an upper bound on is known or can be estimated, as summarized in Table 1. This assumption is reasonable in a variety of applications when there is a natural lower bound on . For example, in supervised learning scenarios such as support vector machines, regression or logistic regression problems, the loss function has non-negative values . Similarly, the noise level may be known or estimated, e.g., in private risk minimization , the noise is added by the user to ensure privacy; therefore, it is a known quantity.
There is a natural well-known trade-off between constant and decaying stepsizes (decaying with the number of iterations ) in stochastic gradient algorithms. Since the noise is multiplied with the stepsize, a stepsize that is decaying with the number of iterations leads to a decay in the variance term; however, this will slow down the decay of the bias term, which is controlled essentially by the behavior of the underlying deterministic accelerated gradient algorithm (AG) that will give the best performance with the constant stepsize (note that when , the bias term gives the known performance bounds for the AG algorithm). The main idea behind the M-ASG algorithm (which allows it to achieve the lower bounds) is to exploit this trade-off to decide on the right time, , to switch to decaying stepsizes, i.e., when the bias term is sufficiently small so that the variance term dominates and should be handled with the decaying stepsize. This insight is visible from the results of Theorem 3.4 which gives further insights on the choice of the stepsize at every stage to achieve the lower bounds. Theorem 3.4 shows that if M-ASG is run with a constant stepsize in the first stage, then the variance term admits the bound which does not decay with the number of iterations in the first stage. However, in later stages, when , the stepsize is decreased as the number of iterations grows and this results in a decay of the variance term. Overall, the choice of the length of the first stage , has a major impact in practice which we will highlight in our numerical experiments.
This result allows one to fine-tune the switching point to start using the decaying stepsizes within our framework as a function of and . In scenarios, when the noise level is small or the initial gap is large, is chosen large enough to guarantee a fast decay in the bias term. We would like to emphasize that this modified M-ASG algorithm only requires the knowledge of and for selecting and the rest of the parameters can be chosen as in Theorem 3.4 which are independent of both and . Finally, the following theorem provides theoretical guarantees of our framework for this choice of . The proof is omitted as it is similar to the proofs of Theorems 3.4 and 3.6.
Numerical experiments
In this section, we demonstrate the numerical performance of Algorithm 1 with parameters specified by Corollary 3.7 (M-ASG) and Theorem 4.1 (M-ASG∗) and compare with other methods from the literature. In our first experiment, we consider the strongly convex quadratic objective where is the Laplacian of a cycle graphAll diagonal entries of are 2, if , and the remaining entries are zero., is a random vector and is a regularization parameter. We assume the gradients are corrupted by additive noise with a Gaussian distribution where . We note that this example has been previously considered in the literature as a problem instance where Standard ASG (ASG iterations with standard choice of parameters and ) perform badly compared to Standard GD (Gradient Descent with standard choice of the stepsize ) . In Figures 1 and 2, we compare M-ASG and M-ASG∗ with Standard GD, Standard AG, AGD+ , and Multistage AC-SA . We consider dimension and initialize all the methods from . We run the algorithms Multistage AC-SA, and M-ASG∗, having access to the same estimate of . Figures 1- 2 show the average performance of all the algorithms along with the confidence interval over 50 sample runs while the total number of iterations and respectively as the noise level is varied. The simulation results reveal that both M-ASG and M-ASG∗ have typically a faster decay of the error in the beginning and outperforms the other algorithms in general when the number of iterations is small to moderate. In this case, the speed-up obtained by M-ASG and M-ASG∗ is more prominent if the noise level is smaller. However, as the number of iterations grows, the performance of the algorithms become similar as the variance term dominates. In addition, we would like to highlight that when the noise is small, using as suggested in (21), M-ASG∗ runs stage one longer than M-ASG; hence, enjoys the linear rate of decay for more iterations before the variance term becomes the dominant term.
For the second set of experiments, we consider a regularized logistic regression problem for binary classification. In particular, we read images from the M-NIST data-set, and our goal is to distinguish the image of digit zero from that of digit eight.We provide an experiment with synthetic data for logistic loss in Appendix N. The number of samples is , and the size of each image is 20 by 20 after removing the margins (hence after vectorizing the images). At each iteration, we randomly choose a batch size of images to compute an estimate of the gradient.This is an unbiased estimate of the gradient with finite but unknown variance, and therefore we do not use M-ASG∗ or other algorithms that need the knowledge of variance. We choose the regularization parameter equal to following the standard practice (see e.g. ). In Figure 3,we compare M-ASG with Standard GD, Standard AG, AGD+ , and AC-SA for . The batch size controls the noise level, with larger batches leading to smaller . We run each of these algorithms for 50 times, and plot their average performance and confidence intervals. It can be seen that M-ASG usually start faster, and achieves the asymptotic rate of other algorithms for all different batch sizes.
Conclusion
In this work, we consider strongly convex smooth optimization problems where we have access to noisy estimates of the gradients. We proposed a multistage method that adapts the choice of the parameters of the Nesterov’s accelerated gradient at each stage to achieve the optimal rate. Our method is universal in the sense that it does not require the knowledge of the noise characteristics to operate and can achieve the optimal rate both in the deterministic and stochastic settings. We provided numerical experiments that compare our method with existing approaches in the literature, illustrating that our method performs well in practice.
The work of Necdet Serhat Aybat is partially supported by NSF Grant CMMI-1635106. Alireza Fallah is partially supported by Siebel Scholarship. Mert Gürbüzbalaban acknowledges support from the grants NSF DMS-1723085 and NSF CCF-1814888.
References
Appendix A Proof of Lemma 2.1
Let us denote the asymptotic convergence rate of the ASG method as a function of and by . It is well-known that has the following characterization (see e.g. , ):
where and is defined as:
with . Note that, since , we have for ; therefore, if and only if , which is equivalent to .
Using the fact that and is decreasing in , we obtain ; hence, for , we have both and . As a consequence, (22) implies that for , we have
Moreover, for , the two branches in (23) take the same value for and ; therefore, when is set to this critical value, we also get for . Note (24) is an increasing function of for any ; thus, given , the smallest rate possible is equal to , which is the rate given in the statement of the lemma and it is achieved by .
Now, we consider the case . From (22), if , then we also have . Thus, showing suffices us to claim that for any , the best possible rate is and this can be achieved by setting . Indeed, as we discussed above, for the case , we have ; thus,
Therefore, to show , we just need to prove
Taking the square of both sides of (25), it follows that (25) is equivalent to
and this holds when . Therefore, for any , we have for . which completes the proof.
Appendix B Proof of Lemma 2.2
We first state the following lemma which is an extension of Lemma 4.1 in for ASG.
Similarly, by extending Lemma 4.5 in to the noise setting (3), for every we obtain
Appendix C Proof of Theorem 2.3
\begin{aligned} \Gamma_{2,2}&=\frac{\mu\sqrt{\mu\alpha}(1-\sqrt{\mu\alpha})^{2}}{2(1+\sqrt{\mu\alpha})^{2}}+\frac{\mu(1-\sqrt{\mu\alpha})^{3}}{2(1+\sqrt{\mu\alpha})^{2}}-\frac{(1-\sqrt{\mu\alpha})^{2}}{2\alpha(1+\sqrt{\mu\alpha})^{2}}+\frac{(1-\sqrt{\mu\alpha})^{3}}{2\alpha}\\ &=\frac{(1-\sqrt{\mu\alpha})^{2}}{2\alpha(1+\sqrt{\mu\alpha})^{2}}\bigg{(}\alpha\Big{(}\mu\sqrt{\mu\alpha}+\mu(1-\sqrt{\mu\alpha})\Big{)}-1+(1-\sqrt{\mu\alpha})(1+\sqrt{\mu\alpha})^{2}\bigg{)}\\ &=\frac{(1-\sqrt{\alpha\mu})^{3}\sqrt{\mu}}{2\sqrt{\alpha}(1+\sqrt{\alpha\mu})}\geq 0\\ \end{aligned}
which is positive semidefinite. Now, consider the case that . For any , let
Note that, for any , (i) implies . This fact, along with (ii) and (iii), indicates that . Hence,
where the second equality comes from (iv). Therefore, the determinant of , itself, and two submatrices and are all positive. Thus, by Sylvester’s criterion, is positive definite for any . As a consequence, since , is positive semidefinite.
Appendix D Proof of Theorem 3.1
Using Theorem 2.3, for every , we have
where in the last inequality we used the fact that . Using this bound recursively for times, we obtain
where the second inequality follows from the inequality that for every , and the third inequality is obtained by replacing by .
Appendix E Proof of Corollary 3.2
We first show . Note that, by assumption, can be written as where and . This assumption, along with the fact that is a decreasing function of as , implies
where in (31) we used the assumption , and (32) follows from the fact that , and therefore, .
Next, using Theorem 3.1 with immediately gives the desired bound.
Appendix F Proof of Lemma 3.3
First, note that , and therefore,
Plugging (33) into (10) for yields
where (34) follows from (2) with and . Finally, taking expectation from (35) completes the proof.
Appendix G Proof of Theorem 3.4
which implies (17) as . We show (36) by induction on . For , using Theorem 3.1, we obtain
where the second inequality comes from the inequality which can be derived similar to (34).
Next, we assume (36) holds for and show it also holds for . Note that
where, (38) and (39) are obtained by using Theorem 3.1 and Lemma 3.3, respectively, and in (40) we used the assumption that (36) holds for .
Appendix H Proof of Theorem 3.6
First, we will show that for every and , we have
where, (43) and (44) follows again from Theorem 3.1 and Lemma 3.3, and we obtain (45) using (36).
Recall the definition which denotes the total number of stochastic gradient iterations required to complete stages of M-ASG for parameter and first-stage iteration number fixed. Given the computational budget of iterations such that , let be the largest number such that . As a result, at iteration we are in stage . Note that (18) implies with ; therefore
Thus, we get the following upper bound on the suboptimality:
and by substituting (46) in (H) we obtain the bound
Next, by (18), , and thus, . Replacing by in (H) completes the proof of (19).
Appendix I Proof of Corollary 3.7
Note that by setting , we have ; hence, plugging in (19) implies the following bound with an constant that does not depend on , and :
Finally, note that ; therefore, and using it in (49) completes the proof.
Appendix J Proof of Corrolary 3.9
By plugging and in (17), it is straightforward to check the bias term is bounded by . Next, consider running M-ASG with given parameters, possibly without knowing and/or specifying the exact number of stages. Consider the end of the -th stage, where . Since , the variance term in (17) is also bounded by , and as a result is an solution.
Now, by using (18), we can bound the number of iterations for completing stages:
where in (50) we used the fact that since , and (51) follows from the bound .
Appendix K Results for More General Noise Setting
where is a random variable independent of previous iterates.
In what follows, we first show how the results of Theorem 2.3 and Lemma 3.3 extends to this setting, and then briefly discuss the results of our multistage scheme for this noise setting.
First, note that similar to the proof of Lemma 2.2 and by using , we can show
Using , we can substitute by in (55); hence,
where the last inequality follows from which is true since \alpha\leq{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}1/L} and . Also note that
where (57) follows from and (58) follows from and the strong convexity assumption, i.e., f(x)-f^{*}\geq{\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}\frac{\mu}{2}}\|x-x^{*}\|^{2}. Finally, (59) is obtained using . Plugging (59) into the definition of implies
where the last inequality follows from the assumption which implies
Finally, note that, (62) along with also implies ; thus, we can bound in (61) by which gives us the desired result. ∎
The proof is very similar to the arguments in Appendix F. In particular,
where (64) follows from (2) with and . Finally, (65) follows from , which holds due to (62) and , along with {\color[rgb]{0,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@gray@stroke{0}\pgfsys@color@gray@fill{0}V_{Q_{\alpha_{k}}}}(\xi_{n_{k}+1}^{k})\geq f(x_{n_{k}+1}^{k})-f^{*}. Taking expectations of both sides of (65) completes the proof. ∎
Using the results in Theorem K.1 and Lemma K.2, we can analyze M-ASG for this more general noise setting in (52) as well and extend our complexity result in Corollary 3.8 as follows:
for sufficiently large and known in advance. It is worth noting that we can also derive similar results to Theorems 3.4 and 3.6 when is not known. We skip the details as all the arguments follow very similar to our analysis in Section 3.
Appendix L M-ASG for Convex Objective Functions
The author of obtains this lower bound for the case of compact domain with the additional knowledge of noise parameter . For unconstrained optimization, and without using the information on the noise parameter, , it is shown in that one can achieve the rate in both bias and variance terms (see last part of Corollary 3.9 and also Corollary 4.1 in ). As we state below, a direct application of our current results recovers a similar result up to a log factor.
Now, using the fact that , and similar to the proof of Lemma 3.3, we can show
Therefore, plugging this into (68), we obtain
This result along with implies
Appendix M AC-SA from the perspective of Nesterov’s Accelerated Method
Recall that AC-SA with initial point and sequence of stepsize parameters and has the following update rule:
Set
Set ;
Set and go to step (ii).
We claim that this algorithm can be cast as an ASG method in (7) with a specific varying stepsize rule. In fact, we show it can be represented as
To show this, first, multiplying both sides of ((ii)) by implies
and by substituting by from ((iv)) we obtain
To show (72a), first note that by ((iv)) for , we obtain . Plugging in this in ((ii)), leads to
which is (72a) and the proof is complete.
As a consequence, Multistage AC-SA is a variant of M-ASG Algorithm that has a different length for each stage and employs a specific varying stepsize rule together with a different selection for the momentum parameter at each stage.