Stochastic First- and Zeroth-order Methods for Nonconvex Stochastic Programming
Saeed Ghadimi, Guanghui Lan
Introduction
In 1951, Robbins and Monro in their seminal work proposed a classical stochastic approximation (SA) algorithm for solving stochastic programming (SP) problems. This approach mimics the simplest gradient descent method by using noisy gradient information in place of the exact gradients, and possesses the “asymptotically optimal” rate of convergence for solving a class of strongly convex SP problems . However, it is usually difficult to implement the “asymptotically optimal” stepsize policy, especially in the beginning, so that the algorithms often perform poorly in practice (e.g., [39, Section 4.5.3]). An important improvement of the classical SA was developed by Polyak and Polyak and Juditsky , where longer stepsizes were suggested together with the averaging of the obtained iterates. Their methods were shown to be more robust with respect to the selection of stepsizes than the classical SA and also exhibit the “asymptotically optimal” rate of convergence for solving strongly convex SP problems. We refer to for an account of the earlier history of SA methods.
The last few years have seen some significant progress for the development of SA methods for SP. On one hand, new SA type methods are being introduced to solve SP problems which are not necessarily strongly convex. On the other hand, these developments, motivated by complexity theory in convex optimization , concerned the convergence properties of SA methods during a finite number of iterations. For example, Nemirovski et al. presented a properly modified SA approach, namely, mirror descent SA for solving general non-smooth convex SP problems. They demonstrated that the mirror descent SA exhibits an optimal iteration complexity for solving these problems. This method has been shown in to be competitive to the widely-accepted sample average approximation approach (see, e.g., ) and even significantly outperform it for solving a class of convex SP problems. Similar techniques, based on subgradient averaging, have been proposed in . While these techniques dealt with non-smooth convex programming problems, Lan presented a unified optimal method for smooth, non-smooth and stochastic optimization, which explicitly takes into account the smoothness of the objective function (see also for discussions about strong convexity). However, note that convexity has played an important role in establishing the convergence of all these SA algorithms. To the best of our knowledge, none of existing SA algorithms can handle more general SP problems whose objective function is possibly nonconvex.
This paper focuses on the theoretical development of SA type methods for solving an important class of nonconvex SP problems. More specifically, we study the classical unconstrained nonlinear programming (NLP) problem given in the form of (e.g., )
for some parameter . Observe that, by (1.2), is an unbiased estimator of and, by (1.3), the variance of the random variable is bounded. It is worth noting that in the standard setting for SP, the random vectors , , are independent of each other (and also of ) (see, e.g., ). Our assumption here is slightly weaker since we do not need to assume , , to be independent.
Our study on the aforementioned SP problems has been motivated by a few interesting applications which are briefly outlined as follows.
In many machine learning problems, we intend to minimize a regularized loss function given by
where either the loss function or the regularization is nonconvex (see, e.g., ).
Another important class of problems originate from the so-called endogenous uncertainty in SP. More specifically, the objective functions for these SP problems are given in the form of
where the support and the distribution function of the random vector depend on . The function in (1.5) is usually nonconvex even if is convex with respect to . For example, if the support does not depend on , it is often possible to represent for some fixed distribution . Typically this transformation results in a nonconvex integrand function. Other techniques have also been developed to compute unbiased estimators for the gradient of in (1.5) (see, e.g., ).
Secondly, in order to improve the large deviation properties and hence the reliability of the RSG method, we present a two-phase randomized stochastic gradient (-RSG) method by introducing a post-optimization phase to evaluate a short list of solutions generated by several independent runs of the RSG method. We show that the complexity of the -RSG method for computing an -solution of problem (1.1), i.e., a point such that for some and , can be bounded by
We further show that, under certain light-tail assumption about the , the above complexity bound can be reduced to
This paper is organized as follows. We introduce two stochastic first-order methods, i.e., the RSG and -RSG methods, for nonconvex SP, and establish their convergence properties in Section 2. We then specialize these methods for solving a class of simulation-based optimization problems in Section 3. Some brief concluding remarks are also presented in Section 4.
If, in addition, is convex, then
Stochastic first-order methods
Our goal in this section is to present and analyze a new class of SA algorithms for solving general smooth nonlinear (possibly nonconvex) SP problems. More specifically, we present the RSG method and establish its convergence properties in Subsection 2.1, and then introduce the -RSG method which can significantly improve the large-deviation properties of the RSG method in Subsection 2.2.
We assume throughout this section that Assumption A1 holds. In some cases, Assumption A1 is augmented by the following “light-tail” assumption.
It can be easily seen that Assumption A2 implies Assumption A1.b) by Jensen’s inequality.
The convergence of existing SA methods requires to be convex . Moreover, in order to guarantee the convexity of , one often need to assume that the random variables , , to be independent of the search sequence . Below we present a new SA-type algorithm that can deal with both convex and nonconvex SP problems, and allow random noises to be dependent on the search sequence. This algorithm is obtained by incorporating a certain randomization scheme into the classical SA method.
A randomized stochastic gradient (RSG) method
Input: Initial point , iteration limit , stepsizes and probability mass function supported on .
Step . Let be a random variable with probability mass function .
Step . Call the stochastic first-order oracle for computing and set
A few remarks about the above RSG method are in order. Firstly, in comparison with the classical SA, we have used a random iteration count, , to terminate the execution of the RSG algorithm. Equivalently, one can view such a randomization scheme from a slightly different perspective described as follows. Instead of terminating the algorithm at the -th step, one can also run the RSG algorithm for iterations but randomly choose a search point (according to ) from its trajectory as the output of the algorithm. Clearly, using the latter scheme, we just need to run the algorithm for the first iterations and the remaining iterations are surpluses. Note however, that the primary goal to introduce the random iteration count is to derive new complexity results for nonconvex SP, rather than save the computational efforts in the last iterations of the algorithm. Indeed, if is uniformly distributed, the computational gain from such a randomization scheme is simply a factor of . Secondly, the RSG algorithm described above is conceptual only because we have not specified the selection of the stepsizes and the probability mass function yet. We will address this issue after establishing some basic convergence properties of the RSG method.
The following result describes some convergence properties of the RSG method.
Suppose that the stepsizes and the probability mass function in the RSG method are chosen such that and
where the expectation is taken with respect to and ,
and denotes the optimal value of problem (1.1);
if, in addition, problem (1.1) is convex with an optimal solution , then, for any ,
where the expectation is taken with respect to and , and
Summing up the above inequalities and re-arranging the terms, we obtain
Dividing both sides of the above inequality by and noting that
which, in view of (2.5), clearly implies (2.4).
We now show that part b) holds. Display . First observe that, for any ,
Moreover, in view of (1.8) and the fact that , we have
Combining the above two relations, we obtain, for any ,
where the last inequality follows from the convexity of and the fact that . Summing up the above inequalities and re-arranging the terms, we have
where the last inequality follows from (2.7) and the fact that . The rest of the proof is similar to that of part a) and hence the details are skipped.
We now describe a possible strategy for the selection of the stepsizes in the RSG method. For the sake of simplicity, let us assume that a constant stepsize policy is used, i.e., , , for some . Note that the assumption of constant stepsizes does not hurt the efficiency estimate of the RSG method. The following corollary of Theorem 1 is obtained by appropriately choosing the parameter .
Suppose that the stepsizes are set to
where is defined in (2.5). If, in addition, problem (1.1) is convex with an optimal solution , then
which together with (2.4) then imply (2.14). Relation (2.15) follows similarly from the above inequality (with replaced by ) and (2.6).
We now add a few remarks about the results obtained in Theorem 1 and Corollary 2. Firstly, as can be seen from (2.11), instead of randomly selecting a solution from , another possibility would be to output the solution such that
Thirdly, one possible drawback for the above RSG method is that one need to estimate to obtain an upper bound on (see, e.g., (2.13)), which will also possibly affect the selection of (see (2.3)). Note that similar requirements also exist for some deterministic first-order methods (e.g., gradient descent and Nesterov’s accelerated gradient methods). While under the deterministic setting, one can somehow relax such requirements by using certain line-search procedures to enhance the practical performance of these methods, it is more difficult to devise similar line-search procedures for the stochastic setting, since the exact values of and are not available. It should be noted, however, that we do not need very accurate estimate for in the RSG method. Indeed, it can be easily checked that the RSG method exhibits an rate of convergence if the stepsizes are set to
for any . In other words, we can overestimate the value of by a factor up to and the resulting RSG method still exhibits similar rate of convergence. A common practice in stochastic optimization is to estimate by using the stochastic gradients computed at a small number of trial points (see, e.g., ). We have adopted such a strategy in our implementation of the RSG method as described in more details in the technical report associated with this paper . It is also worth noting that, although in general the selection of will depend on and hence on , such a dependence is not necessary in some special cases. In particular, if the stepsizes are chosen according to a constant stepsize policy (e.g., (2.13)), then is uniformly distributed on .
Fourthly, it is interesting to note that the RSG method allows us to have a unified treatment for both nonconvex and convex SP problems in view of the specification of and (c.f., (2.3) and (2.13)). Recall that the optimal rate of convergence for solving smooth convex SP problems is given by
This bound has been obtained by Lan based on a stochastic counterpart of Nesterov’s method . Comparing (2.18) with the above bound, the RSG method possesses a nearly optimal rate of convergence, since the second term in (2.18) is unimprovable while the first term in (2.18) can be much improved. Moreover, as shown by Cartis et al. , the first term in (2.17) for nonconvex problems is also unimprovable for gradient descent methods. It should be noted, however that the analysis in applies only for gradient descent methods and does not show that the term is tight for all first-order methods.
Finally, observe that we can use different stepsize policy other than the constant one in (2.13). In particular, it can be shown that the RSG method with the following two stepsize policies will exhibit similar rates of convergence as those in Corollary 2.
Intuitively speaking, one may want to choose decreasing stepsizes which, according to the definition of in (2.3), can stop the algorithm earlier. On the other hand, as the algorithm moves forward and local information about the gradient gets better, choosing increasing stepsizes might be a better option. We expect that the practical performance of these stepsize policies will depend on each problem instance to be solved.
While Theorem 1 and Corollary 2 establish the expected convergence performance over many runs of the RSG method, we are also interested in the large-deviation properties for a single run of this method. In particular, we are interested in establishing its complexity for computing an -solution of problem (1.1), i.e., a point satisfying for some and . By using (2.14) and Markov’s inequality, we have
It then follows that the number of calls to performed by the RSG method for finding an -solution, after disregarding a few constant factors, can be bounded by
The above complexity bound is rather pessimistic in terms of its dependence on . We will investigate one possible way to significantly improve it in next subsection.
2 A two-phase randomized stochastic gradient method
In this section, we describe a variant of the RSG method which can considerably improve the complexity bound in (2.20). This procedure consists of two phases: an optimization phase used to generate a list of candidate solutions via a few independent runs of the RSG method and a post-optimization phase in which a solution is selected from this candidate list.
Input: Initial point , number of runs , iteration limit , and sample size .
Call the RSG method with input , iteration limit , stepsizes in (2.13) and probability mass function in (2.3). Let be the output of this procedure.
Choose a solution from the candidate list such that
where , , are the stochastic gradients returned by the .
Observe that in (2.21), we define the best solution as the one with the smallest value of , . Alternatively, one can choose from such that
It should be noted that the -RSG method is different from a two-phase procedure for convex stochastic programming by Nesterov and Vial , where the average of is chosen as the output solution.
In the -RSG method described above, the number of calls to the are given by and , respectively, for the optimization phase and post-optimization phase. Also note that we can possibly recycle the same sequence across all gradient estimations in the post-optimization phase of -RSG method. We will provide in Theorem 4 below certain bounds on , and , to compute an -solution of problem (1.1).
We need the following results regarding the large deviations of vector valued martingales (see, e.g., Theorem 2.1 of ).
We are now ready to describe the main convergence properties of the -RSG method. More specifically, Theorem 4.a) below shows the convergence rate of this algorithm for a given set of parameters , while Theorem 4.b) establishes the complexity of the -RSG method for computing an -solution of problem (1.1).
Under Assumption A1, the following statements hold for the -RSG method applied to problem (1.1).
Let be defined in (2.14). We have
Let and be given. If the parameters are set to
then the -RSG method can compute an -solution of problem (1.1) after taking at most
calls to the stochastic first-order oracle.
Proof. We first show part a). Observe that by the definition of in (2.21), we have
We now provide certain probabilistic upper bounds to the three terms in the right hand side of the above inequality. Firstly, using the fact that , , are independent and relation (2.19) (with ), we have
Moreover, denoting , , we have . Using this observation, Assumption A1 and Lemma 3.a), we conclude that, for any ,
The result then follows by combining relations (2.28), (2.29), (2.30) and (2.31).
We now show that part b) holds. Since the -RSG method needs to call the RSG method times with iteration limit in the optimization phase, and estimate the gradients , with sample size in the post-optimization phase, the total number of calls to the stochastic first-order oracle is bounded by . It remains to show that is an -solution of problem (1.1). Noting that by the definitions of and , respectively, in (2.14) and (2.25), we have
Using the above observation, (2.26) and setting in (2.23), we have
which, together with relations (2.23) and (2.24), and the selection of , then imply that
It is interesting to compare the complexity bound in (2.27) with the one in (2.20). In view of (2.24), (2.25) and (2.26), the complexity bound in (2.27), after disregarding a few constant factors, is equivalent to
The above bound can be considerably smaller than the one in (2.20) up to a factor of when the second terms are the dominating ones in both bounds.
The following result shows that the bound (2.27) obtained in Theorem 4 can be further improved under certain light-tail assumption of .
Under Assumptions A1 and A2, the following statements hold for the -RSG method applied to problem (1.1).
Let is defined in (2.14). We have, ,
Let and be given. If and are set to and as in (2.24) and (2.25), respectively, and the sample size is set to
then the -RSG method can compute an -solution of problem (1.1) in at most
calls to the stochastic first-order oracle.
Proof. We provide the proof of part a) only, since part b) follows immediately from part a) and an argument similar to the one used in the proof of Theorem 4.b). Denoting , , we have . Using this observation, Assumption A2 and Lemma 3.b), we conclude that, for any and ,
The result in part a) then follows by combining relations (2.28), (2.29), (2.36) and (2.37).
In view of (2.24), (2.25) and (2.34), the bound in (2.35), after disregarding a few constant factors, is equivalent to
Clearly, the third term of the above bound is significantly smaller than the corresponding one in (2.32) by a factor of .
Stochastic zeroth-order methods
Our problem of interest in this section is problem (1.1) with given in (1.4), i.e.,
Throughout this section, we assume that is represented by a stochastic zeroth-order oracle (). More specifically, at the -th iteration, and being the input, the outputs the quantity such that the following assumption holds:
The following result due to Nesterov describes some properties of .
The following statements hold for any .
is Lipschitz continuous with constant such that ;
we conclude from (3.5) that and hence that
Below we modify the RSG method in subsection (2.1) to use stochastic zeroth-order rather than first-order information for solving problem (3.1).
A randomized stochastic gradient free (RSGF) method
Input: Initial point , iteration limit , stepsizes , probability mass function supported on .
Step . Let be a random variable with probability mass function .
Step . Generate by Gaussian random vector generator and call the stochastic zeroth-order oracle for computing given by
Note that the esimator of in (3.12) was suggested by Nesterov in . Indeed, by (3.4) and Assumption A3, we have
By applying the approximation results in Theorem 6 to the functions , , and using a slightly different convergence analysis than the one in Theorem 1, we are able to obtain much refined convergence results for the above RSGF method.
Suppose that the stepsizes and the probability mass function in the RSGF method are chosen such that and
where the expectation is taken with respect to , and , and is defined in(2.5);
if, in addition, problem (3.1) is convex with an optimal solution , then, for any ,
where the expectation is taken with respect to , and , and is defined in (2.7).
Summing up these inequalities, re-arranging the terms and noting that , we obtain
where the second inequality follows from Assumption A1. Taking expectations with respect to on both sides of (3.19) and using the above two observations, we obtain
The above conclusion together with (3.8) and (3.11) then imply that
By re-arranging the terms and simplifying the constants, we have
Dividing both sides of the above inequality by and noting that
We now show part b). Denote . First observe that, for any ,
where the second inequality follows from (2.12) and the convexity of , and the last inequality follows from (3.5). Re-arranging the terms in the above inequality, using the facts that and , and simplifying the constants, we have
The rest of proof is similar to part a) and hence the details are skipped.
Similarly to the RSG method, we can specialize the convergence results in Theorem 7 for the RSGF method with a constant stepsize policy.
Suppose that the stepsizes are set to
where and are defined in (2.5) and (2.7), respectively. Then, under Assumptions A1 and A3, we have
If, in addition, problem (3.1) is convex with an optimal solution and is chosen such that
Proof. We prove (3.26) only since relation (3.27) can be shown by using similar arguments. First note that by (3.24), we have
Therefore, using the above inequalities and (3.16), we obtain
which, in view of (3.25), then implies that
Similarly to the RSG method, we can establish the complexity of the RSGF method for finding an -solution of problem (3.1) for some and . More specifically, by using (3.26) and Markov’s inequality, we have
which implies that the total number of calls to the performed by the RSGF method for finding an -solution of (3.1) can be bounded by
We will investigate a possible approach to improve the above complexity bound in next subsection.
2 A two-phase randomized stochastic gradient free method
In this section, we modify the 2-RSG method to improve the complexity bound in (3.33) for finding an -solution of problem (3.1).
Input: Initial point , number of runs , iteration limit , and sample size .
Call the RSGF method with input , iteration limit , stepsizes in (3.24), probability mass function in (3.15), and the smoothing parameter satisfying (3.25). Let be the output of this procedure.
Choose a solution from the candidate list such that
where is defined in (3.12).
The main convergence properties of the -RSGF method are summarized in Theorem 9. More specifically, Theorem 9.a) establishes the rate of convergence of the -RSGF method with a given set of parameters , while Theorem 9.b) shows the complexity of this method for finding an -solution of problem (3.1).
Under Assumptions A1 and A3, the following statements hold for the -RSGF method applied to problem (3.1).
Let be defined in (3.26). We have
Let and be given. If is set to as in (2.24), and the iteration limit and sample size , respectively, are set to
then the -RSGF method can compute an -solution of problem (3.1) after taking at most
Proof. First, observe that by (3.6), (3.25) and (3.26), we have
Using this observation and the definition of in (3.34), we obtain
where the last inequality also follows from (3.39). We now provide certain probabilistic bounds on the individual terms in the right hand side of the above inequality. Using (3.32) (with ), we obtain
Moreover, denote , . Note that, similar to (3.21), we have
It then follows from the previous inequality, (3.25) and (3.26) that
Noting that , we conclude from (3.42), Assumption A1 and Lemma 3.a) that, for any ,
The result then follows by combining relations (3.40), (3.41),(3.42), (3.43) and (3.44).
We now show part b) holds. Clearly, the total number of calls to in the -RSGF method is bounded by . It then suffices to show that is an -solution of problem (3.1). Noting that by the definitions of and , respectively, in (3.26) and (3.36), we have
Moreover, by setting and using (3.36) and (3.37), we obtain
Using these two observations and relation (3.35) with , we conclude that
Observe that in the view of (2.24), (3.36) and (3.37), the total number of calls to performed by the -RSGF method can be bounded by
The above bound is considerably smaller than the one in (3.33), up to a factor of when the second terms are the dominating ones in both bounds.
Concluding remarks
In this paper, we present a class of new SA methods for solving the classical unconstrained NLP problem with noisy first-order information. We establish a few new complexity results regarding the computation of an -solution for solving this class of problems and show that they are nearly optimal whenever the problem is convex. Moreover, we introduce a post-optimization phase in order to improve the large-deviation properties of the RSG method. These procedures, along with their complexity results, are then specialized for simulation-based optimization problems when only stochastic zeroth-order information is available. In addition, we show that the complexity for gradient-free methods for smooth convex SP can have a much weaker dependence on the dimension than that for more general nonsmooth convex SP.