{'fraction_non_alphanumeric': 0.05077375623481264, 'fraction_numerical': 0.016626167029031847, 'mean_word_length': 4.240951742627346, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Finite-Time Analysis of Stochastic Gradient Descent under Markov Randomness

Motivated by broad applications in reinforcement learning and machine learning, this paper considers the popular stochastic gradient descent (SGD) when the gradients of the underlying objective function are sampled from Markov processes. This Markov sampling leads to the gradient samples being biased and not independent. The existing results for the convergence of SGD under Markov randomness are often established under the assumptions on the boundedness of either the iterates or the gradient samples. Our main focus is to study the finite-time convergence of SGD for different types of objective functions, without requiring these assumptions. We show that SGD converges nearly at the same rate with Markovian gradient samples as with independent gradient samples. The only difference is a logarithmic factor that accounts for the mixing time of the Markov chain.


Introduction
Stochastic gradient descent (SGD), originally introduced in [1] under the name of stochastic approximation SA, is probably the most efficient and powerful method for solving optimization problems in machine learning. In this context, we want to optimize an (unknown) objective function f defined over a large set of collected data, while we only have an access to the noisy samples of the gradient ∇f of f . At a point x, we observe a random vector G(x, ξ), a sample of ∇f (x), where ξ is some random variable. Through a careful choice of step sizes, the "noise" induced by this randomness can be averaged out across iterations, and the algorithm converges to stationary point of f . Such convergence is established based on two standard assumptions, the gradient samples are i.i.d and unbiased, i.e., E[G(x, ξ)] = ∇f (x) [2][3][4][5]. For more details about the results of SGD under this setting can be found in the recent review paper [3].
In this paper, we show that a particular version of SGD is still ergodic when the gradients of the underlying objective function are sampled from Markov processes, and hence are biased and not independent across iterations. It has been observed that the SGD performs better when the gradients are sampled from Markov process as compared to i.i.d samples in both convex and nonconvex problems [6]. This model for the gradients has been considered previously in [6][7][8][9][10], where different variants of SGD are considered. In particular, the Markov subgradient incremental methods have been considered in [8,9] motivated by the applications of distributed algorithms to minimize a sum of functions over a network of agents. At any iteration, an agent updates the current iterates using its own function, and either passes the new iterate to a randomly chosen neighbor or keeps updating. In [7], the authors consider an ergodic version of the popular mirror descent and provide a finite-time analysis for the case of convex optimization problems. The authors in [6] study a non-ergodic version of SGD for both convex and nonconvex problems when the Markov chains is non-reversible. They establish a convergence rate O(1/k 1−q ), q ∈ (1/2, 1), which is worse than O(1/ √ k) under i.i.d sampling. Finally, the authors in [10] consider an accelerated ergodic version of SGD for both nonconvex and convex problems and achieve the same rates as the ones using i.i.d samples, except for a log factor capturing the mixing time of the underlying Markov chain.
The convergence analysis of the existing works listed above is established under the assumptions on the boundedness of the iterates, e.g., either the feasible set is compact or the gradient is bounded. Such assumptions may not be applicable in many settings, for example, in the context of reinforcement learning (RL), which is the main motivation of this paper. Thus, our goal in this paper is to study the convergence rates of SGD under Markov randomness for different settings under less restrictive assumptions as compared to the existing works [6][7][8][9][10]. We also note some relevant works in [11][12][13], where the authors study finite-time analysis of stochastic approximation under Markov randomness. We, however, focus on the convergence rates of SGD under different settings than the ones considered in [11][12][13].

Main contributions
We study the popular stochastic gradient descent where the gradients are sampled from a Markov process. We show that, despite the gradients being biased and dependent across iterations, the convergence rate across many different types of objective functions (strongly convex, smooth and satisfying error bound conditions, nonconvex and smooth) is within a logarithmic factor of the comparable bounds for independent gradients. This logarithmic factor is naturally related to the mixing time of the underlying Markov process generating the stochastic gradients. Our convergence analysis is established without requiring any assumption on the boundedness of the iterates or the gradients, as often assumed in the existing literature.

Stochastic gradient descent under Markov randomness
In this section, we present the main problem considered in this paper, which is inspired by the work in [7]. Specifically, we consider the following (possibly nonconvex) optimization problem where f : R d → R is given as Here S is a finite statistical sample space with probability distribution µ and G(·, ξ) : S → R is a bounded below (possibly nonconvex) function associated with ξ ∈ S. We are interested in the first-order stochastic optimization methods, specifically the popular SGD, for solving problem (1). In particular, we assume that we only have access to G(x; ξ) ∈ ∂G(x; ξ), the (sub)gradient of G(·; ξ) evaluated at the point x. Starting with an arbitrarily initial condition x 0 ∈ X , SGD iteratively updates the iterates as where α k is some nonincreasing and nonnegative time-varying step sizes. We consider in this paper the case where the samples ξ are generated from an ergodic Markov process, whose stationary distribution is µ. Our focus is to study the finite-time analysis of SGD under such Markov randomness on different assumptions of the objective function f . To do that, we introduce the following technical assumptions used throughout this paper.

Assumptions and Preliminaries
Given a vector x ∈ R d , we associate with it a norm · and denote its dual norm as · * , i.e., where ·, · denotes the inner product. Using the Cauchy-Schwarz inequality we obtain Moreover, by (3) we have We first assume that problem (1) is well-defined.
We consider the following fairly standard technical assumptions about the Markov process, which are often assumed in the existing literature [6, 7, 10-12, 14, 15].

Assumption 2.
The sequence {ξ k } is a Markov chain with a finite state space S. In addition, the following limits exit Assumption 3. Given a positive constant α, we denote by τ (α) the mixing time of the Markov chain {ξ k }. We assume that for g(x) ∈ ∂f (x) and ∀ ξ ∈ S Moreover, {ξ k } has a geometric mixing time, i.e., there exists a positive constant C such that Next we assume that G(x, ·) is uniformly Lipschitz continuous, which is satisfied in the context of RL studied in [11,12]. Moreover, this condition is weaker than the boundedness assumptions in [6][7][8][9][10].

Assumption 4. There exists a constant M such that for all
For convenience, we introduce the following notation where τ (α k ) is the mixing time defined in Assumption 3 associated with the step size α k . Note that τ (α k ) = log(1/α k ) . Moreover, we consider in this paper diminishing step size α k , therefore, lim k→∞ τ (α k )α k = 0. This implies that there exists a positive integer K * such that Finally, we consider the following important lemma to provide an upper bound of the iterates generated by SGD. This result is used throughout this paper to derive the rates of SGD.

Lemma 1.
Suppose that Assumptions 2-4 hold. Let {x k } be generated by (3). Then for all k ≥ K * Proof. Using (8), (5), and the triangle inequality we have which gives Recall from (10) Thus, by using (9) we have from the equation above Using the preceding relation we have from (12) for all k ≥ K * where the last inequality is due to (10). Using the preceding inequality and the triangle inequality yields where the last inequality we use (10) to have Lα k;τ (α k ) ≤ log(2) ≤ 1/3. Rearranging the equation above yields (11)

Finite-time analysis of SGD under Markov randomness
In this section, we focus on analyzing the finite-time performance of SGD under Markov randomness for different assumptions on the objective function f . In particular, we consider three different cases, namely, f is strongly convex, f is smooth and satisfies an error bound condition, and f is only smooth and nonconvex. A key observation of our results is that SGD under Markov randomness has the same finite-time convergence as the one under i.i.d samples and unbiased estimate, except for a log factor capturing the impact of geometric mixing time of the underlying Markov processes. More details are given as below.

Convergence analysis: strong convexity
We study here the convergence rates of SGD (3) when the function f is strongly convex, i.e., we consider the following assumption.
Under this assumption, there exists a unique optimal solution x * of (1), i.e., X * = x * . In this section, we consider the norm induced by the inner product, so, · and · * are the same. Recall that K * is a positive integer satisfying (10). With some abuse of notation, we consider in this section which also satisfies (10). Our main result in this section is to show that x k converges to x * in expectation at a rate To derive this rate, we consider the following two key lemmas. The first lemma is to provide an upper bound on the function value.

Lemma 2. Suppose that Assumptions 5 holds. Let {x k } be generated by (3). Then we have for any
Proof. By the strong convexity of f , Eq. (13), we have for all x ∈ R d and g( By (3) we have Substituting the preceding relation into (17) yields (16), i.e., where the second and last inequalities are due to the Cauchy-Schwarz inequality and (8), respectively.
The next lemma provides an upper bound for the last term on the right-hand side of (16).

Lemma 3.
Suppose that Assumptions 2-4 hold. Let {x k } be generated by (3). Then ∀k ≥ K * and x ∈ R n we have Proof. Consider We next analyze each term on the right-hand side of (20). Let F k be the filtration containing all the information generated by SGD up to iteration k. First, by Assumption (3) we have where the third inequality we use (14) to have α k;τ (α k ) ≤ log(2)/M ≤ 1/3 and the last inequality is due to Cauchy-Schwarz inequality. Second, using (8) we consider Taking the expectation on both sides of (19) and using (20) and (21) we obtain (18).
We now state the main result of this section in the following theorem, where we study the convergence rate of SGD when f is strongly convex.

Theorem 1. Suppose that Assumptions 2-5 hold. Let {x k } be generated by (3). Let α k be
Then we have for all k ≥ K * , where K * is defined in (14) E Proof. Taking the expectation on both sides of (16) and using (18) we have for x = x * , where the second inequality we use α k ≤ α k;τ (α k ) and the last inequality is due to the Cauchy-Schwarz inequality. Since f (x k ) − f * ≥ 0, by multiplying both sides by k we obtain Recall that α k = 4/σk we have By (14) we have for all Thus, summing up both sides of (24) over k and using the preceding three relations we have ∀k ≥ K * which implies (23), i.e., for all k ≥ K *

Convergence analysis: smoothness and error bound conditions
In this section, we study the convergence rate of (3) when f is a smooth convex function and satisfies the error bound condition. In particular, given a point x we denote byx the projection of x to X * , i.e., The error bound condition is then defined as below [16].

Assumption 6.
We assume that ∇f satisfies the following condition for all x We note that this error bound condition is weaker than the strong convexity assumption in (13), i.e., (13) implies (26). This condition does not imply that x * is unique if it exists, i.e., if X * is nonempty then it may contains more than one element. However, the convergence rate of the classic gradient descent under the this condition is the same as the one under strong convexity, that is, they both achieve a linear convergence rate [16][17][18][19][20]. We derive the convergence rate of SGD under Assumption 6 in this section, which says that x k converges to x * in expectation at a rate where K * is a positive interger defined later. Basically, this result says that x k converges to the optimal set X * in expectation. To achieve this result, we present some properties of (26) under the smooth condition of f [16][17][18][19][20].
Assumption 7. f is continuously differentiable and there exists a constant L > 0 such that Under this assumption, the condition (26) implies the Polyak-Lojasiewicz (PL) condition which can be derived from the following inequality using ∇f (x) = 0 Second, the error bound condition also implies the following quadratic growth (QG) condition [16,20] 2σ To derive this rate, we consider the following two key lemmas. The first lemma is to provide an upper bound on the function value by using the Lipschitz continuity of the gradient of f .
We next analyse the third term on the right-hand side of (32).
We now present the main result in this section, which is the convergence rate of x k in expectation under Assumption 6. First, we consider the choice of step sizes α k as Moreover, with some abuse of notation, we consider in this section K * satisfying which also satisfies (10). The main result in this section is stated in the following theorem.

Theorem 2.
Suppose that Assumptions 1-4, 6, 7 hold. Let {x k } be generated by (3). In addition, let α k satisfy (38) and K * be defined in (39). We denote by D 1 and D 2 two constants as Then we have for all k ≥ K * where recall thatx k is the projection of x k to X * .
Proof. By (38) we have (1 − Lα k ) ∈ (0, 1). Taking the expectation on both sides of (32) and using (34) we obtain which by using the Cauchy-Schwarz inequality x + y 2 ≤ 2 x 2 + 2 y 2 gives where D 1 and D 2 are defined in (40). By (39) we have for all k ≥ K * Then by (42) we have for all k ≥ K * which by substracting both sides by f * and using (29) yields Using the choice of step sizes in (38) we have In addition, by (39) we also have Thus, by multiplying both sides of (42) by k 2 and using the preceding two relations we obtain for all which by using (31) and multiplying both sides by L/2σk 2 gives us (41).

Convergence analysis: smoothness and nonconvexity
In this section, we study the convergence rate of (3) when f is a smooth nonconvex function, i.e., f satisfies Assumption 7. In particular, we study the convergence to a stationary point of (1) in expectation, which happens at a rate where T is some predetermined positive integer, and x R is randomly selected from the sequence {x k }, for k ∈ [K * , T ], with some probability. This random rule of choosing the return point x R is adopted from [2] for nonconvex optimization problems. We now proceed to show our main result in this section. Given a positive integer T , consider the following choice of step sizes and α 0 satisfies Moreover, we denote by δ δ = max k∈ [1,T ] √ k + M α 0 √ k + 1 ∈ (0, 1).
Finally, let K * be a positive integer such that Under these conditions, we next consider the following lemma, which provide upper bounds for the time α-weighted average of the iterates generated by (3).