Stochastic Gradient Hamiltonian Monte Carlo for Non-Convex Learning
Huy N. Chau, Miklos Rasonyi

TL;DR
This paper provides a non-asymptotic convergence analysis of Stochastic Gradient Hamiltonian Monte Carlo (SGHMC) for non-convex optimization, demonstrating its effectiveness with subsampling techniques in finding global minima.
Contribution
It offers the first non-asymptotic convergence analysis of SGHMC in non-convex settings, improving upon prior theoretical results.
Findings
Enhanced convergence guarantees for SGHMC in non-convex optimization
Improved theoretical bounds over previous analyses
Validation of SGHMC's effectiveness with subsampling techniques
Abstract
Stochastic Gradient Hamiltonian Monte Carlo (SGHMC) is a momentum version of stochastic gradient descent with properly injected Gaussian noise to find a global minimum. In this paper, non-asymptotic convergence analysis of SGHMC is given in the context of non-convex optimization, where subsampling techniques are used over an i.i.d dataset for gradient updates. Our results complement those of [RRT17] and improve on those of [GGZ18].
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsStochastic Gradient Optimization Techniques · Markov Chains and Monte Carlo Methods · Medical Imaging Techniques and Applications
Stochastic Gradient Hamiltonian Monte Carlo for Non-Convex Learning ††thanks: Both authors were supported by the NKFIH (National Research, Development and Innovation Office, Hungary) grant KH 126505 and the “Lendület” grant LP 2015-6 of the Hungarian Academy of Sciences. The authors thank Minh-Ngoc Tran for helpful discussions.
Huy N. Chau
Miklós Rásonyi
Abstract
Stochastic Gradient Hamiltonian Monte Carlo (SGHMC) is a momentum version of stochastic gradient descent with properly injected Gaussian noise to find a global minimum. In this paper, non-asymptotic convergence analysis of SGHMC is given in the context of non-convex optimization, where subsampling techniques are used over an i.i.d dataset for gradient updates. Our results complement those of [RRT17] and improve on those of [GGZ18].
1 Introduction
Let be a probability space where all the random objects of this paper will be defined. The expectation of a random variable with values in a Euclidean space will be denoted by .
We consider the following optimization problem
[TABLE]
and is a random element in some measurable space with an unknown probability law . The function is assumed continuously differentiable (for each ) but it can possibly be non-convex. Suppose that one has access to i.i.d samples drawn from , where is fixed. Our goal is to compute an approximate minimizer such that the population risk
[TABLE]
is minimized, where the expectation is taken with respect to the training data and additional randomness generating .
Since the distribution of is unknown, we consider the empirical risk minimization problem
[TABLE]
using the dataset
Stochastic gradient algorithms based on Langevin Monte Carlo have gained more attention in recent years. Two popular algorithms are Stochastic Gradient Langevin Dynamics (SGLD) and Stochastic Gradient Hamiltonian Monte Carlo (SGHMC). First, we summarize the use of SGLD in optimization, as presented in [RRT17]. Consider the overdamped Langevin stochastic differential equation
[TABLE]
where is the standard Brownian motion in and is the inverse temperature parameter. Under suitable assumptions on , the SDE (3) admits the Gibbs measure as its unique invariant distribution. In addition, it is known that for sufficiently big , the Gibbs distribution concentrates around global minimizers of . Therefore, one can use the value of from (3), (or from its discretized counterpart SGLD), as an approximate solution to the empirical risk problem, provided that is large and temperature is low.
In this paper, we consider the underdamped (second-order) Langevin diffusion
[TABLE]
where model the position and the momentum of a particle moving in a field of force with random force given by Gaussian noise. It is shown that under some suitable conditions for , the Markov process is ergodic and has a unique stationary distribution
[TABLE]
where is the normalizing constant
[TABLE]
It is easy to observe that the -marginal distribution of is the invariant distribution of (3). We consider the first order Euler discretization of (4), (5), also called Stochastic Gradient Hamiltonian Monte Carlo (SGHMC), given as follows
[TABLE]
where is a step size parameter and is a sequence of i.i.d standard Gaussian random vectors in . The initial condition may be random, but independent of .
In certain contexts, the full knowledge of the gradient is not available, however, using the dataset , one can construct its unbiased estimates. In what follows, we adopt the general setting given by [RRT17]. Let be a measurable space, and such that for any ,
[TABLE]
where is a random element in with probability law . Conditionally on , the SGHMC algorithm is defined by
[TABLE]
where is a sequence of i.i.d. random elements in with law . We also assume from now on that are independent.
Our ultimate goal is to find approximate global minimizers to the problem (1). Let be the output of the algorithm (9),(10) after iterations, and be such that . The excess risk is decomposed as follows, see also [RRT17],
[TABLE]
The remaining part of the present paper is about finding bounds for these errors. Section 2 summarizes technical conditions and the main results. Comparison of our contributions to previous studies is discussed in Section 3. Proofs are given in Section 4.
Notation and conventions. For , scalar product in is denoted by . We use to denote the Euclidean norm (where the dimension of the space may vary). denotes the Borel - field of . For any -valued random variable and for any , let us set . We denote by the set of with . The Wasserstein distance of order between two probability measures and on is defined by
[TABLE]
where is the set of couplings of , see e.g. [Vil08]. For two -valued random variables and , we denote , where is the law of . We do not indicate in the notation and it may vary.
2 Asumptions and main results
The following conditions are required throughout the paper.
Assumption 2.1**.**
The function is continuously differentiable, takes non-negative values, and there are constants such that for any ,
[TABLE]
Assumption 2.2**.**
There is such that, for each ,
[TABLE]
Assumption 2.3** (Dissipative).**
There exist constants such that
[TABLE]
Assumption 2.4**.**
For each , it holds that and
[TABLE]
Assumption 2.5**.**
There exists a constant such that for every ,
[TABLE]
Assumption 2.6**.**
The law of the initial state satisfies
[TABLE]
where is the Lyapunov function defined in (17) below.
Remark 2.7**.**
If the set of global minimizers is bounded, we can always redefine the function to be quadratic outside a compact set containing the origin while maintaining its minimizers. Hence, Assumption 2.3 can be satisfied in practice. Assumption 2.4 means that the estimated gradient is also Lipschitz when using the same training dataset. For example, at each iteration of SGHMC, we may sample uniformly with replacement a random minibatch of size . Then we can choose where are i.i.d random variables having distribution . The gradient estimate is thus
[TABLE]
which is clearly unbiased and Assumption 2.4 will be satisfied whenever Assumptions 2.2 and 2.1 are in force. Assumption 2.5 controls the variance of the gradient estimate.
An auxiliary continuous time process is needed in the subsequent analysis. For a step size , denote by the scaled Brownian motion. Let be the solutions of
[TABLE]
with initial condition where may be random but independent of .
Our first result tracks the discrepancy between the SGHMC algorithm (9), (10) and the auxiliary processes (13), (14).
Theorem 2.8**.**
Let . There exists a constant such that for all ,
[TABLE]
Proof.
The proof of this theorem is given in Section 4.2. ∎
The following is the main result of the paper.
Theorem 2.9**.**
Let . Suppose that the SGHMC iterates are defined by (9), (10). The expected population risk can be bounded as
[TABLE]
where
[TABLE]
where are appropriate constants and is the metric defined in (20) below.
Proof.
The proof of this theorem is given in Section 4.3. ∎
Corollary 2.10**.**
Let We have
[TABLE]
whenever
[TABLE]
Proof.
From the proof of Theorem 2.9, or more precisely from (46), we need to choose and such that
[TABLE]
First, we choose and so that and then
[TABLE]
will hold for large enough. ∎
3 Related work and our contributions
Non-asymptotic convergence rate Langevin dynamics based algorithms for approximate sampling log-concave distributions are intensively studied in recent years. For example, overdamped Langevin dynamics are discussed in [WT11], [Dal17b], [DM16], [DK17], [DM17] and others. Recently, [BCM*+*18] treats the case of non-i.i.d. data streams with a certain mixing property. Underdamped Langevin dynamics are examined in [CFG14], [Nea11], [CCBJ17], etc. Further analysis on HMC are discussed on [BBLG17], [Bet17]. Subsampling methods are applied to speed up HMC for large datasets, see [DQK*+*17], [QKVT18].
The use of momentum to accelerate optimization methods are discussed intensively in literature, for example [AP16]. In particular, performance of SGHMC is experimentally proved better than SGLD in many applications, see [CDC15], [CFG14]. An important advantage of the underdamped SDE is that convergence to its stationary distribution is faster than that of the overdamped SDE in the -Wasserstein distance, as shown in [EGZ17].
Finding an approximate minimizer is similar to sampling distributions concentrate around the true minimizer. This well known connection gives rise to the study of simulated annealing algorithms, see [Hwa80], [Gid85], [Haj85], [CHS87], [HKS89], [GM91], [GM93]. Recently, there are many studies further investigate this connection by means of non asymptotic convergence of Langevin based algorithms and in stochastic non-convex optimization and large-scale data analysis, [CCG*+*16], [Dal17a].
Relaxing convexity is a more challenging issue. In [CCAY*+*18], the problem of sampling from a target distribution where is L-smooth everywhere and -strongly convex outside a ball of finite radius is considered. They provide upper bounds for the number of steps to be within a given precision level of the 1-Wasserstein distance between the HMC algorithm and the equilibrium distribution. In a similar setting, [MMS18] obtains bounds in both the and distances for overdamped Langevin dynamics with stochastic gradients. [XCZG18] studies the convergence of the SGLD algorithm and the variance reduced SGLD to global minima of nonconvex functions satisfying the dissipativity condition.
Our work continues these lines of research, the most similar setting to ours is the recent paper [GGZ18]. We summarize our contributions below:
- •
Diffusion approximation. In Lemma 10 of [GGZ18], the upper bound for the 2-Wasserstein distance between the SGHMC algorithm at step and underdamped SDE at time is (up to constants) given by
[TABLE]
which depends on the number of iteration . Therefore obtaining a precision requires a careful choice of and even . By introducing the auxiliary SDEs (13), (14), we are able to achieve the rate
[TABLE]
see Theorem 2.8 for the case . This upper bound is better in the number of iterations and hence, improves Lemma 10 of [GGZ18]. Our analysis for variance of the algorithm is also different. The iteration does not accumulate mean squared errors, as the number of step goes to infinity.
- •
Our proof for Theorem 2.8 is relatively simple and we do not need to adopt the techniques of [RRT17] which involve heavy functional analysis, e.g. the weighted Csiszár - Kullback - Pinsker inequalities in [BV05] is not needed.
- •
If we consider the -Wasserstein distance for , in particular, when , Theorem 2.9 gives tighter bounds, compared to Theorem 2 of [GGZ18].
- •
Dependence structure of the dataset in the sampling mechanism, can be arbitrary, see the proof of Theorem 2.8. The i.i.d assumption on dataset is used only for the generalization error. We could also incorporate non-i.i.d data in our analysis, see Remark 4.5, but this is left for further research.
4 Proofs
4.1 A contraction result
In this section, we recall a contraction result of [EGZ17]. First, it should be noticed that the constant and the function in their paper are and in the present paper, respectively. Here, the subscript stands for “contraction”. Using the upper bound of Lemma 5.1 for below, there exist constants small enough and such that
[TABLE]
Therefore, Assumption 2.1 of [EGZ17] is satisfied, noting that and
[TABLE]
We define the Lyapunov function
[TABLE]
For any , we set
[TABLE]
where are suitable positive constants to be fixed later and is continuous, non-decreasing concave function such that , is on for some constant with right-sided derivative and left-sided derivative and is constant on . For any two probability measures on , we define
[TABLE]
Note that and are semimetrics but not necessarily metrics. A result from [EGZ17] is recalled below.
For a probability measure on , we denote by the law of when .
Theorem 4.1**.**
There exists a continuous non-decreasing concave function with such that for all probability measures on , and , we have
[TABLE]
where the following relations hold:
[TABLE]
The function is constant on , on with
[TABLE]
and satisfies .
Proof.
From (5.15) of [EGZ17], we get
[TABLE]
Furthermore, from the proof of Corollary 2.6 of [EGZ17], if ,
[TABLE]
and if then
[TABLE]
These bounds and Theorem 2.3 of [EGZ17] imply that
[TABLE]
The proof is complete. ∎
It should be emphasized that , and consequently, contracts at the rate .
4.2 Proof of Theorem 2.8
Here, we summarize our approach. For a given step size , we divide the time axis into intervals of length . For each time step , we compare the SGHMC to the version with exact gradients relying on the Doob inequality, and then compare the later to the auxiliary continuous-time diffusion with the scaled Brownian motion. At this stage we reply on the contraction result from [EGZ17] and uniform boundedness of the Langevin diffusion and its discrete time versions. Since the auxiliary dynamics evolves slower than the original Langevin dynamics, or more precisely at the same speed as that of the SGHCM, our upper bounds do not accumulate errors and are independent from the number of iterations.
Proof.
For each , we define
[TABLE]
Let be -valued random variables satisfying Assumption 2.6. For , we recursively define , and
[TABLE]
Let . For each , and for each , we set
[TABLE]
For each , it holds by definition that and the triangle inequality implies for ,
[TABLE]
and
[TABLE]
Denote . By Assumption 2.4, the estimation continues as follows
[TABLE]
Using (25), one obtains
[TABLE]
noting that Therefore, the estimation in (26) continues as
[TABLE]
Applying the discrete-time version of Grönwall’s lemma and taking squares, noting also that yield
[TABLE]
where
[TABLE]
Taking conditional expectation with respect to , the estimation becomes
[TABLE]
Since the random variables are independent, the sequence of random variables , are independent conditionally on , noting that is measurable with respect to . In addition, they have zero mean by the tower property of conditional expectation. By Assumption 2.4,
[TABLE]
and thus
[TABLE]
by the independence of from . Doob’s inequality and (29) imply
[TABLE]
Taking one more expectation and using Lemma 5.3 give
[TABLE]
By Lemma 4.3, we have , and therefore,
[TABLE]
where we define
[TABLE]
Consequently, we have from (25)
[TABLE]
Let and be the continuous-time interpolation of , and of on , respectively,
[TABLE]
with the initial conditions and . For each and for , define also
[TABLE]
where the dynamics of are given in (13), (14). In this way, the processes are right continuous with left limits. From Lemma 4.4, we obtain for
[TABLE]
Combining (30), (31) and (35) gives
[TABLE]
Define and for and are -valued random variables. The triangle inequality and Theorem 4.1 imply that for , and for ,
[TABLE]
noting the rate of contraction of is . Using Lemma 5.4, we obtain
[TABLE]
where
[TABLE]
Now, we compute
[TABLE]
In norm, the first and second terms of (38) is bounded by , see (36) and the fifth term is estimated by . We consider the third term in (38). From the dynamics of , we find that for ,
[TABLE]
Hölder’s inequality yields
[TABLE]
where the last inequality uses Lemma 5.3 and Assumption 2.2 and . For the fourth term of (38), we have
[TABLE]
where the last inequality uses Assumption 2.5, Lemma 5.3, and (36) and . A similar estimate holds for
[TABLE]
Letting , the estimation (37) continues as
[TABLE]
Therefore, from (30), (35), (39), the triangle inequality implies for ,
[TABLE]
where . The proof is complete. ∎
Remark 4.2**.**
It is important to remark from the proof above that the data structure of can be arbitrary, and only the independence of random elements is used.
Lemma 4.3**.**
The quantity defined in (28) has second moments and
[TABLE]
Proof.
Noting that for each , the random variable is -measurable. Using Assumption 2.5, the Cauchy–Schwarz inequality implies
[TABLE]
where the last inequality uses Lemma 5.3. ∎
This lemma provides variance control for the algorithm. Each term in has an error of order , the total variance in is of order . However, unlike [RRT17], [GGZ18], our technique does not accumulate variance errors over time, as shown in (30). Recently in [BCM*+*18], the authors imposed no condition for variance of the estimated gradient, but employ the conditional -mixing property of data stream, and hence variance is controlled by the decay of mixing property, see their Lemma 8.6.
Lemma 4.4**.**
For every , it holds that
[TABLE]
Proof.
Noting that , we use the triangle inequality and Assumption 2.2 to estimate
[TABLE]
For notational convenience, we define for every
[TABLE]
Then (40) becomes
[TABLE]
Furthermore,
[TABLE]
We estimate
[TABLE]
Noting that , the Cauchy-Schwarz inequality and Lemma 5.1 imply
[TABLE]
Taking expectation both sides and noting that has the same distribution as , Lemma 5.3 leads to
[TABLE]
for . Similarly,
[TABLE]
Taking squares and expectation of (41), (42), applying (43), (44) we obtain for
[TABLE]
where . Summing up two inequalities yields
[TABLE]
where and then Gronwall’s lemma shows
[TABLE]
noting that is continuous. The proof is complete by setting , which is of order . ∎
4.3 Proof of Theorem 2.9
Denote . Let and be such that and . We decompose the population risk by
[TABLE]
4.3.1 The first term
The first term in the right hand side of (45) is rewritten as
[TABLE]
where is the product of laws of independent random variables . By Assumptions 2.1 and 2.2, the function satisfies Using Lemma 5.2, we have
[TABLE]
where
[TABLE]
by Lemma 5.5. On the other hand, Theorems 2.8 and 4.1 imply
[TABLE]
Therefore, an upper bound for is given by
[TABLE]
4.3.2 The second term
Since the -marginal of is , the Gibbs measure of (3), we compute
[TABLE]
Therefore the argument in [RRT17] is adopted,
[TABLE]
The constant comes from the logarithmic Sobolev inequality for and
[TABLE]
where is the uniform spectral gap for the overdamped Langevin dynamics
[TABLE]
Remark 4.5**.**
One can also find an upper bound for when the data is a realization of some non-Makovian processes. For example, if we assume that is Lipschitz on the second variable and satisfies a certain mixing property discussed in [CKRS16]) then the term is bounded by times a constant, see Theorem 2.5 therein.
4.3.3 The third term
For the third term, we follow [RRT17]. Let be any minimizer of . We compute
[TABLE]
where the last inequality comes from Proposition 3.4 of [RRT17]. The condition is not used here, see the explanation in Lemma 16 of [GGZ18].
5 Technical lemmas
Lemma 5.1**.**
Under Assumptions 2.1, 2.2, for any and ,
[TABLE]
and
[TABLE]
Proof.
See Lemma 2 of [RRT17]. ∎
The next lemma generalizes continuity for functions of quadratic growth in Wasserstein distances given in [PW16].
Lemma 5.2**.**
Let be two probability measures on with finite second moments and let be a function with
[TABLE]
for some . Then for such that , we have
[TABLE]
where
[TABLE]
Proof.
Using the Cauchy-Schwartz inequality, we compute
[TABLE]
Then for any we have
[TABLE]
Since this inequality holds true for any , the proof is complete. ∎
Lemma 5.3**.**
The continuous time processes (4),(5) are uniformly bounded in , more precisely,
[TABLE]
For , where
[TABLE]
and
[TABLE]
[TABLE]
Furthermore, the processes defined in (24), (34) are also uniformly bounded in with the upper bounds , respectively.
Proof.
The uniform boundedness in of the processes in (4), (5), (9), (10) are given in Lemma 8 of [GGZ18]. From (A.4) of [GGZ18], it holds that
[TABLE]
Using the notations in their Lemma 8, we denote
[TABLE]
then the following relations hold
[TABLE]
Taking in (50) gives
[TABLE]
Therefore, by (49) we obtain for
[TABLE]
Then the processes in (34) is uniformly bounded in by (48) and (51),
[TABLE]
and
[TABLE]
Similarly, from (50) and (51), we obtain for ,
[TABLE]
and the upper bounds for are , respectively. ∎
Lemma 5.4**.**
Let be any two probability measures on . It holds that
[TABLE]
where .
Proof.
From (2.11) of [EGZ17], we have that , for , and from (18), . By definition (20), we estimate
[TABLE]
∎
Lemma 5.5**.**
Let . It holds that
[TABLE]
Proof.
We will use the arguments in the proof of Lemma 12 of [GGZ18] to obtain the contraction for and in Lemma 3.9 of [CMR*+*18] to obtain high moment estimates. First, we have
[TABLE]
Denoting , we compute
[TABLE]
Similarly, we have
[TABLE]
Denoting , we compute that
[TABLE]
Let us denote . From (52), (LABEL:eq:V), (54) and (55) we compute that
[TABLE]
where
[TABLE]
Using the inequality (16), we obtain
[TABLE]
The quantity is bounded as follows
[TABLE]
As in [GGZ18], we deduce that
[TABLE]
And then we get that
[TABLE]
where
[TABLE]
Similarly, we bound , using (5) and the definitions of ,
[TABLE]
and thus
[TABLE]
where
[TABLE]
Noting that we have
[TABLE]
[TABLE]
Therefore, for
[TABLE]
where
[TABLE]
Define . We then compute as follows,
[TABLE]
where the last inequality is due to Lemma A.3 of [CMR*+*18]. Denoting we continue
[TABLE]
Clearly we have
[TABLE]
Define
[TABLE]
On we have
[TABLE]
And thus
[TABLE]
If we choose
[TABLE]
then on , the second, the third and the fourth term in the RHS of (LABEL:eq:2p2) are bounded by [math] and then
[TABLE]
On , we have
[TABLE]
where . For sufficiently small , we get from these bounds
[TABLE]
The proof is complete by using (5). ∎
5.1 Explicit dependence of constants on important parameters
Similar to [GGZ18], we choose in such a way that
[TABLE]
Then we get It follows that
[TABLE]
It is checked that
[TABLE]
and
[TABLE]
The constant are and respectively in [GGZ18]. In addition, we check
[TABLE]
and hence
[TABLE]
From Lemma 16 of [GGZ18], we get
[TABLE]
Furthermore, it is observed that
[TABLE]
Therefore, for a fixed , the term is bounded by
[TABLE]
Since is exponentially small in , our bound for is worse than that of given in [GGZ18].
Acknowledgments
Both authors were supported by the NKFIH (National Research, Development and Innovation Office, Hungary) grant KH 126505 and the “Lendület” grant LP 2015-6 of the Hungarian Academy of Sciences. The authors thank Minh-Ngoc Tran for helpful discussions.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[AP 16] Hedy Attouch and Juan Peypouquet. The rate of convergence of Nesterov’s accelerated forward-backward method is actually faster than 1/k^2. SIAM Journal on Optimization , 26(3):1824–1834, 2016.
- 2[BBLG 17] Michael Betancourt, Simon Byrne, Sam Livingstone, and Mark Girolami. The geometric foundations of Hamiltonian Monte Carlo. Bernoulli , 23(4A):2257–2298, 2017.
- 3[BCM + 18] M. Barkhagen, N. H. Chau, E. Moulines, M. Rásonyi, S. Sabanis, and Y. Zhang. On stochastic gradient Langevin dynamics with stationary data streams in the logconcave case. preprint, ar Xiv:1812.02709 , 2018.
- 4[Bet 17] Michael Betancourt. A conceptual introduction to Hamiltonian Monte Carlo. ar Xiv preprint ar Xiv:1701.02434 , 2017.
- 5[BV 05] François Bolley and Cédric Villani. Weighted Csiszár-Kullback-Pinsker inequalities and applications to transportation inequalities. In Annales de la Faculté des sciences de Toulouse: Mathématiques , volume 14, pages 331–352, 2005.
- 6[CCAY + 18] Xiang Cheng, Niladri S. Chatterji, Yasin Abbasi-Yadkori, Peter L. Bartlett, and Michael I. Jordan. Sharp convergence rates for Langevin dynamics in the nonconvex setting. ar Xiv preprint ar Xiv:1805.01648 , 2018.
- 7[CCBJ 17] Xiang Cheng, Niladri S Chatterji, Peter L Bartlett, and Michael I Jordan. Underdamped Langevin MCMC: A non-asymptotic analysis. ar Xiv preprint ar Xiv:1707.03663 , 2017.
- 8[CCG + 16] Changyou Chen, David Carlson, Zhe Gan, Chunyuan Li, and Lawrence Carin. Bridging the gap between stochastic gradient MCMC and stochastic optimization. In Artificial Intelligence and Statistics , pages 1051–1060, 2016.
