Behavior of Accelerated Gradient Methods Near Critical Points of Nonconvex Functions
Michael O'Neill, Stephen J. Wright
Introduction
We consider methods for the smooth unconstrained optimization problem
Our particular interest here is in methods that use gradients and momentum to construct steps. In many such methods, each step is a linear combination of two components: the gradient evaluated at a point at or near the latest iterate, and a momentum term, which is the step between the current iterate and the previous iterate. There are rich convergence theories for these methods in the case in which is convex or strongly convex, along with extensive numerical experience in some important applications. However, although these methods are applied frequently to nonconvex functions, little is known from a mathematical viewpoint about their behavior in such settings. Early results showed that a certain modified accelerated gradient method achieves the same order of convergence on a nonconvex problem as gradient descent — not a faster rate, as in the convex setting.
After submission of our paper, described a method that combines accelerated gradient, perturbation at points with small gradients and explicit negative curvature detection to attain a method with worst-case complexity guarantees.
Heavy-Ball is Unlikely to Converge to Strict Saddle Points
We show in this section that the heavy-ball method is not attracted to strict saddle points, unless initialized in a very particular way, that cannot occur if the starting point is chosen at random and the algorithm is modified slightly. Following , our proof is based on the stable manifold theorem.
We make the following assumption throughout this section.
Under this assumption, the eigenvalues of the Hessian are bounded in magnitude by .
The heavy-ball method is a prototypical momentum method (see ), which proceeds as follows from a starting point :
Convergence for this method is known for the special case in which is a strongly convex quadratic. Denote by the positive lower bound on the eigenvalues of the Hessian of this quadratic, and recall that is the upper bound. For the settings
a rigorous version of the eigenvalue-based argument in [13, Section 3.2] can be applied to show R-linear convergence with rate constant , which is approximately when the ratio is large. This suggests a complexity of iterations to reduce the error by a factor of (where is the unique solution). Such rates are typical of accelerated gradient methods. They contrast with the rates attained by the steepest-descent method on such functions.
We note that the eigenvalue-based argument that is “sketched” by does not extend rigorously beyond strongly convex quadratic functions. A more sophisticated argument based on Lyapunov functions is needed, like the one presented for Nesterov’s accelerated gradient method in [14, Chapter 4].
The key to our argument for non-convergence to strict saddle points lies in formulating the heavy-ball method as a mapping whose fixed points are stationary points of and to which we can apply the stable manifold theorem. Following (3), we define this mapping to be
We have the following elementary result about the relationship of critical points for (1) to fixed points for the mapping .
If is a critical point of , then is a fixed point for . Conversely, if is a fixed point for , then is a critical point for .
The first claim is obvious by substitution into (5). For the second claim, we have that if is a fixed point for , then
from which we have and , giving the result.
We now establish that is a diffeomorphic mapping, a property needed for application of the stable manifold result.
Suppose that Assumption 1 holds. Then the mapping defined in (5) is a diffeomorphism.
We need to show that is injective and surjective, and that and its inverse are times continuously differentiable.
To show injectivity of , suppose that . Then, we have
demonstrating injectivity. To show that is surjective, we construct its inverse explicitly. Let be such that
Then . From the first partition in (9), we obtain , which after substitution of leads to
Thus, is a bijection. Both and are continuously differentiable one time less than , so by Assumption 1, is a -diffeomorphism.
We are now ready to state the stable manifold theorem, which provides tools to let us characterize the set of escaping points.
Let be a fixed point for the local diffeomorphism where is a neighborhood of in the Banach space . Suppose that , where is the invariant subspace corresponding to the eigenvalues of whose magnitude is less than or equal to 1, and is the invariant subspace corresponding to eigenvalues of whose magnitude is greater than 1. Then there exists a embedded disc that is tangent to at 0 called the local stable center manifold. Additionally, there exists a neighborhood of 0 such that , and that if is a point such that for all , then .
This is a similar statement of the stable manifold theorem to the one found in , except that since we have to deal with complex eigenvalues here, we emphasize that the decomposition is between the eigenvalues whose magnitude is less than or equal to , and greater than , respectively. It guarantees the existence of a stable center manifold of dimension equal to the number of eigenvalues of the Jacobian at the critical point that are less than or equal to 1.
We show now that the Jacobian has the properties required for application of this result, for values of and similar to the choices (4). (Note that the conditions on and in this result hold when and , where is the Lipschitz constant from Assumption 1.) For purposes of this and future results in this section, we assume that at the point we have and that the eigenvalue decomposition of can be written as
where the eigenvalues have
for some with , where , and where , are the orthonormal set of eigenvectors that correspond to the eigenvalues in (12). The matrix is orthogonal.
Suppose that Assumption 1 holds. Let be a critical point for at which has negative eigenvalues, where . Consider the mapping defined by (5) where
By performing a symmetric permutation on this matrix, interleaving rows/columns from the first block with rows/columns from the second block, we obtain a block diagonal matrix with blocks of the following form on the diagonals, that is,
The eigenvalues of are obtained from the following quadratic in :
We examine first the matrices for which . We have
so both roots in (18) are real. Since is convex quadratic, with and , one root is in and the other is in . We can thus write
where is the eigenvalue of in the range and is the eigenvalue of in the range . (This claim can be verified by direct calculation of the product (19a).)
Consider now the matrices for which . From (18), we have that the roots are and , which are distinct, since . The eigenvalue decompositions of these matrices have the form
and the are nonsingular matrices.
When , we show that the eigenvalues of both have magnitude less than , under the given conditions on and . Both roots in (18) are complex exactly when the term under the square root is negative, and in this case the magnitude of both roots is
which is less than by assumption. When both roots are real, we have , and we require the following to be true to ensure that both are less than in absolute value:
We deal with the right-hand inequality in (21) first. By rearranging, we show that this is implied by the following sequence of equivalent inequalities:
where the last is clearly true, because of and . Thus the right-hand inequality in (21) is satisfied.
For the left-hand inequality in (21), we have
and the last condition holds because of the assumption that . This completes our proof of the claim (21). Thus our assumptions on and suffice to ensure that both eigenvalues of defined in (15) have magnitude less than when .
where , are the matrices defined in (19), we have from (14) that
Suppose that the assumptions of Theorem 2.6 hold. Then the eigenvector of that corresponds to the unstable eigenvalue , defined in (18) is
But this is true because of (17), so (24) is an eigenvector of corresponding to the eigenvalue . Since the vectors form an orthogonal set, so do the vectors (24) for , completing the proof.
Our next result is similar to [9, Theorem 4.1]. It is for a modified version of the heavy-ball method in which the initial value for is perturbed from its usual choice of .
Suppose that the assumptions of Theorem 2.6 hold. Suppose that the heavy-ball method is applied from an initial point of , where and are random vectors with elements, and is small. We then have
where the probability is taken over the starting vectors and .
Our proof tracks that of [9, Theorem 4.1]. As there, we define the stable set for to be
Theorem 2.10 does not guarantee that once the iterates leave the neighborhood of , they never return. It does not exclude the possibility that the sequence returns infinitely often to a neighborhood of .
We note that the tweak of taking slightly different from does not affect practical performance of the heavy-ball method, and has in fact been proposed before . It also does not disturb the theory that exists for this method, which for the case of quadratic discussed in rests on an argument based on the eigendecomposition of the (linear) operator , which is not affected by the modified starting point. We note too that the accelerated gradient methods to be considered in the next section can also allow without significantly affecting the convergence theory. A Lyapunov-function-based convergence analysis of this method (see, for example [14, Chapter 4], based on arguments in ) requires only trivial modification to accommodate .
We write for some coefficients , , and show that for .
where and , . To derive recurrences for and , we consider the multiplication by that takes us from stages to . We have
where is defined in (15). Using the factorization (19), we have
Because , it follows from this formula that
so if has any component in the span of , (that is, if ), repeated multiplications of by will lead to divergence, so cannot be in the subspace .
A consequence of this theorem is that for a random choice of , there is probability zero that , which is tangential to at . Thus for close to , there is probability zero that is in the measure-zero set . Successive iterations of (2) are locally similar to repeated multiplications of by the matrix , that is, for small, we have
Under the probability-one event that , this suggests divergence of the iteration (2) away from .
On the other hand, we can show that if the sequence passes sufficiently close to a point such that satisfies second-order sufficient conditions to be a solution of (1), it subsequently converges to . For this result we need the following variant of the stable manifold theorem.
Let be a fixed point for the local diffeomorphism where is a neighborhood of in the Banach space . Suppose that is the invariant subspace corresponding to the eigenvalues of whose magnitude is strictly less than 1. Then there exists a embedded disc that is tangent to at , and a neighborhood of such that , and for all , we have at a linear rate.
Speed of Divergence on a Toy Problem
In this section, we investigate the rate of divergence of an accelerated method on a simple nonconvex objective function, the quadratic with defined by
Obviously, this function is unbounded below with a saddle point at . Its gradient has Lipschitz constant . Despite being a trivial problem, it captures the behavior of gradient algorithms near strict saddle points for indefinite quadratics of arbitrary dimension, as is apparent from the analysis below.
We have described the heavy-ball method in (2). The steepest-descent method, by contrast, takes steps of the form
for some . When has Lipschitz constant , the choice leads to decrease in at each iteration that is consistent with convergence of to zero at a sublinear rate when is bounded below . (The classical theory for gradient descent says little about the case in which is unbounded below, as in this example.)
We consider a starting point that is just off the horizontal axis, that is,
For the steepest-descent method with constant steplength, we have
One measure of repulsion from the saddle point is the number of iterations required to obtain . Here it suffices for to be large enough that , for which (using the usual bound ) a sufficient condition is that
Making the standard choice of steplength , we obtain
Consider now the heavy-ball method. Following (2), the iteration has the form:
(For this quadratic problem, the operator defined by (5) is linear, so that is constant.) We can partition this recursion into and components, and write
The eigenvalues of these two matrices are given by (18), by setting and , respectively. For and satisfying the conditions of Theorem 2.6, which translate here to
both eigenvalues of are less than in magnitude (as we show in the proof of Theorem 2.6), so the components converge to zero. Again referring to the proof of Theorem 2.6, the eigenvalues of are both real, with one of them greater than , suggesting divergence in the component.
To understand rigorously the behavior of the sequence, we make some specific choices of and . Consider
for some parameter . Note that for small and , these choices are consistent with (35). By substituting into (18), we see that the two eigenvalues of are
For reasonable choices of , we have that for a modest positive value of . For specificity (and simplicity) let us consider and , for which we have
The formula (19) yields , where and
From (33), and setting , we have
By substituting for and , we obtain
where we simply drop the term involving in the final step and use . It follows that
It follows from this bound, by a standard argument, that a sufficient condition for is
Thus we have confirmed that divergence from the saddle point occurs in iterations for heavy-ball, versus iterations for gradient descent.
For larger values of , the divergence of steepest-descent and heavy-ball methods are both rapid, For appropriate choices of and , the iterates generated by both algorithms leave the vicinity of the saddle point quickly.
Figure 1 illustrates the divergence behavior of steepest descent and heavy-ball on the function (27) with . We set for both steepest descent and heavy-ball. For heavy-ball, we chose . Both methods were started from . We see that the trajectory traced by steepest descent approaches the saddle point quite closely before diverging slowly along the axis. The heavy-ball method “overshoots” the axis (because of the momentum term) but quickly returns to diverging along the direction at a faster rate than for steepest descent.
General Accelerated Gradient Methods Applied to Quadratic Functions
Here we analyze the rate at which a general class of accelerated gradient methods escape the saddle point of an -dimensional quadratic function:
where is a symmetric matrix with eigenvalues satisfying (12). We assume without loss of generality that is in fact diagonal, that is,
The Lipschitz constant for is .
As in Section 3, gradient descent with satisfies
It follows that for all , for which , gradient descent diverges in that component at a rate of .
Algorithm 1 describes a general accelerated gradient framework, including gradient descent when , heavy-ball when and , and accelerated gradient methods when . With defined by (38), the update formula can be written as
The following theorem describes the dynamics of in (41) when .
For all such that , we have from (41) that
In addition if and for all then,
We begin by showing that (43) holds for and . The case for is trivial as . In addition, for , the update formula (41) becomes
Thus because , we can make this consistent with (42) by setting which is exactly (43) for .
Now assume that (42) holds for all . From (41), using the inductive hypothesis for and , we need to show
by the given definition of in (43). Dividing both sides by , this is equivalent to
Now we assume that and holds for all and show by induction that holds for all . This is clearly true for since . Assume now that holds for all . We have
where the second inequality above follows from , and .
Since for all , Theorem 4.1 shows that Algorithm 1 diverges at a faster rate than gradient descent when at least one of or is true. Now we explore the rate of divergence by finding a limit for the sequence .
Let and hold for all and denote and . Then, for all such that , we have , where is defined by by
Recall from Theorem 4.1 that . By substituting into the equation above, we have
By matching this expression with (47), we obtain
which after division by yields
Now assume for contradiction that the nondecreasing sequence has no finite limit, that is, . Recalling that and have a finite limit (as they are nondecreaseing sequences restricted to the interval $k\to\infty\left(1+\alpha|\lambda_{i}|+\bar{\beta}+\bar{\gamma}\alpha|\lambda_{i}|\right)\infty\{b_{i,k}\}_{k=1,2,\dotsc}\bar{b}_{i}$.
To find the value for , we take limits as in (48) to obtain
By solving this quadratic for , we obtain
By Theorem 4.1, we know that for all , so that . Therefore, satisfies (46), as claimed.
We apply Theorem 46 to parameter choices that typically appear in accelerated gradient methods.
Let the assumptions of Theorem 46 hold, let hold for all and let . Then,
By direct computation with , we have
The above corollary gives a rate of divergence for many standard choices of the extrapolation parameters found in the accelerated gradient literature. In particular, it includes the sequence where and
which was used in a seminal work by Nesterov . (For completeness, we provide a proof that , so that the assumptions of Corollary 4.5 hold for this sequence in the appendix.) Another setting used in recent works . For proper choices of , this scheme has a number of impressive properties such as fast convergence of iterates for accelerated proximal gradient as well as achieving a of convergence in the weakly convex case.
We can also use Theorem 46 to derive a bound for the heavy-ball method. If we target the -th eigenvalue and set and for all , simple manipulation shows that , which gives us an equivalent rate to that derived in (37). Note that for defined in (50) we also have .
The divergence rates for accelerated gradient and heavy-ball methods are significantly faster than the per-iteration rate of obtained for steepest descent.
Experiments
Some computational experiments verify that accelerated gradient methods escape saddle points on nonconvex quadratics faster than steepest descent.
We apply these methods to a quadratic with diagonal Hessian, with and a single negative eigenvalue, . The nonnegative eigenvalues are i.i.d. from the uniform distribution on $x^{0}x^{k}e_{n}=(0,0,\dotsc,0,1)^{T}k\bar{b}_{i}\alpha=1/L\beta\beta=0.989\delta=.01\alpha=0.99/L\beta_{k}=\gamma_{k}=\frac{t_{k}-1}{t_{k+1}}t_{k}$ is defined in (51).
It is clear from Figure 2 that accelerated gradient and heavy-ball diverge at a significantly faster rate than steepest descent. In addition, there is only a small discrepancy between applying accelerated gradient and its limiting rate that is derived in Corollary 4.5, suggesting that approaches rapidly as .
Next we investigate how these methods behave for various dimensions and various distributions of the eigenvalues. For two values of ( and ), we generate random matrices with eigenvalues uniformly distributed in the interval $5[-2\delta,-\delta]x^{0}n$. The results of these trials are shown in Table 1.
As expected, accelerated gradient outperforms gradient descent in all respects. All convergence results are slightly faster for than for , because the random choice of will, in expectation, have a smaller component in the span of the negative eigenvectors in the latter case. The eigenvalue spectrum has a much stronger effect on the divergence rate. For steepest descent, an order of magnitude decrease in the absolute value of the negative eigenvalues corresponds to an order of magnitude increase in iterations, whereas Nesterov’s accelerated gradient sees significantly less growth in the iteration count. While the accelerated gradient method diverges at a slightly slower rate than the theoretical limit, the relative difference between the two does not change much as the dimensions change. Thus, Theorem 46 provides a strong indication of the practical behavior of Nesterov’s method on these problems.
Conclusion
We have derived several results about the behavior of accelerated gradient methods on nonconvex problems, in the vicinity of critical points at which at least one of the eigenvalues of the Hessian is negative. Section 2 shows that the heavy-ball method does not converge to such a point when started randomly, while Sections 3 and 4 show that when is an indefinite quadratic, momentum methods diverge faster than the steepest-descent method.
It would be interesting to extend the results on speed of divergence to non-quadratic smooth functions . It would also be interesting to know what can be proved about the complexity of convergence to a point satisfying second-order necessary conditions, for unadorned accelerated gradient methods. A recent work shows that gradient descent can take exponential time to escape from a set of saddle points. We believe that a similar result holds for accelerated methods as well. The report , which appeared after this paper was submitted, describes an accelerated gradient method that add noise selectively to some iterates, and exploits negative curvature search directions when they are detected in the course of the algorithm. This approach is shown to have the rate that characterizes the best known gradient-based algorithms for finding second-order necessary points of smooth nonconvex functions.
Acknowledgments
We are grateful to Bin Hu for his advice and suggestions on the manuscript. We are also grateful to the referees and editor for helpful suggestions.
References
In this appendix we show that the following two properties hold for the sequence defined by (51):
We begin by noting two well known properties of the sequence (see for example [4, Section 3.7.2]):
To prove that is monotonically increasing, we need
Since (which follows immediately from (51)), it is sufficient to prove that
By manipulating this expression and using (54), we obtain the equivalent expression
Thus (56) holds, so the claim (52) is proved. The sequence is nonnegative, since .
Now we prove (53). We can lower-bound as follows:
For an upper bound, we have from that
Since (because of (55)), it follows from (A) and (58) that (53) holds.