betaFeedback

WorksComputer Science

Sample complexity of variance-reduced policy gradient: weaker assumptions and lower bounds

Abstract

Several variance-reduced versions of REINFORCE based on importance sampling achieve an improved O(ε−3)O(ε^{-3}) sample complexity to find an εε-stationary point, under an unrealistic assumption on the variance of the importance weights. In this paper, we propose the \algo (Defensive Policy Gradient) algorithm, based on defensive importance sampling, which achieves the same rate without any assumption on the variance of ordinary importance weights. We also establish lower bounds in a generalized black-box policy-optimization model that hides states and actions and permits parameter-dependent rewards. In this model, the optimal rates are Θ(ε−4)Θ(ε^{-4}) with bounded-variance one-policy feedback and Θ(ε−3)Θ(ε^{-3}) with mean-square-smooth coupled two-policy feedback. Under standard policy-regularity conditions, REINFORCE and \algo realize the corresponding oracle conditions and attain the O(ε−4)O(ε^{-4}) and O(ε−3)O(ε^{-3}) upper bounds, respectively. Although the lower bounds do not apply directly to the classical MDP interaction model in which these algorithms operate, this correspondence provides oracle-level evidence that the faster rate of \algo is optimal and genuinely separated from that of vanilla policy gradient.

Introduction

Policy gradient methods (PG) are a family of reinforcement learning algorithms ([42]) that are particularly suited for large-scale decision and control problems. Recent applications of PG algorithms range from video games ([45]), to robotics ([38]), to large language models ([29, 2]), where fine-tuning of the LLM with these methods shows a concrete application within the current conversational artificial intelligence boom, and the potential impact of accelerated versions of these methods. In fact, the widespread adoption of these methods is still limited by their need for a huge amount of training data, meaning very long training times in the case of cyber-physical systems or massive computational resources in the case of virtual systems. This motivates the study of the sample complexity of PG from a theoretical perspective ([1]) and the development of accelerated algorithms from a practical one.

The sample complexity of policy gradient algorithms can be measured in terms of the number of interaction episodes, or samples, required to find an ϵ\epsilon-stationary point ([31]). More formally, if Θ⊆Rd\Theta\subseteq\mathbb{R}^{d} is a space of policy parameters and J:Θ→RJ : \Theta\to\mathbb{R} is an objective function measuring the performance of a policy, the goal is to find a θ∈Θ\theta\in\Theta such that

∥∇θJ(θ)∥≤ϵ,\lVert\nabla_{\theta} J(\theta) \rVert\le\epsilon,

using as few samples as possible, or at least with a number of samples that is polynomial in ϵ−1\epsilon^{-1} and all relevant problem-dependent quantities. Alternatively, under stronger assumptions, one can study the number of samples necessary to find a globally optimal policy ([26]). However, since JJ can be nonconvex, convergence to a local optimum is the best one can hope for in full generality. In this paper, we will focus on convergence to ϵ\epsilon-first-order-stationary points (ϵ\epsilon-FOSP). Furthermore, we will restrict our attention to policy gradient algorithms that use first-order information only, which are typically more computationally efficient [15].

The prototypical policy gradient algorithm is REINFORCE [44] and its sample complexity is O(ϵ−4)O(\epsilon^{-4}). This simply follows from the sample complexity of stochastic gradient descent [9, 43], but the details were only worked out recently (see, e.g., Yuan et al, [51]). Variants of REINFORCE based on stochastic variance reduction, a technique originally developed for finite-sum optimization [20], can obtain a better sample complexity. The first algorithm to break the ϵ−4\epsilon^{-4} barrier was SVRPG [31], for which Xu et al [46] proved O(ϵ−10/3)O(\epsilon^{-10/3}) sample complexity. A further improvement was achieved by SRVR-PG [47], with a sample complexity of O(ϵ−3)O(\epsilon^{-3}). This is commonly believed to be optimal (e.g., Yuan et al, [50]) due to a lower bound for the related setting of nonconvex stochastic optimization [5], although the latter is not directly comparable with policy optimization. Several other algorithms followed: STORM-PG [50], PAGE-PG [16], and others [34, 18], all with O(ϵ−3)O(\epsilon^{-3}) sample complexity. Modest empirical improvements over REINFORCE were also observed in these works.

However, all these algorithms employ importance weights to keep the variance-reduced gradient unbiased, an issue specific to RL [31], which is absent in stochastic optimization. Their sample complexity upper bounds rely on an unrealistic assumption on the variance of the importance weights, which can be infinite in practically relevant cases [52]. Notable exceptions are algorithms based on second-order information [41, 15], and TSIVR-PG by Zhang et al [52]. The latter could remove the unrealistic assumption (while still using importance weights) by truncating the gradients. However, their O~(ϵ−3)\widetilde{O}(\epsilon^{-3}) upper bound only holds for softmax policy parametrizations, which are impractical for continuous action spaces. More recently Fatkhullin et al [15] proposed an accelerated policy gradient algorithm that uses neither importance weighting nor second-order information. However, its sample complexity to find an ϵ\epsilon-FOSP is O(ϵ−3.5)O(\epsilon^{-3.5}). It is then only natural to ask the following question:

Can policy gradient algorithms achieve O(ϵ−3)O(\epsilon^{-3}) sample complexity to find an ϵ\epsilon-FOSP, using first-order information only and without any assumption on the variance of importance weights?

In this paper, we answer positively by designing a variance-reduced policy gradient algorithm based on defensive importance sampling [30], a variant of importance weighting with naturally bounded variance. Although we build on existing variance-reduced policy gradient algorithms [16], in particular, we are the first to introduce to this line of work the defensive importance sampling technique, which overcomes in a very natural way a major limitation of existing algorithms. Fully exploiting this method poses two main challenges. The first is to design and analyze a defensive sampling scheme within the context of policy gradient learning. The second, more technical, is a characterization of the continuity of the variance of the defensive importance weights, as boundedness alone is not enough to prove the sample complexity upper bound (Lemma 4).

Moreover, we establish lower bounds in a generalized black-box policy-optimization model where the learner observes rewards and policy scores but not states or actions, and where the reward mechanism may depend explicitly on the queried policy parameter. In this model, the optimal rates are Θ(ϵ−4)\Theta(\epsilon^{-4}) with bounded-variance one-policy feedback and Θ(ϵ−3)\Theta(\epsilon^{-3}) with mean-square-smooth coupled two-policy feedback. Under standard policy-regularity conditions, REINFORCE and DEF-PG realize the corresponding oracle conditions and attain the O(ϵ−4)O(\epsilon^{-4}) and O(ϵ−3)O(\epsilon^{-3}) upper bounds, respectively. Although the lower bounds do not apply directly to the classical observed-trajectory MDP model, this correspondence provides oracle-level evidence that the faster rate of DEF-PG reflects a genuine improvement over that of REINFORCE.

Preliminaries

Notation.

For a measurable space X\mathcal{X}, we denote by ΔX\Delta_{\mathcal{X}} the set of probability measures over X\mathcal{X}. We denote by Δm\Delta_m the probability simplex over mm outcomes. We denote by χ2(P∥Q)\chi^2(P\Vert Q) the chi-square divergence between distributions PP and QQ.

In this section, we introduce the basics of policy optimization, off-policy gradient estimation, and the key assumptions that will be used in our study of sample complexity.

Policy optimization.

We consider independent episodes of interaction, of indefinite length, between an agent and an environment. In each timestep h=0,1,…h = 0, 1, \ldots of an episode, the agent observes a state ShS_h, performs an action AhA_h, and receives a reward Rh+1R_{h+1}. We model this as a discounted Markov decision problem [35], that is a 6-tuple (S,A,P,R,μ0,γ)(\mathcal{S}, \mathcal{A}, P, R, \mu_0, \gamma). Here S\mathcal{S} is a state space, which is either very large or continuous; A\mathcal{A} is an action space, which may be discrete or continuous; P:S×A→ΔSP : \mathcal{S} \times\mathcal{A} \to\Delta_{\mathcal{S}} is a transition probability kernel, such that p(s′∣s,a)=P(Sh+1=s′∣Sh=s,Ah=a)p(s' \mid s, a) = \mathbb{P}(S_{h+1} = s' \mid S_h = s, A_h = a) (or the corresponding probability density); R:S×A→RR : \mathcal{S} \times\mathcal{A} \to\mathbb{R} is a reward function, such that Rh+1=R(Sh,Ah)R_{h+1} = R(S_h, A_h); γ∈[0,1)\gamma\in[0, 1) is a discount factor; and μ0∈ΔS\mu_0 \in\Delta_{\mathcal{S}} is the initial state distribution, such that μ0(s)=P(S0=s)\mu_0(s) = \mathbb{P}(S_0 = s) (or the corresponding probability density).

We consider an episodic learning process in which the agent commits, at the beginning of each episode, to a Markovian stationary stochastic policy π:S→ΔA\pi: \mathcal{S} \to\Delta_{\mathcal{A}}, with π(a∣s)=P(Ah=a∣Sh=s)\pi(a \mid s) = \mathbb{P}(A_h = a \mid S_h = s), or the corresponding probability density. The goal is to maximize the expected discounted return:

max⁡πJ(π):=E[∑h≥0γhRh+1∣π].\max_{\pi} J(\pi) := \mathbb{E}\left[\left.\sum_{h\geq0}\gamma^{h}R_{h+1}\right|\pi\right].

where the expectation is with respect to S0∼μ0S_0 \sim\mu_0, Ah∼π(⋅∣Sh)A_h \sim\pi(\cdot|S_h), and Sh+1∼P(⋅∣Sh,Ah)S_{h+1} \sim P(\cdot|S_h,A_h).

In particular, we restrict our attention to parametric policies with parameter space Θ=Rd\Theta= \mathbb{R}^{d}. The corresponding policy space is ΠΘ={πθ∣θ∈Θ}\Pi_{\Theta} = \{\pi_{\theta}\mid\theta\in\Theta\}, where each policy is parametrized by an element of Θ\Theta. Throughout, we tacitly assume the standard regularity conditions for likelihood-ratio policy-gradient methods [43], including parameter-independent common support and conditions permitting differentiation under the relevant trajectory integrals and discounted sums. The policy-optimization problem can then be written, with slight abuse of notation, as

max⁡θ∈ΘJ(θ):=J(πθ).\max_{\theta\in\Theta}J(\theta):=J(\pi_{\theta}).

In the following, JJ will always denote the parametric objective function, that is, J:Θ→RJ:\Theta\to\mathbb{R}. We call it the performance function. Whenever ∣R(s,a)∣≤Rmax⁡|R(s,a)|\leq R_{\max}, it satisfies ∣J(θ)∣≤Rmax⁡/(1−γ)|J(\theta)|\leq R_{\max}/(1-\gamma) for all θ∈Θ\theta\in\Theta.

In general, JJ is nonconvex, but it has the structure of an expectation under the trajectory distribution induced by the policy.

Remark 1 (Geometric stopping). For the estimators, we use an equivalent finite-trajectory representation of the discounted objective. Independently of the policy and the environment, terminate each episode after every transition with probability 1−γ1-\gamma. If HγH_{\gamma} denotes the resulting trajectory length, then

P(Hγ>h)=γh,E[Hγ]=11−γ.\mathbb{P}(H_{\gamma}>h)=\gamma^{h},\qquad\mathbb{E}[H_{\gamma}]=\frac{1}{1-\gamma}.

We henceforth let p(⋅∣θ)p(\cdot\mid\theta) denote the distribution of the stopped trajectory τ=(S0,A0,R1,…,SHγ−1,AHγ−1,RHγ,SHγ)\tau= (S_0, A_0, R_1, \ldots, S_{H_\gamma-1}, A_{H_\gamma-1}, R_{H_\gamma}, S_{H_\gamma}), and define its undiscounted stopped return by

R(τ)=∑h=0Hγ−1Rh+1.R(\tau) = \sum_{h=0}^{H_\gamma-1} R_{h+1}.

Since the stopping rule is independent of the trajectory,

Eτ∼p(⋅∣θ)[R(τ)]=E[∑h≥0γhRh+1∣πθ]=J(θ).\mathbb{E}_{\tau\sim p(\cdot\mid\theta)}[R(\tau)] = \mathbb{E}\left[\left.\sum_{h \ge0} \gamma^h R_{h+1}\right| \pi_\theta\right] = J(\theta).

Thus, geometric stopping introduces no approximation or truncation bias. It also introduces no additional dependence on ϵ\epsilon. If individual environment transitions are counted instead of trajectories, each oracle call has expected cost (1−γ)−1(1-\gamma)^{-1}.

The performance function can therefore be written as

J(θ)=Eτ∼p(⋅∣θ)[R(τ)].J(\theta) = \mathbb{E}_{\tau\sim p(\cdot\mid\theta)}[R(\tau)].

The stopped return is a fixed function of the trajectory and depends on θ\theta only through the trajectory distribution p(⋅∣θ)p(\cdot\mid\theta). Both RR and the mapping θ↦p(⋅∣θ)\theta\mapsto p(\cdot\mid\theta) are unknown to the agent.

We are interested in algorithms that run a sequence of policies πθ1,πθ2,…\pi_{\theta_1}, \pi_{\theta_2}, \ldots, each for one or more independent episodes, collecting datasets of trajectories D1,D2,…D_1, D_2, \ldots, where Dk={τ1k,…,τnkk}D_k = \{\tau_1^k, \ldots, \tau_{n_k}^k\} is a dataset of nkn_k independent trajectories such that τik∼p(⋅∣θk)\tau_i^k \sim p(\cdot\mid\theta_k), with the aim of maximizing the unknown performance function JJ from the collected data. Policy gradient algorithms [44] do this via stochastic gradient ascent:

θk+1=θk+η∇^J(θk).\theta_{k+1} = \theta_k + \eta\widehat{\nabla} J(\theta_k).

References

  1. [1]Agarwal A, Kakade SM, Lee JD, et al (2021) On the theory of policy gradient methods: Optimality, approximation, and distribution shift. J Mach Learn Res 22:98:1–98:76
  2. [2]Ahmadian A, Cremer C, Gallé M, et al (2024) Back to basics: Revisiting reinforce style optimization for learning from human feedback in llms. 2402.14740arxiv.org/abs/2402.14740
  3. [3]Allen-Zhu Z (2018) How to make the gradients small stochastically: Even faster convex and nonconvex SGD. In: NeurIPS, pp 1165–1175
  4. [4]Arjevani Y, Carmon Y, Duchi JC, et al (2020) Second-order information in non-convex stochastic optimization: Power and limitations. In: COLT, Proceedings of Machine Learning Research, vol 125. PMLR, pp 242–299arxiv.org/abs/2006.13476
  5. [5]Arjevan Y, Carmon Y, Duchi JC, et al (2023) Lower bounds for non-convex stochastic optimization. Math Program 199(1):165–214
  6. [6]Azar MG, Munos R, Kappen HJ (2013) Minimax PAC bounds on the sample complexity of reinforcement learning with a generative model. Mach Learn 91(3):325–349DOI
  7. [7]Barto AG, Sutton RS, Anderson CW (1983) Neuronlike adaptive elements that can solve difficult learning control problems. IEEE Trans Syst Man Cybern 13(5):834–846DOI
  8. [8]Baxter J, Bartlett PL (2001) Infinite-horizon policy-gradient estimation. J Artif Intell Res 15:319–350DOI
  9. [9]Bertsekas DP, Tsitsiklis JN (1996) Neuro-dynamic programming, Optimization and neural computation series, vol 3. Athena Scientific
  10. [10]Cortes C, Mansour Y, Mohri M (2010) Learning bounds for importance weighting. In: NIPS. Curran Associates, Inc., pp 442–450
  11. [11]Cutkosky A, Orabona F (2019) Momentum-based variance reduction in non-convex SGD. In: NeurIPS, pp 15210–15219arxiv.org/abs/1905.10018
  12. [12]Degris T, White M, Sutton RS (2012) Linear off-policy actor-critic. In: ICML. icml.cc / Omnipress
  13. [13]Du SS, Chen J, Li L, et al (2017) Stochastic variance reduction methods for policy evaluation. In: ICML, Proceedings of Machine Learning Research, vol 70. PMLR, pp 1049–1058arxiv.org/abs/1702.07944
  14. [14]Fang C, Li CJ, Lin Z, et al (2018) SPIDER: near-optimal non-convex optimization via stochastic path-integrated differential estimator. In: NeurIPS, pp 687–697arxiv.org/abs/1807.01695
  15. [15]Fatkhullin I, Barakat A, Kireeva A, et al (2023) Stochastic policy gradient methods: Improved sample complexity for fisher-non-degenerate policies. In: ICML, Proceedings of Machine Learning Research, vol 202. PMLR, pp 9827–9869arxiv.org/abs/2302.01734
  16. [16]Gargiani M, Zanelli A, Martinelli A, et al (2022) PAGE-PG: A simple and loopless variance-reduced policy gradient method with probabilistic gradient estimation. In: ICML, Proceedings of Machine Learning Research, vol 162. PMLR, pp 7223–7240arxiv.org/abs/2202.00308
  17. [17]Gil M, Alajaji F, Linder T (2013) Rényi divergence measures for commonly used univariate continuous distributions. Information Sciences 249:124–131
  18. [18]Huang F, Gao S, Pei J, et al (2020) Momentum-based policy gradient methods. In: ICML, Proceedings of Machine Learning Research, vol 119. PMLR, pp 4422–4433arxiv.org/abs/2007.06680
  19. [19]Huang F, Gao S, Huang H (2022) Bregman gradient policy optimization. In: ICLR. OpenReview.netarxiv.org/abs/2106.12112
  20. [20]Johnson R, Zhang T (2013) Accelerating stochastic gradient descent using predictive variance reduction. In: NeurIPS, pp 315–323
  21. [21]Kakade SM (2001) A natural policy gradient. In: NIPS. MIT Press, pp 1531–1538
  22. [22]Konda VR, Tsitsiklis JN (1999) Actor-critic algorithms. In: NIPS. The MIT Press, pp 1008–1014
  23. [23]Lei L, Jordan MI (2017) Less than a single pass: Stochastically controlled stochastic gradient. In: AISTATS, Proceedings of Machine Learning Research, vol 54. PMLR, pp 148–156
  24. [24]Levine S, Kumar A, Tucker G, et al (2020) Offline reinforcement learning: Tutorial, review, and perspectives on open problems. CoRR abs/2005.01643arxiv.org/abs/2005.01643
  25. [25]Li Z, Bao H, Zhang X, et al (2021) PAGE: A simple and optimal probabilistic gradient estimator for nonconvex optimization. In: ICML, Proceedings of Machine Learning Research, vol 139. PMLR, pp 6286–6295arxiv.org/abs/2008.10898
  26. [26]Liu Y, Zhang K, Basar T, et al (2020) An improved analysis of (variance-reduced) policy gradient and natural policy gradient methods. In: NeurIPSarxiv.org/abs/2211.07937
  27. [27]Metelli AM, Papini M, Montali N, et al (2020) Importance sampling techniques for policy optimization. J Mach Learn Res 21:141:1–141:75
  28. [28]Nguyen LM, Liu J, Scheinberg K, et al (2017) SARAH: A novel method for machine learning problems using stochastic recursive gradient. In: ICML, Proceedings of Machine Learning Research, vol 70. PMLR, pp 2613–2621arxiv.org/abs/1703.00102
  29. [29]OpenAI (2023) Gpt-4 technical report. 2303.08774arxiv.org/abs/2303.08774
  30. [30]Owen A, Zhou Y (2000) Safe and effective importance sampling. Journal of the American Statistical Association 95(449):135–143DOI
  31. [31]Papini M, Binaghi D, Canonaco G, et al (2018) Stochastic variance-reduced policy gradient. In: ICML, Proceedings of Machine Learning Research, vol 80. PMLR, pp 4023–4032arxiv.org/abs/1806.05618
  32. [32]Papini M, Pirotta M, Restelli M (2022) Smoothing policies and safe policy gradients. Mach Learn 111(11):4081–4137arxiv.org/abs/1905.03231
  33. [33]Peters J, Schaal S (2008) Reinforcement learning of motor skills with policy gradients. Neural Networks 21(4):682–697DOI
  34. [34]Pham NH, Nguyen LM, Phan DT, et al (2020) A hybrid stochastic policy gradient algorithm for reinforcement learning. In: AISTATS, Proceedings of Machine Learning Research, vol 108. PMLR, pp 374–385arxiv.org/abs/2003.00430
  35. [35]Puterman ML (2014) Markov decision processes: discrete stochastic dynamic programming. John Wiley & Sons
  36. [36]Reddi SJ, Hefny A, Sra S, et al (2016) Stochastic variance reduction for nonconvex optimization. In: ICML, JMLR Workshop and Conference Proceedings, vol 48. JMLR.org, pp 314–323arxiv.org/abs/1603.06160
  37. [37]Roux NL, Schmidt M, Bach FR (2012) A stochastic gradient method with an exponential convergence rate for finite training sets. In: NeurIPS, pp 2672–2680
  38. [38]Rudin N, Hoeller D, Reist P, et al (2021) Learning to walk in minutes using massively parallel deep reinforcement learning. In: CoRL, Proceedings of Machine Learning Research, vol 164. PMLR, pp 91–100arxiv.org/abs/2109.11978
  39. [39]Salehkaleybar S, Khorasani S, Kiyavash N, et al (2022) Adaptive momentum-based policy gradient with second-order information. CoRR abs/2205.08253arxiv.org/abs/2205.08253
  40. [40]Schulman J, Levine S, Abbeel P, et al (2015) Trust region policy optimization. In: ICML, JMLR Workshop and Conference Proceedings, vol 37. JMLR.org, pp 1889–1897arxiv.org/abs/1502.05477
  41. [41]Shen Z, Ribeiro A, Hassani H, et al (2019) Hessian aided policy gradient. In: ICML, Proceedings of Machine Learning Research, vol 97. PMLR, pp 5729–5738
  42. [42]Sutton RS, Barto AG (2018) Reinforcement learning: An introduction. MIT press
  43. [43]Sutton RS, McAllester DA, Singh S, et al (1999) Policy gradient methods for reinforcement learning with function approximation. In: NIPS. The MIT Press, pp 1057–1063
  44. [44]Williams RJ (1992) Simple statistical gradient-following algorithms for connectionist reinforcement learning. Mach Learn 8:229–256
  45. [45]Wurman PR, Barrett S, Kawamoto K, et al (2022) Outracing champion gran turismo drivers with deep reinforcement learning. Nat 602(7896):223–228DOI
  46. [46]Xu P, Gao F, Gu Q (2019) An improved convergence analysis of stochastic variance-reduced policy gradient. In: UAI, Proceedings of Machine Learning Research, vol 115. AUAI Press, pp 541–551arxiv.org/abs/1905.12615
  47. [47]Xu P, Gao F, Gu Q (2020) Sample efficient policy gradient methods with recursive variance reduction. In: ICLR. OpenReview.netarxiv.org/abs/1909.08610
  48. [48]Xu T, Liu Q, Peng J (2017) Stochastic variance reduction for policy gradient estimation. CoRR abs/1710.06034arxiv.org/abs/1710.06034
  49. [49]Yang L, Zhang Y, Zheng G, et al (2022) Policy optimization with stochastic mirror descent. In: AAAI. AAAI Press, pp 8823–8831
  50. [50]Yuan H, Lian X, Liu J, et al (2020) Stochastic recursive momentum for policy gradient methods. CoRR abs/2003.04302arxiv.org/abs/2003.04302
  51. [51]Yuan R, Gower RM, Lazaric A (2022) A general sample complexity analysis of vanilla policy gradient. In: AISTATS, Proceedings of Machine Learning Research, vol 151. PMLR, pp 3332–3380arxiv.org/abs/2107.11433
  52. [52]Zhang J, Ni C, Yu Z, et al (2021) On the convergence and sample efficiency of variance-reduced policy gradient method. In: NeurIPS, pp 2228–2240arxiv.org/abs/2102.08607
  53. [53]Zhao T, Hachiya H, Niu G, et al (2012) Analysis and improvement of policy gradient estimation. Neural Networks 26:118–129

Paper details

vlnc:W_s57taaka
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 10

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents