AlgaeDICE: Policy Gradient from Arbitrary Experience

Ofir Nachum, Bo Dai, Ilya Kostrikov, Yinlam Chow, Lihong Li, Dale Schuurmans

Introduction

The use of model-free reinforcement learning (RL) in conjunction with function approximation has proliferated in recent years, demonstrating successful applications in fields such as robotics (Andrychowicz et al., 2018; Nachum et al., 2019a), game playing (Mnih et al., 2013), and conversational systems (Gao et al., 2019). These successes often rely on on-policy access to the environment; i.e., during the learning process agents may collect new experience from the environment using policies they choose, and these interactions are effectively unlimited. By contrast, in many real-world applications of RL, interaction with the environment is costly, if not impossible, hence experience collection during learning is limited, necessitating the use of off-policy RL methods, i.e., algorithms which are able to learn from logged experience collected by potentially multiple and possibly unknown behavior policies.

The off-policy nature of many practical applications presents a significant challenge for RL algorithms. The traditional max-return objective is in the form of an on-policy expectation, and thus, policy gradient methods (Sutton et al., 2000; Konda and Tsitsiklis, 2000) require samples from the on-policy distribution to estimate the gradient of this objective. The most straightforward way to reconcile policy gradient with off-policy settings is via importance weighting (Precup et al., 2000). However, this approach is prone to high variance and instability without appropriate damping (Munos et al., 2016; Wang et al., 2016; Gruslys et al., 2017; Schulman et al., 2017). The more common approach to the off-policy problem is to simply ignore it, which is exactly what has been proposed by many existing off-policy policy gradient methods (Degris et al., 2012; Silver et al., 2014). These algorithms simply compute the gradients of the max-return objective with respect to samples from the off-policy data, ignoring distribution shift in the samples. The justification for this approach is that the maximum return policy will be optimal regardless of the sampling distribution of states. However, such a justification is unsound in function approximation settings, where models have limited expressiveness, with potentially disastrous consequences on optimization and convergence (e.g., Lu et al., 2018).

Value-based methods provide an alternative that may be more promising for the off-policy setting. In these methods, a value function is learned either as a critic to a learned policy (as in actor-critic) or as the maximum return value function itself (as in QQ-learning). This approach is based on dynamic programming in tabular settings, which is inherently off-policy and independent of any underlying data distribution. Nevertheless, when using function approximation, the objective is traditionally expressed as an expectation over single-step Bellman errors, which re-raises the question, “What should the expectation be?” Some theoretical work suggests that the ideal expectation is in fact the on-policy expectation (Sutton et al., 2000; Silver et al., 2014; Nachum et al., 2018). In practice, this problem is usually ignored, with the same justification as that made for off-policy policy gradient methods. It is telling that actor-critic or QQ-learning algorithms advertised as off-policy still require large amounts of online interaction with the environment (Haarnoja et al., 2018; Hessel et al., 2018).

In this work, we present an ALgorithm for policy Gradient from Arbitrary Experience via DICE (AlgaeDICE)DICE is an abbreviation for distribution correction estimation and is taken from the DualDICE work (Nachum et al., 2019b) on off-policy policy evaluation. Although our current work notably focuses on policy optimization as opposed to evaluation and only implicitly estimates the distribution corrections, our derivations are nevertheless partly inspired by this previous work. as an alternative to policy gradient and value-based methods. We start with the dual formulation of the max-return objective, which is expressed in terms of normalized state-action occupancies rather than a policy or value function. Traditionally, this objective is considered unattractive, since access to the occupancies either requires an on-policy expectation (similar to policy gradient methods) or learning a function approximator to satisfy single-step constraints (similar to value-based methods). We demonstrate how these problems can be remedied by adding a controllable regularizer and applying a carefully chosen change of variables, obtaining a joint objective over a policy and an auxiliary dual function (that can be interpreted as a critic). Crucially, this objective relies only on access to samples from an arbitrary off-policy data distribution, collected by potentially multiple and possibly unknown behavior policies (under some mild conditions). Unlike traditional actor-critic methods, which use a separate objective for actor and critic, this formulation trains the policy (actor) and dual function (critic) to optimize the same objective. Further illuminating the connection to policy gradient methods, we show that if the dual function is optimized, the gradient of the proposed objective with respect to the policy parameters is exactly the on-policy policy gradient. This way, our approach naturally avoids issues of distribution mismatch without any explicit use of importance weights. We continue to provide an alternative derivation of the same results, based on a primal-dual form of the return-maximizing RL problem, and notably this perspective extends the previous results to both undiscounted γ=1\gamma=1 settings and unregularized max-return objectives. Finally, we provide empirical evidence that AlgaeDICE can perform well on benchmark RL tasks.

Background

We consider the RL problem presented as a Markov Decision Process (MDP) Puterman (1994), which is specified by a tuple M=⟨S,A,r,T,μ0⟩\mathcal{M}=\langle S,A,r,T,\mu_{0}\rangle consisting of a state space, an action space, a reward function, a transition probability function, and an initial state distribution. A policy π\pi interacts with the environment by starting at an initial state s0∼μ0s_{0}\sim\mu_{0}, and iteratively producing a sequence of distributions π(⋅∣st)\pi(\cdot|s_{t}) over AA, at steps t=0,1,...t=0,1,..., from which actions ata_{t} are sampled and successively applied to the environment. At each step, the environment produces a scalar reward rt=r(st,at)r_{t}=r(s_{t},a_{t}) and a next state st+1∼T(st,at)s_{t+1}\sim T(s_{t},a_{t}). In RL, one wishes to learn a return-maximizing policy:

where QπQ_{\pi} describes the future rewards accumulated by π\pi from any state-action pair (s,a)(s,a),

and 0≤γ<10\leq\gamma<1 is a discount factor. This objective may be equivalently written in its dual form (Puterman, 1994; Wang et al., 2008) in terms of the policy’s normalized state visitation distribution as

As we will discuss in Section 4 and Appendix A, these objectives are the primal and dual of the same linear programming (LP) problem.

where Bπ\mathcal{B}_{\pi} is the expected Bellman operator with respect to π\pi. Thus, the critic is learned according to some variation on

for some distribution β\beta. Although the use of an arbitrary β\beta suggests the critic may be learned off-policy, to achieve satisfactory performance, actor-critic algorithms generally rely on augmenting a replay buffer with new on-policy experience. Theoretical work has suggested that if one desires compatible function approximation, then an appropriate β\beta is, in fact, the on-policy distribution dπd^{\pi} (Sutton et al., 2000; Silver et al., 2014; Nachum et al., 2018).

In this work, we focus on the off-policy setting directly. Specifically, we are given a dataset D={(sk,ak,rk,sk′)}k=1N\mathcal{D}=\{(s_{k},a_{k},r_{k},s_{k}^{\prime})\}_{k=1}^{N}, where rk=r(sk,ak)r_{k}=r(s_{k},a_{k}); sk′∼T(sk,ak)s_{k}^{\prime}\sim T(s_{k},a_{k}); and aka_{k} has been sampled according to an unknown process. We let dDd^{\mathcal{D}} denote the unknown state-action distribution, and additionally assume access to a sample of initial states, U={s0,k}k=1N\mathcal{U}=\{s_{0,k}\}_{k=1}^{N}, such that s0,k∼μ0s_{0,k}\sim\mu_{0}.

AlgaeDICE via Density Regularization

We begin by presenting an informal derivation of our method, motivated as a regularization of the dual max-return objective in (3). In Section 4 we will present our results more formally as a consequence of the Lagrangian of a linear programming formulation of the max-return objective.

The max-return objective (3) is written exclusively in terms of the on-policy distribution dπd^{\pi}. To introduce an off-policy distribution dDd^{\mathcal{D}} into the objective, we incorporate a regularizer:

with α>0\alpha>0 and DfD_{f} denoting the ff-divergence induced by a convex function ff:

where we have used the shorthand wπ/D(s,a):=dπ(s,a)dD(s,a)w_{\pi/\mathcal{D}}(s,a):=\frac{d^{\pi}(s,a)}{d^{\mathcal{D}}(s,a)}. This form of regularization encourages conservative behavior, compelling the state-action occupancies of π\pi to remain close to the off-policy distribution, which can improve generalization. We emphasize that the introduction of this regularizer is to enable the subsequent derivations and not to impose a strong constraint on the optimal policy. Indeed, by appropriately choosing α\alpha and ff, the strength of the regularization can be controlled. Later, we will show that many of our results also hold for exploratory regularization (α<0\alpha<0) and even for no regularization at all (α=0\alpha=0).

Equivalently, x(s,a)=1α(Bπν−ν)(s,a)x(s,a)=\frac{1}{\alpha}(\mathcal{B}_{\pi}\nu-\nu)(s,a). Note that ν\nu always exists and is bounded when xx and rr are bounded (Puterman, 1994). Applying this change of variables to (10) (after some telescoping, see Nachum et al. (2019b)) yields

The resulting objective is now completely off-policy, relying only on access to samples from the initial state distribution μ0\mu_{0} and the off-policy dataset dDd^{\mathcal{D}}. Thus, we have our first theorem, providing an off-policy formulation of the max-return objective:

Under mild conditions on dD,α,fd^{\mathcal{D}},\alpha,f, the regularized max-return objective may be expressed as a max-min optimization:

It is clear that the same derivations above may apply to an exploratory regularizer of the same form with α<0\alpha<0, which leads to the following optimization problem:

The appearance of Bπ\mathcal{B}_{\pi} inside f∗f_{*} in the second term of (12) presents a challenge in practice, since Bπ\mathcal{B}_{\pi} involves an expectation over the transition function TT, whereas one typically only has access to a single empirical sample from TT for a given state-action pair. This challenge, known as double sampling in the RL literature (Baird, 1995), can prevent the algorithm from finding the desired value function, even with infinite data. There are several alternatives to handle this issue (e.g., Antos et al., 2008; Farahmand et al., 2016; Feng et al., 2019). Here, we apply the dual embedding technique (Dai et al., 2016, 2018b). Specifically, the dual representation of f∗f_{*},

can be substituted into (12), to result in a max⁡\max-min⁡\min-max⁡\max problem:

As we will see in Section 4, under mild conditions, strong duality holds in the inner min⁡\min-max⁡\max of (15), hence one can switch the min⁡ν\min_{\nu} and max⁡ζ\max_{\zeta} to reduce to a more convenient max⁡\max-max⁡\max-min⁡\min form.

2 Consistent Policy Gradient using Off-Policy Data

We note that Theorem 2 also holds when using the more sophisticated objective in (15), since the optimal ζπ∗\zeta^{*}_{\pi} is equal to wπ/Dw_{\pi/\mathcal{D}}, regardless of π\pi.

3 Connection to Actor-Critic

The relationship between the proposed off-policy objective and the classic policy gradient becomes more profound when we consider the form of the objective under specific choices of convex function ff. If we take f(x)=12x2f(x)=\frac{1}{2}x^{2}, then f∗(x)=12x2f_{*}(x)=\frac{1}{2}x^{2} and the proposed objective is reminiscent of actor-critic:

The second term alone is an instantiation of the off-policy critic objective in actor-critic. However, in actor-critic, the use of an off-policy objective for the critic is difficult to theoretically motivate. Moreover, in practice, critic and actor learning can both suffer from the mismatch between the off-policy distribution dDd^{\mathcal{D}} and the on-policy dπd^{\pi}. By contrast, our derivations show that the introduction of the first term to the objective transforms the off-policy actor-critic algorithm to an on-policy actor-critic, without any explicit use of importance weights. Moreover, while standard actor-critic has two separate objectives for value and policy, our proposed objective is a single, unified objective. Both the policy and value functions are trained with respect to the same off-policy objective.

A Lagrangian View of AlgaeDICE

We now show how AlgaeDICE can be alternatively derived from the Lagrangian of a linear programming (LP) formulation of the QπQ_{\pi}-function. Please refer to Appendix A for details. We begin by introducing some notations and assumptions, which have appeared in the literature (e.g., Puterman, 1994; Nachum et al., 2019b; Zhang et al., 2020).

For the next assumption, we introduce the transpose Bellman operator:

The transposed Bellman operator Bπ⊤\mathcal{B}_{\pi}^{\top} has a unique fixed point solution. When γ∈[0,1)\gamma\in[0,1), Bπ⊤\mathcal{B}_{\pi}^{\top} has a unique fixed point regardless of the underlying MDP. For γ=1\gamma=1, in the discrete case, the assumption reduces to requiring that Bπ⊤\mathcal{B}_{\pi}^{\top} be ergodic. The continuous case for γ=1\gamma=1 is more involved; see Meyn and Tweedie (2012); Levin and Peres (2017) for a detailed discussion.

Our derivation begins with a formalization of the LP characterization of the QπQ_{\pi}-function and its dual form:

We characterize the optimizers νπ∗\nu^{*}_{\pi} and ζπ∗\zeta^{*}_{\pi} and the optimum value L(νπ∗,ζπ∗;π)L(\nu^{*}_{\pi},\zeta^{*}_{\pi};\pi) of this objective in the following theorem. Interestingly, although the regularization can affect the optimal primal solution νπ∗\nu^{*}_{\pi}, the optimal dual solution ζπ∗\zeta^{*}_{\pi} is unchanged.

Under Assumptions 1–4, the solution to (23) is given by,

Thus, we have recovered the Fenchel AlgaeDICE objective for π\pi, given in Equation 15. Furthermore, one may reverse the Legendre transform, f∗((Bπν−ν)(s,a)/α)=max⁡ζ 1α(Bπν−ν)(s,a)⋅ζ−f(ζ)f_{*}((\mathcal{B}_{\pi}\nu-\nu)(s,a)/\alpha)=\max_{\zeta}~{}\frac{1}{\alpha}(\mathcal{B}_{\pi}\nu-\nu)(s,a)\cdot\zeta-f(\zeta), to recover the Primal AlgaeDICE objective in Equation (13).

The derivation of this same result from the LP perspective allows us to exploit strong duality. Specifically, under the assumption that wπ/Dw_{\pi/\mathcal{D}} and rr are bounded, (νπ∗,ζπ∗)\left(\nu^{*}_{\pi},\zeta^{*}_{\pi}\right) does not change if we optimize L(ν,ζ;π)L\left(\nu,\zeta;\pi\right) over a bounded space H×F\mathcal{H}\times\mathcal{F}, as long as (νπ∗,ζπ∗)∈H×F\left(\nu^{*}_{\pi},\zeta^{*}_{\pi}\right)\in\mathcal{H}\times\mathcal{F}. In this case, strong duality holds (Ekeland and Temam, 1999, Proposition 2.1), and we obtain

This implies that, for computational efficiency, we can optimize the policy via

Although AlgaeDICE is originally derived for γ∈[0,1)\gamma\in[0,1) and α>0\alpha>0 in Section 3, the Lagrangian view of the LP formulation of QπQ_{\pi} can be used to generalize the algorithm to γ=1\gamma=1 and α=0\alpha=0. In particular, for α=0\alpha=0, one can directly use the original Lagrangian for the LP. For the case γ=1\gamma=1, the problem reduces to the Lagrangian of the LP for an undiscounted QπQ_{\pi}-function; details are delegated to Appendix A.

The LP form of the QQ-values leading to the Lagrangian (22) can be directly used for behavior-agnostic off-policy evaluation (OPE). In fact, existing estimators for OPE in the behavior-agnostic setting which typically reduce the OPE problem to estimation of quantities wπ/Dw_{\pi/\mathcal{D}} (e.g., DualDICE (Nachum et al., 2019b) and GenDICE (Zhang et al., 2020)) can be recast as special cases by introducing different regularizations to the Lagrangian. As we have shown, the solution to the Lagrangian provides both (regularized) QQ-values and the desired state-action corrections wπ/Dw_{\pi/\mathcal{D}} as primal and dual variables simultaneously.

Related Work

Algorithmically, our proposed method follows a Lagrangian primal-dual view of the LP characterization of the QQ-function, which leads to a saddle-point problem. Several recent works (e.g., Chen and Wang, 2016; Wang, 2017; Dai et al., 2018a, b; Chen et al., 2018; Lee and He, 2018) also considered saddle-point formulations for policy improvement, derived from fundamentally different perspectives. In particular, Dai et al. (2018a) exploit a saddle-point formulation for the multi-step (path) conditions on the consistency between optimal value function and policy. Other works (Chen and Wang, 2016; Wang, 2017; Dai et al., 2018b; Chen et al., 2018) consider the (augmented) Lagrangian of the LP characterization of Bellman optimality for the optimal VV-function, which is slightly different from the LP characterization with respect to the optimal QQ-function we consider. Although slight, the difference between the VV- and QQ-LPs is crucial to enable behavior-agnostic policy optimization in AlgaeDICE. If one were to follow derivations similar to AlgaeDICE but for the VV-function LP, some form of explicit importance weighting (and thus knowledge of the behavior policy) would be required, as in recent work on off-policy estimation (Tang et al., 2019; Uehara and Jiang, 2019). We further note that the application of a regularizer on the dual variable to yield Primal AlgaeDICE is key to transforming the Lagrangian optimization over values and state-action occupancies — typical in these previous works — to an optimization over values and policies, which is more common in practice and can help generalization (e.g., Swaminathan and Joachims, 2015).

The regularization we employ is inspired by previous uses of regularization in RL. Adding regularization to MDPs (Neu et al., 2017; Geist et al., 2019) has been investigated for many different purposes in the literature, including exploration (de Farias and Van Roy, 2000; Haarnoja et al., 2017, 2018), smoothing (Dai et al., 2018b), avoiding premature convergence (Nachum et al., 2017a), ensuring tractability (Todorov, 2006), and mitigating observation noise (Rubin et al., 2012; Fox et al., 2016). We note that the regularization employed by AlgaeDICE as a divergence over state-action densities is markedly different from these previous works, which mostly regularize only the action distributions of a policy conditioned on state. An approach more similar to ours is given by Belousov and Peters (2017), which regularizes the max-return objective using an ff-divergence over state-action densities. Their derivations are similar in spirit to ours, using the method of Lagrange multipliers, but their result is distinct in a number of key characteristics. First, their objective (analogous to ours in (12)) includes not only policy and values but also a number of additional functions, complicating any practical implementation. Second, their results are restricted to conservative regularization (α>0\alpha>0), whereas our findings extend to both exploratory regularization and unregularized objectives (α≤0\alpha\leq 0). Third, the algorithm proposed by Belousov and Peters (2017) follows a bi-level optimization, in which the policy is learned using a separate and distinct objective. In contrast, our proposed AlgaeDICE uses a single, unified objective for both policy and value learning.

Lastly, there are a number of works which (like ours) perform policy gradient on off-policy data via distribution correction. The key differentiator is in how the distribution corrections are computed. One common method is to re-weight off-policy samples by considering eligibility traces (Precup et al., 2000; Geist and Scherrer, 2014), i.e., compute weights by taking the product of per-action importance weights over a trajectory. Thus, these methods can suffer from high variance as the length of trajectory increases, known as the “curse of horizon” (Liu et al., 2018). A more recent work (Liu et al., 2019) attempts to weight updates by estimated state-action distribution corrections. This is more in line with our proposed AlgaeDICE, which implicitly estimates these quantities. One key difference is that this previous work explicitly estimates these corrections, which results in a bi-level optimization, as opposed to our more appealing unified objective. It is also important to note that both eligibility trace methods and the technique outlined in Liu et al. (2019) require knowledge of the behavior policy. In contrast, AlgaeDICE is a behavior-agnostic off-policy policy gradient method, which may be more relevant in practice. Compared to existing behavior-agnostic off-policy estimators (Nachum et al., 2019b; Zhang et al., 2020), this work considers the substantially more challenging problem of policy optimization.

Experiments

We present empirical evaluations of AlgaeDICE, first in a tabular setting using the Four Rooms domain (Sutton et al., 1999) and then on a suite of continuous control benchmarks using MuJoCo (Todorov et al., 2012) and OpenAI Gym (Brockman et al., 2016).

We begin by considering the tabular setting given by the Four Rooms environment (Sutton et al., 1999), in which an agent must navigate to a target location within a gridworld. In this tabular setting, we evaluate Primal AlgaeDICE (Equations 12 and 13) with f(x)=12x2f(x)=\frac{1}{2}x^{2}. This way, for any π\pi, the dual value function ν\nu may be solved exactly using standard matrix operations. Thus, we train π\pi by iteratively solving for ν\nu via matrix operations and then taking a gradient step for π\pi. We collect an off-policy dataset by running a uniformly random policy for 500 trajectories, where each trajectory is initalized at a random state and is of length 10. This dataset is kept fixed, placing us in the completely offline regime. We use α=0.01\alpha=0.01 and γ=0.97\gamma=0.97.

Graphical depictions of learned policies π\pi and dual value functions ν\nu are presented in Figure 1, where each plot shows π\pi and ν\nu during the first, fourth, seventh, and tenth iterations of training. The opacity of each square is determined by the Bellman residuals of ν\nu at that state. Recall that the Bellman residuals of the optimal νπ∗\nu^{*}_{\pi} are the density ratios wπ/Dw_{\pi/\mathcal{D}}. We see that this is reflected in the learned ν\nu. At the beginning of training, the residuals are high around the initial state. As training progresses, there is a clear path (or paths) of high-residual states going from initial to target state. Thus we see that ν\nu learns to properly correct for distribution shifts in the off-policy experience distributions. The algorithm successfully learns to optimize a policy using these corrected gradients, as shown by the arrows denoting preferred actions of the learned policy.

We further provide quantitative results in Figure 2. We plot the average per-step reward of AlgaeDICE compared to actor-critic in both online and offline settings. As a point of comparison, the behavior policy used to collect data for the offline setting achieves average reward of 0.030.03. Although all the variants are able to significantly improve upon this baseline, we see that AlgaeDICE performance is only negligibly affected by the type of dataset, while performance of actor-critic degrades in the offline regime. See Appendix B for experimental details.

2 Continuous Control

We now present results of AlgaeDICE on a set of continuous control benchmarks using MuJoCo (Todorov et al., 2012) and OpenAI Gym (Brockman et al., 2016). We evaluate the performance of Primal AlgaeDICE with f(x)=12x2f(x)=\frac{1}{2}x^{2}. Our empirical objective is thus given by

where δν,π\delta_{\nu,\pi} is a single-sample estimate of the Bellman residual:

We note that using a single-sample estimate for the Bellman residual in general leads to biased gradients, although previous works have found this to not have a significant practical effect in these domains (Kostrikov et al., 2019). We make the following additional practical modifications:

As entropy regularization has been shown to be important on these tasks (Nachum et al., 2017b; Haarnoja et al., 2018), we augment the rewards with a causal entropy term; i.e., replace rr in (25) with r−τlog⁡π(a′∣s′)r-\tau\log\pi(a^{\prime}|s^{\prime}), where τ\tau is learned adaptively as in Haarnoja et al. (2018).

As residual learning is known to be hard in function approximation settings (Baird, 1995), we replace ν(s′,a′)\nu(s^{\prime},a^{\prime}) in (25) with a mixture η⋅ν(s′,a′)+(1−η)⋅ν‾(s′,a′)\eta\cdot\nu(s^{\prime},a^{\prime})+(1-\eta)\cdot\overline{\nu}(s^{\prime},a^{\prime}) where ν‾(s′,a′)\overline{\nu}(s^{\prime},a^{\prime}) is a target value calculated as in Haarnoja et al. (2018). We use η=0.05\eta=0.05.

If ν\nu is fully optimized, δ\delta will be the density ratio wπ/Dw_{\pi/\mathcal{D}}, and thus always non-negative. However, during optimization, this may not always hold, which can affect policy learning. Thus, when calculating gradients of this objective with respect to π\pi, we clip the value of δ\delta from below at 0.

For training we parameterize π\pi and ν\nu using neural networks and perform alternating stochastic gradient descent on their parameters.

We present our results in Figure 3. We see that AlgaeDICE can perform well in these settings, achieving performance that is roughly competitive with the state-of-the-art SAC and TD3 algorithms. There are potentially more possible improvements to these practical results by choosing ff (or f∗f_{*}) appropriately. In Appendix C, we conduct a preliminary investigation into polynomial ff, showing that certain polynomials can at times provide better performance than f(x)=12x2f(x)=\frac{1}{2}x^{2}. A more detailed and systematic study of this and other design choices for implementing AlgaeDICE is an interesting avenue for future work.

Conclusion

We have introduced an ALgorithm for policy Gradient from Arbitrary Experience via DICE, or AlgaeDICE, for behavior-agnostic, off-policy policy improvement in reinforcement learning. Based on a linear programming characterization of the QQ-function, we derived the new approach from a Lagrangian saddle-point formulation. The resulting algorithm, AlgaeDICE, automatically compensates for the distribution shift in collected off-policy data, and achieves an estimate of the on-policy policy gradient using this off-policy data.

We thank Marc Bellemare, Nicolas Le Roux, George Tucker, Rishabh Agarwal, Dibya Ghosh, and the rest of the Google Brain team for insightful thoughts and discussions.

References

Appendix A Proof Details

We follow the notations in main text. Abusing notation slightly, we will use ∑\sum and ∫\int interchangeably.

Proof Recall that Bπ\mathcal{B}_{\pi} is monotonic; that is, given two bounded functions ν1\nu_{1} and ν2\nu_{2}, ν1≥ν2\nu_{1}\geq\nu_{2} implies Bπν1≥Bπν2\mathcal{B}_{\pi}\nu_{1}\geq\mathcal{B}_{\pi}\nu_{2}. Therefore, for any feasbile ν\nu, we have ν≥(Bπ)ν≥(Bπ)2ν≥(Bπ)3ν≥…≥(Bπ)∞ν=Qπ\nu\geq\left(\mathcal{B}_{\pi}\right)\nu\geq\left(\mathcal{B}_{\pi}\right)^{2}\nu\geq\left(\mathcal{B}_{\pi}\right)^{3}\nu\geq\ldots\geq\left(\mathcal{B}_{\pi}\right)^{\infty}\nu=Q_{\pi}, proving the first claim.

The duality of the linear program (3) can be obtained as

which is exactly (3). Notice that the equality constraints correspond to a system of linear equations of dimension ∣S∣×∣A∣\left|S\right|\times\left|A\right|: (I−γ(Pπ)⊤)ρ=(1−γ)(μ0π)(I-\gamma\left(P_{\pi}\right)^{\top})\rho=(1-\gamma)(\mu_{0}\pi), where (μ0π)(s,a)=μ0(s)π(a∣s)(\mu_{0}\pi)(s,a)=\mu_{0}(s)\pi(a|s), Pπ(s′,a′∣s,a)=π(a′∣s′)T(s′∣s,a)P_{\pi}\left(s^{\prime},a^{\prime}|s,a\right)=\pi\left(a^{\prime}|s^{\prime}\right)T\left(s^{\prime}|s,a\right), and II is the identity matrix. Since the matrix I−γ(Pπ)⊤I-\gamma\left(P_{\pi}\right)^{\top} is nonsingular, the system has a unique solution given by

Finally, when γ∈[0,1)\gamma\in[0,1), we can rewrite (I−γ(Pπ)⊤)−1=∑t=0∞γt(Pπ)t\left(I-\gamma\left(P_{\pi}\right)^{\top}\right)^{-1}=\sum_{t=0}^{\infty}\gamma^{t}\left(P_{\pi}\right)^{t}, so ρ∗=(1−γ)∑t=0∞γt(Pπ)t(μ0π)=dπ\rho^{*}=\left(1-\gamma\right)\sum_{t=0}^{\infty}\gamma^{t}\left(P_{\pi}\right)^{t}\left(\mu_{0}\pi\right)=d^{\pi}, as desired.

Under Assumptions 1–4, the solution to (23) is given by,

To investigate the optimality, we apply the change-of-variable, x(s,a):=1α(Bπν−ν)(s,a)x\left(s,a\right):=\frac{1}{\alpha}\left(\mathcal{B}_{\pi}\nu-\nu\right)\left(s,a\right). Let βt(s)=P(s=st∣s0∼μ0,{ai}i=0t∼π)\beta_{t}\left(s\right)=P\left(s=s_{t}|s_{0}\sim\mu_{0},\left\{a_{i}\right\}_{i=0}^{t}\sim\pi\right), and consider the first expectation in (26):

Let C\mathcal{C} denote the set of functions xx in the image of (Bπν−ν)\left(\mathcal{B}_{\pi}\nu-\nu\right) for ν:S×A→N\nu:S\times A\to\mathcal{N}. Therefore, the change of variables yields the following re-formulation of LL:

To characterize νπ∗\nu^{*}_{\pi}, we note,

To characterize the optimal dual ζπ∗(s,a)\zeta^{*}_{\pi}\left(s,a\right), we have

where the second equality comes from the fact that f′(ζπ∗(s,a))=xπ∗(s,a)⇒ζπ∗(s,a)=f∗′(xπ∗(s,a))f^{\prime}(\zeta^{*}_{\pi}(s,a))=x^{*}_{\pi}(s,a)\Rightarrow\zeta^{*}_{\pi}(s,a)=f_{*}^{\prime}(x^{*}_{\pi}(s,a)).

A.1 Extension to γ=1𝛾1\gamma=1

We begin with the QQ-LP characterization of QπQ_{\pi}-values and visitations dπd^{\pi}.

Given these LP formulations, the Primal and Fenchel AlgaeDICE optimization problems for γ=1\gamma=1 are given by

We have the following analogue to Theorem 4.

Under Assumptions 1–4, the solution to (32) is given by,

To investigate the optimality, we apply the change-of-variable,

Let C\mathcal{C} denote the set of functions xx in the image of −λ+(Bπν−ν)-\lambda+\left(\mathcal{B}_{\pi}\nu-\nu\right) for ν:S×A→N\nu:S\times A\to\mathcal{N}. Therefore, the change of variables yields the following re-formulation of LL:

To characterize νπ∗\nu^{*}_{\pi}, we note,

To characterize the optimal dual ζπ∗(s,a)\zeta^{*}_{\pi}\left(s,a\right), we have

where the second equality comes from the fact that f′(ζπ∗(s,a))=xπ∗(s,a)⇒ζπ∗(s,a)=f∗′(xπ∗(s,a))f^{\prime}(\zeta^{*}_{\pi}(s,a))=x^{*}_{\pi}(s,a)\Rightarrow\zeta^{*}_{\pi}(s,a)=f_{*}^{\prime}(x^{*}_{\pi}(s,a)).

The final step is to show λπ∗\lambda^{*}_{\pi} is bounded, and there exists an optimal solution νπ∗\nu^{*}_{\pi} whose image is in N\mathcal{N}. As discussed, the x∗(s,a)=f′(wπ/D(s,a))x^{*}\left(s,a\right)=f^{\prime}(w_{\pi/\mathcal{D}}(s,a)) is bounded by f′(Wmax⁡)f^{\prime}\left(W_{\max}\right), then, we may use (35) to characterize λπ∗\lambda^{*}_{\pi} as

We may obtain a similar recurrence for a trajectory, (sˉ0,aˉ0,sˉ1,aˉ1,…)(\bar{s}_{0},\bar{a}_{0},\bar{s}_{1},\bar{a}_{1},\ldots), starting from (sˉ,aˉ)(\bar{s},\bar{a}). Subtracting them on both sides, we have

Plugging the above in (38) and realizing νπ∗(sˉ,aˉ)=0\nu^{*}_{\pi}(\bar{s},\bar{a})=0, we obtain

Appendix B Experiment Details

The table below gives hyperparameters used in the continuous control experiments. Many of our settings for AlgaeDICE were taken from Haarnoja et al. (2018) and Fujimoto et al. (2018). We set the regularization coefficient α\alpha in AlgaeDICE to 0.010.01.

Appendix C Additional Results