Power-law escape rate of SGD

Stochastic gradient descent (SGD) undergoes complicated multiplicative noise for the mean-square loss. We use this property of SGD noise to derive a stochastic differential equation (SDE) with simpler additive noise by performing a random time change. Using this formalism, we show that the log loss barrier $\Delta\log L=\log[L(\theta^s)/L(\theta^*)]$ between a local minimum $\theta^*$ and a saddle $\theta^s$ determines the escape rate of SGD from the local minimum, contrary to the previous results borrowing from physics that the linear loss barrier $\Delta L=L(\theta^s)-L(\theta^*)$ decides the escape rate. Our escape-rate formula strongly depends on the typical magnitude $h^*$ and the number $n$ of the outlier eigenvalues of the Hessian. This result explains an empirical fact that SGD prefers flat minima with low effective dimensions, giving an insight into implicit biases of SGD.


Introduction
Deep learning has achieved breakthroughs in various applications in artificial intelligence such as image classification [1,2], speech recognition [3], natural language processing [4], and natural sciences [5][6][7]. Such unparalleled success of deep learning hinges crucially on stochastic gradient descent (SGD) and its variants as an efficient training algorithm.
Although the loss landscape is highly nonconvex, the SGD often succeeds in finding a global minimum. It has been argued that the SGD noise plays a key role in escaping from local minima [8][9][10][11][12][13][14]. It has also been suggested that SGD has an implicit bias that is beneficial for generalization. For example, SGD may help the network to find flat minima, which are considered to imply good generalization [9,15,16], although it is also pointed out that flatness alone does not ensure good generalization [17]. How and why does SGD help the network escape from bad local minima and find flat minima? These questions have been addressed in several works, and it is now recognized that the SGD noise strength and structure significantly affect the efficiency of escape from local minima. Our work follows this line of research and adds new theoretical perspectives.
In physics and chemistry, escape from a local minimum of the energy landscape due to thermal noise at temperature T is a thoroughly studied fundamental problem [18,19]. When the energy barrier is given by ∆E, the escape rate is proportional to e −∆E/T , which is known as the Arrhenius law. By analogy, in machine learning, escape from a local minimum of the loss function is considered to be determined by the loss barrier height ∆L = L(θ s ) − L(θ * ), where L(θ) denotes the loss function at the network parameters θ, θ * stands for a local minimum of L(θ), and θ s denotes a saddle point that separates θ * from other minima. Indeed, if we assume that the SGD noise is uniform and isotropic, which is often assumed in machine-learning literature [8], the escape rate is proportional to e −∆L/D , where D denotes the SGD noise strength.
In this paper, we show that inhomogeneity of the SGD noise strength in the parameter space brings about drastic modification for the mean-square loss. We show that the escape rate is determined by the logarithmic loss barrier height ∆ log L = log L(θ s ) − log L(θ * ) = log[L(θ s )/L(θ * )]. In other words, the escape rate is determined not by the difference but by the ratio of L(θ s ) and L(θ * ). This result means that even if the loss barrier height ∆L is the same, minima with smaller values of L(θ * ) are more stable.
Moreover, given the fact that the eigenvalue spectrum of the Hessian at a minimum consists of a bulk of almost zero eigenvalues and outliers [20,21], our escape-rate formula implies that SGD prefers flat minima with a low effective dimension, where the effective dimension is defined as the number of outliers [22] and flatness is measured by a typical magnitude of outlier eigenvalues [15]. The previous theories [8,9,[11][12][13][14] have also successfully explained the fact that SGD prefers flat minima, but not the preference of small effective dimensions. The logarithmic loss naturally explains the latter, and sheds light on implicit biases of SGD.
Main contributions: We obtain the following main results: • We derive an equation for approximating the SGD noise in Eq. (6). Remarkably, the SGD noise strength in the mean-square loss is shown to be proportional to the loss function, which is experimentally verified in section 5.2. A key ingredient in deriving Eq. (6) is the decoupling approximation given in Eq. (7). This is a novel approximate method introduced in our analysis, and hence we experimentally verify it in section 5.1.
• We derive a novel stochastic differential equation (SDE) in Eq. (14) via a random time change introduced in Eq. (13). Although the original SDE (4) has a multiplicative noise, the transformed SDE (14) has a simple additive noise with the gradient of the logarithmic loss. This shows the relevance of the logarithmic loss landscape for understanding SGD.
• We derive a novel form of SGD escape rate from a local minimum in Eq. (15). Remarkably, the escape rate takes the power-law form with respect to the ratio between L(θ * ) and L(θ s ). In section 5.3, we experimentally test the validity of this result for a linear regression and a neural network.
• We show that the escape rate of SGD crucially depends on the flatness and the effective dimension, which implies that SGD has implicit biases towards flat minima with low effective dimension. We also show in Eq. (16) that a local minimum with an effective dimension n greater than a certain critical value n c becomes unstable.
Related works: The role of the SGD noise structure has been discussed in some previous works [11][12][13][14]23]. It was pointed out that the anisotropic nature of the SGD noise is important: the SGD noise covariance matrix is aligned with the Hessian of the loss function, which is beneficial for escape from sharp minima [11,13,14]. These previous works, however, do not take the parameter dependence of the SGD noise strength into account, and consequently, escape rates derived there depend exponentially on the loss barrier height, which differs from our formula.
Compared with the anisotropy of the SGD noise, the inhomogeneity of the SGD noise strength has been less explored. In [12,23], the SGD dynamics under a state-dependent noise is discussed. However, in these previous works, the connection between the noise strength and the loss function was not theoretically established, and the logarithmic loss landscape was not discussed. The instability due to large effective dimensions was also not shown. Another recent work [24] observed that the noise is proportional to the loss for specific simple models. In our paper, such a result is derived for more generic models. Gürbüzbalaban et al. [25] showed that SGD will converge to a heavy-tailed stationary distribution due to a multiplicative nature of the SGD noise in a simple linear regression problem. Our paper strengthens this result: we argue that such a heavy-tailed distribution generically appears for the mean-square loss.

Setup
We consider supervised learning. Let D = {(x (µ) , y (µ) ) : µ = 1, 2, . . . , N } be the training dataset, where x (µ) ∈ R d denotes a data vector and y (µ) ∈ R be its label. The network output for a given input x is denoted by f (θ, x) ∈ R, where θ ∈ R P stands for a set of trainable parameters with P being the number of trainable parameters. In this work, we focus on the mean-square loss The training proceeds through optimization of L(θ). In most machine-learning applications, the optimization is done via SGD or its variants. In SGD, the parameter θ k+1 at the time step k + 1 is determined by where η > 0 is the learning rate, B k ⊂ {1, 2, . . . , N } with |B k | = B is a mini-batch used at the kth time step, and L B k denotes the mini-batch loss. Since the training dataset D is randomly divided into mini-batches, the dynamics defined by Eq. (2) is stochastic. When B = N , the full training data samples are used for every iteration. In this case, the dynamics is deterministic and called gradient descent (GD). SGD is interpreted as GD with stochastic noise. By introducing the SGD noise Obviously, ξ k = 0, where the brackets denote the average over possible choices of minibatches. The noise covariance matrix is defined as Σ(θ k ) := ξ k ξ T k . The covariance structure of the SGD noise is important in analyzing the SGD dynamics, which will be discussed in section 3.1.

Stochastic differential equation for SGD
When the parameter update for each iteration is small, which is typically the case when the learning rate η is sufficiently small, the continuous-time approximation can be used [26,27]. By introducing a continuous time variable t ∈ R and regarding η as an infinitesimal time step dt, we have a SDE where dW t ∼ N (0, I P dt) with I n being the n-by-n identity matrix, and the multiplicative noise ηΣ(θ t ) · dW t is interpreted as Itô since the noise ξ k in Eq. (3) should not depend on θ k+1 . Throughout this work, we consider the continuous-time approximation (4) with Gaussian noise. In machine learning, the gradient Langevin dynamics (GLD) is also considered, in which the isotropic and uniform Gaussian noise is injected into the GD as where D > 0 corresponds to the noise strength (it is also called the diffusion coefficient) [11,28,29]. The GLD yields an escape rate proportional to e −∆L/D [18,19]. We will see in section 4 that the SGD noise structure, which is characterized by Σ(θ), drastically alters the escape rate from a local minimum.

Dynamics of SGD
The fluctuation of SGD and the local landscape are the two most important factors that influence the escaping behavior of learning. In sections 3.1 and 3.2, we establish the form of the noise of SGD and show that under this type of noise, the relevant landscape for consideration should be log L instead of L. We then use these two results to derive the escape rate of SGD in section 4.

Structure of the SGD noise covariance
The SGD noise covariance matrix Σ(θ) significantly affects the dynamics [8,11,27,30]. In this section, under some approximations, we derive the following expression of Σ(θ) for the mean-square loss near a local minimum θ * : where H(θ) = ∇ 2 L(θ) is the Hessian. It should be noted that ∇L(θ * ) = 0 and H(θ * ) is positive semidefinite at any local minima θ * . We give a derivation below and the list of the approximations and their justifications in Appendix A. In particular, the following decoupling approximation is a key assumption in the derivation.
This approximation seems justified for large networks in which ∇f behaves as a random vector. In section 5.1, we experimentally verify the decoupling approximation for the entire training dynamics.
Our formula (6) possesses two important properties. First, the noise is aligned with the Hessian, which is well known and has been pointed out in the literature [8,11,13,14]. If the loss landscape has flat directions, which correspond to the directions of the Hessian eigenvectors belonging to vanishingly small eigenvalues, the SGD noise does not arise along these directions. Consequently, the SGD dynamics is frozen along the flat directions, which effectively reduces the dimension of the parameter space explored by the SGD dynamics. This reduction plays an important role in the escape efficiency. Indeed, we will see that the escape rate crucially depends on the effective dimension of a given local minimum.
Second, the noise is proportional to the loss function, which is indeed experimentally confirmed in section 5.2. This property has not been pointed out and not been taken into account in previous studies [8,11,13,14] and therefore gives new insights into the SGD dynamics. Indeed, this property allows us to formulate the Langevin equation on the logarithmic loss landscape with simple additive noise as discussed in section 3.2. This new formalism yields the power-law escape rate summarized as theorem 4.7, and the importance of the effective dimension of local minima for their stability.
It should be noted that although Eq. (6) is derived for the mean-square loss, the proportionality between the noise strength and the loss function seems to hold for more general loss functions such as the cross-entropy loss (see appendix D for the detail).
Derivation of Eq. (6): We start from an analytic expression of Σ(θ), which reads where B N is assumed in the second equality. The derivation of Eq. (8) is found in Jastrzȩbski et al. [8], Smith and Le [27]. Usually, the gradient noise variance dominates the square of the gradient noise mean, and hence the term ∇L∇L T in Eq. (8) is negligible.
For the mean-square loss, we have where the decoupling approximation (7) is used in the last equality. Equation (9) is directly related to the Hessian of the loss function near a (local or global) minimum.
The Hessian H(θ) = ∇ 2 L(θ) is written as It is shown by Papyan [31] that the last term of Eq. (10) does not contribute to outliers (i.e. large eigenvalues) of the Hessian. The dynamics near a local minimum is governed by outliers, and hence we can ignore this term. At θ = θ * , we therefore obtain Let us assume C f (θ * ) for θ within the valley of a local minimum θ * . We then obtain the desired expression (6) by substituting it into Eq. (9).

Logarithmized loss landscape
Let us consider the Itô SDE (4) with the SGD noise covariance (6) near a local minimum θ * , which is written as Let us consider a stochastic time t(τ ) for τ ≥ 0 as and perform a random time change from t to τ [32]. Correspondingly, we introduce the Wiener process dW τ ∼ N (0, In terms of the notationθ τ = θ t , Eq. (12) is expressed as We should note that at a global minimum with L(θ) = 0, which is realized in an overparameterized regime [33], the random time change through Eq. (13) is ill-defined since τ is frozen at a finite value once the model reaches a global minimum. We can overcome this difficulty by adding an infinitesimal constant > 0 to the loss, which makes the loss function positive without changing the finite-time dynamics like the escape from a local minimum θ * with L(θ * ) > 0.
In this way, the Langevin equation on the loss landscape L(θ) with multiplicative noise is transformed to that on the logarithmic loss landscape U (θ) = log L(θ) with simpler additive noise. This formulation indicates the importance of considering the logarithmic loss landscape U (θ) = log L(θ). In the following, we use Eq. (14) to discuss the escape efficiency from local minima.

Escape rate from local minima
Now we present our main result on the escape from a local minimum θ * . First, we formally define some key concepts regarding the escape problem.
Definition 4.1 (basin of attraction). For a given local minimum θ * , its basin of attraction A θ * (or a valley of θ * ) is defined as the set of all the starting points θ 0 such that θ t → θ * as t → ∞ when there is no noise. Definition 4.2 (escape rate). We denote by P * the total probability within A θ * and by J the total flux of the probability current across the boundary of A θ * . 1 The escape rate κ is then defined as J /P * [18].
We now calculate the asymptotic behavior of the escape rate in the weak-noise limit η/B → +0, which has been investigated in many fields, including physics [18,34], chemistry [19], stochastic processes [35,36], and machine learning [8,13]. In these previous studies, the following two basic assumptions are commonly used, which are expected to hold in the weak-noise limit. Indeed, the Kramers formula [18], which is obtained by using Assumptions 4.3 and 4.4 below, is rigorously justified [35]. Assumption 4.3 (quasi-stationary approximation). The parameters θ obey the quasistationary distribution near θ * , which is identified as the stationary distribution restricted to A θ * [37].
Assumption 4.4 (most probable escape path). The escape from θ * is dominated by the most probable escape path (MPEP) [38,39]. It is known that the direction of the MPEP at one point must be the direction of one eigenvector of the Hessian at that point, and the MPEP passes a saddle point θ s at the boundary of A θ * . Now we introduce further key assumptions in our analysis for P > 1.
Assumption 4.5 (Hessian outliers). The eigenvalue spectrum of the Hessian H(θ * ) at θ * has n nonzero eigenvalues, which are called "outliers". The remaining P − n eigenvalues are vanishingly small. Assumption 4.6 (low-dimensional subspace of SGD). Outlier eigenvectors of the Hessian v 1 , v 2 , . . . , v n ∈ R P do not change within A θ * , and the SGD dynamics is restricted to the n-dimensional subspace spanned by those outlier eigenvectors (n is called the effective dimension of the local minimum). Assumption 4.5 is empirically confirmed [20,21]. Since the SGD dynamics is frozen along flat directions as we pointed out in section 3.1, the restriction to the n-dimensional outlier subspace in Assumption 4.6 is justified. Indeed, it is empirically observed that the SGD dynamics is actually restricted to a low-dimensional subspace spanned by top eigenvectors of the Hessian [40]. Now we are ready to state our main result in the form of the following theorem.
Theorem 4.7. Let the model parameter θ t evolve according to the SDE in Eq. (12). Under Assumptions 4.3 to 4.6, the escape rate κ asymptotically behaves as as η/B → +0 2 , where θ s is the saddle on the MPEP, h * e is the eigenvalue of the Hessian at θ * along the MPEP, and h s e is the negative eigenvalue of the Hessian at θ s along the MPEP.
Proof. The proof is given in Appendix B. increases with h * e and n, which indicates that sharp minima (i.e. minima with large h * e ) or minima with large n are unstable. This fact explains why SGD finds flat minima with a low effective dimension n. Equation (15) also implies that the effective dimension of any stable minima must satisfy The instability due to a large effective dimension is a new insight naturally explained by the picture of the logarithmic loss landscape. Let us summarize novel aspects of the escape rate derived here, which are not found in previous studies [8,9,[11][12][13][14]. First, the escape rate in Eq. (15) takes a power-law form with respect to the ratio between L(θ * ) and L(θ s ), which differs from a conventional exponential form with respect to the difference ∆L = L(θ s )−L(θ * ). Intuitively, escaping behavior must be a result of noise in the gradient, and if there is no noise, gradient descent cannot escape any basin of attraction. Our result agrees with this intuition: at the global minimum where L(θ * ) = 0, there is no noise, and the SGD must be stuck in where it is with no escaping behavior, which is directly reflected by our formula. However, the standard exponential escape rate formula predicts a non-zero escape rate even when L(θ * ) = 0, which cannot be correct in principle. Second, Eqs. (15) and (16) imply that the SGD is biased to small effective dimensions n. As we mentioned, it is empirically confirmed that the SGD dynamics is restricted to a low-dimensional subspace spanned by top eigenvectors of the Hessian [40]. Since the restriction to a low-dimensional subspace greatly reduces the capacity of the network [41], Eq. (16) supports the presence of an implicit regularization via the SGD.
The formula in Eq. (15) is tested in section 5.3. Since it is difficult in practice to identify when the barrier crossing occurs, we instead consider the mean first passage time, which imitates the escape time for a non-convex loss landscape. Let us fix a threshold value of the loss function. The first passage time t p is defined as the shortest time at which the loss exceeds the threshold value. We identify the threshold value as L(θ s ), i.e., the loss at the saddle in the escape problem. It is expected that t p is similar to the escape time and proportional to κ −1 . Indeed, at least when noise is isotropic and uniform as in the GLD (5), the inverse of the mean first passage time 1/ t p is logarithmically equivalent to κ, i.e., log κ ∼ − log t p , in the weak-noise asymptotic limit [36,38].

Experiments
Our key theoretical observation is that the SGD noise strength is proportional to the loss function, which is obtained as a result of the decoupling approximation. This property leads us to the Langevin equation (14) with the logarithmic loss gradient and an additive noise through a random time change (13). Equation (14) implies the escape rate (15). In section 5.1, we show that the decoupling approximation is valid during the entire training dynamics. In section 5.2, we measure the SGD noise strength and confirm that it is indeed proportional to the loss function near a minimum. In section 5.3, we experimentally test the validity of Eq. (15) for the escape rate. We will see that numerical results for a linear regression and for a non-linear neural network agree with our theoretical results.

Experimental verification of the decoupling approximation
Let us compare the eigenvalue distribution of the exact matrix ( We consider a binary classification problem using the first 10 4 samples of the MNIST dataset such that we classify each image into even (its label is y = +1) or odd number (its label is y = −1). The network has two hidden layers, each of which has 100 units and the ReLU activation, followed by the output layer of a single unit with no activation. Starting from the Glorot initialization, the training is performed via SGD with the mean-square loss, where we fix η = 0.01 and B = 100. Figure 1 shows histograms of their eigenvalues at different stages of the training: (a) at initialization, (b) after 50 epochs, and (c) after 500 epochs. We see that the exact matrix and the approximate one have statistically similar eigenvalue distributions except for exponentially small eigenvalues during the training dynamics. This shows that the decoupling approximation holds during the entire training dynamics in this experiment.

Measurements of the SGD noise strength
Now we test whether the SGD noise strength is actually proportional to the loss function, which is predicted by Eq. (6), an essential theoretical result of ours. As a measure of the SGD noise strength, let us consider the norm of the noise vector ξ given by Here we present experimental results for two architectures and datasets. First, we consider training of the Fashion-MNIST dataset by using a fully connected neural network with three hidden layers, each of which has 2 × 10 3 units and the ReLU activation, followed by the output layer of 10 units with no activation (classification labels are given in the one-hot representation). Second, we consider training of the CIFAR-10 dataset by using a convolutional neural network. Following Keskar et al. Starting from the Glorot initialization, the network is trained by SGD of the minibatch size B = 100 and η = 0.1 for the mean-square loss. During the training, we measure the training loss and the noise strength N for every epoch. Numerical results are given in Fig. 2. We see that roughly N ∝ L at a later stage of the training, which agrees with our theoretical prediction.
Although N is not proportional to L at an early stage of training, it does not mean that Eq. (9) is invalid there. Since the decoupling approximation is valid for the entire training dynamics, Eq. (9) always holds. The reason why the SGD noise strength does not decrease with the loss function in the early-stage dynamics is that N ≈ 2L(θ) × (1/N ) N µ=1 ∇f (θ, x (µ) ) T ∇f (θ, x (µ) ), but the quantity (1/N ) N µ=1 ∇f (θ, x (µ) ) T ∇f (θ, x (µ) ) also changes during training.
Although Eq. (9) is derived for the mean-square loss, the relation N ∝ L(θ) holds in more general loss functions; see Appendix D for general argument and experiments on the cross entropy loss.

Experimental test of the escape rate formula
We now experimentally verify our escape-rate formula (15). Below, we first present numerical results for a simple linear regression problem, and then for a nonlinear model, i.e., a neural network.

Linear regression
Let us start with the following linear regression problem: each entry of x (µ) ∈ R d and its label y (µ) ∈ R are i.i.d. Gaussian random variables of zero mean and unit variance. We focus on the case of d N . The output for an input x is given by f (θ, x) = θ T x, where θ ∈ R d is the trainable network parameter. We optimize θ via SGD. The meansquare loss L(θ) = (1/2N ) N µ=1 θx (µ) − y (µ) 2 is quadratic and has a unique minimum at θ ≈ 0. the Hessian H = (1/N ) N µ=1 x (µ) x (µ)T has d nonzero eigenvalues, all of which are close to unity. We can therefore identify h * e = h * = 1 and n = d. Before investigating the escape rate, we remark that the stationary distribution of θ in this case is theoretically obtained because of the isotropy of SGD noise. Indeed, H(θ * ) in Eq. (14) can be replaced by h * I d , where I d is the d-dimensional identity matrix, and then the stationary distribution ofθ τ is simply given by the Gibbs distribution under the potential U (θ) = log L(θ):P s (θ) ∝ e −U (θ)/T = L(θ) −1/T , where the "temperature" T is given by T = ηh * /B. In Appendix C, it is shown that the stationary distribution P s (θ) of θ t under Eq. (12) is related toP s (θ) via P s (θ) ∝ L(θ) −1P s (θ). We therefore have Remarkably, it depends on L(θ) polynomially rather than exponentially as in the standard GLD [8,28,29]. This property is closely related to the power-law form of the escape rate. First, we test Eq. (17), i.e. the stationary distribution, for d = 1 and N = 10 5 . We sampled the value of θ k at every 100 iterations (k = j × 100, j = 1, 2, . . . , 10 4 ) and made a histogram. We then fit the histogram to the form P s (θ) ∝ L(θ) −φ and determine the exponent φ. Our theory predicts φ = 1 + B/(ηh * ). Numerical results for the exponent φ are presented in Fig. 3 (a) against B for three fixed learning rates η. In the same figure, theoretical values of φ are plotted in dashed lines. The agreement between theory and experiment is fairly well. For a large learning rate η = 1, the exponent slightly deviates from its theoretical value. This is due to the effect of a finite learning rate (recall that η is assumed to be small in deriving the continuous-time stochastic differential equation).
Next, we test our formula on the escape rate, Eq. (15). Although the mean-square loss is quadratic and no barrier crossing occurs, we can measure the first passage time, which imitates the escape time for a non-convex loss landscape as is mentioned in section 4.

Neural network
The escape-rate formula (15) is also verified in a non-linear model. As in section 5.1, we consider the binary classification problem using the first 10 4 samples of MNINST dataset such that we classify each image into even or odd. The network has one hidden layer with 10 units activated by ReLU, followed by the output layer of a single unit with no activation. We always use the mean-square loss. Starting from the Glorot initialization, the network is pre-trained via SGD with η = 0.01 and B = 100 for 10 5 iterations. We find that after pre-training, the loss becomes almost stationary around at L(θ) ≈ 0.035. We assume that the pre-trained network is near a local minimum. We then further train the pre-trained network via SGD with a new choice of η and B (here we fix B = 10), and measure the first passage time t p . The mean first-passage time over 100 independent runs is measured for varying threshold values which are specified by c = L(θ s )/L(θ * ) > 1. Experimental results are presented in Fig. 3 (c). We see the power-law behavior, which is consistent with our theory.
To further verify our theoretical formula (15), we also compare the power-law exponent for the mean first-passage time with our theoretical prediction B/(ηh * e )+1−n/2. Here, h * e and n are estimated by the Hessian eigenvalues. In Appendix E, we present a numerical result for eigenvalues of the approximate Hessian given by the right-hand side of Eq. (11). By identifying the largest eigenvalue of the Hessian as h * e , we have h * e ≈ 95.6. On the other hand, it is difficult to precisely determine the effective dimension n, but it seems reasonable to estimate n ∼ 10. It turns out that theory and experiment agree with each other by choosing n = 9. Dashed lines in Fig. 3 (c) correspond to our theoretical prediction κ −1 ∝ c B/(ηh * e )+1−n/2 with h * e = 95.6 and n = 9. This excellent agreement shows that our theoretical formula (15) is also valid in non-linear models.

Conclusion
In this work, we have investigated the SGD dynamics via a Langevin approach. With several approximations listed in Appendix A, we have derived Eq. (6), which shows that the SGD noise strength is proportional to the loss function. This SGD noise covariance structure yields the stochastic differential equation (14) with additive noise near a minimum via a random time change (13). The original multiplicative noise is reduced to simpler additive noise, but instead the gradient of the loss function is replaced by that of the logarithmic loss function U (θ) = log L(θ). This new formalism yields the power-law escape rate formula (15) whose exponent depends on η, B, h * e , and n. The escape-rate formula in Eq. (15) explains an empirical fact that SGD favors flat minima with low effective dimensions. The effective dimension of a minimum must satisfy Eq. (16) for its stability. This result as well as the formulation of the SGD dynamics using the logarithmic loss landscape should help understand more deeply the SGD dynamics and its implicit biases in machine learning problems.
Although the present work focuses on the Gaussian noise, the non-Gaussianity can also play an important role. For example, Şimşekli et al. [42] approximated SGD as a Lévydriven SDE, which explains why SGD finds wide minima. It would be an interesting future problem to take the non-Gaussian effect into account.

A. List of approximations and their justifications
In section 3.1, we made several approximations to derive the result (6). For clarity, we list the approximations made and their justifications below.
• In Eq. (8), we make the approximation of B N , which simplifies the expression but is not essential. The main conclusion is not affected by this approximation.
• We ignore ∇L∇L T in Eq. (8), which is justified near a local minimum.
• In Eq. (9), we make the decoupling approximation (7), which is one of the key heuristic approximations in our work. This approximation is verified experimentally in section 5.1.
• We ignore the last term of Eq. (10), which is a common approximation [20]. This approximation is justified if we are only interested in the outliers of the Hessian eigenvalues. Indeed, outliers of the Hessian eigenvalues, which play dominant roles in escape from local minima, are known to be attributable to the first term of the right-hand side of Eq. (10) [31].
• In Eq. (11), we assume that the matrix (1/N ) N µ=1 ∇f (θ, x (µ) )∇f (θ, x (µ) ) T does not change so much in a valley with a given local minimum. This approximation is indirectly verified in Fig. 2 (the proportionality between the loss and the noise strength implies this matrix is actually constant).

B. Proof of theorem 4.7
We now prove theorem 4.7. Under Assumption 4.6, dynamics of θ is restricted to the n-dimensional subspace spanned by the outlier eigenvectors v 1 , v 2 , . . . , v n ∈ R P of the Hessian. Consequently, θ is parametrized by n variables z 1 , z 2 , . . . , z n ∈ R as The Hessian is a diagonal matrix in the basis of (v 1 , v 2 , . . . , v n ) within A θ * because of Assumption 4.6. Therefore, ∂ 2 U/∂z i ∂z j = 0 for any i = j, where U = log L is the logarithmic loss introduced in Eq. (14). It implies that ∂U/∂z i is a function of z i , and hence U is written in the form It should be noted that where the last equality is obtained by putting U = log L and ∂ 2 L/∂z 2 i z=0 = h * i . The stochastic differential equation for the n-dimensional vector z = (z 1 , z 2 , . . . , z n ) T in the rescaled time variable τ is given by dz = −∇ z U dτ + 2ηĤ(θ * )/BdW τ [see Eq. (14), which is equivalent to the following Fokker-Planck equation for the distribution function P (z, τ ) of z at τ : where the probability current density J(z) = (J 1 (z), J 2 (z), . . . , J n (z)) T is explicitly given by Under Assumption 4.4, the escape rate is evaluated by considering the MPEP. It is known that the MPEP aligns with one of the eigenvectors of the Hessian [13]. Without loss of generality, let us assume that the direction of eth eigenvector v e corresponds to the direction of the MPEP. We denote by z ⊥ ∈ R n−1 the displacement perpendicular to the escape direction, and write z = (z e , z ⊥ ). At the saddle z s , h s e < 0 and h s i > 0 for all i = e, where {h s i } is the set of eigenvalues of the Hessian at z s , and We now derive the escape rate formula for asymptotically weak noise η/B → +0 following Kramers [18]. The steady current J ∈ R n is aligned to the escape direction, and hence J e = 0 and J ⊥ = 0 along the MPEP. Let us denote by P * the total probability within the valley A θ * and by J τ the total current per unit change of τ flowing to the outside of the valley through the saddle θ s = θ * +z s . From Assumption 4.3, z is assumed to be in the quasi-stationary distribution. Since the quasi-stationary distribution is concentrated around θ * in the weak-noise limit, L(θ t ) is approximately equal to L(θ * ) before the escape. Consequently, the rescaled time variable τ in Eq. (13) is approximately equal to L(θ * )t, and hence the total probability current J t per unit change of t is given by L(θ * )J τ . The escape rate κ per unit change of t is therefore given by We now evaluate P * and J τ . First, to obtain P * , we must know about the quasistationary distribution P s (z) near θ * . It is obtained by putting ∂P (z, τ )/∂τ = 0 in Eq. (21), which implies J(z) = 0. We therefore have For convenience, we put P s (z) = 0 for z / ∈ A θ * . Then, P * , which is the total probability within A θ * , is given by In the weak-noise limit η/B → +0, we can evaluate the above integral by using the saddle-point method, which is also called the Laplace method. By using Eq. (20), the saddle-point method yields as η/B → +0, and therefore Next, let us evaluate J τ . Along the MPEP (z ⊥ = 0), the current vector J ⊥ perpendicular to the escape direction is zero, and hence the probability distribution near the saddle is evaluated in a similar way as Eq. (26): By substituting it into we obtain where the current along the MPEP (z ⊥ = 0) is denoted by J path := J(z s e , z ⊥ = 0). The total current through the saddle is then evaluated by using the saddle-point method: (n−1)/2 (33) as η/B → +0. When the distribution function is almost stationary, Eq. (21) yields ∂J e (z e , z ⊥ = 0)/∂z e = 0, and hence the current along the MPEP is constant J e (z e , z ⊥ = 0) = J path . By putting z ⊥ = 0 in Eq. (32), we have ηh * e U P (z e , z ⊥ = 0) .
By multiplying e B ηh * e U in both sides and integrating over z e from 0 to z c e , where z c e defined as U e (θ * + z c e v e ) = U e (θ * ) (see Fig. 4), we obtain as η/B → +0, where we used the fact that the probability at z c e is negligible in the weak-noise limit. By using the saddle-point method, the integral in the left-hand side of Eq. (35) By substituting this result in Eq. (35), we obtain where ∆U = U (θ s ) − U (θ * ). The total current J τ in Eq. (33) is then expressed as ηh * e ∆U P (θ * ).
By using Eqs. (29) and (38), the escape rate κ in Eq. (24) is evaluated as Since ∆U = log[L(θ s )/L(θ * )], we finally obtain which is exactly identical to the escape rate formula given in theorem 4.7.

C. Stationary distribution
Suppose thatθ τ obeys a simple Langevin equation The stationary distribution ofθ τ is then given by the Gibbs distributionP s (θ) ∝ e −U (θ)/T . On the other hand, what we want is the stationary distribution P s (θ) of θ t , where θ t =θ τ with τ = t 0 dt L(θ t ). In this section, we show the relation between the two distributions: P s (θ) ∝ L(θ) −1P s (θ). We express the stationary distributions in terms of the long-time average of the delta function: By using the relation τ = t 0 dt L(θ t ), we have dτ = L(θ t )dt. For a sufficiently large t, we also obtain τ ∼ tL, whereL := lim s→∞ (1/s) s 0 dt L(θ t ) denotes the long-time average of L(θ t ). By using them, P s (θ) is rewritten as We thus obtain the desired relation, P s (θ) ∝ L(θ) −1P s (θ).

D. Other loss functions
In our paper, we mainly focus on the mean-square loss, for which we can analytically derive the relation between the loss L(θ) and the SGD noise covariance Σ(θ). An important observation is that the SGD noise strength N is proportional to the loss, i.e., N ∝ L(θ) (see section 5.2 for the definition of N ).  Here, we argue that the relation N ∝ L(θ) also holds in more general situations. During the training, the value of µ will fluctuate from sample to sample. At a certain time step of SGD, let us suppose that N − M samples in the training dataset are already fit correctly and hence µ ≈ 0, whereas the other M samples are not and hence µ = O(1). The loss function is then given by L(θ) = (1/N ) N µ=1 µ ∝ M/N . When µ is small, ∇ µ will also be small. Therefore, for N − M samples with µ ≈ 0, ∇ µ ≈ 0 also holds. The other M samples will have non-small gradients: ∇ µ 2 = O(1). We thus estimate N as N ≈ (1/N ) N µ=1 ∇ T µ ∇ µ ∝ M/N ∝ L(θ). In this way, N ∝ L(θ) will hold, irrespective of the loss function.
However, we emphasize that this is a crude argument. In particular, the above argument will not hold near a global minimum because all the samples are correctly fit there, which implies that µ is small for all µ, in contrast to the above argument relying on the existence of M samples with µ and ∇ µ 2 of O(1). We now experimentally test the relation N ∝ L(θ) for the cross-entropy loss. We

E. Hessian eigenvalues for a neural network in section 5.3
We present numerical results on Hessian eigenvalues in a pre-trained neural network studied in section 5.3. Instead of the exact Hessian, we consider an approximate Hessian given on the right-hand side of Eq. (11), i.e., ∇f (θ, x (µ) )∇f (θ, x (µ) ) T .
Eigenvalues {h i } are arranged in descending order as h 1 ≥ h 2 ≥ · · · ≥ h P (in our model P = 7861). A histogram of the Hessian eigenvalues is presented in Fig. 6 (a). We see that most eigenvalues are close to zero, which corresponds to the bulk, but there are some large eigenvalues, which correspond to the outliers. The largest eigenvalue is λ 1 = 95.6, which is identified as h * in our theoretical formula (15).
Another important quantity is the effective dimension n corresnding to the number of outliers. Since the outliers and the bulk are not sharply separated, it is difficult to precisely determine n. In Fig. 6 (b), we plot h i up to i = 30. From this figure, it seems reasonable to estimate n ≈ 10.
As a heuristic method of determining n, we can consider the following identification: first we define the weight p i for ith eigenmode as p i = h i / P j=1 h j . We then determine n as which gives n = 12.7 in our case. In section 5.3, our formula (15) with n = 9 explains numerical results on the firstpassage time.