Near-Optimal Offline Reinforcement Learning via Double Variance Reduction

Ming Yin, Yu Bai, Yu-Xiang Wang

Introduction

Offline reinforcement learning (offline RL, also known as batch RL) aims at learning the near-optimal policy by using a static offline dataset that is collected by a certain behavior policy μ\mu (Lange et al., 2012). As offline RL agent works without needing to interact with the environment, it is more widely applicable to problems where online interaction is infeasible, e.g. when trials-and-errors are expensive (robotics, education), risky (autonomous driving) or even unethical (healthcare) (see,e.g., a recent survey Levine et al., 2020).

Despite its practical significance, a precise theoretical understanding of offline RL has been lacking. Previous sample complexity bounds for RL has primarily focused on the online setting (Azar et al., 2017; Jin et al., 2018; Bai et al., 2019; Zanette & Brunskill, 2019; Simchowitz & Jamieson, 2019; Efroni et al., 2019; Dann & Brunskill, 2015; Cai et al., 2019) or the generative model (simulator) setting (Azar et al., 2013; Sidford et al., 2018a, b; Yang & Wang, 2019; Agarwal et al., 2019; Wainwright, 2019; Lattimore & Szepesvari, 2019), both of which assuming interactive access to the environment and not applicable to offline RL. On the other hand, the sample complexity of offline RL remains unsettled even for environments with finitely many state and actions, a.k.a, the tabular MDPs (Markov Decision Processes). One major line of work is concerned with the off-policy evaluation (OPE) problem (Li et al., 2015; Jiang & Li, 2016; Liu et al., 2018; Kallus & Uehara, 2019a, b; Uehara & Jiang, 2019; Xie et al., 2019; Yin & Wang, 2020; Duan & Wang, 2020). These works provide sample complexity bounds for evaluating the performance of a fixed policy, and do not imply guarantees for policy optimization. Another line of work studies the sample complexity of offline policy optimization in conjunction with function approximation (Chen & Jiang, 2019; Xie & Jiang, 2020b, a; Jin et al., 2020). These results apply to offline RL with general function classes, but when specialized to the tabular setting, they give rather loose sample complexity bounds with suboptimal dependencies on various parameters See Table 1 for a clear comparison..

The recent work of Yin et al. (2021) showed that the optimal sample complexity for finding an ϵ\epsilon-optimal policy in offline RL is O~(H3/dmϵ2)\widetilde{O}(H^{3}/d_{m}\epsilon^{2}) in the finite-horizon non-stationaryThis is also known as the finite-horizon time-inhomogeneous or time-varying setting, where the transition dynamics and rewards could differ by time steps. The stationary case is expected to be easier in the information-theoretical sense, but is more challenging to analyze due to the more complex dependence structure in the observed data. setting (with matching upper and lower bounds), where HH is the horizon length and dmd_{m} is a constant related to the data coverage of the behavior policy in the given MDP. However, the optimal sample complexity in alternative settings such as stationary transition or infinite-horizon settings remains unknown. Further, the O~(H3/dmϵ2)\widetilde{O}(H^{3}/d_{m}\epsilon^{2}) sample complexity is achieved by an off-policy evaluation + uniform convergence type algorithm; other more practical algorithms including (stochastic) optimal planning algorithms such as Q-Learning are not well understood in offline RL. This motivates us to ask:

What algorithm achieves the optimal sample complexity for offline RL in tabular MDPs?

In this paper, we propose an algorithm OPDVR (Off-Policy Doubled Variance Reduction) for offline reinforcement learning based on an extension of the variance reduction technique initiated in (Sidford et al., 2018a; Yang & Wang, 2019). OPDVR performs stochastic (minibatch style) value iterations using the available offline data, and can be seen as a version of stochastic optimal planning that interpolates value iteration and Q-learning. Our main contributions are summarized as follows.

We show that OPDVR finds an ϵ\epsilon-optimal policy with high probability using O~(H2/dmϵ2)\widetilde{O}(H^{2}/d_{m}\epsilon^{2}) episodes of offline data (Section 4.1). This improves upon the best known sample complexity by an HH factor and to the best of our knowledge is the first that achieves an O(H2)O(H^{2}) horizon dependence offlinely, thus formally separating the stationary case with the non-stationary case for offline RL.

We establish a sample (episode) complexity lower bound Ω(H2/dmϵ2)\Omega(H^{2}/d_{m}\epsilon^{2}) for offline RL in the finite-horizon stationary setting (Theorem 4.2), showing that the sample complexity of OPDVR is optimal up to logarithmic factors.

In the finite-horizon non-stationary setting, and infinite horizon γ\gamma-discounted setting, we show that OPDVR achieves O~(H3/dmϵ2)\widetilde{O}(H^{3}/d_{m}\epsilon^{2}) sample (episode) complexity (Section 3) and O~((1−γ)−3/dmϵ2)\widetilde{O}((1-\gamma)^{-3}/d_{m}\epsilon^{2}) sample (step) complexity (Section 4.2) respectively. They are both optimal up to logarithmic factors and our infinite-horizon result improves over the best known results, e.g., those derived for the fitted Q-iteration style algorithms (Xie & Jiang, 2020b).

On the technical end, our algorithm presents a sharp analysis of offline RL with stationary transitions, and uses a doubling technique to resolve the initialization dependence in the original variance reduction algorithm (e.g. of (Sidford et al., 2018a)), both of which could be of broader interest.

Related work.

There is a large and growing body of work on the theory of offline RL and RL in general. We could not hope to provide a comprehensive survey, thus will instead highlight the few prior work that we depend upon on the technical level. The variance reduction techniques that we use in this paper builds upon the work of (Sidford et al., 2018a) in the generative model setting, though it is nontrivial in adapting their techniques to the offline setting; and our two-stage variance reduction appears essential for obtaining optimal rate for ϵ>1\epsilon>1 (see Section 5 and Appendix F.4 for more detailed discussions). We also used a fictitious estimator technique that originates from the OPE literature(Xie et al., 2019; Yin & Wang, 2020), but extended it to the stationary-transition case, and to the policy optimization problem. As we mentioned earlier, the optimal sample complexity in offline RL in the tabular MDPs with stationary transitions was not settled. The result of (Yin et al., 2021) is optimal in the non-stationary case, but is suboptimal by a factor of HH in the stationary case. Our lower bound is a variant of the construction of (Yin et al., 2021) that applies to the stationary case. Other existing work on offline RL has even weaker parameters (sometimes due to their setting being more general, see details in Table 1). We defer more detailed discussion related to the OPE literature and online RL / generative model literature to Appendix A due to space constraint.

Additional paper organization

We present the problem setup in Section 2, present some discussions related to our algorithm in Section 5, and conclude in Section 6. Proofs and some additional technical materials are deferred to the Appendix.

Preliminaries

1 Offline learning problem

In this paper we investigate the offline learning problem, where we do not have interactive access to the MDP, and can only observe a static dataset D={(st(i),at(i),rt(i),st+1(i))}i∈[n]t∈[H]\mathcal{D}=\left\{(s^{(i)}_{t},a^{(i)}_{t},r^{(i)}_{t},s^{(i)}_{t+1})\right\}_{i\in[n]}^{t\in[H]}.We assume that D\mathcal{D} is obtained by executing a pre-specified behavior policy μ\mu (also known as the logging policy) for nn episodes and collecting the trajectories τ(i)=(s1(i),a1(i),r1(i),…,sH(i),aH(i),rH(i),sH+1(i))\tau^{(i)}=(s_{1}^{(i)},a_{1}^{(i)},r_{1}^{(i)},\dots,s_{H}^{(i)},a_{H}^{(i)},r_{H}^{(i)},s_{H+1}^{(i)}), where each episode is rendered in the form: s1(i)∼d1s_{1}^{(i)}\sim d_{1}, at(i)∼μt(⋅∣st(i))a_{t}^{(i)}\sim\mu_{t}(\cdot|s_{t}^{(i)}), rt(i)=r(st(i),at(i))r_{t}^{(i)}=r(s_{t}^{(i)},a_{t}^{(i)}), and st+1(i)∼Pt(⋅∣st(i),at(i))s_{t+1}^{(i)}\sim P_{t}(\cdot|s_{t}^{(i)},a_{t}^{(i)}). Given the dataset D\mathcal{D}, our goal is to find an ϵ\epsilon-optimal policy πout\pi_{\text{out}}, in the sense that ∣∣V1π⋆−V1πout∣∣∞<ϵ||V_{1}^{\pi^{\star}}-V_{1}^{\pi_{\text{out}}}||_{\infty}<\epsilon.

Due to the curse of distributional shift, efficient offline RL is only possible under certain data coverage properties for the behavior policy μ\mu. Throughout this paper we assume the following:

The behavior policy μ\mu satisfies the following: There exists some optimal policy π⋆\pi^{\star} such that dt′μ(st′,at′)>0d_{t^{\prime}}^{\mu}(s_{t^{\prime}},a_{t^{\prime}})>0 if there exists t<t′t<t^{\prime} such that dt:t′π⋆(st′,at′∣st,at)>0d^{\pi^{\star}}_{t:t^{\prime}}(s_{t^{\prime}},a_{t^{\prime}}|s_{t},a_{t})>0, where dt:t′π⋆(st′,at′∣st,at)d^{\pi^{\star}}_{t:t^{\prime}}(s_{t^{\prime}},a_{t^{\prime}}|s_{t},a_{t}) is the conditional multi-step transition probability from step tt to t′t^{\prime}.

Intuitively, Assumption 2.1 requires μ\mu to “cover” certain optimal policy π⋆\pi^{\star}, in the sense that any st′,at′s_{t^{\prime}},a_{t^{\prime}} is reachable by μ\mu if it is attainable from a previous state-action pair by π⋆\pi^{\star}. It is similar to (Liu et al., 2019, Assumption 1). Note that this is weaker than the standard “concentrability” assumption (Munos, 2003; Le et al., 2019; Chen & Jiang, 2019): Concentrability defines βμ:=sup⁡π∈Π∣∣dπ(st,at)/dμ(st,at)∣∣∞<∞\beta_{\mu}:=\sup_{\pi\in\Pi}||d^{\pi}(s_{t},a_{t})/d^{\mu}(s_{t},a_{t})||_{\infty}<\infty (cf. (Le et al., 2019, Assumption 1 & Example 4.1)), which requires the sufficient exploration for tabular caseNote Xie & Jiang (2020b) has a tighter concentration coefficient with Cμ:=max⁡π∈Π∥wdπ/μ∥2,μ2C_{\mu}:=\max_{\pi\in\Pi}\left\lVert w_{d_{\pi}/\mu}\right\rVert^{2}_{2,\mu} but it still requires full exploration when Π\Pi contains all policies. since we optimize over all policies (see Section F.2 for a discussion). In contrast, our assumption only requires μ\mu to “trace” one single optimal policy.Nevertheless, we point out that function approximation++concentrability assumption is powerful for handling realizability/agnostic case and related concepts (e.g. inherent Bellman error) and easier to scale up to general settings.

which is decided by the behavior policy μ\mu and is an intrinsic quantity required by offline learning (see Theorem G.2 in Yin et al. (2021)). Our sample complexity bounds will depend on 1/dm1/d_{m} and in general dmd_{m} is unknown. Yet, we assume dmd_{m} is known for the moment and will utilize the knowledge of dmd_{m} in our algorithms. Indeed, in Lemma 5.1, we show that estimating dmd_{m} (using on-policy Monte Carlo estimator) up to a multiplicative factor only requires O~(1/dm)\widetilde{O}(1/d_{m}) episodes of offline data; replacing the exact dmd_{m} with this estimator suffices for our purpose and, importantly, will not affect our downstream sample complexities.

Variance reduction for offline RL

In this section, we introduce our main algorithm Off-Policy Double Variance Reduction (OPDVR), and present its theoretical guarantee in the finite-horizion non-stationary setting.

We begin by briefly reviewing the variance reduction algorithm for online reinforcement learning, where we have the interactive access to the environment.

Variance reduction (VR) initially emerged as a technique for obtaining fast convergence in large scale optimization problems, for example in the Stochastic Variance Reduction Gradient method (SVRG, (Johnson & Zhang, 2013; Zhang et al., 2013)). This technique is later brought into reinforcement learning for handling policy evaluation (Du et al., 2017) and policy optimization problems (Sidford et al., 2018b, a; Yang & Wang, 2019; Wainwright, 2019; Sidford et al., 2020; Li et al., 2020; Zhang et al., 2020).

In the case of policy optimization, VR is an algorithm that approximately iterating the Bellman optimality equation, using an inner loop that performs an approximate value (or Q-value) iteration using fresh interactive data to estimate V⋆V^{\star}, and an outer loop that performs multiple steps of such iterations to refine the estimates. Concretely, to obtain an reliable Qt(s,a)Q_{t}(s,a) for some step t∈[H]t\in[H], by the Bellman equation Qt(s,a)=r(s,a)+Pt⊤(⋅∣s,a)Vt+1Q_{t}(s,a)=r(s,a)+P_{t}^{\top}(\cdot|s,a)V_{t+1}, we need to estimate Pt⊤(⋅∣s,a)Vt+1P_{t}^{\top}(\cdot|s,a)V_{t+1} with sufficient accuracy. VR handles this by decomposing:

where Vt+1inV_{t+1}^{\text{in}} is a reference value function obtained from previous calculation (See line 4,13 in the inner loop of Algorithm 1) and Pt⊤(⋅∣s,a)(Vt+1−Vt+1in)P_{t}^{\top}(\cdot|s,a)(V_{t+1}-V_{t+1}^{\text{in}}), Pt⊤(⋅∣s,a)Vt+1inP_{t}^{\top}(\cdot|s,a)V_{t+1}^{\text{in}} are estimated separately at different stages. This technique can help in reducing the “effective variance” along the learning process (see Wainwright (2019) Section 2 for a discussion).

In addition, in order to translate the guarantees from learning values to learning policiesNote in general, direct translation of learning a ϵ\epsilon-optimal value to ϵ\epsilon-optimal policy will cause additional suboptimal complexity dependency of HH. , we build on the following “monotonicity property”: For any policy π\pi that satisfies the monotonicity condition Vt≤TπtVt+1V_{t}\leq\mathcal{T}_{\pi_{t}}V_{t+1} for all t∈[H]t\in[H], the performance of π\pi is sandwiched as Vt≤Vtπ≤Vt⋆V_{t}\leq V^{\pi}_{t}\leq V^{\star}_{t}, i.e. π\pi is guaranteed to perform the same or better than VtV_{t}. This property is first captured by (Sidford et al., 2018a) (for completeness we provide a proof in Lemma B.1), and later reused by Yang & Wang (2019); Sidford et al. (2020) under different settings. We rely on this property in our offline setting as well for providing policy optimization guarantees.

2 OPDVR: variance reduction for offline RL

We now explain how we design the VR algorithm in the offline setting. Even though our primary novel contribution is for the stationary case (Theorem 4.1), we begin with non-stationary setting for the ease of explaining algorithmic design. We let ι:=log⁡(HSA/δ)\iota:=\log(HSA/\delta) as a short hand.

We first describe a prototypical version of our offline VR algorithm in Algorithm 1, which we will instantiate with different parameters twice (hence the name“Double”) in each of the three settings of interest.

uniformly for all st,ats_{t},a_{t} with high probability.

Algorithm 1 then proceeds by taking the input offline dataset as a stream of iid sampled trajectories and use an exponentially increasing-sized batches of independent data to pass in zt\mathbf{z}_{t} and gt\mathbf{g}_{t} while updating the estimated QQ value function by applying the Bellman backup operator except that the update is based on a conservative and variance reduced estimated values. Each inner loop iteration backs up from the last time-step and update all QtQ_{t} for t=H,...,1t=H,...,1; and each outer loop iteration passes a new batch of data into the inner loop while ensuring reducing the suboptimality gap from the optimal policy by a factor of 2 in each outer loop iteration.

Now let us introduce our estimators zt\mathbf{z}_{t} and gt\mathbf{g}_{t} in the finite-horizon non-stationary case (the choices for the stationary case and the infinite-horizon case will be introduced later).

where Em,t={nst,at>12m⋅dtμ(st,at)}E_{m,t}=\{n_{s_{t},a_{t}}>\frac{1}{2}m\cdot d^{\mu}_{t}(s_{t},a_{t})\} and nst,atn_{s_{t},a_{t}} is the number of episodes visited (st,at)(s_{t},a_{t}) at time tt. We also note that we only aggregate the data at the same time step tt, so that the observations are from different episodes and thus independentThis is natural for the non-stationary transition setting; for the stationary transition setting we have an improved way for defining this estimators. See Section 4..

Here, El,t={nst,at′>12l⋅dtμ(st,at)}E_{l,t}=\{n^{\prime}_{s_{t},a_{t}}>\frac{1}{2}l\cdot d^{\mu}_{t}(s_{t},a_{t})\} and f(st,at,u):=4uι/ldtμ(st,at)f(s_{t},a_{t},u)\mathrel{\mathop{:}}=4u\sqrt{{\iota}/{ld^{\mu}_{t}(s_{t},a_{t})}}. Notice that f(st,at,u)f(s_{t},a_{t},u) depends on the additional input uinu^{\text{in}} which measures the certified suboptimality of the input.

Fictitious vs. actual estimators.

Careful readers must have noticed that that the above estimators zt\mathbf{z}_{t} and gt\mathbf{g}_{t} are infeasible to implement as they require the unobserved (population level-quantities) in some cases. We call them fictitious estimators as a result. Readers should rest assured since by the following proposition we can show their practical implementations (summarized in Figure 1) are identical to these fictitious estimators with high probability:

Under the condition of Theorem 3.3, we have

These fictitious estimators, however, are easier to analyze and they are central to our extension of the Variance Reduction framework previously used in the generative model setting (Sidford et al., 2018a) to the offline setting. The idea is that it replaces the low-probability, but pathological cases due to random nst,atn_{s_{t},a_{t}} with ground truths. Another challenge of the offline setting is due to the dependence of data points within a single episode. Note that the estimators are only aggregating the data at the same time steps. Since the data pair at the same time must come from different episodes, then conditional independence (given data up to current time steps, the states transition to the next step are independent of each other) can be recovered by this design (3), (4).

The doubling procedure

It turns out that Algorithm 1 alone does not yield a tight sample complexity guarantee, due to its suboptimal dependence on the initial optimality gap u(0)≥sup⁡t∥Vt⋆−Vt(0)∥∞u^{(0)}\geq\sup_{t}\|V^{\star}_{t}-V^{(0)}_{t}\|_{\infty} (recall u(0)u^{(0)} is the initial parameter in the outer loop of Algorithm 1). This is captured in the following:

Suppose ϵ∈(0,1]\epsilon\in(0,1] is the final target accuracy. Algorithm 1 outputs the ϵ\epsilon-optimal policy with episode complexity:

Full algorithm description

We describe our full algorithm OPDVR in Algorithm 2.

3 OPDVR for non-stationary transition settings

We now state our main theoretical guarantee for the OPDVR algorithm in the finite-horizon non-stationary transition setting.

For the HH-horizon non-stationary setting, there exist universal constants c1,c2,c3>0c_{1},c_{2},c_{3}>0 such that if we set m1′=c1H4/dmm^{\prime}_{1}=c_{1}H^{4}/d_{m} for Stage 11, m2′=c2H3/dmm^{\prime}_{2}=c_{2}H^{3}/d_{m} for Stage 22, set K1=K2=log⁡2(H/ϵ)K_{1}=K_{2}=\log_{2}(\sqrt{H}/\epsilon), take gt\mathbf{g}_{t} and zt\mathbf{z}_{t} according to Figure 1, then OPDVR (Algorithm 2) with probability 1−δ1-\delta outputs an ϵ\epsilon-optimal policy π^\hat{\pi} provided that the number of episodes in the offline data D\mathcal{D} exceeds:

Theorem 3.3 shows that our OPDVR algorithm can find an ϵ\epsilon-optimal policy with O~(H3/dmϵ2)\widetilde{O}(H^{3}/d_{m}\epsilon^{2}) episodes of offline data. Compared with the sample complexity lower bound Ω(H3/dmϵ2)\Omega(H^{3}/d_{m}\epsilon^{2}) for offline learning (Theorem G.2. in Yin et al. (2021)), we see that our OPDVR algorithm matches the lower bound up to logarithmic factors. The same rate was achieved previously by the local uniform convergence argument of Yin et al. (2021) under a stronger assumption of full data coverage.

OPDVR for stationary transition settings

In this section, we switch gears to the stationary transition setting, in which the transition probabilities are identical at all time steps: Pt(s′∣s,a):≡P(s′∣s,a)P_{t}(s^{\prime}|s,a):\equiv P(s^{\prime}|s,a). We will consider both the (a) finite-horizon case where each episode is consist of HH steps; and (b) the infinite-horizon case where the reward at the tt-th step is discounted by γt\gamma^{t}, where γ∈(0,1)\gamma\in(0,1) is a discount factor.

These settings encompass additional challenges compared with the non-stationary case, as in theory the transition probabilities can now be estimated more accurately due to the shared information across time steps, and we would like our sample complexity to reflect such an improvement.

We begin by considering the finite-horizon stationary setting. As this is a special case of the non-stationary setting, Theorem 3.3 implies that OPDVR achieves O~(H3/dmϵ2)\widetilde{O}(H^{3}/d_{m}\epsilon^{2}) sample complexity. However, similar as in online RL (Azar et al., 2017), this result may be potentially loose by an O(H)O(H) factor, as the algorithm does not take into account the stationarity of the transitions. This motivates us to design an algorithm that better leverages the stationarity by aggregating state-action pairs across different time steps. Indeed, we modify the fictitious estimators (3) and (4) into the following:

where Em={ns,a>12m⋅∑t=1Hdtμ(s,a)}E_{m}=\{n_{s,a}>\frac{1}{2}m\cdot\sum_{t=1}^{H}d^{\mu}_{t}(s,a)\} and ns,a=∑i=1m∑t=1H1[st(i)=s,at(i)=a]n_{s,a}=\sum_{i=1}^{m}\sum_{t=1}^{H}\mathbf{1}{[s^{(i)}_{t}=s,a^{(i)}_{t}=a]} is the number of data pieces visited (s,a)(s,a) over all mm episodes. Moreover, ft(s,a,u)=4uιl∑t=1Hdtμ(s,a)f_{t}(s,a,u)=4u\sqrt{\frac{\iota}{l}\sum_{t=1}^{H}{d^{\mu}_{t}(s,a)}} and

In the HH-horizon stationary transition setting, there exists universal constants c1′,c2′,c3′c^{\prime}_{1},c^{\prime}_{2},c^{\prime}_{3} such that if we set m1′=c1′H3/dmm^{\prime}_{1}=c^{\prime}_{1}H^{3}/d_{m}, m2′=c2′H2/dmm^{\prime}_{2}=c^{\prime}_{2}H^{2}/d_{m} for Stage 11 and 22, set K1=K2=log⁡2(H/ϵ)K_{1}=K_{2}=\log_{2}(\sqrt{H}/\epsilon), and take zt\mathbf{z}_{t} and gt\mathbf{g}_{t} according to Figure 1, then with probability 1−δ1-\delta, Practical OPDVR finds an ϵ\epsilon-optimal policy provided that the number of episodes in the offline data D\mathcal{D} exceeds:

Theorem 4.1 encompasses our main technical contribution, as the compact data aggregation among different time steps make analyzing the estimators (5) and (6) knotty due to data-dependence (unlike the non-stationary transition setting where estimators are designed using data at specific time so the conditional independence remains). In particular, we need to fully exploit the property that transition PP is identical across different times in a pinpoint way to obtain the H2H^{2} dependence in the sample complexity bound.

Theorem 4.1 shows that OPDVR achieves a sample complexity upper bound O~(H2/dmϵ2)\widetilde{O}(H^{2}/d_{m}\epsilon^{2}) in the stationary setting. To the best of our knowledge, this is the first result that achieves an H2H^{2} dependence for offline RL with stationary transitions, and improves over the vanilla H3H^{3} dependence in either the vanilla (non-stationary) OPDVR (Theorem 3.3) or the “off-policy evaluation + uniform convergence” algorithm of Yin et al. (2021). We emphasize that we exploit specific properties of OPDVR in our techniques for knocking off a factor of HH and there seems to be no direct ways in applying the same techniques in improving the uniform convergence-style results for the stationary-transition setting.

We accompany Theorem 4.1 by a establishing a sample complexity lower bound for this setting, showing that our algorithm achieves the optimal dependence of all parameters up to logarithmic factors.

For all 0<dm≤1SA0<d_{m}\leq\frac{1}{SA}, let the family of problem be \mathcal{M}_{d_{m}}:=\big{\{}(\mu,M)\;\big{|}\;\min_{t,s_{t},a_{t}}d_{t}^{\mu}(s_{t},a_{t})\newline \geq d_{m}\big{\}}. There exists universal constants c1,c2,c,pc_{1},c_{2},c,p (with H,S,A≥c1H,S,A\geq c_{1} and 0<ϵ<c20<\epsilon<c_{2}) such that when n≤cH2/dmϵ2n\leq cH^{2}/d_{m}\epsilon^{2}, we always have

The proof of Theorem 4.2 builds on modifying the O~(H3/dmϵ2)\widetilde{O}(H^{3}/d_{m}\epsilon^{2}) sample complexity lower bound in the non-stationary case (Yin et al., 2021), and can be found in Appendix E.

2 Infinite-horizon discounted setting

We now consider the infinite-horizon discounted setting.

Algorithm 1 and 2 are slighted modified slightly modified to cater to the infinite horizon setting (detailed pseudo-code in Algorithm 3 and 4 in the appendix). Our result is stated as follows. The proof can be found in Appendix D.

Consider Algorithm 4. There are constants c1′,c2′,c3′c^{\prime}_{1},c^{\prime}_{2},c^{\prime}_{3}, such that if we set m1′=O((1−γ)−4/dm),m2′=O((1−γ)−3/dm)m^{\prime}_{1}=O((1-\gamma)^{-4}/d_{m}),m^{\prime}_{2}=O((1-\gamma)^{-3}/d_{m}) (see more precise expressions in Lemma D.7), K1=log⁡2((1−γ)−1/ϵ),K2=log⁡2((1−γ)−1/ϵ)K_{1}=\log_{2}({(1-\gamma)^{-1}}/\epsilon),K_{2}=\log_{2}(\sqrt{(1-\gamma)^{-1}}/\epsilon) , R=log⁡(4/ϵ(1−γ))R=\log(4/\epsilon(1-\gamma)), and choose LCB estimators z\mathbf{z} and g\mathbf{g} as in Figure 1, then with probability 1−δ1-\delta, the infinite horizon version of OPDVR (Algorithm 4) outputs an ϵ\epsilon-optimal policy provided that in offline data D\mathcal{D} has number of samples exceeding

where ι′:=R⋅(log⁡(32(1−γ)−1RSA/δ)+log⁡log⁡2((1−γ)−1/ϵ))⋅log⁡2((1−γ)−1/ϵ)\iota^{\prime}:=R\cdot(\log(32(1-\gamma)^{-1}RSA/\delta)+\log\log_{2}(\sqrt{(1-\gamma)^{-1}}/\epsilon))\cdot\log_{2}(\sqrt{(1-\gamma)^{-1}}/\epsilon).

The proof, deferred to Appendix D, again rely on the analyzing fictitious versions of Algorithm 3 and Algorithm 4 with similar techniques described in our proof sketch of Theorem 4.1.

We note again that for the infinite horizon case, the sample-complexity measures the number of steps, while in the finite horizon case our sample complexity measures the number of episodes (each episode is HH steps) thus (1−γ)−3(1-\gamma)^{-3} is comparable to the H2H^{2} dependence. To the best of our knowledge, Theorem 4.1 and Theorem 4.3 are the first results that achieve H2H^{2}, (1−γ)−3(1-\gamma)^{-3} dependence in the offline regime respectively for stationary transition and infinite horizon setting, see Table 1. Although we note that our result relies on the tabular structure whereas these prior algorithms work for general function classes, their bounds do not improve when reduced to tabular case. In particular, Chen & Jiang (2019); Xie & Jiang (2020b, a) consider using function approximation for exactly tabular problem. Lastly, in the tabular regime, our Assumption 2.1 is much weaker than the βμ,C\beta_{\mu},C considered in these prior work; see Appendix F.2 for a discussion.

Discussions

It is worth mentioning that the input of OPDVR depends on unknown system quantity dmd_{m}. Nevertheless, dmd_{m} is only one-dimensional scalar and thus it is plausible (from a statistical perspective) to leverage standard parameter-tuning tools (e.g. cross validation (Varma & Simon, 2006)) for obtaining a reliable estimate in practice. On the theoretical side, we provide the following result to show plug-in on-policy estimator d^tμ(st,at)=nst,at/n\widehat{d}^{\mu}_{t}(s_{t},a_{t})=n_{s_{t},a_{t}}/n and d^m:=min⁡t,st,at{nst,at/n:nst,at>0},\widehat{d}_{m}:=\min_{t,s_{t},a_{t}}\{n_{s_{t},a_{t}}/n:n_{s_{t},a_{t}}>0\}, is sufficient for accurately estimating dtμ,dmd^{\mu}_{t},d_{m} simultaneously.

For the finite-horizon setting (either stationary or non-stationary), there exists universal constant cc, s.t. when n≥c⋅1/dm⋅log⁡(HSA/δ)n\geq c\cdot 1/d_{m}\cdot\log(HSA/\delta), then w.p. 1−δ1-\delta, we have ∀t,st,at\forall t,s_{t},a_{t}, 12dtμ(st,at)≤d^tμ(st,at)≤32dtμ(st,at)\frac{1}{2}d^{\mu}_{t}(s_{t},a_{t})\leq\widehat{d}^{\mu}_{t}(s_{t},a_{t})\leq\frac{3}{2}d^{\mu}_{t}(s_{t},a_{t}) and, in particular, 12dm≤d^m≤32dm.\frac{1}{2}d_{m}\leq\widehat{d}_{m}\leq\frac{3}{2}d_{m}.

Computational and memory cost.

OPDVR can be implemented as a streaming algorithm that uses only one pass of the dataset. Its computational cost is O~(H4/dmϵ2)\widetilde{O}(H^{4}/d_{m}\epsilon^{2}) — the same as its sample complexity in steps (HH steps is an episode), and the memory cost is O(HSA)O(HSA) for the episodic case and O(SA)O(SA) for the stationary or infinite horizon case. In particular, the double variance reduction technique does not introduce additional overhead beyond constant factors.

Improvement over variance reduction under generative models.

This work may be considered as an extension of the variance reduction framework for RL in the generative model setting (e.g. (Sidford et al., 2018a; Yang & Wang, 2019)), as some of proving techniques such as VR and monotone preserving Vt≤TπtVt+1V_{t}\leq\mathcal{T}_{\pi_{t}}V_{t+1} are inherited from previous works. However, two improvements are made. First, the data pieces collected in offline case are highly dependent (in contrast for generative model setting each simulator call is independent) therefore how to disentangle the dependent structure and analyze tight results makes the offline setting inherently more challenging. Second, our doubling mechanism always guarantee the minimax rate with any initialization and the single VR procedure does not have this property (see Appendix F.4 for a more detailed discussion). Lastly, on the other hand it is not very surprising technique (like VR) from generative model setting can be leveraged for offline RL. While generative model assumes access to the strong simulator P(s′∣s,a)P(s^{\prime}|s,a), for offline RL μ\mu serves as a surrogate simulator where we can simulate episodes. If we can treat the distributional shift appropriately and decouple the data dependence in a pinpoint manner, it is hopeful that generic ideas still work.

Conclusion

This paper proposes OPDVR (off-policy double variance reduction), a new variance reduction algorithm for offline reinforcement learning. We show that OPDVR achieves tight sample complexity for offline RL in tabular MDPs; in particular, ODPVR is the first algorithm that acheives the optimal sample complexity for offline RL in the stationary transition setting. On the technical end, we present a sharp analysis under stationary transitions, and use the doubling technique to resolve the initialization dependence in variance reduction, both of which could be of broader interest. We believe this paper leads to some interesting next steps. For example, can our understandings about the variance reduction algorithm shed light on other commonly used algorithms (such as Q-Learning) for offline RL? How can we better deal with insufficient data coverage? We would like to leave these as future work.

Acknowledgment

The authors would like to thank Lin F. Yang for the discussions about (Sidford et al., 2018a).

References

Appendix A More Discussion on Related Work

There is a growing body of work on offline RL recently (Levine et al., 2020) in both offline policy evaluation (OPE) and offline policy optimization. OPE (also known as Off-Policy Evaluation (Li et al., 2015)) requires estimating the value of a target policy π\pi from an offline dataset that is often generated using another behavior policy μ\mu. A variety of algorithms and theoretical guarantees have been established for offline policy evaluation (Li et al., 2015; Jiang & Li, 2016; Liu et al., 2018; Kallus & Uehara, 2019a, b; Uehara & Jiang, 2019; Xie et al., 2019; Yin & Wang, 2020; Duan & Wang, 2020; Liu et al., 2020a, b; Feng et al., 2020). The majority of these work uses (vanilla or more advanced versions of) importance sampling to correct for the distribution shift, or uses minimax formulation to approximate the task and solves the questions through convex/non-convex optimization.

Meanwhile, the offline policy optimization problem needs to find a near-optimal policy given the offline dataset. The study of offline policy optimization can be dated back to the classical Fitted Q-Iteration algorithm (Antos et al., 2008a, b). The sample complexity for offline policy optimization is studied in a line of recent work (Chen & Jiang, 2019; Le et al., 2019; Xie & Jiang, 2020b, a; Liu et al., 2020b). The focus on these work is on the combination of offline RL and function approximation; when specialized to the tabular setting, the sample complexities have a rather suboptimal dependence on the horizon HH (or (1−γ)−1(1-\gamma)^{-1} in the discounted setting). In particular, Chen & Jiang (2019); Le et al. (2019) first established finite sample guarantees with complexity O~((1−γ)−6βμ/ϵ2)\widetilde{O}((1-\gamma)^{-6}\beta_{\mu}/\epsilon^{2}) (where βμ\beta_{\mu} is the concentration coefficient) and it is later improved to O~((1−γ)−4βμ/ϵ2)\widetilde{O}((1-\gamma)^{-4}\beta_{\mu}/\epsilon^{2}) by Xie & Jiang (2020b) with a finer analysis. Later, Xie & Jiang (2020a) considers offline RL under weak realizability assumption and Liu et al. (2020b) considers offline RL without good exploration. Those are challenging offline settings but their dependence on horizon (1−γ)−1(1-\gamma)^{-1} (or HH) is very suboptimal. The recent work of Yin et al. (2021) (OPE + uniform convergence) first achieves the sample complexity O~(H3/dmϵ2)\widetilde{O}(H^{3}/d_{m}\epsilon^{2}) in the finite-horizon non-stationary transition setting for tabular offline RL, and establishes a lower bound Ω(H3/dmϵ2)\Omega(H^{3}/d_{m}\epsilon^{2}) (where dmd_{m} is a constant related to the data coverage of the behavior policy in the given MDP that is similar to the concentration coefficient βμ\beta_{\mu}) that matches the upper bound up to logarithmic factors. Compared with these work, we analyze a new variance reduction algorithm for offline policy learning, which is a more generic approach as it adapts to all typical settings (finite horizon stationary/non-stationary transition, infinite horizon setting) with optimal sample complexity while the technique in Yin et al. (2021) only works for non-stationary setting and cannot directly reduce to O~(H2/dmϵ2)\widetilde{O}(H^{2}/d_{m}\epsilon^{2}) when the transition becomes stationary. Concurrent to this work, Jin et al. (2020) study pessimism-based algorithms for offline policy optimization under insufficient coverage of the data and Wang et al. (2020); Zanette (2020) provide some negative results (exponential lower bound) for offline RL with linear MDP structure.

Reinforcement learning in online settings

In the generative model setting (where one has a simulator that samples (rt,st+1)(r_{t},s_{t+1}) from any (st,at)(s_{t},a_{t}), (Azar et al., 2013; Wainwright, 2019) prove sample complexity O~((1−γ)−3SA/ϵ2)\widetilde{O}((1-\gamma)^{-3}SA/\epsilon^{2}) is sufficient for the output QQ-function to be ϵ\epsilon-optimal, i.e. ∣∣Q⋆−Qout∣∣∞<ϵ||Q^{\star}-Q^{\text{out}}||_{\infty}<\epsilon, however this does not imply ϵ\epsilon-optimal policy with the same sample complexity. The most related to our work among this line is (Sidford et al., 2018a), which designs an variance reduction algorithm that overcomes the above issue and obtains O~((1−γ)−3SA/ϵ2)\widetilde{O}((1-\gamma)^{-3}SA/\epsilon^{2}) sample complexity or finding the optimal policy as well. Later (Yang & Wang, 2019) again uses VR to obtain the sample optimality under the linear transition models. The design of our algorithm builds upon the variance reduction technique; our doubling technique and analysis in the offline setting can be seen as a generalization of (Sidford et al., 2018a); see Section 5 and Appendix F.4 for more detailed discussions.

Appendix B Proofs for finite-horizon non-stationary setting

The roadmap of our analysis in this section consists of first doing concentration analysis, then iteratively reasoning using induction, analyzing the doubling procedure and proving from prototypical version to the practical version. At a high level, we arrange the proving pipeline to be similar to that of Sidford et al. (2018a) and let exquisite readers feel the difference between generative model setting and offline setting in tabular case (and why VR works under weak offline Assumption 2.1). We also address one defect in Sidford et al. (2018a) later (see Section F.4) to contrast that our doubling VR procedure is necessary.

Even before that, let us start with the simple monotone preservation lemma.

Suppose VV and π\pi is any value and policy satisfy Vt≤TπtVt+1V_{t}\leq\mathcal{T}_{\pi_{t}}V_{t+1} for all t∈[H]t\in[H]. Then it holds Vt≤Vtπ≤Vt⋆V_{t}\leq V^{\pi}_{t}\leq V^{\star}_{t}, for all t∈[H]t\in[H].

We only need to show Vt≤VtπV_{t}\leq V^{\pi}_{t}. Since Vt≤TπtVt+1V_{t}\leq\mathcal{T}_{\pi_{t}}V_{t+1}, we can use it repeatedly to obtain

where “∘\circ” denotes operator composition. Note by default VH+1=VH+1π=VH+1⋆=0V_{H+1}=V_{H+1}^{\pi}=V_{H+1}^{\star}=\mathbf{0}, therefore

where we use the definition of Bellman equation that Vtπ=TπtVt+1πV_{t}^{\pi}=\mathcal{T}_{\pi_{t}}V_{t+1}^{\pi} for all tt. Combining (7) and (8) gives the stated result. ∎

First fix st,ats_{t},a_{t}. Let Et:={nst,at≥12m⋅dtμ(st,at)}E_{t}:=\{n_{s_{t},a_{t}}\geq\frac{1}{2}m\cdot d^{\mu}_{t}(s_{t},a_{t})\}, then by definition,

Next we conditional on nst,atn_{s_{t},a_{t}}. Then from above expression and Bernstein inequality G.3 we have with probability at least 1−δ1-\delta

i.e. for fixed (st,at)(s_{t},a_{t}) we have with probability at least 1−δ1-\delta,

Apply the union bound over all t,st,att,s_{t},a_{t}, we obtain

where the inequality is element-wise and this is (9). ∎

From the definition we have for fixed (st,at)(s_{t},a_{t})

By using the same conditional on nst,atn_{s_{t},a_{t}} as in Lemma B.2, applying Hoeffding’s inequality and law of total expectation, we obtain with probability 1−δ/21-\delta/2, the first term in above is bounded by

and similarly with probability 1−δ/21-\delta/2,

Note for a,b,c>0a,b,c>0, if ∣a−b∣≤c|a-b|\leq c, then ∣a2−b2∣=∣a−b∣⋅∣a+b∣≤∣a−b∣⋅(∣a∣+∣b∣)≤∣a−b∣⋅(2∣b∣+c)≤c⋅(2∣b∣+c)=2bc+c2|a^{2}-b^{2}|=|a-b|\cdot|a+b|\leq|a-b|\cdot(|a|+|b|)\leq|a-b|\cdot(2|b|+c)\leq c\cdot(2|b|+c)=2bc+c^{2}, therefore by (12) we have

where the last inequality comes from ∣P⊤(⋅∣st,at)Vt+1in∣≤∣∣P(⋅∣st,at)∣∣1∣∣Vt+1in∣∣∞≤Vmax⁡|P^{\top}(\cdot|s_{t},a_{t})V^{\text{in}}_{t+1}|\leq||P(\cdot|s_{t},a_{t})||_{1}||V^{\text{in}}_{t+1}||_{\infty}\leq V_{\max}. Combining (11), (13) and a union bound, we have with probability 1−δ1-\delta,

apply again the union bound over t,st,att,s_{t},a_{t} gives the desired result.

Fix time t∈[H]t\in[H]. Let gtg_{t} be the estimator in (4) in Algorithm 1. Then if ∣∣Vt+1−Vt+1in∣∣∞≤2uin||V_{t+1}-V^{\text{in}}_{t+1}||_{\infty}\leq 2u^{\text{in}}, then with probability 1−δ/H1-\delta/H,

Recall gt,dtμg_{t},d^{\mu}_{t} are vectors. By definition of gt(st,at)g_{t}(s_{t},a_{t}), applying Hoeffding’s inequality we obtain with probability 1−δ/H1-\delta/H

Now use assumption ∣∣Vt+1−Vt+1in∣∣∞≤2uin||V_{t+1}-V_{t+1}^{\text{in}}||_{\infty}\leq 2u^{\text{in}} and a union bound over st,ats_{t},a_{t}, we have with probability 1−δ/H1-\delta/H,

use f=4uinlog⁡(2HSA/δ)/ldtμf=4u^{\text{in}}\sqrt{{\log(2HSA/\delta)}/{ld^{\mu}_{t}}}, we obtain the stated result. ∎

The marginal state-action distribution dtμd^{\mu}_{t} entails the hardness in off-policy setting. If the current logging policy μ\mu satisfies there exists some st,ats_{t},a_{t} such that dtμ(st,at)d^{\mu}_{t}(s_{t},a_{t}) is very small, then learning the MDP using this off-policy data will be generically hard, unless dtπ∗(st,at)d^{\pi^{*}}_{t}(s_{t},a_{t}) is also relatively small for this st,ats_{t},a_{t}, see analysis in the following sections.

B.2 Iterative update analysis

Step1: For any a,b≥0a,b\geq 0, we have the basic inequality a+b≤a+b\sqrt{a+b}\leq\sqrt{a}+\sqrt{b}, and apply to Lemma B.4 we have with probability 1−δ/41-\delta/4,

Next, similarly for any a,b≥0a,b\geq 0, we have a≤∣a−b∣+b\sqrt{a}\leq\sqrt{|a-b|}+\sqrt{b}, conditional on above then apply to Lemma B.2 (with probability 1−δ/41-\delta/4) and we obtain with probability 1−δ/21-\delta/2,

Next note σ(⋅)\sqrt{\sigma_{(\cdot)}} is a norm, so by norm triangle inequality (for the second inequality) and a≤b+∣b−a∣\sqrt{a}\leq\sqrt{b}+\sqrt{|b-a|} with (15) (for the first inequality) we have

To sum up, so far we have shown that (16), (18) hold with probability 1−δ/21-\delta/2 and we condition on that.

First of all, VH+1⋆=VH+1=VH+1in=0V^{\star}_{H+1}=V_{H+1}=V_{H+1}^{\text{in}}=0 implies VH+1⋆≤VH+1≤VH+1inV^{\star}_{H+1}\leq V_{H+1}\leq V_{H+1}^{\text{in}} and

Now for certain tt, using induction assumption we can assume with probability at least 1−(H−t−1)δ/H1-(H-t-1)\delta/H, for all t′=t+1,...,Ht^{\prime}=t+1,...,H,

In particular, since Vt+1in≤Vt+1⋆≤Vt+1in+uin1V^{\text{in}}_{t+1}\leq V_{t+1}^{\star}\leq V^{\text{in}}_{t+1}+u^{\text{in}}\mathbf{1}, so combine this and (20) for t′=t+1t^{\prime}=t+1 we get

By Lemma B.5, with probability 1−δ/H1-\delta/H,

By the right hand side of above and (16) we acquire with probability 1−(H−t)δ/H1-(H-t)\delta/H,

where the second equality already gives the proof of the first part of claim (19) and the second inequality is by induction assumption. Moreover, above Qt≤Qt⋆Q_{t}\leq Q_{t}^{\star} also implies VQt≤VQt⋆=Vt⋆V_{Q_{t}}\leq V_{Q_{t}^{\star}}=V_{t}^{\star}, so together with Lemma B.1 (note Vtin≤TπtinVt+1inV_{t}^{\text{in}}\leq\mathcal{T}_{\pi_{t}^{\text{in}}}V_{t+1}^{\text{in}}) we have

this completes the proof of the second part of claim (19).

Step3: Next we prove Vt≤TπtVt+1V_{t}\leq\mathcal{T}_{\pi_{t}}V_{t+1}.

where the first equal sign comes from the definition of VtV_{t} when VQt(st)≥Vtin(st)V_{Q_{t}}(s_{t})\geq V^{\text{in}}_{t}(s_{t}) and the first inequality is from Step2.

On the other hand, if πt(st)=πin(st)\pi_{t}(s_{t})=\pi^{\text{in}}(s_{t}), then

where the first inequality is the property of input VinV^{\text{in}}, πin\pi^{\text{in}} and the second inequality is from Step2.

Step4: It remains to prove Qt⋆−Qt≤Ptπ⋆[Qt+1⋆−Qt+1]+ξtQ^{\star}_{t}-Q_{t}\leq\textit{{P}}^{\pi^{\star}}_{t}[Q^{\star}_{t+1}-Q_{t+1}]+{\xi}_{t}. Indeed, using the construction of QtQ_{t}, we have

where the second equation uses Bellman optimality equation and the third equation uses the definition of ξt=Pt(Vt+1−Vt+1in)−gt+PtVt+1in−zt{\xi}_{t}=\textit{{P}}_{t}(V_{t+1}-V^{\text{in}}_{t+1})-g_{t}+\textit{{P}}_{t}V_{t+1}^{\text{in}}-z_{t}. By (18) and (21),

Lastly, note PtVt+1⋆=Ptπ⋆Qt+1⋆\textit{{P}}_{t}V_{t+1}^{\star}=\textit{{P}}^{\pi^{\star}}_{t}Q^{\star}_{t+1} and by definition Vt+1≥VQt+1V_{t+1}\geq V_{Q_{t+1}}, so we have PtVt+1≥PtVQt+1=PtπQt+1Qt+1≥Ptπ⋆Qt+1\textit{{P}}_{t}V_{t+1}\geq\textit{{P}}_{t}V_{Q_{t+1}}=\textit{{P}}^{\pi_{Q_{t+1}}}_{t}Q_{t+1}\geq\textit{{P}}^{\pi^{\star}}_{t}Q_{t+1}, the last inequality holds true since πQt+1\pi_{Q_{t+1}} is the greedy policy over Qt+1Q_{t+1}. Threfore (22) becomes Qt⋆−Qt=PtVt+1⋆−PtVt+1+ξt≤Ptπ⋆Qt+1⋆−Ptπ⋆Qt+1+ξtQ^{\star}_{t}-Q_{t}=\textit{{P}}_{t}V_{t+1}^{\star}-\textit{{P}}_{t}V_{t+1}+{\xi_{t}}\leq\textit{{P}}^{\pi^{\star}}_{t}Q^{\star}_{t+1}-\textit{{P}}^{\pi^{\star}}_{t}Q_{t+1}+{\xi_{t}}. This completes the proof.

Suppose the input VtinV^{\text{in}}_{t}, t∈[H]t\in[H] of Algorithm 1 satisfies Vtin≤TπtinVt+1inV^{\text{in}}_{t}\leq\mathcal{T}_{\pi^{\text{in}}_{t}}V_{t+1}^{\text{in}} and Vtin≤Vt⋆≤Vtin+uin1V^{\text{in}}_{t}\leq V^{\star}_{t}\leq V^{\text{in}}_{t}+u^{\text{in}}\mathbf{1}. Let VtV_{t}, π\pi be the return of inner loop of Algorithm 1 and choose m=l:=m′⋅log⁡(16HSA)/(uin)2m=l:=m^{\prime}\cdot\log(16HSA)/(u^{\text{in}})^{2}, where m′m^{\prime} is a parameter will be decided later. Then in addition to the results of Lemma B.7, we have with probability 1−δ1-\delta,

Note if uin≥Hu^{\text{in}}\geq\sqrt{H}, the first term in Vt−Vt⋆V_{t}-V_{t}^{\star} requires sample m′m^{\prime} of order O(H4)O(H^{4}), which is suboptimal. This is the main reason why we need the doubling procedure in Algorithm 2 to keep the whole algorithm optimal.

By Lemma B.7, we have with probability 1−δ1-\delta, for all t∈[H]t\in[H],

Applying the recursion repeatedly, we obtain

Now by our choice of m=l:=m′⋅log⁡(16HSA/δ)/(uin)2m=l:=m^{\prime}\cdot\log(16HSA/\delta)/(u^{\text{in}})^{2}, then (23) further less than

Case1. If uin≤Hu^{\text{in}}\leq\sqrt{H}, then (24) is less than

Case2. If uin≥Hu^{\text{in}}\geq\sqrt{H}, then (24) is less than

B.3 The doubling procedure

Before we explain the doubling procedure, let us first finish the proof the Algorithm 1.

Recall ϵ\epsilon is the target accuracy in the outer loop of Algorithm 1. Then:

If u(0)≤Hu^{(0)}\leq\sqrt{H}, then choose m(i)=l(i)=Blog⁡(16HSAK/δ)/(u(i−1))2m^{(i)}=l^{(i)}=B\log(16HSAK/\delta)/(u^{(i-1)})^{2}, where

If u(0)>Hu^{(0)}>\sqrt{H}, then choose m(i)=l(i)=Blog⁡(16HSAK/δ)/(u(i−1))2m^{(i)}=l^{(i)}=B\log(16HSAK/\delta)/(u^{(i-1)})^{2}, where

Then Algorithm 1 guarantees with probability 1−δ1-\delta, the output π(K)\pi^{(K)} is a ϵ\epsilon-optimal policy, i.e. ∣∣V1⋆−V1π(K)∣∣∞<ϵ||V_{1}^{\star}-V_{1}^{\pi^{(K)}}||_{\infty}<\epsilon with total episode complexity:

for both cases. Moreover, BB can be simplified as:

If u(0)≤Hu^{(0)}\leq\sqrt{H},then B≤cH3/dmB\leq cH^{3}/d_{m};

If u(0)>Hu^{(0)}>\sqrt{H}, then B≤cH4/dmB\leq cH^{4}/d_{m}.

Step1: proof in general. First, using induction it is easy to show for all 0<a1,...,an<10<a_{1},...,a_{n}<1, it follows

and this directly implies (1−δK)K≥1−δ(1-\frac{\delta}{K})^{K}\geq 1-\delta. By the choice of m′m^{\prime} and KK, for both situation by Lemma B.8 we always have ∣∣Vt⋆−Vtπ(i)∣∣∞<u(i−1)/2=u(i)||V_{t}^{\star}-V_{t}^{\pi^{(i)}}||_{\infty}<u^{(i-1)}/2=u^{(i)} with probability 1−δ/K1-\delta/K (this is because we choose m(i)=l(i)=Blog⁡(16HSAK/δ)/(u(i−1))2m^{(i)}=l^{(i)}=B\log(16HSAK/\delta)/(u^{(i-1)})^{2} instead of Blog⁡(16HSA/δ)/(u(i−1))2B\log(16HSA/\delta)/(u^{(i-1)})^{2}).

In particular, in both situationThe last equal sign holds since if u(0)≤Hu^{(0)}\leq\sqrt{H} (or u(0)≤Hu^{(0)}\leq{H}), you can always reset u(0)=Hu^{(0)}=\sqrt{H} (or u(0)=Hu^{(0)}={H}).

Step2: simplified expression for m′m^{\prime}. Indeed,

Plug all these numbers back, we have the simplified bound for BB. ∎

The Assumption 2.1 comes into picture for the validity of the bound for A2A_{2} since when dt:t′π⋆(st′,at′∣st,at)>0d^{\pi^{\star}}_{t:t^{\prime}}(s^{\prime}_{t},a^{\prime}_{t}|s_{t},a_{t})>0, by Assumption 2.1 we always have dt′μ(st′,at′)>0d_{t^{\prime}}^{\mu}(s^{\prime}_{t},a^{\prime}_{t})>0 so the bound will never be the trivial +∞+\infty.

Note choose any m′>Bm^{\prime}>B (in Lemma B.10) yields the similar complexity bound of

therefore by the simplified bound of BB, we choose m′=O(H4/dm)m^{\prime}=O(H^{4}/d_{m}) for stage1 and m′=O(H3/dm)m^{\prime}=O(H^{3}/d_{m}) for stage2.

Stage1. Denote ϵ′=Hϵ\epsilon^{\prime}=\sqrt{H}\epsilon and u(0)=Hu^{(0)}=H, then by the choice of KK and mH′=cH4/dmm^{\prime}_{H}=cH^{4}/d_{m} for the case of u(0)≥Hu^{(0)}\geq\sqrt{H} in Lemma B.10, it outputs VtintermediateV_{t}^{\text{intermediate}}, πintermediate\pi^{\text{intermediate}} which is ϵ′\epsilon^{\prime} optimal with complexity:

where Kϵ′=log⁡2(H/ϵ′)K_{\epsilon^{\prime}}=\log_{2}(H/\epsilon^{\prime});

Stage2. Use VtintermediateV_{t}^{\text{intermediate}}, πintermediate\pi^{\text{intermediate}} as input, since ϵ′=Hϵ≤H\epsilon^{\prime}=\sqrt{H}\epsilon\leq\sqrt{H}, we can set u(0)=Hu^{(0)}=\sqrt{H}. Now by Lemma B.10 again (with mH′=cH3/dmm^{\prime}_{\sqrt{H}}=cH^{3}/d_{m}), Algorithm 2 has the final output VtfinalV_{t}^{\text{final}}, πfinal\pi^{\text{final}} that is ϵ\epsilon optimal with complexity

where Kϵ=log⁡2(H/ϵ)K_{\epsilon}=\log_{2}(\sqrt{H}/\epsilon).

Plug back ϵ′=Hϵ\epsilon^{\prime}=\sqrt{H}\epsilon, Algorithm 2 guarantees ϵ\epsilon-optimal policy with probability 1−δ1-\delta using total complexity

where the last inequality uses mH′≤cH3/dmm^{\prime}_{\sqrt{H}}\leq cH^{3}/d_{m} and mH′≤cH4/dmm^{\prime}_{H}\leq cH^{4}/d_{m} in Lemma B.10 and above holds with probability 1−δ1-\delta .

B.4 Practical OPDVR

To go from non-implementable version to the practical version, the idea is to bound the event {nst,at≤12m⋅dtμ(st,at)}\{n_{s_{t},a_{t}}\leq\frac{1}{2}m\cdot d^{\mu}_{t}(s_{t},a_{t})\} and {nst,at′≤12l⋅dtμ(st,at)}\{n^{\prime}_{s_{t},a_{t}}\leq\frac{1}{2}l\cdot d^{\mu}_{t}(s_{t},a_{t})\} so that with high probability, the non-implementable version is identical to the practical OPDVR in Algorithm 2. Specifically, when m′≥8H2/dmm^{\prime}\geq 8H^{2}/d_{m} (this is satisfied since for each stage we set m′m^{\prime} to be at least O(H3/dm)O(H^{3}/d_{m})), then

and repeat this analysis for both stages, we have with probability 1−δ/21-\delta/2, Practical OPDVR is identical to the non-implementable version.

B.5 Proof of Theorem 3.3

The proof consists of two parts. The first part is to use (27) to show OPDVR in Algorithm 2 outputs ϵ\epsilon-optimal policy using episode complexity

with probability 1−δ/21-\delta/2, and the second part is to use (28) to let Practical OPDVR is identical to the non-implementable version with probability 1−δ/21-\delta/2. Apply a union bound of these two gives the stated results in Theorem 3.3 with probability 1−δ1-\delta. ∎

Appendix C Proofs for finite-horizon stationary setting

and recall f(s,a)=4uinlog⁡(2HSA/δ)/l∑t=1Hdtμ(s,a)f(s,a)=4u^{\text{in}}\sqrt{{\log(2HSA/\delta)}/{l\sum_{t=1}^{H}d^{\mu}_{t}(s,a)}}.

Consdier fixed s,as,a. Let Es,a:={ns,a≥12m⋅∑t=1Hdtμ(s,a)}E_{s,a}:=\{n_{s,a}\geq\frac{1}{2}m\cdot\sum_{t=1}^{H}d^{\mu}_{t}(s,a)\}, then by definition,

Next we conditional on ns,an_{s,a}. Define Fk:={su(i),au(i)}i∈[m]u∈[k]\mathcal{F}_{k}:=\{s_{u}^{(i)},a_{u}^{(i)}\}_{i\in[m]}^{u\in[k]} is an increasing filtration and denote

Note if 1[su(i)=s,au(i)=a]=1\mathbf{1}[s^{(i)}_{u}=s,a^{(i)}_{u}=a]=1, then

if 1[su(i)=s,au(i)=a]=0\mathbf{1}[s^{(i)}_{u}=s,a^{(i)}_{u}=a]=0, then still

First of all by Hoeffding’s inequality, we have the martingale difference satisfies with probability 1−δ/21-\delta/2,

where we use shorthand notation Vt+1in(sk+1(i)∣s,a)V^{\text{in}}_{t+1}(s^{(i)}_{k+1}|s,a) to denote the value of Vk+1in(sk+1(i))V^{\text{in}}_{k+1}(s^{(i)}_{k+1}) given sk(i)=ss^{(i)}_{k}=s and ak(i)=aa^{(i)}_{k}=a and nk,s,a=∑i=1m1[sk(i)=s,ak(i)=a]≤ns,an_{k,s,a}=\sum_{i=1}^{m}\mathbf{1}[s^{(i)}_{k}=s,a^{(i)}_{k}=a]\leq n_{s,a}.

where the second equal sign uses episodes are independent, the third equal sign uses Markov property, the fourth uses 1[sk(i)=s,ak(i)=a]\mathbf{1}[s^{(i)}_{k}=s,a^{(i)}_{k}=a] is measurable w.r.t sk(i),ak(i)s^{(i)}_{k},a^{(i)}_{k} and P⊤(⋅∣s,a)Vt+1inP^{\top}(\cdot|s,a)V^{\text{in}}_{t+1} is constant, the fifth equal sign uses the identity

and sixth line is true since we have stationary transition, the underlying transition is always P(⋅∣s,a)P(\cdot|s,a) regardless of time step. This is the key for further reducing the dependence on HH and is NOT shared by non-stationary transition setting!

which means with probability at least 1−δ1-\delta

Now we get rid of the conditional on nst,atn_{s_{t},a_{t}}. Denote

Finally, apply the union bound over all t,s,at,s,a, we obtain

where the inequality is element-wise and this is (9). ∎

From the definition we have for fixed (s,a)(s,a)

Now we conditional on ns,an_{s,a}. The key point is we can regroup mm episodic data into mHmH data pieces, in order. (This is valid since within each episode data is generated by time and between different episodes are independent, so we can concatenate one episode after another and end up with mHmH pieces that comes in sequentially.) This key reformulation allows us to apply Azuma Hoeffding’s inequality and obtain with probability 1−δ/21-\delta/2,

where the first equal sign comes from the reformulation trick and the first inequality is by Xk:=∑u′=1k[Vt+1in(su′+1(i))2−P⊤(⋅∣st,at)(Vt+1in)2]1[su′(i)=s,au′(i)=a]X_{k}:=\sum_{u^{\prime}=1}^{k}\left[V^{\text{in}}_{t+1}(s^{(i)}_{u^{\prime}+1})^{2}-P^{\top}(\cdot|s_{t},a_{t})(V^{\text{in}}_{t+1})^{2}\right]\mathbf{1}[s^{(i)}_{u^{\prime}}=s,a^{(i)}_{u^{\prime}}=a] is martingale. Similarly with probability 1−δ/21-\delta/2,

Note for a,b,c>0a,b,c>0, if ∣a−b∣≤c|a-b|\leq c, then ∣a2−b2∣=∣a−b∣⋅∣a+b∣≤∣a−b∣⋅(∣a∣+∣b∣)≤∣a−b∣⋅(2∣b∣+c)≤c⋅(2∣b∣+c)=2bc+c2|a^{2}-b^{2}|=|a-b|\cdot|a+b|\leq|a-b|\cdot(|a|+|b|)\leq|a-b|\cdot(2|b|+c)\leq c\cdot(2|b|+c)=2bc+c^{2}, therefore by (35) we have

where the last inequality comes from ∣P⊤(⋅∣s,a)Vt+1in∣≤∣∣P(⋅∣s,a)∣∣1∣∣Vt+1in∣∣∞≤Vmax⁡|P^{\top}(\cdot|s,a)V^{\text{in}}_{t+1}|\leq||P(\cdot|s,a)||_{1}||V^{\text{in}}_{t+1}||_{\infty}\leq V_{\max}. Combining (34), (36) and a union bound, we have with probability 1−δ1-\delta,

apply again the union bound over t,s,at,s,a gives the desired result.

Fix time t∈[H]t\in[H]. Let gtg_{t} be the estimator in (4) in Algorithm 1. Then if ∣∣Vt+1−Vt+1in∣∣∞≤2uin||V_{t+1}-V^{\text{in}}_{t+1}||_{\infty}\leq 2u^{\text{in}}, then with probability 1−δ/H1-\delta/H,

Recall gt,dtμg_{t},d^{\mu}_{t} are vectors. By definition of gt(s,a)g_{t}(s,a), use similar regrouping trick and apply Azuma Hoeffding’s inequality we obtain with probability 1−δ/H1-\delta/H

Now use assumption ∣∣Vt+1−Vt+1in∣∣∞≤2uin||V_{t+1}-V_{t+1}^{\text{in}}||_{\infty}\leq 2u^{\text{in}} and a union bound over s,as,a, we have with probability 1−δ/H1-\delta/H,

use f=4uinlog⁡(2HSA/δ)/l∑t=1Hdtμf=4u^{\text{in}}\sqrt{{\log(2HSA/\delta)}/{l\sum_{t=1}^{H}d^{\mu}_{t}}}, we obtain the stated result. ∎

Note that Lemma C.1,C.2,C.3 updates Lemma B.2,B.4,B.5 by replacing dtμd^{\mu}_{t} with ∑t=1Hdtμ\sum_{t=1}^{H}d^{\mu}_{t} and keeping the rest the same except the second order term 16Vmax⁡⋅log⁡(2HSA/δ)9m∑t=1Hdtμ⋅log⁡(HSA/δ)\sqrt{\frac{16V_{\max}\cdot\log(2HSA/\delta)}{9m\sum_{t=1}^{H}d^{\mu}_{t}}}\cdot\log(HSA/\delta) in Lemma C.1 is different from Lemma C.1. However, this is still lower order term since it is of order O~(Hm∑t=1Hdtμ)\widetilde{O}(\sqrt{\frac{H}{m\sum_{t=1}^{H}d^{\mu}_{t}}}). To avoid redundant reasoning, by following the identical logic as Section B.2 we have a similar expression of (18) as follows:

where the last term is additional. However, note when uin≤Hu^{\text{in}}\leq\sqrt{H}, then

so the last term cVmax⁡⋅log⁡(16HSA/δ)m⋅∑t=1Hdtμc\sqrt{\frac{V_{\max}\cdot\log(16HSA/\delta)}{m\cdot\sum_{t=1}^{H}d^{\mu}_{t}}} can be assimilated by previous one. If uin>Hu^{\text{in}}>\sqrt{H}, it is of even lower order. Therefore following the same reasoning we can complete the proof for Algorithm 1.

From non-implementable version to the practical version, we need to bound the event of {ns,a≤12m⋅∑t=1Hdtμ(s,a)}\{n_{s,a}\leq\frac{1}{2}m\cdot\sum_{t=1}^{H}d^{\mu}_{t}(s,a)\}, where ns,a=∑i=1m∑t=1H1[st(i)=s,at(i)=a]n_{s,a}=\sum_{i=1}^{m}\sum_{t=1}^{H}\mathbf{1}{[s^{(i)}_{t}=s,a^{(i)}_{t}=a]}. In this case, ns,an_{s,a} is no longer binomial random variable so Lemma G.2 cannot be applied. However, the trick we use for resolving this issue is the following decomposition

where ns,a=∑t=1Hnt,s,an_{s,a}=\sum_{t=1}^{H}n_{t,s,a} and nt,s,a=∑i=1m1[st(i)=s,at(i)=a]n_{t,s,a}=\sum_{i=1}^{m}\mathbf{1}{[s^{(i)}_{t}=s,a^{(i)}_{t}=a]} are binomial random variables. Lemma G.2 can then be used together with union bounds to finish the proof.

Appendix D Proofs for infinite-horizon discounted setting

First recall data D={s(i),a(i),r(i),s′(i)}i∈[n]\mathcal{D}=\{s^{(i)},a^{(i)},r^{(i)},s^{\prime(i)}\}_{i\in[n]} are i.i.d off-policy pieces with (s(i),a(i))∼dμ(s^{(i)},a^{(i)})\sim d^{\mu} and s′(i)∼P(⋅∣s(i),a(i))s^{\prime(i)}\sim P(\cdot|s^{(i)},a^{(i)}). Moreover, dμd^{\mu} is defined as:

The corresponding off-policy estimators in Algorithm 3 are defined as:

where ns,a:=∑i=1n1[s(i)=s,a(i)=a]n_{s,a}:=\sum_{i=1}^{n}\mathbf{1}[s^{(i)}=s,a^{(i)}=a] is the number of samples start at (s,a)(s,a). Similarly, P⊤(⋅∣s,a)[V−Vin]P^{\top}(\cdot|s,a)[V-V^{\text{in}}] is later updated using different ll episodes (ns,a′n^{\prime}_{s,a} is the number count from ll episodes):

where f=4uinlog⁡(2RSA/δ)/ldμf=4u^{\text{in}}\sqrt{{\log(2RSA/\delta)}/{ld^{\mu}}} and R=ln⁡(4/uin(1−γ))R=\ln(4/u^{\text{in}}(1-\gamma)).

Suppose VV and π\pi is any value and policy satisfy V≤TπVV\leq\mathcal{T}_{\pi}V. Then it holds V≤Vπ≤V⋆V\leq V^{\pi}\leq V^{\star}.

This is similar to Lemma B.1 and the key is to use Bellman equation Vπ=TπVπV^{\pi}=\mathcal{T}_{\pi}V^{\pi}. ∎

First fix s,as,a. Let Es,a:={ns,a≥12m⋅dμ(s,a)}E_{s,a}:=\{n_{s,a}\geq\frac{1}{2}m\cdot d^{\mu}(s,a)\}, then by definition,

Next we conditional on ns,an_{s,a}. Then from above expression and Bernstein inequality G.3 we have with probability at least 1−δ1-\delta

i.e. for fixed (s,a)(s,a) we have with probability at least 1−δ1-\delta,

Apply the union bound over all s,as,a, we obtain

where the inequality is element-wise and this is (41). ∎

From the definition we have for fixed (s,a)(s,a)

By using the same conditional on ns,an_{s,a} as in Lemma D.2, applying Hoeffding’s inequality and law of total expectation, we obtain with probability 1−δ/21-\delta/2,

and similarly with probability 1−δ/21-\delta/2,

Again note for a,b,c>0a,b,c>0, if ∣a−b∣≤c|a-b|\leq c, then ∣a2−b2∣=∣a−b∣⋅∣a+b∣≤∣a−b∣⋅(∣a∣+∣b∣)≤∣a−b∣⋅(2∣b∣+c)≤c⋅(2∣b∣+c)=2bc+c2|a^{2}-b^{2}|=|a-b|\cdot|a+b|\leq|a-b|\cdot(|a|+|b|)\leq|a-b|\cdot(2|b|+c)\leq c\cdot(2|b|+c)=2bc+c^{2}, therefore by (44) we have

where the last inequality comes from ∣P⊤(⋅∣s,a)Vin∣≤∣∣P(⋅∣s,a)∣∣1∣∣Vin∣∣∞≤Vmax⁡|P^{\top}(\cdot|s,a)V^{\text{in}}|\leq||P(\cdot|s,a)||_{1}||V^{\text{in}}||_{\infty}\leq V_{\max}. Combining (43), (45) and a union bound, we have with probability 1−δ1-\delta,

apply again the union bound over s,as,a gives the desired result.

Fix i∈[R]i\in[R]. Let g(i)g^{(i)} be the estimator in (40) in Algorithm 3. Then if ∣∣V(i)−Vin∣∣∞≤2uin||V^{(i)}-V^{\text{in}}||_{\infty}\leq 2u^{\text{in}}, then with probability 1−δ/R1-\delta/R,

Recall g(i),dμg^{(i)},d^{\mu} are vectors. By definition of g(i)(s,a)g^{(i)}(s,a), applying Hoeffding’s inequality we obtain with probability 1−δ/R1-\delta/R,

Now use assumption ∣∣V(i)−Vin∣∣∞≤2uin||V^{(i)}-V^{\text{in}}||_{\infty}\leq 2u^{\text{in}} and a union bound over s,as,a, we have with probability 1−δ/R1-\delta/R,

use f=4uinlog⁡(2RSA/δ)/ldμf=4u^{\text{in}}\sqrt{{\log(2RSA/\delta)}/{ld^{\mu}}}, we obtain the stated result. ∎

The goal of iterative update is to obtain the recursive relation: Q⋆−Q(i)≤γPπ⋆[Q⋆−Q(i−1)]+ξQ^{\star}-Q^{(i)}\leq\gamma\textit{{P}}^{\pi^{\star}}[Q^{\star}-Q^{(i-1)}]+{\xi}.

Let Q⋆Q^{\star} be the optimal QQ-value satisfying Q⋆=r+γPV⋆Q^{\star}=r+\gamma\textit{{P}}V^{\star} and π⋆\pi^{\star} is one optimal policy satisfying Assumption 2.1. Let π\pi and VtV_{t} be the Return of inner loop in Algorithm 3. We have with probability 1−δ1-\delta, for all i∈[R]i\in[R],

Step1: For any a,b≥0a,b\geq 0, we have the basic inequality a+b≤a+b\sqrt{a+b}\leq\sqrt{a}+\sqrt{b}, and apply to Lemma D.3 we have with probability 1−δ/41-\delta/4,

Next, similarly for any a,b≥0a,b\geq 0, we have a≤∣a−b∣+b\sqrt{a}\leq\sqrt{|a-b|}+\sqrt{b}, conditional on above then apply to Lemma D.2 (with probability 1−δ/41-\delta/4) and we obtain with probability 1−δ/21-\delta/2,

Next note σ(⋅)\sqrt{\sigma_{(\cdot)}} is a norm, so by norm triangle inequality (for the second inequality) and a≤b+∣b−a∣\sqrt{a}\leq\sqrt{b}+\sqrt{|b-a|} with (47) (for the first inequality) we have

To sum up, so far we have shown that (48), (50) hold with probability 1−δ/21-\delta/2 and we condition on that.

First of all, V(0)=VinV^{(0)}=V^{\text{in}} implies Vin≤V(0)≤V⋆V^{\text{in}}\leq V^{(0)}\leq V^{\star} and Q(0):=0≤r+γPV(0)Q^{(0)}:=\mathbf{0}\leq r+\gamma\textit{{P}}V^{(0)} so the results hold for the base case.

Now for certain ii, using induction assumption we can assume with probability at least 1−(i−1)δ/R1-(i-1)\delta/R, for all i′=0,...,i−1i^{\prime}=0,...,i-1,

In particular, since Vin≤V⋆≤Vin+uin1V^{\text{in}}\leq V^{\star}\leq V^{\text{in}}+u^{\text{in}}\mathbf{1}, so combine this and (52) for i′=i−1i^{\prime}=i-1 we get

By Lemma D.4, with probability 1−δ/R1-\delta/R,

By the right hand side of this and (48) we acquire with probability 1−iδ/R1-i\delta/R,

where the second equality already gives the proof of the first part of claim (51). Moreover, by induction assumption V(i−1)≤V⋆V^{(i-1)}\leq V^{\star} we have

which implies VQ(i−1)≤VQ⋆=V⋆V_{Q^{(i-1)}}\leq V_{Q^{\star}}=V^{\star}, therefore we have

this completes the proof of the second part of claim (51).

Step3: Next we prove V(i)≤Tπ(i)V(i)V^{(i)}\leq\mathcal{T}_{\pi^{(i)}}V^{(i)}.

where the first equal sign comes from the definition of V(i)V^{(i)} when VQ(i−1)(s)≥Vin(s)V_{Q^{(i-1)}}(s)\geq V^{\text{in}}(s) and the first inequality is from Step2.

On the other hand, if π(i)(s)=π(i−1)(s)\pi^{(i)}(s)=\pi^{(i-1)}(s), then

Step4: It remains to check Q⋆−Q(i)≤γPπ⋆[Q⋆−Q(i−1)]+ξQ^{\star}-Q^{(i)}\leq\gamma\textit{{P}}^{\pi^{\star}}[Q^{\star}-Q^{(i-1)}]+{\xi}. Indeed, using the construction of Q(i)Q^{(i)}, we have

where the second equation uses Bellman optimality equation and the third equation uses the definition of ξ=γ[P(V(i)−Vin)−g(i)+PVin−z]{\xi}=\gamma[\textit{{P}}(V^{(i)}-V^{\text{in}})-g^{(i)}+\textit{{P}}V^{\text{in}}-z]. By (50) and (53),

Lastly, note PV⋆=Pπ⋆Q⋆\textit{{P}}V^{\star}=\textit{{P}}^{\pi^{\star}}Q^{\star} and from V(i)≥VQ(i−1)V^{(i)}\geq V_{Q^{(i-1)}}, we have PV(i)≥PVQ(i−1)=PπQi−1Q(i−1)≥Pπ⋆Q(i−1)\textit{{P}}V^{(i)}\geq\textit{{P}}V_{Q^{(i-1)}}=\textit{{P}}^{\pi_{Q^{i-1}}}Q^{(i-1)}\geq\textit{{P}}^{\pi^{\star}}Q^{(i-1)}, the last inequality holds true since πQ(i−1)\pi_{Q^{(i-1)}} is the greedy policy over Q(i−1)Q^{(i-1)}. Threfore (54) becomes Q⋆−Q(i)=γPV⋆−γPV(i)+ξ≤γPπ⋆Q⋆−γPπ⋆Q(i−1)+ξQ^{\star}-Q^{(i)}=\gamma\textit{{P}}V^{\star}-\gamma\textit{{P}}V^{(i)}+{\xi}\leq\gamma\textit{{P}}^{\pi^{\star}}Q^{\star}-\gamma\textit{{P}}^{\pi^{\star}}Q^{(i-1)}+{\xi}. This completes the proof.

Suppose the input VinV^{\text{in}} of Algorithm 3 satisfies Vin≤TπinVinV^{\text{in}}\leq\mathcal{T}_{\pi^{\text{in}}}V^{\text{in}} and Vin≤V⋆≤Vin+uin1V^{\text{in}}\leq V^{\star}\leq V^{\text{in}}+u^{\text{in}}\mathbf{1}. Let VoutV^{\text{out}}, πout\pi^{\text{out}} be the return of inner loop of Algorithm 3 and choose m=l(i):=m′⋅log⁡(16RSA)/(uin)2m=l^{(i)}:=m^{\prime}\cdot\log(16RSA)/(u^{\text{in}})^{2}, where m′m^{\prime} is a parameter will be decided later. Then in addition to the results of Lemma D.5, we have with probability 1−δ1-\delta,

if uin∈[1/(1−γ),1/(1−γ)]u^{\text{in}}\in[\sqrt{1/(1-\gamma)},1/(1-\gamma)], then:

if uin≤1/(1−γ)u^{\text{in}}\leq\sqrt{1/(1-\gamma)}, then

By Lemma D.5, we have with probability 1−δ1-\delta, for all t∈[H]t\in[H],

Applying the recursion repeatedly, we obtain

Now by our choice of m=l(i):=m′⋅log⁡(16RSA/δ)/(uin)2m=l^{(i)}:=m^{\prime}\cdot\log(16RSA/\delta)/(u^{\text{in}})^{2}, then the first term of (55) is further less than

Case1. If uin≤1/(1−γ)u^{\text{in}}\leq\sqrt{1/(1-\gamma)}, then (56) is less than

Case2. If uin≥1/(1−γ)u^{\text{in}}\geq\sqrt{1/(1-\gamma)}, then (56) is less than

Next, let us first finish the proof the Algorithm 3.

Recall ϵ\epsilon is the target accuracy in the outer loop of Algorithm 3 and R=ln⁡(4/ϵ(1−γ))R=\ln(4/\epsilon(1-\gamma)). Then:

If u(0)>(1−γ)−1u^{(0)}>\sqrt{(1-\gamma)^{-1}}, then let m(j)=l(i,j)=m′log⁡(16(1−γ)−1SARK)/(u(i−1))2m^{(j)}=l^{(i,j)}=m^{\prime}\log(16(1-\gamma)^{-1}SARK)/(u^{(i-1)})^{2}, where

If u(0)≤(1−γ)−1u^{(0)}\leq\sqrt{(1-\gamma)^{-1}}, then let m(j)=l(i,j)=m′log⁡(16(1−γ)−1SARK/δ)/(u(j−1))2m^{(j)}=l^{(i,j)}=m^{\prime}\log(16(1-\gamma)^{-1}SARK/\delta)/(u^{(j-1)})^{2}, where

Algorithm 3 obeys that, with probability 1−δ1-\delta,the output π(K)\pi^{(K)} is an ϵ\epsilon-optimal policy, i.e. ∣∣V1⋆−V1π(K)∣∣∞<ϵ||V_{1}^{\star}-V_{1}^{\pi^{(K)}}||_{\infty}<\epsilon with total sample complexity:

for both cases. Moreover, m′m^{\prime} can be simplified as:

If u(0)≤(1−γ)−1u^{(0)}\leq\sqrt{(1-\gamma)^{-1}},then m′≤c(1−γ)−3/dmm^{\prime}\leq c(1-\gamma)^{-3}/d_{m};

If u(0)>(1−γ)−1u^{(0)}>\sqrt{(1-\gamma)^{-1}}, then m′≤c(1−γ)−4/dmm^{\prime}\leq c(1-\gamma)^{-4}/d_{m}.

The proof of this lemma follows the same logic as Lemma B.10. Note there is additional logarithmic factor RR since the Inner loop of Algorithm 3 has an extra For loop. Also, A2A_{2} can be bounded by O((1−γ)−3/2)O((1-\gamma)^{-3/2}) due to the following counterpart result of Lemma G.5:

which reduces the dependence from (1−γ)−3(1-\gamma)^{-3} to (1−γ)−2(1-\gamma)^{-2}. ∎

D.2 Proof of Theorem 4.3

Appendix E Proof of Theorem 4.2

We prove the offline learning lower bound (best policy identification in the offline regime) of Ω(H2/dmϵ2)\Omega(H^{2}/d_{m}\epsilon^{2}) for stationary transition case. Our proof consists of two steps: we will first show a minimax lower bound (over all MDP instances) for learning ϵ\epsilon-optimal policy is Ω(H2SA/ϵ2)\Omega(H^{2}SA/\epsilon^{2}); next we can further improve the lower bound (over problem class Mdm\mathcal{M}_{d_{m}}) for learning ϵ\epsilon-optimal policy to Ω(H2/dmϵ2)\Omega(H^{2}/d_{m}\epsilon^{2}) by a reduction of the first result.

There are numerous literature that provide information theoretical lower bounds under different setting, e.g. Dann & Brunskill (2015); Jiang et al. (2017); Krishnamurthy et al. (2016); Jin et al. (2018); Sidford et al. (2018a); Domingues et al. (2020); Yin et al. (2021); Zanette (2020); Duan & Wang (2020); Wang et al. (2020); Jin et al. (2020). However, to the best of our knowledge, Yin et al. (2021) is the only one that gives the lower bound for explicit parameter dependence in offline case. Concretely, their lower bound Ω(H3/dmϵ2)\Omega(H^{3}/d_{m}\epsilon^{2}) (for non-stationary setting) includes dmd_{m} which is an inherent measure of offline problems. In the stationary transition setting, by a modification of their construction (which again originated from Jiang et al. (2017)) we can prove the lower bound of Ω(H2/dmϵ2)\Omega(H^{2}/d_{m}\epsilon^{2}).

Given H≥2H\geq 2, A≥2A\geq 2, 0<ϵ<14880<\epsilon<\frac{1}{48\sqrt{8}} and S≥c1S\geq c_{1} where c1c_{1} is a universal constant. Then for any algorithm and any n≤cH2SA/ϵ2n\leq cH^{2}SA/\epsilon^{2}, there exists a non-stationary HH horizon MDP with probability at least pp, the algorithm outputs a policy π^\widehat{\pi} with v⋆−vπ^≥ϵv^{\star}-v^{\widehat{\pi}}\geq\epsilon.

The proof relies on embedding Θ(S)\Theta(S) independent multi-arm bandit problems into a family of hard-to-learn MDP instances so that any algorithm that wants to output a near-optimal policy needs to identify the best action in Ω(S)\Omega(S) problems. By standard multi-arm bandit identification result Lemma G.1 we need O(SA)O(SA) episodes. To recover the H2H^{2} factor, we only assign reward 11 to “good” states in the latter half of the MDP and all other states have reward .

We construct a non-stationary MDP with SS states per level, AA actions per state and has horizon 2H2H. States are categorized into three types with two special states gg, bb and the remaining S−2S-2 “bandit” states denoted by sis_{i}, i∈[S−2]i\in[S-2]. Each bandit state has an unknown best action ai⋆a^{\star}_{i} that provides the highest expected reward comparing to other actions.

The transition dynamics are defined as follows:

For bandit states bib_{i}, there is probability 1−1H1-\frac{1}{H} to transition back to itself (bib_{i}) regardless of the action chosen. For the rest of 1H\frac{1}{H} probability, optimal action ai⋆a^{\star}_{i} have probability 12+τ\frac{1}{2}+\tau or 12−τ\frac{1}{2}-\tau transition to gg or bb respectively and all other actions aa will have equal probability 12\frac{1}{2} for either gg or bb, where τ\tau is a parameter will be decided later. Or equivalently,

gg always transitions to gg and bb always transitions to bb, i.e. for all a∈Aa\in\mathcal{A},

We will determine parameter τ\tau at the end of the proof.

Reward assignment: the instantaneous reward is 11 if and only if state s=gs=g and the current time t∈{H,…,2H−1}t\in\{H,\ldots,2H-1\}. In all other cases, the reward is . i.e.,

By this construction the optimal policy must take ai⋆a^{\star}_{i} for each bandit state sis_{i} for at least the first half of the MDP (when t≤Ht\leq H). In other words, this construction embeds (S−2)(S-2) independent best arm identification problems that are identical to the stochastic multi-arm bandit problem in Lemma G.1 into the MDP for the following two reasons: 1. the transition is stationary (the optimal arm ai⋆a_{i}^{\star} for state sis_{i} is identical across all time tt) so instead of H(S−2)H(S-2) (for non-stationary case) MAB problems we only have S−2S-2 of them; 2. all S−2S-2 problems are independent since each state sis_{i} can only transition to themselves or gg, bb.

Notice for any time hh with h≤Hh\leq H, any bandit state sis_{i}, the difference of the expected reward between optimal action ai⋆a_{i}^{\star} and other actions is:

so it seems by Lemma G.1 one suffices to use the least possible A72(τ)2\frac{A}{72(\tau)^{2}} samples to identify the best action ai⋆a_{i}^{\star}. However, note observing ∑t=12Hrt=H\sum_{t=1}^{2H}r_{t}=H is equivalent as observing ∑t=1Hrt=1\sum_{t=1}^{H}r_{t}=1 (since ∑t=1Hrt=1\sum_{t=1}^{H}r_{t}=1 is equivalent to sH=gs_{H}=g and is equivalent to ∑t=1Hrt=1\sum_{t=1}^{H}r_{t}=1). Therefore, for the bandit states in the first half the samples that provide information for identifying the best arm is up to time HH. Or in other words, identify best arm in stationary transition setting can be decided in each single stage after t≥Ht\geq H. As a result, the difference of the expected reward between optimal action ah,i⋆a_{h,i}^{\star} and other action for identifying the best arm should be corrected as:

or one can compute any bandit state in latter half (h≥Hh\geq H):

which yields the same result. Now by Lemma G.1, unless A72(τ/H)2\frac{A}{72(\tau/H)^{2}} samples are collected from that bandit state, the learning algorithm fails to identify the optimal action ai⋆a^{\star}_{i} with probability at least 1/31/3.

After running any algorithm, let CC be the set of bandit states for which the algorithm identifies the correct action. Let DD be the set of bandit states for which the algorithm collects fewer than A72(τ/H)2\frac{A}{72(\tau/H)^{2}} samples. Then by Lemma G.1 we have

If we have n≤(S−2)2×A72(τ/H)2n\leq\frac{(S-2)}{2}\times\frac{A}{72(\tau/H)^{2}}, by pigeonhole principle the algorithm can collect A72(τ/H)2\frac{A}{72(\tau/H)^{2}} samples for at most half of the bandit problems, i.e. ∣D∣≥(S−2)/2|D|\geq(S-2)/2. Therefore we have

so the algorithm failed to identify the optimal action on 1/12 fraction of the bandit problems with probability at least 1/111/11. Note for each failure in identification, the reward is differ by at least τ\tau in terms of the value for v^π\hat{v}^{\pi} (see (60)), therefore under the event {∣C′∣≥112(S−2)}\{|C^{\prime}|\geq\frac{1}{12}(S-2)\}, the suboptimality of the policy produced by the algorithm is

where the third equal sign uses all best arm identification problems are independent. Now we set τ=min⁡(1/8,ϵ/c1)\tau=\min(\sqrt{1/8},\epsilon/c_{1}) and under n≤cH2SA/ϵ2n\leq cH^{2}SA/\epsilon^{2}, we have

the last inequality holds as long as S≥2/(1−2c′′)S\geq 2/(1-2c^{\prime\prime}). Therefore in this situation, with probability at least 1/111/11, v⋆−vπ^≥ϵv^{\star}-v^{\widehat{\pi}}\geq\epsilon. Finally, we can use scaling to reduce the horizon from 2H2H to HH.

The suboptimality gap calculation (61) does not use the construction that each sis_{i} has 1−1H1-\frac{1}{H} probability going back to itself so if we only need Theorem E.1 then one can assign all the probability to just gg or bb, which reduces to the construction of Theorem 2 in Dann & Brunskill (2015). However, our construction is essential for proving the following offline lower bound.

For all 0<dm≤1SA0<d_{m}\leq\frac{1}{SA}, let the class of problems be

Under the condition of Theorem E.1. In addition assume 0<dm≤1SA0<d_{m}\leq\frac{1}{SA}. There exists another universal constant cc such that when n≤cH2/dmϵ2n\leq cH^{2}/d_{m}\epsilon^{2}, we always have

The proof is mostly identical to Yin et al. (2021) except we concatenate all state together to ensure transition is stationary. The hard instances (μ,M)(\mu,M) we used rely on Theorem E.1 as follow:

for the MDP M=(S+3,A,r,P,d1,2H)M=(\mathcal{S}+3,\mathcal{A},r,P,d_{1},2H),

There are three extra states s0,syes,snos_{0},s_{\text{yes}},s_{\text{no}} in addition to Theorem E.1. Initial distribution d1d_{1} will always enter state s0s_{0}, and there are two actions with action a1a_{1} always transitions to syess_{\text{yes}} and action a2a_{2} always transitions to snos_{\text{no}}. The reward at the first time r1(s,a)=0r_{1}(s,a)=0 for any s,as,a.

For state snos_{\text{no}}, it will always transition back to itself regardless of the action and receive reward , i.e.

For state syess_{\text{yes}}, it will transition to the MDP construction in Theorem E.1 with horizon 2H2H and syess_{\text{yes}} always receives reward zero (see Figure 2).

For t=1t=1, choose μ(a1∣s0)=12dmSA\mu(a_{1}|s_{0})=\frac{1}{2}d_{m}SA and μ(a2∣s0)=1−12dmSA\mu(a_{2}|s_{0})=1-\frac{1}{2}d_{m}SA. For all other states, choose μ\mu to be uniform policy, i.e. μ(at∣st)=1/A\mu(a_{t}|s_{t})=1/A.

Based on this construction, the optimal policy has the form π⋆=(a1,…)\pi^{\star}=(a_{1},\ldots) and therefore the MDP branch that enters snos_{\text{no}} is uninformative. Hence, data collected by that part is uninformed about the optimal policy and there is only 12dmSA\frac{1}{2}d_{m}SA proportion of data from syess_{\text{yes}} are useful. Moreover, by Theorem E.1 the rest of Markov chain succeeded from syess_{\text{yes}} requires Ω(H2SA/ϵ2)\Omega(H^{2}SA/\epsilon^{2}) episodes (regardless of the exploration strategy/logging policy), so the actual data complexity needed for the whole construction (μ,M)(\mu,M) is Ω(H2SA/ϵ2)dmSA=Ω(H2/dmϵ2)\frac{\Omega(H^{2}SA/\epsilon^{2})}{d_{m}SA}=\Omega(H^{2}/d_{m}\epsilon^{2}).

It remains to check this construction μ,M\mu,M stays within Mdm\mathcal{M}_{d_{m}}. The checking is mostly the same as Theorem G.2. in Yin et al. (2021) so we don’t state here. We only highlight the checking for bandit state at different time steps. Indeed, for all i∈[S−2]i\in[S-2],

now by μ\mu is uniform we have dt+1μ(st+1,i,a)≥Ω(dmA)⋅1A=Ω(dm)d^{\mu}_{t+1}(s_{t+1,i},a)\geq\Omega(d_{m}A)\cdot\frac{1}{A}=\Omega(d_{m}) for all aa. So the condition is satisfied in the stationary transition case. This concludes the proof.

Appendix F More details for Discussion Section 5

Note data D\mathcal{D} comes from the logging policy μ\mu, therefore we can use extra n(≥1/dm⋅log⁡(HSA/δ))n(\geq 1/d_{m}\cdot\log(HSA/\delta)) episodes to construct direct on-policy estimator as:

Since nst,atn_{s_{t},a_{t}} is binomial, by the multiplicative Chernoff bound (Lemma G.2), we have

this implies that for any (st,at)(s_{t},a_{t}) such that dtμ(st,at)>0d^{\mu}_{t}(s_{t},a_{t})>0, when n≥1/dm⋅log⁡(1/δ)≥1/dtμ(st,at)⋅log⁡(1/δ)n\geq 1/d_{m}\cdot\log(1/\delta)\geq 1/d^{\mu}_{t}(s_{t},a_{t})\cdot\log(1/\delta), we have with probability 1−δ1-\delta that

Applying a union bound, we have the above is true for all (t,st,at)(t,s_{t},a_{t}) when n≥1/dm⋅log⁡(HSA/δ)n\geq 1/d_{m}\cdot\log(HSA/\delta). Finally, take d^m:=min⁡(t,st,at):d^tμ(st,at)>0d^tμ(st,at)\widehat{d}_{m}\mathrel{\mathop{:}}=\min_{(t,s_{t},a_{t}):\widehat{d}^{\mu}_{t}(s_{t},a_{t})>0}\widehat{d}^{\mu}_{t}(s_{t},a_{t}). On the above concentration event, we get

In the function approximation regime, roughly speaking, the concentration coefficient assumption requires Munos (2003); Le et al. (2019); Chen & Jiang (2019); Xie & Jiang (2020b)

where F\mathcal{F} is the policy class induced by approximation functions. In the tabular case, since we want to maximize over all policies, F={all    policies}\mathcal{F}=\{all\;\;policies\}, therefore above should be interpreted as:

since F\mathcal{F} is the largest possible class, if the transition kernel P(s′∣s,a)P(s^{\prime}|s,a) is able to reach some s′∈Ss^{\prime}\in\mathcal{S} given s,as,a, then that implies dtπ(s′)>0d^{\pi}_{t}(s^{\prime})>0. Next one can always pick πt+1(s′)=a′\pi_{t+1}(s^{\prime})=a^{\prime} such that dt+1π(s′,a′)=dtπ(s′)>0d^{\pi}_{t+1}(s^{\prime},a^{\prime})=d^{\pi}_{t}(s^{\prime})>0, for all a′∈Aa^{\prime}\in\mathcal{A}. This means μ\mu has the chance to explore all states and actions whenever the transition PP can transition to all states (from some previous s,as,a).

On the other hand, our Assumption 2.1 only require μ\mu to trace at least one optimal policy π⋆\pi^{\star} and it is fine for μ\mu to never visit certain state-action s,as,a that is not related to μ\mu.

As a result, since βμ\beta_{\mu} or CC are explicitly incorporated, the upper bounds in Le et al. (2019); Chen & Jiang (2019); Xie & Jiang (2020b) may degenerate to +∞+\infty under our setting (Assumption 2.1), regardless of the dependence on horizon.

Nevertheless, we point out that function approximation++concentrability assumption is a powerful framework for handling realizability/agnostic case and related concepts (e.g. inherent Bellman error) and easier to scale the setting to general continuous case.

F.4 The doubling procedure overcomes the proofing defect in Sidford et al. (2018a)

Sidford et al. (2018a) first uses variance reduction technique to provides provable guarantee for the ϵ\epsilon-optimal policy. However, their complexity may actually become suboptimal under their initialization. In fact, in their Proof of Proposition 5.4.1. (page 2323 of https://arxiv.org/pdf/1806.01492.pdf), they claim the inequality

which is equivalent to u≤O(1/(1−γ))u\leq O(\sqrt{1/(1-\gamma)}) (or u≤Hu\leq\sqrt{H}) and based on their initialization v(0)=0\bm{v}^{(0)}=\mathbf{0} they cannot guarantee ∥v⋆∥=∥v(0)−v⋆∥∞:=u≤(1−γ)−1/2\left\lVert\bm{v}^{\star}\right\rVert=\left\lVert\bm{v}^{(0)}-\bm{v}^{\star}\right\rVert_{\infty}:=u\leq(1-\gamma)^{-1/2}. We fix this issue using the doubled Variance Reduction so that minimaxity is preserved for the offline learning with arbitrary initialization.

Appendix G Technical lemmas

Let XX follows Binomial distribution, i.e. X∼Binom(n,p)X\sim Binom(n,p). For any 1≥δ>01\geq\delta>0, we have that

Or equivalently, with probability 1−δ1-\delta,

Let rt(1),st(1),at(1)r^{(1)}_{t},s^{(1)}_{t},a^{(1)}_{t} denotes random variables. Then the following decomposition holds:

This is a conditional version of Lemma 3.4 in Yin & Wang (2020). It can be proved using the identical trick as Lemma 3.4 in Yin & Wang (2020) except the law of total variance is replaced by the law of total conditional variance.