Escaping Saddles with Stochastic Gradients

We analyze the variance of stochastic gradients along negative curvature directions in certain non-convex machine learning models and show that stochastic gradients exhibit a strong component along these directions. Furthermore, we show that - contrary to the case of isotropic noise - this variance is proportional to the magnitude of the corresponding eigenvalues and not decreasing in the dimensionality. Based upon this observation we propose a new assumption under which we show that the injection of explicit, isotropic noise usually applied to make gradient descent escape saddle points can successfully be replaced by a simple SGD step. Additionally - and under the same condition - we derive the first convergence rate for plain SGD to a second-order stationary point in a number of iterations that is independent of the problem dimension.


Introduction
In this paper we analyze the use of gradient descent (GD) and its stochastic variant (SGD) to minimize objectives of the form where f ∈ C 2 (R d , R) is a not necessarily convex loss function and P is an arbitrary probability distribution.
In the era of big data and deep neural networks, (stochastic) gradient descent is a core component of many training algorithms (Bottou, 2010). What makes SGD so attractive is its simplicity, its seemingly universal applicability and a convergence rate that is independent of the size of the training set. One specific trait of SGD is the inherent noise, originating from sampling training points, whose variance has to be controlled in order to guarantee convergence either through a conservative step size (Nesterov, 2013) or via * Equal contribution 1 ETH, Zurich, Switzerland. Correspondence to: Hadi Daneshmand <hadi.daneshmand@inf.ethz.ch>. explicit variance-reduction techniques (Johnson & Zhang, 2013).
While the convergence behavior of SGD is well-understood for convex functions (Bottou, 2010), we are here interested in the optimization of non-convex functions which pose additional challenges for optimization in particular due to the presence of saddle points and suboptimal local minima (Dauphin et al., 2014;Choromanska et al., 2015). For example, finding the global minimum of even a degree 4 polynomial can be NP-hard (Hillar & Lim, 2013). Instead of aiming for a global minimizer, a more practical goal is to search for a local optimum of the objective. In this paper we thus focus on reaching a second-order stationary point of smooth non-convex functions. Formally, we aim to find an ( g , h )-second-order stationary point w such that the following conditions hold: where g , h > 0.
Existing work, such as (Ge et al., 2015;Jin et al., 2017a), proved convergence to a point satisfying Eq. (2) for modified variants of gradient descent and its stochastic variant by requiring additional noise to be explicitly added to the iterates along the entire path (former) or whenever the gradient is sufficiently small (latter). Formally, this yields the following update step for the perturbed GD and SGD versions: where ζ t is typically zero-mean noise sampled uniformly from a unit sphere.
Isotropic noise The perturbed variants of GD and SGD in Eqs.
(3)-(4) have been analyzed for the case where the added noise ζ t is isotropic (Ge et al., 2015;Levy, 2016;Jin et al., 2017a) or at least exhibits a certain amount of variance along all directions in R d (Ge et al., 2015). As shown in Table 1, an immediate consequence of such conditions is that they introduce a dependency on the input dimension d in the convergence rate. Furthermore, it is unknown as of today, if this condition is satisfied by the intrinsic noise of vanilla SGD for any specific class of machine learning models. Recent empirical observations show that this is not the case for training neural networks (Chaudhari & Soatto, 2017).
In this work, we therefore turn our attention to the following question. Do we need to perturb iterates along all dimensions in order for (S)GD to converge to a second-order stationary point? Or is it enough to simply rely on the inherent variance of SGD induced by sampling? More than a purely theoretical exercise, this question has some very important practical implications since in practice the vast majority of existing SGD methods do not add additional noise and therefore do not meet the requirement of isotropic noise. Thus we instead focus our attention on a less restrictive condition for which perturbations only have a guaranteed variance along directions of negative curvature of the objective, i.e. along the eigenvector(s) associated with the minimum eigenvalue of the Hessian. Instead of explicitly adding noise as done in Eqs. (3) and (4), we will from now on consider the simple SGD step: and propose the following sufficient condition on the stochastic gradient ∇f z (w) to guarantee convergence to a second-order stationary point.

Assumption 1 (Correlated Negative Curvature (CNC)).
Let v w be the eigenvector corresponding to the minimum eigenvalue of the Hessian matrix ∇ 2 f (w). The stochastic gradient ∇f z (w) satisfies the CNC assumption, if the second moment of its projection along the direction v w is uniformly bounded away from zero, i.e.
Contributions Our contribution is fourfold: First, we analyze the convergence of GD perturbed by SGD steps (Algorithm 1). Under the CNC assumption, we demonstrate that this method converges to an ( , 2/5 )-second-order stationary point inÕ( −2 ) iterations and with high probability. Second, we prove that vanilla SGD as stated in Algorithm 2 -again under Assumption 1-also convergences to an ( , )-second-order stationary point inÕ( −10 ) iterations and with high probability. To the best of our knowledge, this is the first second-order convergence result for SGD without adding additional noise. One important consequence of not relying on isotropic noise is that the rate of convergence becomes independent of the input dimension d. This can be a very significant practical advantage when optimizing deep neural networks that contain millions of trainable parameters. Third, we prove that stochastic gradients satisfy Assumption 1 in the setting of learning half-spaces, which is ubiquitous in machine learning. Finally, we provide experimental evidence suggesting the validity of this condition for training neural networks. In particular we show that, while the variance of uniform noise along eigenvectors corresponding to the most negative eigenvalue decreases as O(1/d), stochastic gradients have a significant component along this direction independent of the width and depth of the neural net. When looking at the entire eigenspectrum, we find that this variance increases with the magnitude of the associated eigenvalues. Hereby, we contribute to a better understanding of the success of training deep networks with SGD and its extensions.

Background & Related work
Reaching a 1st-order stationary point For smooth nonconvex functions, a first-order stationary point satisfying ∇f (x) ≤ can be reached by GD and SGD in O( −2 ) and O( −4 ) iterations respectively (Nesterov, 2013). Recently, it has been shown that GD can be accelerated to find such a point in O( −7/4 log( −1 )) (Carmon et al., 2017).
Reaching a 2nd-order stationary point In order to reach second-order stationary points, existing first-order techniques rely on explicitly adding isotropic noise with a known variance (see Eq. (3)). The key motivation for this step is the insight that the area of attraction to a saddle point constitutes an unstable manifold and thus gradient descent methods are unlikely to get stuck, but if they do, adding noise allows them to escape (Lee et al., 2016). Based upon this observations, recent works prove second-order convergence of normalized GD (Levy, 2016) and perturbed GD (Jin et al., 2017a). The later needs at most O(max{ −2 g , −4 h } log 4 (d)) iterations and is thus the first to achieve a poly-log dependency on the dimensionality. The convergence of SGD with additional noise was analyzed in (Ge et al., 2015) but to the best of our knowledge, no prior work demonstrated convergence of SGD without explicitly adding noise.
Using curvature information Since negative curvature signals potential descent directions, it seems logical to apply a second-order method to exploit this curvature direction in order to escape saddle points. Yet, the prototypical Newton's method has no global convergence guarantee and is locally attracted by saddle points and even local maxima (Dauphin et al., 2014). Another issue is the computation (and perhaps storage) of the Hessian matrix, which requires O(nd 2 ) operations as well as computing the inverse of the Hessian, which requires O(d 3 ) computations.
The first problem can be solved by using trust-region methods that guarantee convergence to a second-order stationary point (Conn et al., 2000). Among these methods, the Cubic Regularization technique initially proposed by (Nesterov & Polyak, 2006) has been shown to achieve the optimal worstcase iteration bound O(max{ h }) (Cartis et al., 2012). The second problem can be addressed by replac-

Algorithm
First-order Complexity Second-order Complexity d Dependency Perturbed SGD (Ge et al., 2015) O (Jin et al., 2017a) O Table 1. Dimension dependency and iteration complexity to reach a second-order stationary point as characterized in Eq.
ing the computation of the Hessian by Hessian-vector products that can be computed efficiently in O(nd) (Pearlmutter, 1994). This is applied e.g. using matrix-free Lanczos iterations (Curtis & Robinson, 2017;Reddi et al., 2017) or online variants such as Oja's algorithm (Allen-Zhu, 2017). Sub-sampling the Hessian can furthermore reduce the dependence on n by using various sampling schemes (Kohler & Lucchi, 2017;Xu et al., 2017). Finally, (Xu & Yang, 2017) and (Allen-Zhu & Li, 2017) showed that noisy gradient updates act as a noisy Power method allowing to find a negative curvature direction using only first-order information.
Despite the recent theoretical improvements obtained by such techniques, first-order methods still dominate for training large deep neural networks. Their theoretical properties are however not perfectly well understood in the general case and we here aim to deepen the current understanding.

GD Perturbed by Stochastic Gradients
In this section we derive a converge guarantee for a combination of gradient descent and stochastic gradient steps, as presented in Algorithm 1, for the case where the stochastic gradient sequence meets the CNC assumption introduced in Eq. (6). We name this algorithm CNC-PGD since it is a modified version of the PGD method (Jin et al., 2017a), but use the intrinsic noise of SGD instead of requiring noise isotropy. Our theoretical analysis relies on the following smoothness conditions on the objective function f .

Assumption 2 (Smoothness Assumption).
We assume that the function f ∈ C 2 (R d , R) has L-Lipschitz gradients and ρ-Lipschitz Hessians and that each function f z has anbounded gradient. 1 W.l.o.g. we further assume that ρ, , and L are greater than one.
Note that L-smoothness and ρ-Hessian Lipschitzness are standard assumptions for convergence analysis to a secondorder stationary point (Ge et al., 2015;Jin et al., 2017a;Nesterov & Polyak, 2006). The boundedness of the stochastic gradient ∇f z (w) is often used in stochastic optimization (Moulines & Bach, 2011). 1 See Appendix A for formal definitions.
Algorithm 1 CNC-PGD 1: Input: g thres , t thres , T , η and r 2: t noise ← −t thres − 1 3: for t = 1, 2, . . . , T do 4: if ∇f (w t ) 2 ≤ g thres and t − t noise ≥ t thres then 5:w t ← w t , t noise ← t # used in the analysis 6: Table 2. Parameters of CNC-PGD. Note that the constants fthres and ω are only needed for the analysis and thus not required to run Algorithm 1. The constant δ ∈ (0, 1) comes from the probability statement in Theorem 1. Finally the constants c1, c2 and c3 are independent of the parameters γ,δ, , , ρ, and L (see Appendix B for more details).
Parameters The analysis presented below relies on a particular choice of parameters. Their values are set based on the desired accuracy and presented in Table 2.
Remark CNC-PGD converges polynomially to a secondorder stationary point under Assumption 1. By relying on isotropic noise, (Jin et al., 2017a) prove convergence to a , (ρ ) 1/2 -stationary point inÕ 1/ 2 steps. The result of Theorem 1 matches this rate in terms of first-order optimality but is worse by an −0.1 -factor in terms of the second-order condition. Yet, we do not know whether our rate is the best achievable rate under the CNC condition and whether having isotropic noise is necessary to obtain a faster rate of convergence. As mentioned previously, a major benefit of employing the CNC condition is that it results in a convergence rate that does not depend on the dimension of the parameter space. 2 Furthermore, we believe that the dependency to γ (Eq. (6)) can be significantly improved.

Proof sketch of Theorem 1
In order to prove Theorem 1, we consider three different scenarios depending on the magnitude of the gradient and the amount of negative curvature. Our proof scheme is mainly inspired by the analysis of perturbed gradient descent (Jin et al., 2017a), where a deterministic sufficient condition is established for escaping from saddle points (see Lemma 11). This condition is shown to hold in the case of isotropic noise. However, the non-isotropic noise coming from stochastic gradients is more difficult to analyze. Our contribution is to show that a less restrictive assumption on the perturbation noise still allows to escape saddle points. Detailed proofs of each lemma are provided in the Appendix.
Large gradient regime When the gradient is large enough, we can invoke existing results on the analysis of gradient descent for non-convex functions (Nesterov, 2013). Lemma 1. Consider a gradient descent step w t+1 = w t − η∇f (w t ) on a L-smooth function f . For η ≤ 1/L this yields the following function decrease: Using the above result, we can guarantee the desired decrease whenever the norm of the gradient is large enough. Suppose that ∇f (w t ) 2 ≥ g thres , then Lemma 1 immediately yields Small gradient and sharp negative curvature regime Consider the setting where the norm of the gradient is small, i.e. ∇f (w t ) 2 ≤ g thres , but the minimum eigenvalue of the Hessian matrix is significantly less than zero, i.e. λ min (∇ 2 f (w)) 0. In such a case, exploiting Assumption 1 (CNC) provides a guaranteed decrease in the function value after t thres iterations, in expectation. Lemma 2. Let Assumptions 1 and 2 hold. Consider perturbed gradient steps (Algorithm 1 with parameters as in Table 2) starting fromw t such that ∇f (w t ) 2 ≤ g thres . Assume the Hessian matrix ∇ 2 f (w t ) has a large negative eigenvalue, i.e.
Then, after t thres iterations the function value decreases as where the expectation is over the sequence {w k } t+t thres t+1 .
Small gradient with moderate negative curvature regime Suppose that ∇f (w t ) 2 ≤ g thres and that the absolute value of the minimum eigenvalue of the Hessian is close to zero, i.e. we already reached the desired first-and second-order optimality. In this case, we can guarantee that adding noise will only lead to a limited increase in terms of expected function value. Lemma 3. Let Assumptions 1 and 2 hold. Consider perturbed gradient steps (Algorithm 1 with parameters as in Table 2) starting fromw t such that ∇f (w t ) 2 ≤ g thres . Then after t thres iterations, the function value cannot increase by more than where the expectation is over the sequence {w k } t+t thres t+1 .

Joint analysis
We now combine the results of the three scenarios discussed so far. Towards this end we introduce the set S as Each of the visited parameters w t , t = 1, . . . , T constitutes a random variable. For each of these random variables, we define the event A t := {w t ∈ S}. When A t occurs, the function value decreases in expectation. Since the number of steps required in the analysis of the large gradient regime and the sharp curvature regime are different, we use an amortized analysis similar to (Jin et al., 2017a) where we consider the per-step decrease 3 . Indeed, when the negative curvature is sharp, then Lemma 2 provides a guaranteed decrease in f which -when normalized per step -yields The large gradient norm regime of Lemma 1 guarantees a decrease of the same order and hence follows from combining the two results. Let us now consider the case when A c t (complement of A t ) occurs. Then the result of Lemma 3 allows us to bound the increase in terms of function value, i.e.
Probabilistic bound The results established so far have shown that in expectation the function value decreases until the iterates reach a second-order stationary point, for which Lemma 3 guarantees that the function value does not increase too much subsequently. 4 This result guarantees visiting a second-order stationary point in T steps (see Table 2). Yet, certifying second-order optimality is slightly more intricate as one would need to know which of the parameters {w 1 , . . . , w T } meets the required condition. One solution to address this problem is to provide a high probability statement as suggested in (Jin et al., 2017a) (see Lemma 10). We here follow a similar approach except that unlike the result of (Jin et al., 2017a) that relies on exact function values, our results are valid in expectation. Our solution is to establish a high probability bound by returning one of the visited parameters picked uniformly at random. This approach is often used in stochastic non-convex optimization (Ghadimi & Lan, 2013).
The idea is simple: If the number of steps is sufficiently large, then the results of Lemma (1)-(3) guarantee that the number of times we visit a second-order stationary point is high. Let R be a random variable that determines the ratio of ( , √ ρ 2/5 )-second-order stationary points visited through the optimization path {w t } t=1,...,T . Formally, where 1 is the indicator function. Let P t denote the probability of event A t and 1 − P t be the probability of its complement A c t . The probability of returning a second-order stationary point is simply Estimating the probabilities P t is difficult due to the interdependence of the random variables w t . However, we can upper bound the sum of the individual P t 's. Using the law of total expectation and the results from Eq. (13) and (14), we bound the expectation of the function value decrease as: which, after rearranging terms, leads to the following upperbound Therefore, the probability that A c t occurs uniformly over {1, . . . , T } is lower bounded as which concludes the proof of Theorem 1.

SGD without Perturbation
We now turn our attention to the stochastic variant of gradient descent under the assumption that the stochastic gradients fulfill the CNC condition (Assumption 1). We name this method CNC-SGD and demonstrate that it converges to a second-order stationary point without any additional perturbation. Note that in order to provide the convergence guarantee, we periodically enlarge the step size through the optimization process, as outlined in Algorithm 2. This periodic step size increase amplifies the variance along eigenvectors corresponding to the minimum eigenvalue of the Hessian, allowing SGD to exploit the negative curvature in the subsequent steps (using a smaller step size). Increasing the step size is therefore similar to the perturbation step used in CNC-PGD (Algorithm 1). Although this may not be very common in practice, adaptive stepsizes are not unusual in the literature (see e.g. (Goyal et al., 2017)).
Parameters The analysis of CNC-SGD relies on the particular choice of parameters presented in Table 3.

Parameter
Value Table 3. Parameters of CNC-SGD: the constants c1, c2, and c3 are independent of the parameters γ,δ, , ρ, and L (see Appendix B for more details).
Remarks As reported in Table 1, perturbed SGD -with isotropic noise -converges to an ( , 1/4 )-second-order stationary point in O(d p −4 ) steps (Ge et al., 2015). Here, we prove that under the CNC assumption, vanilla SGD -i.e. without perturbations -converges to an ( , √ ρ 2/5 )secondorder stationary point usingÕ( −4 ) stochastic gradient steps. Although our result is worse in terms of the firstorder optimality, it yields an improvement by an 0.15 -factor in terms of second-order optimality (note that the focus of this paper is the second-order optimality). However, this second-order optimality rate is still worse by an −0.1 -factor compared to the best known convergence rate for perturbed SGD established by (Zhang et al., 2017), which requires O(d p −4 ) iterations for an ( , 1/2 )-second-order stationary point. One can even improve the convergence guarantee of SGD by using the NEON framework (Allen-Zhu & Li, 2017; Xu & Yang, 2017) but a perturbation with isotropic noise is still required. The theoretical guarantees we provide in Theorem 2, however, are based on a less restrictive assumption. As we prove in the following Section, this assumption actually holds for stochastic gradients when learning halfspaces. Subsequently, in Section 6, we present empirical observations that suggest its validity even for training wide and deep neural networks.

Learning Half-spaces with Correlated Negative Curvature
The analysis presented in the previous sections relies on the CNC assumption introduced in Eq. (6). As mentioned before, this assumption is weaker than the isotropic noise condition required in previous work. In this Section we confirm the validity of this condition for the problem of learning half-spaces which is a core problem in machine learning, commonly encountered when training Perceptrons, Support Vector Machines or Neural Networks (Zhang et al., 2015). Learning a half-space reduces to a minimization problem of the following form where ϕ is an arbitrary loss function and the data distribution P might have a finite or infinite support. There are different choices for the loss function ϕ, e.g. zero-one loss, sigmoid loss or piece-wise linear loss (Zhang et al., 2015).
Here, we assume that ϕ(·) is differentiable. Generally, the objective f (w) is non-convex and might exhibit many local minima and saddle points. Note that the stochastic gradient is unbiased and defined as where the samples z are drawn from the distribution P.
Noise isotropy vs. CNC assumption. First, one can easily find a scenario where the noise isotropy condition is violated for stochastic gradients. Take for example the case where the data distribution from which z is sampled lives in a low-dimensional space L ⊂ R d . In this case, one can prove that there exists a vector u ∈ R d orthogonal to all z ∈ L. Then clearly E (u ∇f z (w)) 2 = 0 and thus ∇f z (w) does not have components along all directions.
However -under mild assumptions -we show that the stochastic gradients do have a significant component along directions of negative curvature. Lemma 4 makes this argument precise by establishing a lower bound on the second moment of the stochastic gradients projected onto eigenvectors corresponding to negative eigenvalues of the Hessian matrix ∇ 2 f (w). To establish this lower bound we require the following structural property of the loss function ϕ. Assumption 3. Suppose that the magnitude of the secondorder derivative of ϕ is bounded by a constant factor of its first-order derivative, i.e.
holds for all α in the domain of ϕ and c > 0.
1. Stochastic gradients 2. Isotropic noise 3. Extreme eigenvalues The reader might notice that this condition resembles the self-concordant assumption often used in the optimization literature (Nesterov, 2013), for which the second derivative is bounded by the third derivative. One can easily check that this condition is fulfilled by commonly used activation functions in neural networks, such as the sigmoid and softplus. We now leverage this property to prove that the stochastic gradient ∇f z (w) satisfies Assumption 1 (CNC). Lemma 4. Consider the problem of learning half-spaces as stated in Eq. (21), where ϕ satisfies Assumption 3. Furthermore, assume that the support of P is a subset of the unit sphere. 5 Let v be a unit length eigenvector of ∇ 2 f (w) with corresponding eigenvalue λ < 0. Then Discussion Since the result of Lemma 4 holds for any eigenvector v associated with a negative eigenvalue λ < 0, this naturally includes the eigenvector(s) corresponding to λ min . As a result, Assumption 1 (CNC) holds for stochastic gradients on learning half-spaces. Combining this result with the derived convergence guarantees in Theorem 1 implies that a mix of SGD and GD steps (Algorithm 1) obtains a second-order stationary point in polynomial time. Furthermore, according to Theorem 2, vanilla SGD obtains a second-order stationary point in polynomial time without any explicit perturbation. Notably, both established convergence guarantees are dimension free.
Furthermore, Lemma 4 reveals an interesting relationship between stochastic gradients and eigenvectors at a certain iterate w. Namely, the variance of stochastic gradients along these vectors scales proportional to the magnitude of the negative eigenvalues within the spectrum of the Hessian matrix. This is in clear contrast to the case of isotropic noise variance which is uniformly distributed along all eigenvectors of the Hessian matrix. The difference can be important form a generalization point of view. Consider the simplified setting where ϕ is square loss. Then the eigenvectors with large eigenvalues correspond to the principal directions of the data. In this regard, having a lower variance along the non-principal directions avoids over-fitting.
In the following section we confirm the above results and furthermore show experiments on Neural Networks that suggest the validity of these results beyond the setting of learning half-spaces.

Experiments
In this Section we first show that vanilla SGD (Algorithm 2) as well as GD with a stochastic gradient step as perturbation (Algorithm 1) indeed escape saddle points. Towards this end, we initialize SGD, GD, perturbed GD with isotropic noise (ISO-PGD) (Jin et al., 2017a) and CNC-PGD close to a saddle point on a low dimensional learning-halfspaces problem with Gaussian input data and sigmoid loss. Figure  2 shows suboptimality over epochs for an average of 10 runs. The results are in line with our analysis since all stochastic methods quickly find a negative curvature direction to escape the saddle point. See Appendix E for more details. 6 Secondly -and more importantly -we study the properties of the variance of stochastic gradients depending on the width and depth of neural networks. All of these experiments are conducted using feed-forward networks on the well-known MNIST classification task (n = 70 000). Specifically, we draw m = 30 random parameters w i in each of these networks and test Assumption 1 by estimating the second moment of the stochastic gradients projected onto the eigenvectors v k of ∇ 2 f (w i ) as follows We do the same for n isotropic noise vectors drawn from the unit ball B d around each w i . 7 Figure 1 shows this estimate for eigenvectors corresponding to the minimum eigenvalues for a 1 hidden layer network with increasing number of units (top) and for a 10 hidden unit network with increasing number of layers (bottom). Similar results on the entire negative eigenspectrum can be found in Appendix E. Figure 3 shows how µ k varies with the magnitude of the corresponding negative eigenvalues λ k . Again we evaluate 30 random parameter settings in neural networks with increasing depth. Two conclusions can be drawn from the results: (i) Although the variance of isotropic noise along eigenvectors corresponding to λ min decreases as O(1/d), the stochastic gradients maintain a significant component along the directions of most negative curvature independent of width and depth of the neural network (see Figure 1), (ii) the stochastic gradients yield an increasing variance along 6 Rather than an encompassing benchmark of the different methods, this result is to be seen as a proof of concept. 7 For a fair comparison all involved vectors were normalized.

(ii) suggests that the bound established in
Lemma 4 may well be extended to more general settings such as training neural networks and illustrates the implicit regularization of optimization methods that rely on stochastic gradients since directions of large curvature correspond to principal (more robust) components of the data for many machine learning models.

Conclusion
In this work we have analyzed the convergence of PGD and SGD for optimizing non-convex functions under a new assumption -named CNC -that requires the stochastic noise to exhibit a certain amount of variance along the directions of most negative curvature. This is a less restrictive assumption than the noise isotropy condition required by previous work which causes a dependency to the problem dimensionality in the convergence rate. We have shown theoretically that stochastic gradients satisfy the CNC assumption and reveal a variance proportional to the eigenvalue's magnitude for the problem of learning half-spaces. Furthermore, we provided empirical evidence that suggests the validity of this assumption in the context of neural networks and thus contributes to a better understanding of training these models with stochastic gradients. Proving this observation theoretically and investigating its implications on the optimization and generalization properties of stochastic gradients methods is an interesting direction of future research.
Xu, Y. and Yang, T. First-order stochastic algorithms for escaping from saddle points in almost linear time. arXiv preprint arXiv:1711.01944, 2017.

Appendix A. Preliminaries
Assumptions Recall that we assumed the function f is L-smooth (or L-Lipschitz gradient) and ρ-Lipschitz Hessian. We define these two properties below.
Definition 2 (Hessian Lipschitz). A twice-differentiable function f is ρ-Lipschitz Hessian if Definition 3 (Bounded Gradient). A differentiable function f (of form of (1)) is -bounded gradient 8 if Definition 4 (Stochastic Gradient Lipschitz). A differentiable function (of form of (1)) has β-Lipschitz stochastic gradients if Lemma 5. Let w t+1 be obtained from one stochastic gradient step at w t on the L-smooth objective f , namely where E z [∇f z (w t )] = ∇f (w t ) and f z is -bounded gradient. Then the function value decreases in expectation as

Convergence of SGD on a smooth function
Proof. The proof is based on a straightforward application of smoothness:

Bounded series
Lemma 6. For all 1 > β > 0, the following series are bounded as Proof. The proof is based on the following bounds on power series for |z| < 1: Yet, for the sake of brevity, we omit the subsequent (straightforward) derivations needed to prove the statement.
B. PGD analysis B.1. Choosing the parameters   Table 2) starting fromw t such that ∇f (w t ) 2 ≤ g thres . Assume the Hessian matrix ∇ 2 f (w t ) has a large negative eigenvalue, i.e.
Then, after t thres iterations the function value decreases as where the expectation is over the sequence {w k } t+t thres t+1 .
Notation Without loss of generality, we assume that t = 0. Let v be the eigenvector And we use the simplified notation ξ := ∇f z (w 0 ), v := v 0 . We also use the compact notations: Note thatw denote parameter w 0 before perturbation and w i is obtained by i GD steps after perturbation. Recall the compact notation λ as λ := | min{λ min ∇ 2 f (w), 0} | Finally, we set κ := 1 + ηλ.
Proof sketch The proof presented below proceeds by contradiction and is inspired by the analysis of accelerated gradient descent in non-convex settings as done in (Jin et al., 2017b). We first assume that the sufficient decrease condition is not met and show that this implies an upper bound on the distance moved over a given number of iterations. We then derive a lower bound on the iterate distance and show that -for the specific choice of parameters introduced earlier -this lower bound contradicts the upper bound for a large enough number of steps T . We therefore conclude that we get sufficient decrease for t > T .

Proof of Lemma 7:
Part 1: Upper bounding the distance on the iterates in terms of function decrease. We assume that PGD does not obtain the desired function decrease in t thres iterations, i.e.
The above assumption implies the iterates w t stay close tow, for all t ≤ t thres . We formalize this result in the following lemma.
Lemma 8 (Distance Bound). Under the setting of Lemma 7, assume Eq (36) holds. Then the expected distance to the initial parameter can be bounded as as long as η ≤ 1/L.
Proof. Here, we use the proposed proof strategy of normalized gradient descent (Levy, 2016). First of all, we bound the effect of the noise in the first step. Recall the first update of Algorithm 1 under the above setting Then by a straightforward application of lemma 5, we have We proceed using the result of Lemma 1 that relates the function decrease to the norm of the visited gradients: According to Eq. (36), the function value does not decrease too much. Plugging this bound into the above inequality yields an upper bound on the sum of the squared norm of the visited gradients, i.e.
Using the above result allows us to bound the expected distance in the parameter space as: Replacing the above inequality into the following bound completes the proof: Part 2: Quadratic approximation Since the parameter vector stays close tow under the condition in Eq. (36), we can use a "stale" Taylor expansion approximation of the function f atw: Using a stale Taylor approximation over all iterations is the essential part of the proof that is firstly proposed by (Ge et al., 2015) for analysis of PSGD method. The next lemma proves that the gradient of f can be approximated by the gradient of g as long as w is close enough tow.
Lemma 9 (Taylor expansion bound for the gradient (Nesterov, 2013)). For every twice differentiable, function f : R d → R with ρ-Lipschitz Hessians the following bound holds true.
Furthermore, the guaranteed closeness to the initial parameter allows us to use the gradient of the quadratic objective g in the GD steps as follows, where the vectors u t , δ t and d t are defined in Table 5.
As long as w 1 −w is correlated with the negative curvature, the norm of u t grows exponentially. In this case, the upper bound of Lemma 8 doesn't hold anymore after a certain number of iterations, as we formally prove in part 3. Indeed, the term u t constitutes power iterations on the hessian matrix H. The term δ t arises from the stale Taylor approximation errors through all iterations. Assuming that w t stays close tow, we will bound this term. Finally, the d t terms depend on the initial gradient. We will show that the distance E w 1 −w 2 is eventually dominated by the power iterates u t .

Vector
Formula Dependency   Table 5. Components of CNC-PGD expanded steps.
Part 3: Lower bounding the iterate distance.
A lower-bound on the distance Our goal is to provide a lower-bound on E w tthres − w 0 2 that contradicts the result of Lemma 8. To obtain a lower bound on the distance, we use the classical result a + b 2 ≥ a 2 + 2a b. Setting a = u t and b = η(δ t + d t ) yields Removing the initial gradient dependency The established lower-bound in Eq. (44) has a dependency to the gradient ∇f (w) through the term E u t d t . Intuitively, the initial gradient should not cause a problem for negative curvature exploration phase. More precisely, the third term of the lower bound of Eq. (44) should be positive. This result is proven in the next lemma.
Lemma 10 (Removing initial gradient dependency). Under the setting of Lemma 7, Proof. Assumption 1 (CNC) implies that E [w 1 −w] = −r∇f (w), hence the expectation of the power iteration term is Using this result, as well as the fact that (I − ηH) 0 for η ≤ 1/L we have which proves the assertion.
Plugging the result of the last lemma into the lower-bound established in Eq. (44) yields To complete our lower bound, we need : (I) a lower bound on E u t 2 , (II) an upper bound on u t and (III) an upper bound on E δ t .
(I) Lower-bound on E u t 2 Norm of u t exponentially grows in iterations. Next lemma proves this claim.
Lemma 11 (Exponential Growing Power Iteration). Under the setting of Lemma 7, t steps of PGD yield an exponentially growing lower bound on the expected squared norm of u t , i.e.
Proof. We first use Cauchy-Schwarz inequality to derive the following lower bound: Now, suppose H = U ΣU . Since any non-zero vector u ∈ R d is an eigenvector of the identity matrix we can decompose I = U IU and thus (I − ηH) = U (I − ηΣ)U . As a result, we have for the leftmost eigenvector v of the Hessian H. Plugging Equation (49) into (48) and recalling κ := 1 + ηλ as well as the definition of u t as given in Table 5 yields where the last inequality follows from Assumption 1.

(II) Upper-bound on u t
Using the definition of the scaling factor r and the fact that the noise lies inside the unit sphere the next lemma proves a deterministic bound on this term.
Lemma 12. Under the setting of Lemma 7 the norm of u t is deterministically bounded as Proof. Starting from the definition of u t and recalling that ξ has at most unit norm by Assumption 1, we have To bound this term, we use the fact proved in Lemma 8 that w t stays close to w 0 for all t ≤ t thres .
Lemma 13. Under the setting of Lemma 7, if then the norm of δ t is bounded in expectation: Proof. Using the result of Lemma 9 as well as the distance bound established in Lemma 8, we have Now, the results on convergence of power series derived in Lemma 6 and the definition κ : By combining Equation (52) and (53) we can establish the desired bound on δ t : We are now ready to combine the results of Lemma 11,12,and 13,into Eq. (46) in order to obtain the desired lower bound on the distance travelled by the iterates of PGD.
Lemma 14 (Distance lower bound). Under the setting of Lemma 7 and for each t ≤ t thres and for the choice of parameters as in Table 4 we have where κ := 1 + η|λ min ∇ 2 f (w) |.
Proof. To prove this statement we introduce each bound in Eq. (46) step by step: We need the lower bound to be positive to complete the proof. In this regard, we require the following condition to hold, Escaping Saddles with Stochastic Gradients Using the lower bound the absolute value of the minimum eigenvalue as λ ≥ √ ρ 2/5 (in Eq. (34)), we choose parameters r, f thres , and g thres such that the above constraints are satisfied, 9 i.e.
f thres ≤ γ 4/5 r/(32 ) ≤ γλ 2 r/(32ρ ) These choices of parameters establish an exponential lower bound on the distance as According to the result of Lemma 8, if the expected distance from the initial parameter is sufficiently large, then the assumption E f t −f > −f thres cannot be valid. To derive the contradiction, we have to choose the number of step such that the established lower-bound exceeds the upper-bound in Lemma 8, namely 1 4 γr 2 κ 2t ? ≥ 2 2ηf thres + ηL( r) 2 t + 2( r) 2 .
Since the left hand side is exponentially growing, we can derive the contradiction by choosing a large enough number of steps as: which completes the proof of Lemma 7.

B.3. Moderate negative curvature regime
Lemma 15 (Restate of Lemma 3). Let Assumption 1 and 2 hold. Consider perturbed gradient steps (Algorithm 1 with parameters as in Table 4) starting fromw t such that ∇f (w t ) 2 ≤ g thres . Then after t thres iterations, the function value cannot increase by more than where the expectation is over the sequence {w k } t+t thres t+1 .
Proof. Using the resulf of lemma 5, we bound the decrease in the function value as Since there is no perturbation in following t thres steps, GD doesn't increase the function value in following t thres -steps (according to the result of lemma 1). Table 6 lists the parameters of CNC-SGD presented in Algorithm 2 together with the constraints that determines our choice of parameters. These constraints are driven by the theoretical analysis.  Table 6. Parameters of CNC-SGD (Restated Table 3). By λ 2 = ρ 2 , one can reach the value of parameters from the established upperbounds.

C.2. Proof of the Main Theorem
Theorem 3 (Restated Theorem 2). Let the stochastic gradients ∇f z (w t ) in CNC-SGD satisfy Assumption 1 and let f and f z satisfy Assumption 2. Then algorithm 2 returns an , √ ρ -second order stationary point with probability at Proof. We decompose the SGD step as where the noise term ζ t s are i.i.d and zero-mean and the noise term ξ t satisfies CNC assumption 1. Our analysis relies on the CNC assumption only at steps with large step-size r. That is, we only exploit the negative curvature in the steps with a large step size. In this regard, we need to use the larger step size r > η in these steps. This is different from Perturbed SGDwith isotropic noise- (Ge et al., 2015) where the variance of perturbations in all steps is exploited in the analysis.
Large gradient regime: If the norm of the gradient is large, i.e.
∇f (w) 2 = 2 ≥ 2 2 Lr/δ, [The choice of r in Table 6] then the result on the one step convergence of SGD in Lemma 5 guarantees the desired decrease rE ∇f zr (w i ) 2 + Lr 2 l 2 /2 + t thres Lη 2 2 /2 ≤ −r ∇f (w) 2 + L 2 /2 r 2 + t thres η 2 The choice of r and η in Table 6 ensures that t thres η 2 ≤ r 2 The above constraint simplifies the established upperbound on the function value decrease as where the last step is the result of the choice of parameters in Table 6.
Sharp curvature regime: When the minimum eigenvalue is significantly less than zero, SGD steps with a large step-size r provides enough variance for following SGD steps -with a smaller step size ηto exploit the negative curvature direction. This statement is formally proved in the next lemma.
Lemma 16 (Negative curvature exploration by CNC-SGD). Suppose Assumptions 1 and 2 hold. If the Hessian matrix atw t has a small negative eigenvalue, i.e.
Then t thres iterations with the small step-size η yields the following decrease in the function value in expectation where the expectation is taken over the sequence {w k } t+k t+1 .
Moderate curvature and gradient regime: Suppose that the minimum eigenvalue of the Hessian is quite small and visited gradients has also a small norm. In this case, we need to bound increase in the function caused by the variance of SGD. The established upperbound in Eq. 67 bounds the total increase after t thres iterations as [The choice of r in Table 6] Probabilistic bound The probabilistic lower bound on returning the desired second order stationary point can be derived from Eq (67) and (70) as well as Lemma 16 using exactly the same argument as the probabilistic argument on perturbed gradient descent. We define the event A k as According to the result for the large gradient regime (in Eq. (67)) and the large curvature result (in Lemma 16), the function value decreases as in t thres itetations of SGD. In all other iterates, the increase of the function value due to the stochastic gradient steps is controlled by using our choice of steps sizes, according to the result of Eq. (70): Let P t is the probability associated with A t , hence 1 − P t is the probability associated with its complement event A c t . Note that computing the probabilities P t is very hard due to the dependency of w t to all stochastic gradient steps before iteration t. Plugging these probabilities into the above conditional expectation results yields E f (w (k+1)tthres ) − f (w ktthres ) ≤ (1 − P k )δf thres /2 − P k f thres .
Summing the above inequalities over the K = T /t thres steps obtains the following upper-bound on the average of P t s The choice of the number of steps T = Kt thres in Table 6.] The above bound allows us to lower-bound the probability of retrieving an ( , √ ρ )-second order stationary point (which is equivalent to the occurrence of the complement event A c k ) uniformly over T steps: This concludes the proof of the convergence guarantee of CNC-SGD under Assumption 1.

C.3. Proof of the main Lemma 16
Preliminary Through our analysis, we invoke the result of the following lemma repeatedly.
Lemma 17. Consider stochastic processes X t adapted to filtration Proof. The proof is straightforward: where the last step is due to the fact that Y is F t−1 -measurable.
Lemma 18 (Restated Lemma 16). Suppose Assumptions 1 and 2 hold. If the Hessian matrix atw t has a small negative eigenvalue, i.e.
Then t thres iterations with the small step-size η yields the following decrease in the function value in expectation where the expectation is taken over the sequence {w k } t+t thres t+1 .
Proof. Our analysis for the large curvature case in CNC-PGD (lemma 7) can be extended to SGD. Here, we borrow the compact notations from Lemma 7. Similar to the proof scheme of lemma 7, our proof is based on contradiction. We assume that the desired decrease in the function value is not obtained in t thres iterations, namely A direct result of the above assumption is that we can establish a bound on the expectation of the distance tow for all iterates w t such that t < t thres .
Lemma 19 (Distance Bound for SGD). Suppose that expectation of the decrease in function value is lower-bounded as stated in (76). Then, the expectation of the distance from the current iterate tow is bounded as E w t −w 2 ≤ 4f thres η + 2Lη( r) 2 + 4( η) 2 + 2Lη 3 2 t thres t + 2( r) 2 , for all t < t thres as long as Assumption 2 holds.
We postpone the proof of the last lemma to Section C.4. The proposed bound in the last lemma is larger than the established distance bound for PGD steps (lemma 8). This is due to the variance of the stochastic gradients. In the rest of the proof, we will construct a lower-bound that contradicts to the above upper-bound using the CNC assumption 1. To this end, we expand the SGD steps (in Eq. (62)) using the gradient of the stale Taylor expansion g(w): where the vectors u t , δ t , d t , and ζ t are defined in Table 7. The only new term in the expansion is the noise of the stochastic gradient steps ζ t s. Similarly to PGD, the power iterations u t plays an essential rule in the negative curvature exploration.
Vector Formula Indication Included in PGD analysis? u t (I − ηH) t (w 1 −w) Power Iteration Yes For this term, we can reuse our analysis from lemma 12 and 11. The term δ t is caused by using a stale Taylor approximation for all iterates t ≤ t thres . We need to bound the perturbation effect of this term to guarantee that power iterates u t exploit the negative curvature. To this end, we required a bound on E δ t . This bound is established in the next lemma using the distance bound of Lemma 19.
To complete the picture of Figure 2 we here also present the gradient norms and minimum/maximum eigenvalues along the trajectories of the different methods. It becomes apparent that all of them indeed started at a saddle and eventually move towards (and along) the flat end of the sigmoid. However, Gradient Descent is much slower in finding regions of significant negative curvature than the stochastic methods.
1. Suboptimality 2. Gradient norm 3. min and max eigenvalues Neural Networks The neural network experiments were implemented using the Pytorch library and conducted on a GPU server. Note that we downsized the mnist dataset to an image size of 10 × 10 and applied sigmoid acivations in the hidden layers as well as a cross-entropy loss over the 10 classes.
While we present covariances between the stochastic gradients/isotropic noise vectors with the leftmost Eigenvectors in the main paper, Figure 5 plots the covariances with the entire negative eigenspectrum.
In Figure 3 we show that the correlation of eigenvectors and stochastic gradients increases with the magnitude of the associated eigenvalues. As expected, this is not the case for noise vectors that are drawn randomly from the unit sphere. Furthermore, these correlations show a decrease with an increasing dimension as can be seen in Figure 6.