A Generic Acceleration Framework for Stochastic Composite Optimization
Andrei Kulunchakov, Julien Mairal
Introduction
In this paper, we consider stochastic composite optimization problems of the form
Yet, as noted in , one is typically not interested in the minimization of the empirical risk—that is, a finite sum of functions—with high precision, but instead, one should focus on the expected risk involving the true (unknown) data distribution. When one can draw an infinite number of samples from this distribution, the true risk (1) may be minimized by using appropriate stochastic optimization techniques. Unfortunately, fast methods designed for deterministic objectives would not apply to this setting; methods based on stochastic approximations admit indeed optimal “slow” rates that are typically for convex functions and for strongly convex ones, depending on the exact assumptions made on the problem, where is the number of noisy gradient evaluations .
Better understanding the gap between deterministic and stochastic optimization is one goal of this paper. Specifically, we are interested in Nesterov’s acceleration of gradient-based approaches . In a nutshell, gradient descent or its proximal variant applied to a -strongly convex -smooth function achieves an exponential convergence rate in the worst case in function values, and a sublinear rate if the function is simply convex (). By interleaving the algorithm with clever extrapolation steps, Nesterov showed that faster convergence could be achieved, and the previous convergence rates become and , respectively. Whereas no clear geometrical intuition seems to appear in the literature to explain why acceleration occurs, proof techniques to show accelerated convergence and extensions to a large class of other gradient-based algorithms are now well established .
Yet, the effect of Nesterov’s acceleration to stochastic objectives remains poorly understood since existing unaccelerated algorithms such as stochastic mirror descent and their variants already achieve the optimal asymptotic rate. Besides, negative results also exist, showing that Nesterov’s method may be unstable when the gradients are computed approximately . Nevertheless, several approaches such as have managed to show that acceleration may be useful to forget faster the algorithm’s initialization and reach a region dominated by the noise of stochastic gradients; then, “good” methods are expected to asymptotically converge with a rate exhibiting an optimal dependency in the noise variance , but with no dependency on the initialization. A major challenge is then to achieve the optimal rate for these two regimes.
In this paper, we consider an optimization method with the following property: given an auxiliary strongly convex objective function , we assume that is able to produce iterates with expected linear convergence to a noise-dominated region—that is, such that
where , is the minimum function value, and is an upper bound on the variance of stochastic gradients accessed by , which we assume to be uniformly bounded. Whereas such an assumption has limitations, it remains the most standard one for stochastic optimization (see for more realistic settings in the smooth case). The class of methods satisfying (2) is relatively large. For instance, when is -smooth, the stochastic gradient descent method (SGD) with constant step size and iterate averaging satisfies (2) with , , and , see .
In this paper, we extend the Catalyst approach to general stochastic problems.All objectives addressed by the original Catalyst approach are deterministic, even though they may be large finite sums. Here, we consider general expectations as defined in (1). Under mild conditions, our approach is able to turn into a converging algorithm with a worst-case expected complexity that decomposes into two parts: the first one exhibits an accelerated convergence rate in the sense of Nesterov and shows how fast one forgets the initial point; the second one corresponds to the stochastic regime and typically depends (optimally in many cases) on . Note that even though we only make assumptions about the behavior of on strongly convex sub-problems (2), we also treat the case where the objective (1) is convex, but not strongly convex.
Other contributions.
In this paper, we generalize the analysis of Catalyst to handle various new cases. Beyond the ability to deal with stochastic optimization problems, our approach (i) improves Catalyst by allowing sub-problems of the form (2) to be solved approximately in expectation, which is more realistic than the deterministic requirement made in and which is also critical for stochastic optimization, (ii) leads to a new accelerated stochastic gradient descent algorithms for composite optimization with similar guarantees as , (iii) handles the analysis of accelerated proximal gradient descent methods with inexact computation of proximal operators, improving the results of while also treating the stochastic setting.
Finally, we note that the extension of Catalyst we propose is easy to implement. The original Catalyst method introduced in indeed required solving a sequence of sub-problems while controlling carefully the convergence, e.g., with duality gaps. For this reason, Catalyst has sometimes been seen as theoretically appealing but not practical enough . Here, we focus on a simpler and more practical variant presented later in , which consists of solving sub-problems with a fixed computational budget, thus removing the need to define stopping criterions for sub-problems. The code used for our experiments is available here: http://github.com/KuluAndrej/NIPS-2019-code.
Related Work on Inexact and Stochastic Proximal Point Methods.
Catalyst is based on the inexact accelerated proximal point algorithm , which consists in solving approximately a sequence of sub-problems and updating two sequences and by
where in is obtained from Nesterov’s acceleration principles , is a well chosen regularization parameter, and is the Euclidean norm. The method is used to obtain an approximate minimizer of ; when converges linearly, it may be shown that the resulting algorithm (4) enjoys a better worst-case complexity than if was used directly on , see .
Since asymptotic linear convergence is out of reach when is a stochastic objective, a classical strategy consists in replacing in (4) by a finite-sum approximation obtained by random sampling, leading to deterministic sub-problems. Typically without Nesterov’s acceleration (with ), this strategy is often called the stochastic proximal point method . The point of view we adopt in this paper is different and is based on the minimization of surrogate functions related to (4), but which are more general and may take other forms than .
Preliminaries: Basic Multi-Stage Schemes
In this section, we present two simple multi-stage mechanisms to improve the worst-case complexities of stochastic optimization methods, before introducing acceleration principles.
Consider an optimization method with convergence rate (2) and assume that there exists a hyper-parameter to control a trade-off between the bias and the computational complexity. Specifically, we assume that the bias can be reduced by an arbitrary factor , while paying a factor in terms of complexity per iteration (or may be reduced by a factor , thus slowing down convergence). This may occur in two cases:
by using a mini-batch of size to sample gradients, which replaces by ;
or the method uses a step size proportional to that can be chosen arbitrarily small.
For instance, stochastic gradient descent with constant step size and iterate averaging is compatible with both scenarios . Then, consider a target accuracy and define the sequences and for . We may now solve successively the problem up to accuracy —e.g., with a constant number steps of when using mini-batches of size to reduce the bias—and by using the solution of iteration as a warm restart. As shown in Appendix B, the scheme converges and the worst-case complexity to achieve the accuracy in expectation is
For instance, one may run SGD with constant step size at stage with iterate averaging as in , which yields , , and . Then, the left term is the classical complexity of the (unaccelerated) gradient descent algorithm for deterministic objectives, whereas the right term is the optimal complexity for stochastic optimization in . Similar restart principles appear for instance in in the design of a multistage accelerated SGD algorithm.
Restart: from sub-linear to linear rate with strong convexity.
A natural question is whether asking for a linear rate in (2) for strongly convex problems is a strong requirement. Here, we show that a sublinear rate is in fact sufficient for our needs by generalizing a restart technique introduced in for stochastic optimization, which was previously used for deterministic objectives in .
Specifically, consider an optimization method such that the convergence rate (2) is replaced by
where and is a minimizer of . Assume now that is -strongly convex with and consider restarting times the method , each time running for constant iterations. Then, it may be shown (see Appendix B) that the relation (2) holds with constant , , and . If a mini-batch or step size mechanism is available, we may then proceed as before and obtain a converging scheme with complexity (5), e.g., by using mini-batches of exponentially increasing sizes once the method reaches a noise-dominated region, and by using a restart frequency of order .
Generic Multi-Stage Approaches with Acceleration
We are now in shape to introduce a generic acceleration framework that generalizes (4). Specifically, given some point at iteration , we consider a surrogate function related to a parameter , an approximation error , and an optimization method that satisfy the following properties:
is -strongly convex, where is the strong convexity parameter of ;
The generic acceleration framework is presented in Algorithm 1. Note that the conditions on bear similarities with estimate sequences introduced by Nesterov ; indeed, () is a direct generalization of (2.2.2) from and () resembles (2.2.1). However, the choices of and the proof technique are significantly different, as we will see with various examples below. We also assume at the moment that the exact minimizer of is available, which differs from the Catalyst framework ; the case with approximate minimization will be presented in Section 4.1.
The proof of the proposition is given in Appendix C and is based on an extension of the analysis of Catalyst . Next, we present various application cases leading to algorithms with acceleration.
When is deterministic and the proximal operator of (see Appendix A for the definition) can be computed in closed form, choose and define
Consider that minimizes in closed form: . Then, () is obvious; () holds from the convexity of , and () with follows from classical inequalities for -smooth functions . Finally, we recover accelerated convergence rates .
Accelerated proximal point algorithm.
We consider given in (4) with exact minimization (thus an unrealistic setting, but conceptually interesting) with . Then, the assumptions (), (), and () are satisfied with and we recover the accelerated rates of .
Accelerated stochastic gradient descent with prox.
A more interesting choice of surrogate is
where we used the non-expansiveness of the proximal operator . Therefore, () holds with . The resulting algorithm is similar to and offers the same guarantees. The novelty of our approach is then a unified convergence proof for the deterministic and stochastic cases.
Consider Algorithm 1 with defined in (10). When is -strongly convex, choose . Then,
which is of the form (2) with and . Interestingly, the optimal complexity can be obtained by using the first restart strategy presented in Section 3, see Eq. (5), either by using increasing mini-batches or decreasing step sizes.
When the objective is convex, but not strongly convex, Proposition 1 gives a bias term that increases linearly with . Yet, the following corollary exhibits an optimal rate with finite horizon, when both and an upper-bound on are available. Even though non-practical, the result shows that our analysis recovers the optimal dependency in the noise level, as and others.
Consider a fixed budget of iterations of Algorithm 1 with defined in (10). When ,
While all the previous examples use the choice , we will see in Section 4.2 cases where we may choose . Before that, we introduce a variant when is not available.
In principle, it is possible to design other surrogates, which would lead to new algorithms coming with convergence guarantees given by Propositions 1 and 4, but the given examples (4), (10), and (10) already cover all important cases considered in the paper for functions of the form (1).
1 Variant with Inexact Minimization
In this variant, presented in Algorithm 2, is not available and we assume that also satisfies:
The next proposition, proven in Appendix C, gives us some insight on how to achieve acceleration.
Consider Alg. 2. Then, for any ,
To maintain the accelerated rate, the sequence needs to converge at a similar speed as in Proposition 1, but the dependency in is slightly worse. Specifically, when is positive, we may have both and decreasing at a rate with , but we pay a factor compared to (8). When , the accelerated rate is preserved whenever and , but we pay a factor compared to (8).
Consider Alg. 2 with defined in (4). Then, for ,
Our results improve upon Catalyst in two aspects that are crucial for stochastic optimization: (i) we allow the sub-problems to be solved in expectation, whereas Catalyst requires the stronger condition ; (ii) Proposition 5 removes the requirement of to perform a full gradient step for initializing the method in the composite case (see Prop. 12 in ).
Proximal gradient descent with inexact prox [45].
The surrogate (10) with inexact minimization can be treated in the same way as Catalyst, which provides a unified proof for both problems. Then, we recover the results of , while allowing inexact minimization to be performed in expectation.
Stochastic Catalyst.
Accelerated stochastic proximal gradient descent with inexact prox.
Finally, consider defined in (10) but the proximal operator is computed approximately, which, to our knowledge, has never been analyzed in the stochastic context. Then, it may be shown (see Appendix B for details) that, even though is not available, Proposition 4 holds nonetheless with . Then, an interesting question is how small should be to guarantee the optimal dependency with respect to as in Corollary 2. In the strongly-convex case, Proposition 4 simply gives such that .
2 Exploiting methods ℳℳ{\mathcal{M}} providing strongly convex surrogates
Among various application cases, we have seen an extension of Catalyst to stochastic problems. To achieve convergence, the strategy requires a mechanism to reduce the bias in (2), e.g., by using mini-batches or decreasing step sizes. Yet, the approach suffers from two issues: (i) some of the parameters are based on unknown quantities such as ; (ii) the worst-case complexity exhibits a sub-optimal dependency in , typically of order when . Whereas practical workarounds for the first point are discussed in Section 5, we now show how to solve the second one in some cases, by using Algorithm 1 with an optimization method , which is able not only to minimize an auxiliary objective , but also at the same time is able to provide a model , typically a quadratic function, which is easy to minimize. Consider then a method satisfying (2) and which produces, after steps, a point and a surrogate such that
As shown in Appendix D, even though (14) looks technical, a large class of optimization techniques are able to provide the condition (14), including many variants of proximal stochastic gradient descent methods with variance reduction such as SAGA , MISO , SDCA , or SVRG .
Whereas (14) seems to be a minor modification of (2), an important consequence is that it will allow us to gain a factor in complexity when , corresponding precisely to the sub-optimality factor. Therefore, even though the surrogate needs only be minimized approximately, the condition (14) allows us to use Algorithm 1 instead of Algorithm 2. The dependency with respect to being better than (by ), we have then the following result:
Consider Algorithm 1 with a method and surrogate satisfying (14) when is used to minimize by using as a warm restart. Assume that is -strongly convex and that there exists a parameter that can reduce the bias by a factor while paying a factor in terms of inner-loop complexity.
The term on the left is the accelerated rate of Catalyst for deterministic problems, whereas the term on the right is potentially optimal for strongly convex problems, as illustrated in the next table. We provide indeed practical choices for the parameters , leading to various values of , for the proximal stochastic gradient descent method with iterate averaging as well as variants of SAGA,MISO,SVRG that can cope with stochastic perturbations, which are discussed in Appendix D. All the values below are given up to universal constants to simplify the presentation.
Experiments
In this section, we perform numerical evaluations by following , which was notably able to make SVRG and SAGA robust to stochastic noise, and accelerate SVRG. Code to reproduce the experiments is provided with the submission and more details and experiments are given in Appendix E.
where is either the logistic loss , or the squared hinge loss , which are both -smooth, with for logistic and for the squared hinge loss. Studying the squared hinge loss is interesting since its gradients are unbounded on the optimization domain, which may break the bounded noise assumption. The regularization parameter acts as the strong convexity constant for the problem and is chosen among the smallest values one would try when performing parameter search, e.g., by cross validation. Specifically, we consider and , where is the number of training points; we also try to evaluate the numerical stability of methods in very ill-conditioned problems. Following , we consider DropOut perturbations —that is, setting each component to 0 with a probability and to otherwise. This procedure is motivated by the need of a simple optimization benchmark illustrating stochastic finite-sum problems, where the amount of perturbation is easy to control. The settings used in our experiments are (no noise) and .
Datasets.
alpha is from the Pascal Large Scale Learning Challenge websitehttp://largescale.ml.tu-berlin.de/ and contains points in dimension .
gene consists of gene expression data and the binary labels characterize two different types of breast cancer. This is a small dataset with and .
ckn-cifar is an image classification task where each image from the CIFAR-10 datasethttps://www.cs.toronto.edu/~kriz/cifar.html is represented by using a two-layer unsupervised convolutional neural network . We consider here the binary classification task consisting of predicting the class 1 vs. other classes, and use our algorithms for the classification layer of the network, which is convex. The dataset contains images and the dimension of the representation is .
Methods.
We consider the variants of SVRG and SAGA of , which use decreasing step sizes when (otherwise, they do not converge). We use the suffix “-d” each time decreasing step sizes are used. We also consider Katyuasha when , and the accelerated SVRG method of , denoted by acc-SVRG. Then, SVRG-d, SAGA-d, acc-SVRG-d are used with the step size strategies described in , by using the code provided to us by the authors.
Practical questions and implementation.
In all setups, we choose the parameter according to theory, which are described in the previous section, following Catalyst . For composite problems, Proposition 5 suggests to use as a warm start for inner-loop problems. For smooth ones, shows that in fact, other choices such as are appropriate and lead to similar complexity results. In our experiments with smooth losses, we use , which has shown to perform consistently better.
Experiments and conclusions.
We run each experiment five time with a different random seed and average the results. All curves also display one standard deviation. Appendix E contains numerous experiments, where we vary the amount of noise, the type of approach (SVRG vs. SAGA), the amount of regularization , and choice of loss function. In Figure 1, we show a subset of these curves. Most of them show that acceleration may be useful even in the stochastic optimization regime, consistently with . At the same time, all acceleration methods may not perform well for very ill-conditioned problems with , where the sublinear convergence rates for convex optimization () are typically better than the linear rates for strongly convex optimization (). However, these ill-conditioned cases are often unrealistic in the context of empirical risk minimization.
Acknowledgments
This work was supported by the ERC grant SOLARIS (number 714381) and ANR 3IA MIAI@Grenoble Alpes. The authors would like to thank Anatoli Juditsky for numerous interesting discussions that greatly improved the quality of this manuscript.
References
Appendix A Useful Results and Definitions
In this section, we present auxiliary results and definitions.
Consider the sequence in defined by the recursion
and define . Then,
if and , then, for all ,
if , then for all ,
if , then for all ,
Let us prove the first point when and . The relation is obvious for all and the relation holds for . By induction, let us assume that we have the relation and let us show that it propagates for . Assume, by contradiction, that , meaning that . Then,
and we obtain a contradiction. Therefore, and the induction hypothesis allows us to conclude for all . Then, note that we also have for all ,
Second point.
The second point is obvious by induction.
Third point.
For the third point, we simply assume such that . Then, the relation and therefore are easy to show by induction. Then, consider the sequence defined recursively by with . From the first point, we have that . We will show that for all , which will be sufficient to conclude since then we would have . First, we note that ; then, assume that and also assume by contradiction that . This implies that
which contradicts the assumption . This allows us to conclude by induction. ∎
Consider the sequence with in . Then,
We use the classical inequality for all :
when noting that the function is greater than for all , since and is non-decreasing. Then,
Appendix B Details about Complexity Results
Consider the complexity (2) with . To achieve the accuracy , it is sufficient to run the method for iterations, such that
It is then easy to see that this inequality is satisfied as soon as is greater than . Since and using the concavity of the logarithm function, it is also sufficient to choose .
and (5) follows by elementary calculations.
B.2 Obtaining (5) from (6)
Since is -strongly convex, we notice that (6) implies the rate
by using the strong convexity inequality . After running the algorithm for iterations, we can show that
Then, when restarting the procedure times (using the solution of the previous iteration as initialization), and denoting by the last iterate, it is easy to show that
Then, calling , we can use the inequality for in $$, due to convexity, and
which gives us (2) with and . It is then easy to obtain (5) by following similar steps as in Section B.1, by noticing that the restart frequency is of the same order .
B.3 Details about (13)
Outer-loop complexity.
Global complexity.
where the last relation uses the fact that .
B.4 Complexity of accelerated stochastic proximal gradient descent with inexact prox
Assume that . Then, following similar steps as in (11),
And thus, .
Appendix C Proofs of Main Results
In order to treat both propositions jointly, we introduce the quantity
with , as well as for all .
Note that the following relations hold for all , keeping in mind that :
Then, based on the previous relations, we have
Introduce now the following quantity for the convergence analysis:
and consider in (17) while taking expectations, noting that all random variables indexed by are deterministic given ,
where the last inequality is due to ().
The first relation is due to the convexity of ; the second one can be obtained from the definition of in (16) after simple calculations; the last one can be obtained as in the proof of Theorem 3 in (end of page 16).
We may now come back to (18) and we use the relations (19):
It is then easy to see that the terms involving cancel each other since .
We may finally define the Lyapunov function
For variant Algorithm 1, we have since , and we obtain the following relation by unrolling the recursion:
Specialization to μ>0𝜇0\mu>0.
When , we have and
Specialization to μ=0𝜇0\mu=0.
When , we have and . Then, according to Lemma 8 and (22), for ,
and we obtain the second part of (8) noting that and that . Then, Proposition 1 is proven.
Proof of Proposition 4.
When , we need to control the quantity . Consider any scalar in . Then,
Then, we take expectations and, noticing that the quadratic term involving is smaller than in expectation (from the definition of in (20)), we obtain
Specialization to μ>0𝜇0\mu>0.
When , we have for all . Then, we may choose ; then, and \frac{A_{k}}{\Theta_{k}}\leq\big{(}1-\frac{\sqrt{q}}{2}\big{)}^{k} for all . By using the relation (23), we obtain
Specialization to μ=0𝜇0\mu=0.
When , we have and . We may then choose for any in , leading to for all according to Lemma 9. Besides, according to the proof of Lemma 8, for all .
which yields the second part of Proposition (4). ∎
C.2 Proof of Proposition 5
Assume that for , we have the relation
Then, we want to evaluate the quality of the initial point to minimize .
where the third inequality uses the non-expansiveness of the proximal operator; the fourth inequality uses the inequality for vectors , and the last inequality uses the strong convexity of . Then, we may use the same upper-bound on as [33, Proposition 12], namely
C.3 Proof of Proposition 6
The proof is similar to the derivation described in Section B.3.
Outer-loop complexity.
Global complexity.
We use the exact same derivations as in Section B.3 except that we use the fact that instead of , which gives us the desired complexity.
Appendix D Methods ℳℳ{\mathcal{M}} with Duality Gaps Based on Strongly-Convex Lower Bounds
In this section, we summarize a few results from and introduce minor modifications to guarantee the condition (14). For solving a stochastic composite objectives such as (1), where is -strongly convex, consider an algorithm performing the following classical updates
where , and the variance of is upper-bounded by . Inspired by estimate sequences from , the authors of build recursively a -strongly convex quadratic function of the form
From the proof of Proposition 1 in , we then have
which is a minor modification of Proposition 1 in that is better suited to our purpose.
Assume now that for all . Following the iterate averaging procedure used in Theorem 1 of , which produces an iterate , we obtain
where is a minimizer of , which is sufficient to guarantee (2) given that .
such that () is satisfied, and finally (29) becomes
Variance-reduction methods.
In , gradient estimators with variance reduction are studied, leading to variants of SAGA , MISO , and SVRG , which can deal with the stochastic finite-sum problem presented in Section 1. Then, the variance of decreases (Proposition 2 in ).
Let us then consider again the guarantees of the method obtained when minimizing with . From Corollary 5 of , we have
and (2) is satisfied. Consider now two cases at iteration :
otherwise, it is easy to modify Theorem 2 and Corollary 5 of to obtain
Consider now applying the method for minimizing , with the same choice of as (31), which ensures (), and same definitions as above for and . Note that the conditions on and above are satisfied when under the condition . Then, we have from the previous results, after replacing by making the right subsitutions
Other schemes.
Whereas we have presented approaches were is quadratic, also studies another class of algorithms where is composite (see Section 2.2 in ). The results we present in this paper can be extended to such cases, but for simplicity, we have focused on quadratic surrogates.
Appendix E Additional Experimental Material
The numerical evaluation was performed by using four nodes of a CPU cluster with 56 cores of Intel CPUs each. The full set of experiments presented in this paper (with runs for each setup) takes approximately half a day.
Making plots.
We run each experiment five times and average the outputs. We display plots on a logarithmic scale for the primal gap (with estimated as the minimum value observed from all runs). Note that for SVRG, one iteration is considered to perform two epochs since it requires accessing the full dataset every iterations on average.
E.1 Additional experiments.
We start evaluating the acceleration approach when there is no noise. This is essentially evaluating the original Catalyst method in a deterministic setup in order to obtain a baseline comparison when . The results are presented in Figures 2 and 3 for the logistic regression problem. As predicted by theory, acceleration is more important when conditioning is low (bottom curves).
Stochastic acceleration with no noise, δ=0.01𝛿0.01\delta=0.01 and δ=0.1𝛿0.1\delta=0.1.
Then, we perform a similar experiments by adding noise and report the results in Figures 4, 5, 6, 7. In general, the stochastic Catalyst approach seems to perform on par with the accelerated SVRG approach of and even better in one case.
Evaluating the square hinge loss.
In Figure 8, we perform experiments using the square hinge loss, where the methods perform similarly as for the logistic regression case, despite the fact that the bounded noise assumption does not necessarily hold on the optimization domain for the square hinge loss.
Evaluating ill-conditioned problems.
Finally, we study in Figure 10 how the methods behave when the problems are badly conditioned. There, acceleration seems to work on ckn-cifar, but fails on gene and alpha, suggestions that acceleration is difficult to achieve when the condition number is extremely low.