Off-policy Learning with Eligibility Traces: A Survey

Matthieu Geist, Bruno Scherrer

Introduction

We consider the problem of learning a linear approximation of the value function of some fixed policy in a Markov Decision Process (MDP) framework, in the most general situation where learning must be done from a single trajectory possibly generated by some other policy, also known as off-policy learning. Given samples, well-known methods for estimating a value function are temporal difference (TD) learning and Monte Carlo (Sutton and Barto, 1998). TD learning with eligibility traces (Sutton and Barto, 1998), known as TD(λ\lambda), constitutes a nice bridge between both approaches, and by controlling the bias/variance trade-off (Kearns and Singh, 2000), their use can significantly speed up learning. When the value function is approximated through a linear architecture, the depth λ\lambda of the eligibility traces is also known to control the quality of approximation (Tsitsiklis and Van Roy, 1997). Overall, the use of these traces often plays an important practical role.

There has been a significant amount of research on parametric linear approximation of the value function, without eligibility traces (in the on- or off-policy case). We follow the taxonomy proposed by Geist and Pietquin (2013), briefly recalled in Table 1 and further developped in Section 2. Value function approximators can be categorized depending on the cost function they minimize (based on bootstrapping, on a Bellman residual minimization or on a projected fixed point approach) and on how it is minimized (gradient-descent-based or linear least-squares). Most of these algorithms have been extended to take into account eligibility traces, in the on-policy case. Works on extending these approaches (based on eligibility traces) to off-policy learning are scarser. They are summarized in Table 2 (algorithms in black). The first motivation of this article is to argue that it is conceptually simple to extend all the algorithms of Table 1 so that they can be applied to the off-policy setting and use eligibility traces. If this allows rederiving existing algorithms (in black in Table 2), it also leads to new candidate algorithms (in red in Table 2). The second motivation of this work is to discuss the subtle differences between these intimately-related algorithms, and to provide some comparative insights on their empirical behavior (a topic that has to our knowledge not been considered in the literature, even in the simplest on-policy and no-trace situation).

The rest of this article is organized as follows. Section 2 introduces the background of Markov Decision Processes, describes the state-of-the-art algorithms for learning without eligibility traces, and gives the fundamental idea to extend the methods to the off-policy situation with eligibility traces. Section 3 details this extension for the least-squares based approaches: the resulting algorithms are formalized, and we derive recursive and memory-efficient formula for their implementation (this allows online learning without loss of generality, all the more that half of these algorithms are recursive by their very definition), and we discuss their convergence properties. Section 4 does the same job for stochastic gradient based approaches, which offers a smaller computational cost (linear per update, instead of quadratic). Last but not least, Section 5 describes an empirical comparison and Section 6 concludes.

Background

where EπE_{\pi} denotes the expectation induced by policy π\pi. The value function satisfies the (linear) Bellman equation:

It can be rewritten as the fixed-point of the Bellman evaluation operator: Vπ=TπVπV^{\pi}=T^{\pi}V^{\pi} where for all V,  TπV=Rπ+γPπVV,~{}~{}T^{\pi}V=R^{\pi}+\gamma P^{\pi}V.

In this article, we are interested in learning an approximation of this value function VπV^{\pi} under some constraints. First, we assume our approximation to be linearly parameterized:

The projection Π0\Pi_{0} onto the hypothesis space spanned by Φ\Phi with respect to the μ0\mu_{0}-quadratic norm, which will be central for the understanding of the algorithms, has the following closed-form:

If π0\pi_{0} is different from π\pi, it is called an off-policy setting. Notice that all algorithms considered in this paper use this Π0\Pi_{0} projection operator, that is the projection according to the observed dataIt would certainly be interesting to consider the projection according to the stationary distribution of π\pi, the (unobserved) target policy: this would reduce off-policy learning to on-policy learning. However, this would require reweighting samples according to the stationary distribution of the target policy π\pi, which is unknown and probably as difficult to estimate as the value function itself. As far as we know, the only work to move in this direction is the off-policy approach of Kolter (2011): samples are weighted such that the projection operator composed with the Bellman operator is non-expansive (so, weaker than finding the projection of the stationary distribution, but offering some guarantees). In this article, we consider only the Π0\Pi_{0} projection..

so that T^jV\hat{T}_{j}V is an unbiased estimate of TV(sj)TV(s_{j}).

Projected fixed point approaches aim at finding the fixed-point of the operator being the composition of the projection onto the hypothesis space and of the Bellman operator. In other words, they search for the fixed-point V^θ=ΠTV^θ\hat{V}_{\theta}=\Pi T\hat{V}_{\theta}, Π\Pi being the just introduced projection operator. Solving the following fixed-point problem:

with a least-squares approach, corresponds to the Least-Squares Temporal Differences (LSTD) algorithm of Bradtke and Barto (1996). Recently, Sutton et al. (2009) proposed two algorithms reaching the same objective, Temporal Difference with gradient Correction (TDC) and Gradient Temporal Difference 2 (GTD2), by performing a stochastic gradient descent of the function θ↦∥V^θ−ΠTV^θ∥2\theta\mapsto\|\hat{V}_{\theta}-\Pi T\hat{V}_{\theta}\|^{2} which is minimal (and equal to 0) when V^θ=ΠTV^θ\hat{V}_{\theta}=\Pi T\hat{V}_{\theta}.

A related approach consists in building a recursive algorithm that repeatedly mimicks the iteration V^θi≃ΠTV^θi−1\hat{V}_{\theta_{i}}\simeq\Pi T\hat{V}_{\theta_{i-1}}. In practice, we aim at minimizing

Performing the minimization exactly through a least-squares method leads to the Least-Squares Policy Evaluation (LSPE) algorithm of Bertsekas and Ioffe (1996). If this minimization is approximated by a stochastic gradient descent, this leads to the classical Temporal Difference (TD) algorithm (Sutton and Barto, 1998).

Bootstrapping approaches consist in treating value function approximation after seeing the ithi^{th} transition as a supervised learning problem, by replacing the unobserved values Vπ(sj)V^{\pi}(s_{j}) at states sjs_{j} by some estimate computed from the trajectory until the transition (sj,sj+1)(s_{j},s_{j+1}), the best such estimate being T^jV^θj−1\hat{T}_{j}\hat{V}_{\theta_{j-1}}. This amounts to minimizing the following function:

Choi and Van Roy (2006) proposed the Fixed-Point Kalman Filter (FPKF), a least-square variation of TD that minmizes exactly the function of Equation (6). If the minimization is approximated by a stochastic gradient descent, this gives – again – the classical TD algorithm (Sutton and Barto, 1998).

Finally, residual approaches aim at minimizing the distance between the value function and its image through the Bellman operator, ∥V−TV∥μ02\|V-TV\|_{\mu_{0}}^{2}. Based on a trajectory, this suggests the following function to minimize

which is a biased surrogate of the objective ∥V−TV∥μ02\|V-TV\|_{\mu_{0}}^{2} (for instance, see Antos et al. (2006)). This cost function has originally been proposed by Baird (1995) who minimized it using a stochastic gradient approach (this algorithm being referred here as gBRM for gradient-based Bellman Residual Minimization). Both the parametric Gaussian Process Temporal Differences (GPTD) algorithm of Engel (2005) and the linear Kalman Temporal Differences (KTD) algorithm of Geist and Pietquin (2010b) can be shown to minimize the above cost using a least-squares approach, and are thus the very same algorithmThis is only true in the linear case. GPTD and KTD were both introduced in a more general setting: GPTD is nonparametric and KTD is motivated by the goal of handling nonlinearities., that we will refer to as BRM (for Bellman Residual Minimization) in the remaining of this paper.

To sum up, it thus appears that after the ithi^{th} transition has been observed, the above mentioned algorithms behave according to the following pattern:

either through a least-squares approach or a stochastic gradient descent. Each of the algorithms mentionned above is obtained by substituting {\color[rgb]{0,0.16,0.90}\theta_{i}}\text{, }{\color[rgb]{0,0.16,0.90}\theta_{i-1}}\text{, }{\color[rgb]{0,0.16,0.90}\theta_{j-1}}\text{ or }{\color[rgb]{0,0.16,0.90}\omega} for {\color[rgb]{0.90,0.16,0}\xi}.

Towards Off-policy Learning with Traces

It is now easy to preview, at least at a high level, how one may extend the previously described algorithms so that they can deal with eligibility traces and off-policy learning. The idea of eligibility traces amounts to looking for the fixed-point of the following variation of the Bellman operator (Bertsekas and Tsitsiklis, 1996)

that makes a geometric average with parameter λ∈(0,1)\lambda\in(0,1) of the powers of the original Bellman operator TT. Clearly, any fixed-point of TT is a fixed-point of TλT^{\lambda} and vice-versa. After some simple algebra, one can see that:

This leads to the following well-known temporal difference-based expression in some state ss

where we recall that EπE_{\pi} means that the expectation is done according to the target policy π\pi, and where we \delta_{ik}(s)=E_{\pi}\left[r_{k}+\gamma V(s_{k+1})-V(s_{k})\Big{|}s_{i}=s\right] is the expected temporal-difference (Sutton and Barto, 1998). With λ=0\lambda=0, we recover the Bellman evaluation equation. With λ=1\lambda=1, this is the definition of the value function as the expected and discounted cumulative reward: T1V(s)=Eπ[∑k=i∞γk−irk∣si=s]T^{1}V(s)=E_{\pi}[\sum_{k=i}^{\infty}\gamma^{k-i}r_{k}|s_{i}=s].

As before, we assume that we are given a trajectory (s1,a1,r1,s2,…,(s_{1},a_{1},r_{1},s_{2},\dots, sj,aj,rj,sj+1…,s_{j},a_{j},r_{j},s_{j+1}\dots, sn,an,rn,sn+1)s_{n},a_{n},r_{n},s_{n+1}), except now that it may be generated from some behaviour policy possibly different from the target policy π\pi of which we want to estimate the value. We are going to describe how to compute the ithi^{th} iterate for several algorithms. For any i≤ki\leq k, unbiased estimates of the temporal difference terms δik(sk)\delta_{ik}(s_{k}) can be computed through importance sampling (Ripley, 1987). Indeed, for all s,as,a, let us introduce the following weight:

In our trajectory context, for any jj and kk, write

with the convention that if k<jk<j, ρjk=1\rho_{j}^{k}=1. With these notations,

is an unbiased estimate of δik(sk)\delta_{ik}(s_{k}), from which we may build an estimate T^j,iλV\hat{T}^{\lambda}_{j,i}V of TλV(sj)T^{\lambda}V(s_{j}) (we will describe this very construction separately for the least-squares and the stochastic gradient as they slightly differ). Then, by replacing the empirical operator T^j\hat{T}_{j} in Equation (8) by T^j,iλ\hat{T}_{j,i}^{\lambda}, we get the general pattern for off-policy trace-based algorithms:

either through a least-squares approach or a stochastic gradient descent after having instantiated {\color[rgb]{0.90,0.16,0}\xi}={\color[rgb]{0,0.16,0.90}\theta_{i}}\text{, }{\color[rgb]{0,0.16,0.90}\theta_{i-1}}\text{, }{\color[rgb]{0,0.16,0.90}\theta_{j-1}}\text{ or }{\color[rgb]{0,0.16,0.90}\omega}. This process, including in particular the precise definition of the empirical operator T^j,iλ\hat{T}_{j,i}^{\lambda}, will be further developped in the next two sectionsNote that we let the empirical operator T^j,iλ\hat{T}_{j,i}^{\lambda} depends on the index jj of the sample (as before) but also on the step ii of the algorithm. This will be particularly useful for the derivation of the recursive and memory-efficient least-squares based algorithms that we present in the next section.. Since they are easier to derive, we begin by focusing on least-squares algorithms (right column of Table 2) in Section 3. Then, Section 4 focuses on stochastic gradient descent-based algorithms (left column of Table 2).

Least-squares-based extensions to eligibility traces and off-policy learning

In this section, we first consider the case of least-squares solving of the pattern described in Equation (17). At their ithi^{th} step, the algorithms that we are about to describe will compute the parameter θi\theta_{i} by exactly solving the following problem:

where we define the following empirical truncated approximation of TλT_{\lambda}:

Though different definitions of this operator may lead to practical implementations, note that T^j,iλ\hat{T}^{\lambda}_{j,i} only uses samples seen before time ii: this very feature – considered by all existing works in the literature – will enable us to derive recursive and low-memory algorithms.

Recall that a linear parameterization is chosen here, V^ξ(si)=ξTϕ(si)\hat{V}_{\xi}(s_{i})=\xi^{T}\phi(s_{i}). We adopt the following notations:

The generic cost function to be solved is therefore:

Before deriving existing and new least-squares-based algorithms, as announced, some technical lemmata are required.

The first lemma allows computing directly the inverse of a rank-one perturbated matrix.

The next lemma is simply a rewriting of imbricated sums. However, it is quite important here as it will allow stepping from the operator T^j,iλ\hat{T}^{\lambda}_{j,i} (operator which depends on future of sjs_{j}) – forward view of eligibility traces – to the recursion over parameters using eligibility traces (dependence on only past samples) – backward view of eligibility traces – (see (Sutton and Barto, 1998, Ch.7) for further discussion on backward/forward views).

We are now ready to mechanically derive the off-policy algorithms LSTD(λ\lambda), LSPE(λ\lambda), FPKF(λ\lambda) and BRM(λ\lambda). This is what we do in the following subsections.

The off-policy LSTD(λ\lambda) algorithm corresponds to instantiating Problem (22) with {\color[rgb]{0.90,0.16,0}\xi}={\color[rgb]{0,0.16,0.90}\theta_{i}}:

This can be solved by zeroing the gradient respectively to ω\omega:

which, through Lemma 2, is equivalent to:

Introducing the (importance based) eligibility vector zjz_{j}:

one obtains the following batch estimate:

Thanks to Lemma 1, the inverse Mi=(Ai)−1M_{i}=(A_{i})^{-1} can be computed recursively:

This can be used to derive a recursive estimate:

Writing KiK_{i} the gain Mi−1zi1+ΔϕiTMi−1zi\frac{M_{i-1}z_{i}}{1+\Delta\phi_{i}^{T}M_{i-1}z_{i}}, this gives Algorithm 1.

This algorithm has been proposed and analyzed recently by Yu (2010a). The author proves the following result: if the behavior policy π0\pi_{0} induces an irreducible Markov chain and chooses with positive probability any action that may be chosen by the target policy π\pi, and if the compound (linear) operator Π0Tλ\Pi_{0}T^{\lambda} has a unique fixed-pointIt is not always the case, see Tsitsiklis and Van Roy (1997) for a counter-example., then off-policy LSTD(λ\lambda) converges to it almost surely. Formally, it converges to the solution θ∗\theta^{*} of the so-called projected fixed-point equation:

Using the expression of the projection Π0\Pi_{0} and the form of the Bellman operator in Equation (10), it can be seen that θ∗\theta^{*} satisfies (see Yu (2010a) for details)

The core of the analysis of Yu (2010a) consists in showing that 1iAi\frac{1}{i}A_{i} and 1ibi\frac{1}{i}b_{i} defined in Equation (31) respectively converge to AA and bb almost surely. Through Equation (30), this implies the convergence of θi\theta_{i} to θ∗\theta^{*}.

2 Off-policy LSPE(λ𝜆\lambda)

The off-policy LSPE(λ\lambda) algorithm corresponds to the instantiation {\color[rgb]{0.90,0.16,0}\xi}={\color[rgb]{0,0.16,0.90}\theta_{i-1}} in Problem (22):

This can be solved by zeroing the gradient respectively to ω\omega:

Lemma 2 can be used (recall the definition of the eligibility vector zjz_{j} in Equation (29)):

where the second equality follows from Lemma 1. Let AiA_{i} and bib_{i} be defined as in the LSTD description in Equation (31). For clarity, we restate their definition along with their recursive writing:

Then, it can be seen that the LSPE(λ\lambda) update is:

The overall computation is provided in Algorithm 2.

This algorithm, (briefly) mentioned by Yu (2010a), generalizes the LSPE(λ\lambda) algorithm of Bertsekas and Ioffe (1996) to off-policy learning. With respect to LSTD(λ\lambda), which computes θi=(Ai)−1bi\theta_{i}=(A_{i})^{-1}b_{i} (cf. Equation (30)) at each iteration, LSPE(λ\lambda) is fundamentally recursive (as it is based on an iterated fixed-point search). Along with the almost sure convergence of 1iAi\frac{1}{i}A_{i} and 1ibi\frac{1}{i}b_{i} to AA and bb (defined in Equation (37)), it can be shown that iNiiN_{i} converges to N=(ΦTD0Φ)−1N=(\Phi^{T}D_{0}\Phi)^{-1} (see for instance Nedić and Bertsekas (2003)) so that, asymptotically, LSPE(λ\lambda) behaves as:

or using the defintion of Π0\Pi_{0}, AA, bb (Equation (37)) and TλT^{\lambda} (Equation (10)):

The behavior of this sequence depends on whether the spectral radius of Π0Tλ\Pi_{0}T^{\lambda} is smaller than 11 or not. Thus, the analyses of Yu (2010a) and Nedić and Bertsekas (2003) (for the convergence of NiN_{i}) imply the following convergence result: under the assumptions required for the convergence of off-policy LSTD(λ\lambda), and the additional assumption that the operator Π0Tλ\Pi_{0}T^{\lambda} has a spectral radius smaller than 1 (so that it is contracting), LSPE(λ\lambda) also converges almost surely to the fixed-point of the compound Π0Tλ\Pi_{0}T^{\lambda} operator.

There are two sufficient conditions that can ensure such a desired contraction property. The first one is when one considers on-policy learning, as Nedić and Bertsekas (2003) did when they derived the first convergence proof of (on-policy) LSPE(λ\lambda). When the behavior policy π0\pi_{0} is different from the target policy π\pi, a sufficient condition for contraction is that λ\lambda be close enough to 1; indeed, when λ\lambda tends to 1, the spectral radius of TλT^{\lambda} tends to zero and can potentially balance an expansion of the projection Π0\Pi_{0}. In the off-policy case, when γ\gamma is sufficiently big, a small value of λ\lambda can make Π0Tλ\Pi_{0}T^{\lambda} expansive (see Tsitsiklis and Van Roy (1997) for an example in the case λ=0\lambda=0) and off-policy LSPE(λ\lambda) will then diverge. Eventually, Equations (35) and (48) show that when λ=1\lambda=1, both LSTD(λ\lambda) and LSPE(λ\lambda) asymptotically coincide (as T1VT^{1}V does not depend on VV).

3 Off-policy FPKF(λ𝜆\lambda)

The off-policy FPKF(λ\lambda) algorithm corresponds to the instantiation {\color[rgb]{0.90,0.16,0}\xi}={\color[rgb]{0,0.16,0.90}\theta_{j-1}} in Problem (22):

This can be solved by zeroing the gradient respectively to ω\omega:

where NiN_{i} is the matrix introduced for LSPE(λ\lambda) in Equation (43). For clarity, we restate its definition here and its recursive writing:

With respect to the previously described algorithms, the difficulty here is that on the right side there is a dependence with all the previous terms θk−1\theta_{k-1} for 1≤k≤i1\leq k\leq i. Using the symmetry of the dot product ΔϕjTθk−1=θk−1TΔϕj\Delta\phi_{j}^{T}\theta_{k-1}=\theta_{k-1}^{T}\Delta\phi_{j}, it is possible to write a recursive algorithm by introducing the trace matrix ZjZ_{j} that integrates the subsequent values of θk\theta_{k} as follows:

Using Equation (51) and a few algebraic manipulations, we end up with:

This is the parameter update as provided in Algorithm 3.

It generalizes the FPKF algorithm of Choi and Van Roy (2006) that was originally only introduced without traces and in the on-policy case. As LSPE(λ\lambda), this algorithm is fundamentally recursive. However, its overall behavior is quite different. As we discussed for LSPE(λ\lambda), iNiiN_{i} can be shown to tend asymptotically to N=(ΦTD0Φ)−1N=(\Phi^{T}D_{0}\Phi)^{-1} and FPKF(λ\lambda) iterates eventually resemble:

The term in brackets is a random component (that only depends on the last transition) and 1i\frac{1}{i} acts as a learning coefficient that asymptotically tends to 0. In other words, FPKF(λ\lambda) has a stochastic approximation flavour. In particular, one can see FPKF(0) as a stochastic approximation of LSPE(0). Indeed, asymptotically, FPKF(0) does the following update

and one can notice that ρiϕiri\rho_{i}\phi_{i}r_{i} and ϕiΔϕiT\phi_{i}\Delta\phi_{i}^{T} are samples of AA and bb to which AiA_{i} and bib_{i} converge through LSPE(0). When λ>0\lambda>0, the situation is less clear – up to the fact that since T1VT^{1}V does not depend on VV, we expect FPKF to asymptotically behave like LSTD and LSPE when λ\lambda tends to 11.

Due to its much more involved form (notably the matrix trace ZjZ_{j} integrating the values of all the values θk\theta_{k} from the start), it does not seem easy to provide a guarantee for FPKF(λ\lambda), even in the on-policy case. To our knowledge, there does not exist any proof of convergence for stochastic approximation algorithms in the off-policy case with tracesAn analysis of TD(λ\lambda), with a simplifying assumption that forces the algorithm to stay bounded is given by Yu (2010a). An analysis of GQ(λ\lambda) is provided by Maei and Sutton (2010), with an assumption on the second moment of the traces, which does not hold in general (see Proposition 2 in (Yu, 2010a)). A full analysis of these algorithms thus remains to be done. See also Sections 4.1 and 4.2., and a related result for FPKF(λ\lambda) thus seems difficult. Based on the above-mentioned relation between FPKF(0) and LSPE(0) and the experiments we have run (see Section 5), we conjecture that off-policy FPKF(λ\lambda) has the same asymptotic behavior as LSPE(λ\lambda). We leave the formal study of this algorithm for future work.

4 Off-policy BRM(λ𝜆\lambda)

The off-policy BRM(λ\lambda) algorithm corresponds to the instantiation {\color[rgb]{0.90,0.16,0}\xi}={\color[rgb]{0,0.16,0.90}\omega} in Problem (22):

This yields the following batch estimate:

The transformation of this batch estimate into a recursive update rule is somewhat tedious (it involves three “trace” variables), and the details are deferred to Appendix A for clarity. The resulting BRM(λ\lambda) method is provided in Algorithm 4. Note that at each step, this algorithm involves the inversion of a 2×22\times 2 matrix (involving the 2×22\times 2 identity matrix I2I_{2}), inversion that admits a straightforward analytical solution. The computational complexity of an iteration of BRM(λ\lambda) is thus O(p2)O(p^{2}) (as for the preceding least-squares-based algorithms).

GPTD and KTD, which are close to BRM, have also been extended with some trace mechanism; however, GPTD(λ\lambda) (Engel, 2005)Technically, GPTD(λ\lambda) is not exactly a generalization of GPTD as it does not reduce to it when λ=0\lambda=0. It is rather a variation., KTD(λ\lambda) (Geist and Pietquin, 2010a) and the just described BRM(λ\lambda) are different algorithms. Briefly, GPTD(λ\lambda) is very close to LSTD(λ\lambda) and KTD(λ\lambda) uses a different Bellman operatorThe corresponding loss is (T^j,i0V^(ω)−V^ω(sj)+γλ(T^j+1,i1V^(ω)−V^ω(sj+1)))2(\hat{T}^{0}_{j,i}\hat{V}(\omega)-\hat{V}_{\omega}(s_{j})+\gamma\lambda(\hat{T}^{1}_{j+1,i}\hat{V}(\omega)-\hat{V}_{\omega}(s_{j+1})))^{2}. With λ=0\lambda=0 it gives T^j,i0\hat{T}^{0}_{j,i} and with λ=1\lambda=1 it provides T^j,i1\hat{T}^{1}_{j,i}.. As BRM(λ\lambda) builds a linear system whose solution is updated recursively, it resembles LSTD(λ\lambda). However, the system it builds is different. The following theorem, proved in Appendix B, partially characterizes the behavior of BRM(λ\lambda) and its potential limitOur proof is similar to that of Proposition 4 in Bertsekas and Yu (2009b). The overall arguments are the following: Equation (61) implies that the traces can be truncated at some depth ll, whose influence on the potential limit of the algorithm vanishes when ll tends to ∞\infty. For all ll, the ll-truncated version of the algorithm can easily be analyzed through the ergodic theorem for Markov chains. Making ll tend to ∞\infty allows tying the convergence of the original arguments to that of the truncated version. Eventually, the formula for the limit of the truncated algorithm is computed and one derives the limit..

Assume that the stochastic matrix P0P_{0} of the behavior policy is irreducible and has stationary distribution μ0\mu_{0}. Further assume that there exists a coefficient β<1\beta<1 such that

The fundamental idea behind the Bellman Residual approach is to address the computation of the fixed-point of TλT^{\lambda} differently from the previous methods. Instead of computing the projected fixed-point as in Equation (35), one considers the following overdetermined system

Stochastic gradient based extensions to eligibility traces and off-policy learning

We have just provided a systematic derivation of all least-squares-based algorithms for learning with eligibility traces in an off-policy manner. When the number of features pp is very large, the O(p2)O(p^{2}) complexity involved by a least-squares approach may be prohibitive. In such a situation, a natural alternative is to consider an approach based on a stochastic gradient descent of the objective function of interest (Bottou and Bousquet, 2011; Sutton et al., 2009; Maei and Sutton, 2010).

In this section, we will describe a systematic derivation of stochastic gradient based algorithms for learning in an off-policy manner with eligibility traces. The principle followed is the same as for the least-squares-based approaches: we shall instantiate the algorithmic pattern of Equation (17) by choosing the value of ξ\xi and update the parameter so as move towards the minimum of J(θi,ξ)J(\theta_{i},\xi) in Equation (17) using a stochastic gradient descent. To make the pattern of Equation (17) precise, we need to define the empirical approximate operator we use. We will consider the untruncated T^i,nλ\hat{T}^{\lambda}_{i,n} operators (written in the followings T^iλ\hat{T}^{\lambda}_{i}, with a slight abuse of notation):

where nn is the total length of the trajectory.

It should be noted that algorithmic derivations will here be a little bit more involved than in the least-squares case. First, with the instantiation ξ=θi\xi=\theta_{i}, the pattern given in Equation (17) is actually a fixed-point problem onto which one cannot directly perform a stochastic gradient descent (this issue will be addressed in Section 4.2 through the introduction of an auxiliary objective function, following the approach originally proposed by Sutton et al. (2009)). A second difficulty is the following: the just introduced empirical operator T^iλ\hat{T}^{\lambda}_{i} depends on all the trajectory after step ii (on the future of the process), and is for this reason usually coined a forward view estimate. Though it would be possible, in principle, to implement a gradient descent based on this forward view, it would not be very memory nor time efficient. Thus, we will follow a usual trick of the literature by deriving recursive algorithms based on a backward view estimate that is equivalent to the forward view in expectation. To do so, we will repeatedly use the following identity that highlights the fact that the estimate T^iλV\hat{T}^{\lambda}_{i}V can be written as a forward recursion:

Proof Using notably the identity ρij=ρiρi+1j\rho_{i}^{j}=\rho_{i}\rho_{i+1}^{j}, we have:

To sum up, the “recipe” that we are about to use to derive off-policy gradient learning algorithms based on eligibility traces will consist of the following steps:

write the empirical generic cost function (17) with the untruncated Bellman operator of Equation (70)

instantiate ξ\xi and derive the gradient-based update rule (with some additional work for ξ=θi\xi=\theta_{i}, see Section 4.2);

turn the forward view into an equivalent (in expectation) backward view.

The next subsection details the precise derivation of the algorithms.

Because it is the simplest, we begin by considering the bootstrap approach, that is the instantiation ξ=θj−1\xi=\theta_{j-1}. The cost function to be minimized is therefore:

Minimized with a stochastic gradient descent, the related update rule is (αi\alpha_{i} being a standard learning rate and recalling that V^ω(si)=ωTϕ(si)=ωTϕi\hat{V}_{\omega}(s_{i})=\omega^{T}\phi(s_{i})=\omega^{T}\phi_{i}):

At this point, one could notice that the exact same update rule would have been obtained with the instantiation ξ=θi−1\xi=\theta_{i-1}. This was to be expected: as only the last term of the sum is considered for the update, we have j=ij=i, therefore ξ=θi−1=θj−1\xi=\theta_{i-1}=\theta_{j-1}.

Equation (77) makes use of a λ\lambda-TD error defined as

For convenience, let also δi\delta_{i} be the standard (off-policy) TD error defined as

The λ\lambda-TD error can be expressed as a forward recursion:

Let δiλ\delta_{i}^{\lambda} be the λ\lambda-TD error and δi\delta_{i} be the standard TD error. Then for all ω\omega,

Therefore, we get the following update rule

with δiλ(θi−1)=δi(θi−1)+γλδi+1λ(θi−1)\delta_{i}^{\lambda}(\theta_{i-1})=\delta_{i}(\theta_{i-1})+\gamma\lambda\delta_{i+1}^{\lambda}(\theta_{i-1}). The key idea here is to find some backward recursion such that in expectation, when the Markov chain has reached its steady state, it provides the same result as the forward recursion. Such a backward recursion is given by the following lemma.

Let ziz_{i} be the eligibility vector, defined by the following recursion:

Proof For clarity, we omit the dependence with respect to ω\omega and write below δi\delta_{i} (resp. δiλ)\delta_{i}^{\lambda}) for δi(ω)\delta_{i}(\omega) (resp. δiλ(ω))\delta_{i}^{\lambda}(\omega)). The result relies on successive applications of Lemma 5. We have:

Moreover, we have that Eμ0[ϕiρiδi+1λ]=Eμ0[ϕi−1ρi−1δiλ]E_{\mu_{0}}[\phi_{i}\rho_{i}\delta_{i+1}^{\lambda}]=E_{\mu_{0}}[\phi_{i-1}\rho_{i-1}\delta_{i}^{\lambda}], as expectation is done according to the stationary distribution, therefore:

This suggests to replace Equation (77) by the following update rule,

which is equivalent in expectation when the Markov chain has reached its steady state. This is summarized in Algorithm 5.

This algorithm has first been proposed in the tabular case by Precup et al. (2000). An off-policy TD(λ\lambda) algorithm (with function approximation) has been proposed by Precup et al. (2001), but it differs significantly from the algorithm just described (notably it differs in the definition of the traces and the projected Bellman equation, and in the fact that it is constrained to episodic trajectories). Algorithm 5 has actually first been proposed much more recently by Bertsekas and Yu (2009a).

An important issue for the analysis of this algorithm is the fact that the trace ziz_{i} may have an infinite variance, due to importance sampling (see Yu (2010b, Sec. 3.1)). As far as we know, the only existing analysis of off-policy TD(λ\lambda) (as provided in Algorithm 5) uses an additional contraint which forces the parameters to be bounded: after each parameter update, the resulting parameter vector is projected onto some predefined compact set. This analysis is performed by Yu (2010b, Sec. 4.1). Under the standard assumptions of stochastic approximations and most of the assumptions required for the on-policy TD(λ\lambda) algorithm, assuming moreover that Π0Tλ\Pi_{0}T^{\lambda} is a contraction (which we recall to hold for a big enough λ\lambda) and that the predefined compact set used to project the parameter vector is a large enough ball containing the fixed point of Π0Tλ\Pi_{0}T^{\lambda}, the constrained version of off-policy TD(λ\lambda) converges to this fixed-point (therefore, the same solution as off-policy LSTD(λ\lambda), LSPE(λ\lambda) and FPKF(λ\lambda)). We refer to Yu (2010b, Sec. 4.1) for further details. An analysis of the unconstrained version of off-policy TD(λ\lambda) described in Algorithm 5 is an interesting topic for future research.

2 Off-policy TDC(λ𝜆\lambda) and off-policy GTD2(λ𝜆\lambda)

In this section, the case ξ=θi\xi=\theta_{i} is considered. Following the general pattern, at step ii, we would like to come up with a new parameter θi\theta_{i} that moves (from θi−1\theta_{i-1}) closer to the minimum of the function

This problem is tricky since the function to minimize contains what we want to compute – θi\theta_{i} – as a parameter. For this reason we cannot directly perform a stochastic gradient descent of the right hand side. Instead, we will consider an alternative (but equivalent) formulation of the projected fixed-point minimization θ=arg⁡min⁡ω∥Vω−Π0TλVω∥2\theta=\arg\min_{\omega}\|V_{\omega}-\Pi_{0}T^{\lambda}V_{\omega}\|^{2}, and will move from θi−1\theta_{i-1} to θi\theta_{i} by making one step of gradient descent of an estimate of the function

we consider the following objective function:

This is the derivation followed by Sutton et al. (2009) in the case λ=0\lambda=0 and by Maei and Sutton (2010) in the case λ>0\lambda>0 (and off-policy learning). Let us introduce the following notation:

Note that since we consider a linear approximation this quantity does not depend on θ\theta. Noticing that ∇δjλ(θ)=ϕj−gjλ\nabla\delta_{j}^{\lambda}(\theta)=\phi_{j}-g_{j}^{\lambda}, we can compute ∇J(θ)\nabla J(\theta):

Let wi(θ)w_{i}(\theta) be a quasi-stationary estimate of the last part, that can be recognized as the solution of a least-squares problem (regression of λ\lambda-TD errors δjλ\delta^{\lambda}_{j} on features ϕj\phi_{j}):

The identification with the above least-squares solution suggests to use the following stochastic gradient descent to form the quasi-stationary estimate:

This update rule makes use of the λ\lambda-TD error, defined through a forward view. As for the previous algorithm, we can use Proposition 6 to obtain the following backward view update rule that is equivalent (in expectation when the Markov chain reaches its steady state):

Using this quasi-stationary estimate, the gradient can be approximated as:

Therefore, a stochastic gradient descent gives the following update rule for the parameter vector θ\theta:

Once again the forward view term δiλ(θi−1)ϕi\delta_{i}^{\lambda}(\theta_{i-1})\phi_{i} can be turned into a backward view by using Proposition 6. There remains to work on the term giλϕiTg_{i}^{\lambda}\phi_{i}^{T}.

First, one can notice that the term giλg_{i}^{\lambda} satisfies a forward recursion.

Proof This result is simply obtained by applying the gradient to the forward recursion of T^iλVθ\hat{T}_{i}^{\lambda}V_{\theta} provided in Lemma 4 (according to θ\theta). Using this, the term giλϕiTg_{i}^{\lambda}\phi_{i}^{T} can be worked out similarly to the term δiλ(θi−1)ϕi\delta_{i}^{\lambda}(\theta_{i-1})\phi_{i}.

Let ziz_{i} be the eligibility vector defined in Proposition 6. We have

Proof The proof is similar to that of Proposition 6. Writing bi=γρi(1−λ)ϕi+1b_{i}=\gamma\rho_{i}(1-\lambda)\phi_{i+1} and ηi=γλρi\eta_{i}=\gamma\lambda\rho_{i}, we have

Using this result and Proposition 6, it is natural to replace Equation (111) by an update based on a backward recursion:

Last but not least, for the estimate wiw_{i} to be indeed quasi-stationary, the learning rates should satisfy the following condition (in addition to the classical conditions):

Eqs. (117) and (109) define the off-policy TDC(λ\lambda) algorithm, summarized in Algorithm 6. It was originally proposed by Maei and Sutton (2010) under the name GQ(λ\lambda). We call it off-policy TDC(λ\lambda) to highlight the fact that it is the extension of the original TDC algorithm of Sutton et al. (2009) to off-policy learning with traces. One can observe – to our knowledge, this was never mentionned in the literature before – that when λ=1\lambda=1, the learning rule of TDC(1) reduces to that of TD(1).

Maei and Sutton (2010) show that the algorithm converges with probability 1 to the same solution as the LSTD(λ\lambda) algorithm (that is, to θ∗=A−1b\theta^{*}=A^{-1}b) under some technical assumptions. Contrary to off-policy TD(λ\lambda), this algorithm does not requires Π0Tλ\Pi_{0}T^{\lambda} to be a contraction in order to be convergent. Unfortunately, one of the assumptions made in the analysis, requiring that the traces ziz_{i} have uniformly bounded second moments, is restrictive since in an off-policy setting the traces ziz_{i} may easily have an infinite variance (unless the behavior policy is really close to the target policy), as noted by Yu (2010a) (see also Randhawa and Juneja (2004)). A full proof of convergence thus still remains to be done.

Using the same principle (that is, performing a stochastic gradient descent to minimize J(θ)J(\theta)), in the λ=0\lambda=0 case, an alternative to TDC, the GTD2 algorithm was derived by Sutton et al. (2009). As far as we know, it has never been extended to off-policy learning with traces; we do it now. Notice that, given the derivation of GQ(λ\lambda), obtaining this algorithm is pretty straightforward.

To do so, we can start back from Equation (105):

This suggests the following alternative update rule (based on forward recursion):

Using Proposition 8, it is natural to use the following alternative update rule, based on a backward recursion:

The update of wiw_{i} remains the same, and put together it gives off-policy GTD2(λ\lambda), summarized in Algorithm 7. The analysis of this new algorithm constitutes a potential topic for future research.

3 Off-policy gBRM(λ𝜆\lambda)

The last considered approach is the residual approach, corresponding to the instantiation ξ=ω\xi=\omega. The cost function to be minimized is then:

Following the negative of the gradient of the last term leads to the following update rule:

recalling the notation giλ=∇T^iλV^ωg_{i}^{\lambda}=\nabla\hat{T}_{i}^{\lambda}\hat{V}_{\omega} first defined in Equation (102).

As usual, this update involves a forward view, which we are going to turn into a backward view. The term ϕiδiλ\phi_{i}\delta_{i}^{\lambda} can be worked thanks to Proposition 6. The term giλδiλg_{i}^{\lambda}\delta_{i}^{\lambda} is more difficult to handle, as it is the product of two forward views (until now, we only considered the product of a forward view with a non-recursive term). This can be done thanks to the following original relation (the proof being somewhat tedious, it is deferred to Appendix C):

Write giλ=∇ωT^iλg_{i}^{\lambda}=\nabla_{\omega}\hat{T}_{i}^{\lambda} and define

This result (together with Proposition 6) suggests to update parameters as follows:

This gives the off-policy gBRM(λ\lambda) algorithm, depicted in Algorithm 8. One can observe that gBRM(1) is equivalent to TD(1) (and thus also TDC(1), cf. the comment before the description of Algorithm 6).

The analysis of this new algorithm is left for future research.

Empirical Study

This section aims at empirically comparing the surveyed algorithms. As they only address the policy evaluation problem, we compare the algorithms in their ability to perform policy evaluation (no control, no policy optimization); however, they may straightforwardly be used in an approximate policy iteration approach (Bertsekas and Tsitsiklis, 1996; Munos, 2003)). In order to assess their quality, we consider finite problems where the exact value function can be computed.

More precisely, we consider Garnet problems (Archibald et al., 1995), which are a class of randomly constructed finite MDPs. They do not correspond to any specific application, but are totally abstract while remaining representative of the kind of MDP that might be encountered in practice. In our experiments, a Garnet is parameterized by 4 parameters and is written G(nS,nA,b,p)\mathcal{G}(n_{S},n_{A},b,p): nSn_{S} is the number of states, nAn_{A} is the number of actions, bb is a branching factor specifying how many possible next states are possible for each state-action pair (bb states are chosen uniformly at random and transition probabilities are set by sampling uniform random b−1b-1 cut points between 0 and 1) and pp is the number of features (for function approximation). The reward is state-dependent: for a given randomly generated Garnet problem, the reward for each state is uniformly sampled between 0 and 1. Features are chosen randomly: Φ\Phi is a nS×pn_{S}\times p feature matrix of which each component is randomly and uniformly sampled between 0 and 1, except the first row of which each component is set to 1 (this corresponds to a constant feature). The discount factor γ\gamma is set to 0.950.95 in all experiments.

We consider two types of problems, “small” and “big”, respectively corresponding to instances G(30,4,2,8)\mathcal{G}(30,4,2,8) and G(100,10,3,20)\mathcal{G}(100,10,3,20). We also consider two types of learning: on-policy learning and off-policy learning. In the on-policy setting, for each Garnet a policy π\pi to be evaluated is randomly generated (by sampling randomly nA−1n_{A}-1 cut points between and 11 for each state), and trajectories (to be used for learning) are sampled according to this same policy. In the off-policy setting, the policy π\pi to be evaluated is randomly generated the same way, but trajectories are sampled according to a uniform policy π0\pi_{0} (that chooses each action with equal probability, that is π0(a∣s)=1nA\pi_{0}(a|s)=\frac{1}{n_{A}} for any state-action couple).

For all algorithms, we choose θ0=0\theta_{0}=0. For least-squares-based algorithms (LSTD, LSPE, FPKF and BRM), we set the initial matrices (M0,N0,C0)(M_{0},N_{0},C_{0}) to 103I10^{3}I (the higher this value, the more negligible its effect on estimatesWe observed that this parameter did not play a crucial role in practice.). We run a first set of experiments in order to set all other parameters (eligibility factor and learning rates). We use the following schedule for the learning rates:

More precisely, we generate one problem (MDP and policy) for each possible combination small/big on-policy/off-policy (leading to four problems). For each problem, we generate 10 trajectories of length 10410^{4} using the behaviorial policy (which is the randomly generated target policy in the on-policy case and the uniform policy in the off-policy case), to be used by all algorithms. For each meta-parameter, we consider the following ranges of values: λ∈{0,0.4,0.7,0.9,1}\lambda\in\{0,0.4,0.7,0.9,1\}, α0∈{10−2,10−1,100}\alpha_{0}\in\{10^{-2},10^{-1},10^{0}\}, αc∈{101,102,103}\alpha_{c}\in\{10^{1},10^{2},10^{3}\}, β0∈{10−2,10−1,100}\beta_{0}\in\{10^{-2},10^{-1},10^{0}\} and βc∈{101,102,103}\beta_{c}\in\{10^{1},10^{2},10^{3}\}. Then, we compute the parameter estimates considering all algorithms instantiated with each possible combination of the meta-parameters. This gives for each combination a family θi,d\theta_{i,d} with ii the number of transitions encountered in the dthd^{\text{th}} trajectory. Finally, for each problem and each algorithm, we choose the combination of meta-parameters which minimizes the average error on the second half of the learning curves (we do this to reduce the sensitivity to the initialization and the transient behavior). Formally, we pick the set of parameters that minimizes the following quantity:

We provide the empirical results of this first set of experiments in Table 3 to 6. As a complement, we detail in Figure 1 the sensitivity of all algorithms with respect to the main parameter λ\lambda that controls the eligibility traces. We comment these results below.

Table 3 shows the best meta-parameters for 10 trajectories of a single instance of a small Garnet problem in an on-policy setting, as well as related efficiencies. Numerically, all least-squares-based methods provide equivalent performance, with similar choices of the eligibility factor (which is the only meta-parameter). TD gets its best results with a small λ\lambda (we believe this is the case because the MDP has few states). The new gBRM algorithm and GTD2 algorithm work well, but picking a higher value of λ\lambda. Eventually, TDC performs slightly worse. Figure 1 (top, left) shows that the choice of λ\lambda does not matter, except for FPKF that requires λ=1\lambda=1 to be efficient; with this value FPKF is almost identical to LSPE(1) and LSTD(1) (cf. the discussion at the end of Section 3.3).

Table 4 shows the best meta-parameters for 10 trajectories of a single instance of a big Garnet problem in an on-policy setting, as well as related performance. These results are consistent with those of the small problem, in the on-policy setting (with slightly different meta-parameters). The main difference are that GTD2 performs here the worse. Figure 1 (top, right) suggests that as the problem’s size grows, the role of the eligibity factor gets more prominent: most algorithms need a relatively high value of λ\lambda to perform the best.

Table 5 reports the best meta-parameters in an off-policy setting for a small problem. In terms of performance, Least-squares approaches are no longer equivalent. LSTD and LSPE get the best results, with the smallest possible value λ=0\lambda=0: we believe that this choice is due to the fact that higher eligibility factor increases the variance due to importance sampling. FPKF and BRM need large values of λ\lambda to work well, and suffer much more from the off-policy aspect. Figure 1 (bottom, left) suggests that FPKF and BRM need a high value of λ\lambda (to “catch” the good performance of LSTD/LSPE) but then suffers from the variance due to importance sampling. Regarding gradient-based methods, TD’s performance is good (it is close that of LSTD/LSPE), followed closely by GTD2 (both being better than FPKF/BRM). TDC and gBRM lead to the worse results; as both methods choose λ=1\lambda=1, they here turn out to be equivalent to TD(1) (cf. the discussions after Algorithms 6 and 8)In particular, one can observe that the performance of gBRM(1) and TDC(1) in Table 5 are numerically equal.. As for FPKF/BRM with respect to LSTD/LSPE, Figure 1 (bottom, left) further suggests that TDC and gBRM need a high value of λ\lambda in order to get a reasonable performance, but then suffer from the variance of importance sampling.

Eventually, Table 6 shows the meta-parameters and performance in the most difficult situation: the off-policy setting of the big problem. These results are consistent with the off-policy results of the small problem, summarized in Table 5. LSTD and LSPE are the most efficient algorithms and choose the smallest possible value λ=0\lambda=0. FPKF and BRM’s performance deteriorate (significantly for the latter). TD behaves reasonably good (it is in particular much better than FPKF) and GTD2 follows closely. The performance of TDC and gBRM are the worse, the latter’s by a significant amount. Figure 1 (bottom, right) is similar to that of the small problem.

The main goal of the series of experiments we have just described was to choose reasonable values for the meta-parameters. We have also used these experiments to quickly comment the relative performance of the algorithms, but this is not statistically significant as this was based on a single (random) problem. Though we will see that the general behavior of the algorithm is globally consistent with what we have seen so far, the series of experiments that we are about to describe aims at providing such a statistically significant performance comparison. For each situation (small and big problems, on- and off-policy), we fix the meta-parameters to the previously reported values and we compare the algorithms on several new instances of the problems. These results are reported on Figures. 2 to 5. For each of the 4 problems, we randomly generate 100 instances (MDP and policy to be evaluated). For each such problem, we generate a trajectory of length 10510^{5}. Then, all algorithms learn using this very trajectory. On each figure, we report the average performance (left), measured as the difference between the true value function (computed from the model) and the currently estimated one, ∥Vπ−Φθ∥2\|V^{\pi}-\Phi\theta\|_{2}, as well as the associated standard deviation (right).

We begin by discussing the results in the on-policy setting. Figure 2 compares all algorithms for 100 randomly generated small problems (that is, each run corresponds to different dynamics, reward function, features and evaluated policy), the meta-parameters being those provided in Table 3. All least-squares approaches provide the best results and are bunched together; this was to be expected, as all algorithms use λ\lambda close to 11. In these problems, gBRM works better than other gradient-based methods, followed by TD and GTD2/TDC. Figure 3 compares the algorithms for 100 randomly generated big problems, the meta-parameters being those provided in Table 4. These result are similar to those of the small problem in an off-policy setting, except that TDC is now faster than GTD2, that TD is slightly faster than gBRM.

We now consider the off-policy setting. Figure 4 provides the average performance and standard deviation of the algorithms (meta-parameters being those of Table 5) on 100 small problems. Once again, we can see that LSTD/LSPE provide the best results. The two other least-squares methods (FPKF and BRM) are overtaken by the gradient-based TD algorithm. GTD2 is quite slow (slower than TD) and TDC/gBRM (that are identical to TD(1) since they both use λ=1\lambda=1) are the slowest algorithms. Figure 5 provides the same data for the big problems (with the meta-parameters of Table 6). These results are similar to those of the small problems in an off-policy setting. The main differences are 1) that FPKF appears to converge faster than TD but with a bigger standard deviation, and 2) gBRM (that uses λ=0\lambda=0) does not work anymore (it is here equivalent to the standard algorithm by (Baird, 1995) and probably suffers from the well-known associated bias issue).

Overall, our experiments suggest that the two best algorithms are LSTD/LSPE, since they converge much faster in all situations. The gradient-based TD algorithm globally diplays a good behavior and constitutes a good alternative when the number pp of features is too big for least-squares methods to be implemented. Though some new algorithms/extensions show interesting results (FPKF(λ\lambda) is consistently better that the state-of-the-art FPKF by Choi and Van Roy (2006), gBRM works well in the on-policy setting) most of the other algorithms do not seem to be empirically competitive with the trio LSTD/LSPE/TD, especially in off-policy situations. In particular, the algorithm introduced specifically for the off-policy setting (TDC/GTD2) are much slower than TD. Moreover, the condition required for the good behavior of LSPE, FPKF and TD – the contraction of Π0Tλ\Pi_{0}T^{\lambda} – does not seem to be very restrictive in practice (at least for the Garnet problems we considered): though it is possible to build specific pathological examples where these algorithms divergeA preliminary version of this article (Scherrer and Geist, 2011) contains such examples, and also an example where an adverserial choice of λ\lambda leads to the divergence of LSTD(λ\lambda)., this never happened in our experiments.

Conclusion and Future Work

We have considered least-squares and gradient-based algorithms for value estimation in an MDP context. Starting from the on-policy case with no trace, we have recalled that several algorithms (LSTD, LSPE, FPKF and BRM for least-squares approaches, TD, gBRM and TDC/GTD2 for gradient-based approaches) fall in a common algorithmic pattern (Equation (8)). Substituting the original Bellman operator by an operator that deals with traces and off-policy samples naturally leads to the state-of-the-art off-policy trace-based versions of LSTD, LSPE, TD and TDC, and suggests natural extensions of FPKF, BRM, gBRM and GTD2. This way, we surveyed many known and new off-policy eligibility traces-based algorithms for policy evaluation.

We have explained how to derive recursive (memory and time-efficient) implementations of all these algorithms and discussed their known convergence properties (including an original analysis of BRM(λ\lambda) for sufficiently small λ\lambda, that implies the so far not known convergence of GPTD/KTD). Interestingly, it appears that the analysis of off-policy traces-based stochastic gradient algorithms under mild assumptions is still an open problem: the only currently known analysis of TD (Yu, 2010a) only applies to a constrained version of the algorithm, and that of TDC (Maei and Sutton, 2010) relies on an assumption on the boundedness of the second moment traces that is restrictive (Yu, 2010a). Filling this theoretical gap, as well as providing complete analyses for the other gradient algorithms and FPFK(λ\lambda) and BRM(λ\lambda) constitute important future work.

Finally, we have illustrated and compared the behavior of these algorithms; this constitutes the first exhaustive empirical comparison of linear methodsTo our knowledge, there does not even exist any work reporting and comparing empirical results of LSTD(0) and FPKF(0).. Overall, our study suggests that even if the use of eligibility traces generally improves the efficiency of all algorithms, LSTD and LSPE consistently provide the best estimates; and in situations where the computational cost is prohibitive for a least-squares approach (when the number pp of features is large), TD probably constitutes the best alternative.

References

A Derivation of the recursive formulae for BRM(λ𝜆\lambda)

We here detail the derivation of off-policy BRM(λ\lambda). We will need two technical lemmata. The first one is the Woodbury matrix identity which generalizes the Sherman-Morrison formula (given in Lemma 1).

Let AA, UU, CC and VV be matrices of correct sizes, then:

The second lemma is a rewriting of imbricated sums:

As stated in Equation (59), we have the following batch estimate for BRM(λ\lambda):

To obtain a recursive formula, these two sums have to be reworked through Lemma 11. Let us first focus on the latter:

and with the convention that z0=0z_{0}=0 and D0=0\mathfrak{D}_{0}=0, one can write:

and I2I_{2} the 2×22\times 2 identity matrix, we have:

We can apply the Woodbury identity given in Lemma 10:

Finally, the recursive BRM(λ\lambda) estimate can be computed as follows:

This gives BRM(λ\lambda) as provided in Algorithm 4.

B Proof of Theorem 3 (Convergence of BRM(λ𝜆\lambda))

The proof of Theorem 3 follows the general idea of that of Proposition 4 of Bertsekas and Yu (2009b). It is done in 2 steps. First we argue that the limit of the sequence is linked to that of an alternative algorithm for which one cuts the traces at a certain depth ll. Then, we show that for all depth ll, this alternative algorithm converges almost surely, we explicitely compute its limit and make ll tend to infinity to obtain the limit of BRM(λ\lambda).

where ϵ1(l)\epsilon_{1}(l) tends to 0 when ll tends to infinity. Similarly, using the fact that yk≤11−β2y_{k}\leq\frac{1}{1-\beta^{2}} and writing K=max⁡s,s′∥ϕ(s)−γϕ(s′)∥∞K=\max_{s,s^{\prime}}\|\phi(s)-\gamma\phi(s^{\prime})\|_{\infty}, one has for all jj,

where ϵ2(l)\epsilon_{2}(l) also tends to 0. Then, it can be seen that:

where ϵ(l)\epsilon(l) tends to 0 when ll tends to infinity. This implies that:

Let us now explicitely compute this expectation. Write xix_{i} the indicator vector (of which the kthk^{th} coordinate equals 11 when the state at time ii is kk and otherwise). One has the following relations: ϕi=ΦTxi\phi_{i}=\Phi^{T}x_{i}. Let us first look at the left part of the above limit:

Write Fi{\cal F}_{i} the realization of the process until time ii. Recalling that sis_{i} is the state at time ii and xix_{i} is the indicator vector corresponding to sis_{i}, one has for all s′s^{\prime}:

Let us consider the next identity. For i≤ji\leq j,

Eventually, the last identity is obtained by considering Ym,i,j=Xm,j,iT.Y_{m,i,j}=X_{m,j,i}^{T}.

Similarly, the second term on the right side of Equation (170) satisfies:

with Ql=∑j=0l−1(λγP)j.Q_{l}=\sum_{j=0}^{l-1}(\lambda\gamma P)^{j}.

Gathering this and Equation (179), we see that the limit of Ai,li\frac{A_{i,l}}{i} expressed in Equation (170) equals:

C Proof of Proposition 9

To prove Proposition 9, we need the following technical lemma.

Forget the notations used so far. Let αi\alpha_{i} and βi\beta_{i} be two forward recursions defined as

Assume that for any function ff we have thatThis is typically true if the index ii refers to a state sampled according to some stationary distribution, which is the case we are interested in.

Let also uiu_{i}, viv_{i} and wiw_{i} be the backward recursions defined as:

Proof The proof looks like the one of Proposition 6, but is a little bit more complicated. A key equality, to be applied repeatedly, is:

Another equality to be used repeatedly makes use of the “stationarity” assumption. For any k≥0k\geq 0 we have:

These two identities can be used to work the term of interest:

The work on the second term is symmetric:

The proof of Proposition 9 is a simple application of the preceding technical lemma. By lemma 5, we have that

The result is then a direct application of lemma 13.