THE HEAVY-TAIL PHENOMENON IN SGD

Abstract

In recent years, various notions of capacity and complexity have been proposed for characterizing the generalization properties of stochastic gradient descent (SGD) in deep learning. Some of the popular notions that correlate well with the performance on unseen data are (i) the 'flatness' of the local minimum found by SGD, which is related to the eigenvalues of the Hessian, (ii) the ratio of the stepsize η to the batch size b, which essentially controls the magnitude of the stochastic gradient noise, and (iii) the 'tail-index', which measures the heaviness of the tails of the network weights at convergence. In this paper, we argue that these three seemingly unrelated perspectives for generalization are deeply linked to each other. We claim that depending on the structure of the Hessian of the loss at the minimum, and the choices of the algorithm parameters η and b, the SGD iterates will converge to a heavy-tailed stationary distribution. We rigorously prove this claim in the setting of quadratic optimization: we show that even in a simple linear regression problem with independent and identically distributed Gaussian data, the iterates can be heavy-tailed with infinite variance. We further characterize the behavior of the tails with respect to algorithm parameters, the dimension, and the curvature. We then translate our results into insights about the behavior of SGD in deep learning. We finally support our theory with experiments conducted on both synthetic data and fully connected neural networks.

1. INTRODUCTION

The learning problem in neural networks can be expressed as an instance of the well-known population risk minimization problem in statistics, given as follows: min x∈R d F (x) := E z∼D [f (x, z)], (1.1) where z ∈ R p denotes a random data point, D is a probability distribution on R p that denotes the law of the data points, x ∈ R d denotes the parameters of the neural network to be optimized, and f : R d × R p → R + denotes a measurable cost function, which is often non-convex in x. While this problem cannot be attacked directly since D is typically unknown, if we have access to a training dataset S = {z 1 , . . . , z n } with n independent and identically distributed (i.i.d.) observations, i.e., z i ∼ i.i.d. D for i = 1, . . . , n, we can use the empirical risk minimization strategy, which aims at solving the following optimization problem (Shalev-Shwartz & Ben-David, 2014): min x∈R d f (x) := f (x, S) := (1/n) n i=1 f (i) (x), (1.2) where f (i) denotes the cost induced by the data point z i . The stochastic gradient descent (SGD) algorithm has been one of the most popular algorithms for addressing this problem: x k = x k-1 -η∇ fk (x k-1 ), where ∇ fk (x) := (1/b) i∈Ω k ∇f (i) (x). (1.3) Here, k denotes the iterations, η > 0 is the stepsize (also called the learning-rate), ∇ f is the stochastic gradient, b is the batch-size, and Ω k ⊂ {1, . . . , n} is a random subset with |Ω k | = b for all k. Even though the practical success of SGD has been proven in many domains, the theory for its generalization properties is still in an early phase. Among others, one peculiar property of SGD that has not been theoretically well-grounded is that, depending on the choice of η and b, the algorithm can exhibit significantly different behaviors in terms of the performance on unseen test data. A common perspective over this phenomenon is based on the 'flat minima' argument that dates back to Hochreiter & Schmidhuber (1997), and associates the performance with the 'sharpness' or 'flatness' of the minimizers found by SGD, where these notions are often characterized by the magnitude of the eigenvalues of the Hessian, larger values corresponding to sharper local minima 1

