Random Permutations Fix a Worst Case for Cyclic Coordinate Descent
Ching-Pei Lee, Stephen J. Wright
Introduction
The basic (component-wise) coordinate descent framework for the smooth unconstrained optimization problem
When is a convex quadratic function, and when in Algorithm 1 is chosen to minimize exactly along each coordinate direction, these variants are simply different variants of the Gauss-Seidel approach for solving the equivalent system of linear equations.
The coordinate descent approach is enjoying renewed popularity because of its usefulness in data analysis applications. Its convergence properties have come under renewed scrutiny. We refer to (Wright, 2015b) for a discussion of the state of the art as of 2015, but make a few additions and updates here, with an emphasis on results concerning linear convergence of the function values, by which we mean epoch-wise convergence of the form
where is typically much closer to than to , and is the optimal value of (1). For randomized methods, we consider a corresponding expression in expectation:
where the expectation is taken over all random variables encountered in the algorithm. When (3) holds, a reduction in function error by a factor of can be attained in approximately epochs. We sometimes refer to as the “complexity” of an algorithm for which (3) or (4) holds.
The standard Lipschitz constant is defined so that
(Here and throughout, we use to denote .) For reasonable choices of the constants in (5), (6), and (7), the following bounds are satisfied:
The following property of Łojasiewicz (1963) is useful in proving linear convergence:
This property holds for strongly convex (with modulus of strong convexity ), and for the case in which grows quadratically with distance from a non-unique minimizing set, as in the “optimal strong convexity” condition of Liu & Wright (2015, (1.2)). It also holds generically for convex quadratic programs, even when the Hessians are singular. Further, condition (9) holds for the functional form considered by Luo & Tseng (1992, 1993), which is
without any conditions on . (For a proof, see Appendix C.) In (Karimi et al., 2016), property (9) is called the “Polyak-Łojasiewicz condition.”
In this paper, our focus is on the case of convex quadratic, that is,
For this function, the values of , , , and are as follows:
where denotes the minimum nonzero eigenvalue. For such functions, the upper bound in (8) is achieved by (where ), for which , ; ; and .
We have not included a linear term in (11), but note that there is no loss of generality in doing so. If we were to consider instead
(note that is the minimizer of this function), the main results of Sections 2 and 3 would continue to hold, except that in several theorems the initial iterate would be replaced by , and is replaced by .
2 Linear Convergence Results for CD Variants
Luo & Tseng (1992) prove linear convergence for a function of the form (10), where they require to have no zero columns. They obtain expressions for the constant in (3) for two variants of CD — a Gauss-Southwell variant and an “almost cyclic” rule — but these constants are difficult to characterize in terms of fundamental properties of . In (Luo & Tseng, 1993), the same authors analyze a family of methods (including CD) for more general functions that satisfy a local error bound of the form holds (where is the projection of onto the solution set of (1) and is some constant). Again, their analysis is not clear about how the constant of (3) depends on the properties of .
A family of linear convergence results is proved in Beck & Tetruashvili (2013, Theorem 3.9) for the case in which is strongly convex (immediately extendable to the case in which satisfies the condition (9)). For constant stepsizes , convergence of the form (3) holds with
For the random-permutations cyclic version RPCD, the convergence theory in (Beck & Tetruashvili, 2013) can be applied without modification to attain the bounds given above. As we discuss below, however, the practical performance of RPCD is sometimes much better than these bounds would suggest.
A different convergence rate is proved in Nesterov (2012, Theorem 5), namely,
for some constant depending on the initial point. This is an R-linear expression, obtained from Q-linear convergence of the modified function , where is the (unique) solution of (1). It indicates a complexity of approximately .
An important benchmark in studying the convergence rates of coordinate descent is the steepest-descent (SD) method, which takes a step from along all coordinates simultaneously, in the direction . For some important types of functions, including empirical-risk-minimization functions that arise in data analysis, the computational cost of one steepest-descent step is comparable to the cost of one epoch of Algorithm 1 (see (Wright, 2015b)). Standard analysis of steepest descent shows that fixed-steplength variants applied to functions satisfying (9) have linear convergence of the form (3) (with one iteration of SD replacing one epoch of Algorithm 1) with . This worst-case complexity is not improved qualitatively by using exact line searches.
In comparing convergence rates between CCD and SD (on the one hand) and RCD (on the other hand), we see that the former tend to depend on while the latter depends on . These bounds suggest that CCD may tend to track the performance of SD, while RCD could be significantly better if the ratio is large, that is, toward the upper end of its range in (8). The phenomenon of large values of is captured well by convex quadratic problems (11) in which the Hessian has a large contribution from . Such matrices were used in computations by one of the authors in 2015 (see (Wright, 2015a); reported briefly in (Wright, 2015b)). These tests showed that on such matrices, RCD was indeed much faster than CCD (and also SD). The performance of RPCD was as fast as that of RCD; it did not track CCD as the obvious worst-case analysis would suggest. Later work, reported in (Wright, 2015c), identified the matrix
3 Motivation and Outline
Our focus in this paper is to analyze the performance of RPCD for minimizing (11) with defined in (17). Our interest in RPCD is motivated by computational practice. Much has been written about randomized optimization algorithms (particularly stochastic gradient and coordinate descent) in recent years. The analysis usually applies to sampling-with-replacement versions, but the implementations almost always involve a sampling-without-replacement scheme. The reasons are clear: Convergence analysis is much more straightforward for sampling with replacement, while for sampling without replacement, implementations are more efficient, involving less data movement. Moreover, it has long been folklore in the machine learning community that sampling-without-replacement schemes perform better in practice. In this paper we take a step toward bringing the analysis into line with the practice, by giving a tight analysis of the sampling-without-replacement scheme RPCD, on a special but important function that captures perfectly the advantages of randomized schemes over a deterministic scheme.
In Section 2, we derive tools for analyzing epoch-wise convergence of CD variants on convex quadratic problems (11), focusing on the permutation-invariant matrix (17) and recalling results for the CCD and RCD variant in this case (obtained from (Sun & Ye, 2016) and (Nesterov, 2012)). Section 3 contains our results for RPCD applied to (11) with the permutation-invariant matrix (17), characterizing its convergence rate in terms of a two-parameter recurrence. The relationship of this two-parameter sequence to the expected function value at the end of each epoch is described in Theorem 3.5. Our main result, Theorem 3.7, gives bounds on these two parameters in terms of (the parameter that defines (17)) and epoch number. These bounds indicate that the convergence rate of RPCD matches that of RCD, and both are much faster than CCD on the problem defined by (11) and (17). We also note that a slightly tighter bound on the asymptotic behavior of the two-variable recurrence can be obtained from the spectral radius of the matrix governing this recurrence, in a regime in which is close to zero. We derive an estimate of this spectral radius in (52), using results from Appendix B. Theorem 3.9 explores the behavior of the randomized methods on the very first iteration, showing that a significant decrease can be expected just on this one iteration. (Similar results can be expected for the cyclic variant CCD, as we remark in comments following Theorem 3.9.)
Empirical verification of our analysis of RPCD, and computational comparisons with CCD and RCD, are presented in Section 4. The theoretical results are confirmed nicely in all cases. We conclude with some discussions in Section 5.
Convergence of CD Variants on Convex Quadratics
We consider the application of CCD and RPCD to the convex quadratic problem (11). This problem has solution with optimal objective . We assume that the matrix is diagonally scaled so that
Under this assumption, the step of Algorithm 1 with exact line search will have the form
Some variants of CD methods applied (11) can be viewed as Gauss-Seidel methods applied to the system . Cyclic CD corresponds to standard Gauss-Seidel, whereas RCD and RPCD are variants of randomized Gauss-Seidel.
Writing , where is strictly lower triangular and is the diagonal, one epoch of the CCD method can be written as follows:
The average improvement in per epoch is obtained from the formula
To obtain a bound on this quantity, we denote the eigenvalues of by , , and recall that the spectral radius is . Since is positive definite, we have (Golub & Van Loan, 2012, Theorem 11.2.3). We have from Gelfand’s formula (Gelfand, 1941) that
We can obtain a bound on in terms of as follows:
We can describe each epoch of RPCD algebraically by using a permutation matrix to represent the permutation on epoch . We split the matrix and define the operator as follows:
2 CD Variants Applied to Permutation-Invariant A𝐴A
In our search for the simplest instance of a matrix for which the superiority of randomization is observed, we arrived at the matrix (17). As mentioned above, the eigenvalues of are
The restriction in (17) ensures that has the following properties:
unit diagonals: , ;
invariant under symmetric permutations of the rows and columns, that is, for any permutation matrix ;
is close to its maximum value of when is small, opening a wide gap between the worst-case theoretical behaviors of CCD and RCD.
Figure 2 shows results for the CCD, RPCD, and RCD variants on the matrix from (17) with and two different values of . Here, the vertical axis shows actual function values (not expected values) relative to , for some particular whose elements are drawn i.i.d from . For both values of , both randomized variants are much faster than CCD. For the larger value of , RPCD has a clear advantage over RCD. Our analysis below supports these empirical observations.
We now derive expressions for the epoch iteration matrix of Section 2.1 for the specific case of the permutation-invariant matrix (17). This is needed for the analysis of RPCD on this matrix. By applying the splitting (20) to (17), we have
We have from (31b) and the properties of and that
For the complementary case , we have
3 Convergence Rates of CCD and RCD on the Permutation-Invariant A𝐴A
Here, we examine the theoretical convergence rate of CCD on the quadratic function with Hessian (17) by using the results of Sun & Ye (2016).
Recalling the rate (14) from Sun & Ye (2016, Proposition 3.1), and substituting the following quantities for (17):
(We use in place of , to emphasize the dependence of in (17) on the parameter .) By making the mild assumption that , this expression simplifies to
On the other hand, Sun and Ye show the following lower bound on (obtained by substituting from (33) into Theorem 3.1 of Sun & Ye (2016)):
By combining (34) and (35), we see that for small values of , the average epoch-wise decrease in error is , for some moderate value of . Classical numerical analysis for Gauss-Seidel derives similar dependency on for this case from the eigenvalues of , , and ; see (Samarskii & Nikolaev, 1989), Young & Rheinboldt (1971, p. 464), and Hackbusch (2016, Theorem 3.44). This dependency on is confirmed empirically, by running CCD for with the same but different , as shown in Figure 3(a).
For RCD, we have by substituting the values in (33) into (15) that the expected per-epoch improvement in error is given by
This result suggests that complexity of RCD is times better than CCD for small , and that its rate does not depend strongly on . This independence of is confirmed empirically by Figure 3(b). The expression (16) suggests a slightly better complexity for RCD of roughly epochs, rather than epochs, corresponding to replacing in (36) by
A kind of lower bound on the per-iterate improvement of RCD on the problem (11), (17) can be found by setting , with even. It can be shown that the function values for this and the next RCD iterate are
Figure 3(c) shows that RPCD too has a convergence rate independent of on this matrix. (The performances of RPCD and RCD are quite similar on the problems graphed.) The convergence rate of CCD deteriorates with , according to the predictions above.
Convergence of RPCD for the Permutation-Invariant A𝐴A
and note that and (by comparison with (39)) that
We have the following recursive relationship between successive terms in the sequence of matrices:
For any , if shifts the th position to the th position, then . Since the probability of taking any permutation from is identical, we have that
(where denotes probability). Therefore, each diagonal entry is the average over all diagonal entries of .
Consider permutations that shift the th and the th entries to the th and the th positions, respectively, that is,
Note that we always have that because permutations are bijections from and to . Thus, there are permutations in with the property (44). Under the same reasoning as before, each off-diagonal entry of is the average of all off-diagonal entries of .
Finally, we obtain (43) by noting that , while for .
Note that for (46c) and (46d) we used the property .
The following theorem reveals the relationship between successive matrices in the sequence .
Consider solving (11) with the matrix defined in (17) using RPCD. For defined in (41), with , we have
where and
and are defined in (46).
We first prove (47) by induction. By (17), it holds at . Now assume it holds for , for some and , then for we have from (41)
Because is in the form (47), it is invariant to row and column permutations, that is, for all . Hence,
Consider solving (11) with the matrix defined in (17) using RPCD. Then, using the notation of Theorem 3.3, we have
2 Convergence of the Two-Parameter Recurrence
It is evident from Theorems 3.3 and 3.5 (and Gelfand’s formula) that the asymptotic convergence of the expected value of is governed by , which, because of definitions (49) and (46), is a function of and . In Figure 2(b) of Section 2.2 and Table 1 of Section 4, we see that this rate is significantly better than those obtained for RCD and CCD when is not too close to zero (that is, ). In this section, we estimate the convergence rate of RPCD for close to zero, showing that in this regime, it is close to the rate of approximately obtained by RCD (37), and much faster than the rate of CCD discussed in (34), (35), which is , for some modest value of .
By appealing to Theorems 3.3 and 3.5, we obtain our main result.
Consider solving (11), (17) with and using RPCD. Then, using the notation of Theorem 3.3, we have that
Thus, we have the following bound on the convergence of the expected value of the function:
Since , we have from (48) and using that
The final claim follows directly from Theorem 3.5.
This result indicates a global linear rate of at worst , similar to the rate (37) obtained for RCD (identical to ) and much faster than the rate obtained for CCD in (34), (35).
By using slightly more refined estimates of the elements of , which involve not strict upper bounds as in (A.11) but rather remainder terms containing higher powers of and/or , we can obtain an estimate of . In Appendix B, we obtain the following estimates of , , , and :
By substituting these estimates into (49) and calculating the spectral radius as the largest root of the characteristic quadratic , we obtain
This asymptotic rate is identical to the rate for RCD (37) in the , , and , terms, and is slightly better because of the presence of the term.
3 The First Iteration
We noted in the numerical experiments (Figures 3 and 4) that the decrease in over the first epoch of RPCD is rather dramatic. In fact, after just a single iteration, the function value was often of order , for all three variants (CCD, RPCD, and RCD). The following result supports this observation.
Consider solving (11) with the matrix defined in (17) using RCD or RPCD with exact line search (19). Given any , the expected function value after a single iteration satisfies
where denotes the coordinate chosen for updating at the first iteration.
Note that is chosen uniformly at random from for both RPCD and RCD. After one step of CD, we have
we have by taking expectation with respect to in (54) that the equality in (53) holds.
For CCD, we have from (54) with that
If is independent of , we have that . However there is no guarantee that is substantially smaller than . If is chosen “adversarially” in such a way that , we may find that is not much smaller than . For random choices of , however, we would expect a significant decrease on the first iteration, similar to that observed for RPCD and RCD.
Computational Results
Conclusions
Recent work has shown that the problem (11) with Hessian matrix (17) is a case that reveals significant differences in performance between cyclic and randomized variants of coordinate descent. Here, we provide an analysis of the performance of random-permutations cyclic coordinate descent that sharply predicts the practical convergence behavior of this approach, showing an asymptotic convergence rate that at least matches (and is even slightly better than) that obtained by a random sampling-with-replacement scheme.
Acknowledgments
We thank two referees and the Editor-in-Chief for their comments on earlier drafts, which caused us to improve the presentation and sharpen the results of the paper.
References
Appendix A Estimating Terms in the Recurrence Matrix M𝑀M
Here we first find upper and (in some cases) lower bounds for the following quantities, for the matrix given in (17) and the corresponding value of defined in (29) and (31):
We then use these quantities to obtain bounds on , , , and from (46). We assume throughout that and .
For , we have from (29) and (31) that
where and have the following components:
(from (31a)). For , we have
We next seek an upper bound for . We have from (32) that
We now use (32) to compute bounds on the other quantities in (A.1). We have
Noting that and for the values of and of interest, and using , we continue as follows:
Thus, dividing by , and using to deduce that , we obtain
For the corresponding lower bound, we pick up from (A.4) and again use and , together with and , to obtain the following:
Note that this lower bound is strictly positive in the regime and .
For , we obtain from (32) that
where in (A.8) we used . It therefore follows that
It follows, using again and , that
where we used (A.6) for the final inequality. It follows that
From the formulas (46) together with (A.2), (A.5), (A.6), (A.3), (A.9), and (A.10), and using , we have the following:
From (A.11c), (A.11d), (A.2) and (A.3), we have
For the two terms and , we first need better approximations of and . From (A.4), we proceed with
For , we obtain from (A.7) that
Appendix C Condition (9) for g(Ex)𝑔𝐸𝑥g(Ex) with g𝑔g Strongly Convex
Meanwhile we have by convexity of that
Dividing both sides by we obtain