A Unified Approach for Multi-step Temporal-Difference Learning with Eligibility Traces in Reinforcement Learning

Similar documents
arxiv: v1 [cs.ai] 5 Nov 2017

Temporal difference learning

Open Theoretical Questions in Reinforcement Learning

Reinforcement Learning

MDP Preliminaries. Nan Jiang. February 10, 2019

ilstd: Eligibility Traces and Convergence Analysis

Bias-Variance Error Bounds for Temporal Difference Updates

Replacing eligibility trace for action-value learning with function approximation

On the Convergence of Optimistic Policy Iteration

Chapter 7: Eligibility Traces. R. S. Sutton and A. G. Barto: Reinforcement Learning: An Introduction 1

Reinforcement Learning with Function Approximation. Joseph Christian G. Noel

Balancing and Control of a Freely-Swinging Pendulum Using a Model-Free Reinforcement Learning Algorithm

Machine Learning I Reinforcement Learning

arxiv: v1 [cs.ai] 1 Jul 2015

Reinforcement Learning

Christopher Watkins and Peter Dayan. Noga Zaslavsky. The Hebrew University of Jerusalem Advanced Seminar in Deep Learning (67679) November 1, 2015

Notes on Tabular Methods

Temporal Difference. Learning KENNETH TRAN. Principal Research Engineer, MSR AI

Reinforcement Learning. George Konidaris

Lecture 3: Markov Decision Processes

Least-Squares λ Policy Iteration: Bias-Variance Trade-off in Control Problems

An Adaptive Clustering Method for Model-free Reinforcement Learning

Chapter 6: Temporal Difference Learning

Review: TD-Learning. TD (SARSA) Learning for Q-values. Bellman Equations for Q-values. P (s, a, s )[R(s, a, s )+ Q (s, (s ))]

Basics of reinforcement learning

Machine Learning. Reinforcement learning. Hamid Beigy. Sharif University of Technology. Fall 1396

The Book: Where we are and where we re going. CSE 190: Reinforcement Learning: An Introduction. Chapter 7: Eligibility Traces. Simple Monte Carlo

Q-Learning for Markov Decision Processes*

Procedia Computer Science 00 (2011) 000 6

Off-Policy Actor-Critic

Generalization and Function Approximation

Reinforcement Learning: the basics

CS599 Lecture 1 Introduction To RL

Reinforcement Learning. Spring 2018 Defining MDPs, Planning

Emphatic Temporal-Difference Learning

Reinforcement learning

PART A and ONE question from PART B; or ONE question from PART A and TWO questions from PART B.

Lecture 3: Policy Evaluation Without Knowing How the World Works / Model Free Policy Evaluation


Reinforcement Learning II

Dual Temporal Difference Learning

Unifying Task Specification in Reinforcement Learning

ECE276B: Planning & Learning in Robotics Lecture 16: Model-free Control

Off-Policy Temporal-Difference Learning with Function Approximation

Accelerated Gradient Temporal Difference Learning

Approximate Dynamic Programming

Linear Least-squares Dyna-style Planning

arxiv: v1 [cs.lg] 20 Sep 2018

6 Reinforcement Learning

PART A and ONE question from PART B; or ONE question from PART A and TWO questions from PART B.

Introduction to Reinforcement Learning. CMPT 882 Mar. 18

Reinforcement Learning in Continuous Action Spaces

This question has three parts, each of which can be answered concisely, but be prepared to explain and justify your concise answer.

1 Problem Formulation

Reinforcement Learning

CSE 190: Reinforcement Learning: An Introduction. Chapter 8: Generalization and Function Approximation. Pop Quiz: What Function Are We Approximating?

arxiv: v3 [cs.ai] 7 Jul 2017

Approximate Optimal-Value Functions. Satinder P. Singh Richard C. Yee. University of Massachusetts.

Introduction to Reinforcement Learning

Lecture 23: Reinforcement Learning

Speedy Q-Learning. Abstract

Grundlagen der Künstlichen Intelligenz

Reinforcement Learning

Markov Decision Processes and Dynamic Programming

Reinforcement Learning. Summer 2017 Defining MDPs, Planning

Reinforcement Learning

Reinforcement Learning. Value Function Updates

Reinforcement learning an introduction

State Space Abstractions for Reinforcement Learning

Prioritized Sweeping Converges to the Optimal Value Function

Reinforcement Learning

An Introduction to Reinforcement Learning

Q-Learning in Continuous State Action Spaces

Introduction to Reinforcement Learning

CMU Lecture 12: Reinforcement Learning. Teacher: Gianni A. Di Caro

Notes on Reinforcement Learning

Prof. Dr. Ann Nowé. Artificial Intelligence Lab ai.vub.ac.be

Chapter 8: Generalization and Function Approximation

Reinforcement Learning

In Advances in Neural Information Processing Systems 6. J. D. Cowan, G. Tesauro and. Convergence of Indirect Adaptive. Andrew G.

An Introduction to Reinforcement Learning

Lecture 4: Approximate dynamic programming

Approximate Dynamic Programming

ROB 537: Learning-Based Control. Announcements: Project background due Today. HW 3 Due on 10/30 Midterm Exam on 11/6.

Deep Reinforcement Learning: Policy Gradients and Q-Learning

Introduction to Reinforcement Learning. Part 6: Core Theory II: Bellman Equations and Dynamic Programming

Lecture 8: Policy Gradient

Lower PAC bound on Upper Confidence Bound-based Q-learning with examples

Markov Decision Processes and Solving Finite Problems. February 8, 2017

Using Gaussian Processes for Variance Reduction in Policy Gradient Algorithms *

Reinforcement Learning

Approximate Dynamic Programming

Multiagent (Deep) Reinforcement Learning

Weighted Double Q-learning

Average Reward Parameters

Elements of Reinforcement Learning

Reinforcement Learning. Machine Learning, Fall 2010

Biasing Approximate Dynamic Programming with a Lower Discount Factor

Reinforcement Learning

Value Function Based Reinforcement Learning in Changing Markovian Environments

Transcription:

A Unified Approach for Multi-step Temporal-Difference Learning with Eligibility Traces in Reinforcement Learning Long Yang, Minhao Shi, Qian Zheng, Wenjia Meng, and Gang Pan College of Computer Science and Technology, Zhejiang University, China {yanglong,minhaowill,qianzheng,mengwenjia,gpan}@zju.edu.cn Abstract Recently, a new multi-step temporal learning algorithm Q unifies n-step Tree-Backup when 0 and n-step Sarsa when 1 by introducing a sampling parameter. However, similar to other multi-step temporal-difference learning algorithms, Q needs much memory consumption and computation time. Eligibility trace is an important mechanism to transform the offline updates into efficient on-line ones which consume less memory and computation time. In this paper, we combine the original Q with eligibility traces and propose a new algorithm, called Q,, where is trace-decay parameter. This new algorithm unifies Sarsa when 1 and Q when 0. Furthermore, we give an upper error bound of Q, policy evaluation algorithm. We prove that Q, control algorithm converges to the optimal value function exponentially. We also empirically compare it with conventional temporal-difference learning methods. Results show that, with an intermediate value of, Q, creates a mixture of the existing algorithms which learn the optimal value significantly faster than the extreme end 0, or 1. 1 Introduction In reinforcement learning RL, experiences are sequences of states, actions and rewards which are generated by the agent interacts with environment. The agent s goal is learning from experiences and seeking an optimal policy from the delayed reward decision system. There are two fundamental mechanisms of learning have been studied in RL, one is temporaldifference TD learning method which is a combination of Monte Carlo method and dynamic programming Sutton, 1988. The other one is eligibility trace Sutton, 1984; Watkins, 1989 which is a short-term memory process as a function of states. TD combines TD learning with eligibility trace and unifies one-step learning 0 and Monte Carlo methods 1 through the trace-decay parameter Sutton, 1988. Results show that the unified algorithm Corresponding author. TD performs better at an intermediate value of rather than either extreme case. Recently, Multi-step Q Sutton and Barto, 2017 unifies n-step Sarsa 1, full-sampling and n-step Treebackup 0, pure-expectation. For some intermediate value 0 < < 1, Q creates a mixture of full-sampling and pure-expectation approach, can perform better than the extreme case 0 or 1 De Asis et al., 2018. The results in De Asis et al., 2018 implies a fundamental trade-off problem in reinforcement learning: should one estimates the value function by adopting pure-expectation 0 algorithm or full-sampling 1 algorithm? Although pure-expectation approach has lower variance, it needs more complexity and larger calculation Van Seijen et al., 2009. On the other hand, full-sampling algorithm needs smaller calculation time, however, it may have a worse asymptotic performance De Asis et al., 2018. Multi-step Q Sutton and Barto, 2017 firstly attempts to combine pure-expectation with full-sample algorithms, however, multi-step temporaldifference learning is too expensive in complexity of time and space during its training. Eligibility trace is an effective way to address the above complexity problem. In this paper, we try to combine the Q algorithm with eligibility trace, and create a new algorithm, called Q,. The proposed Q, unifies the Sarsa algorithm Rummery and Niranjan, 1994 and Q algorithm Harutyunyan, 2016. When varies from 0 to 1, Q, changes continuously from Sarsa 1 in Q, to Q 0 in Q,. We also focus on the trade-off between pure-expectation and full-sample in control task, our experiments show that an intermediate value achieves a better performance than either extreme case. Our contributions are summarised as follows: We define a mixed-sampling operator through which we derive the proposed Q, policy evaluation algorithm and control algorithm. The new algorithm Q, unifies Sarsa and Q. For Q, policy evaluation algorithm, we give its upper error bound. For the control problem, we prove that both of the off-line and on-line Q, algorithm converge to the optimal value function. 2 Framework and Notation The standard episodic reinforcement learning framework Sutton and Barto, 2017 is often formalized as Markov deci- 2984

sion processes MDPs. Such framework considers 5-tuples form M S, A, P, R, γ, where S indicates the set of all states, A indicates the set of all actions, P a is the element ss of P and it indicates a state-transition probability from state s to state s under taking action a, a A, s, s S; R a ss is the element of R and it indicates the expected reward for a transition, γ 0, 1 is the discount factor. A policy is a probability distribution on S A and stationary policy is a policy that does not change over time. In this paper, we denote {S t, A t, R t } t 0 as a trajectory of the state-reward sequence in one episode. state-action value q maps on S A to R, for a given policy, has a corresponding state-action value: q s, a E γ t R t S 0 s, A 0 a. Optimal state-action value is defined as: Bellman operator T : Bellman optimal operator T : q s, a max q s, a. T q R + γp q, 1 T q max R + γp q, 2 where P R S S, R R S A, and the corresponding entry is: P ss s, ap a ss, R s, a s, a P a ss Ra ss. a A s S Value function q and q satisfy the following Bellman equation and optimal Bellman equation correspondingly: T q q, T q q. Both T and T are γ-contraction operator with sup-norm, that is to say, T Q 1 T Q 2 γ Q 1 Q 2 for any Q 1, Q 2 R S A, where T T or T. Based on the fact that the fixed point of a contraction operator is unique, then value iteration converges: T n Q q, T n Q q, as n, for any initial Q. 2.1 One-step TD Learning Algorithms Unfortunately, both the system 1 and 2 can not be solved directly because of fact that the P and R in the environment are usually unknown or the dimension of S is huge in practice. A unavailable model in reinforcement learning is called model free. TD learning algorithm Sutton, 1984; Sutton, 1988 is one of the most significant algorithms in model free reinforcement learning, the idea of bootstrapping is critical to TD learning: the evluation of the value function are used as targets during the learning process. In reinforcement learning, target policy µ is the policy being learned about, and the policy µ used to generate trajectory {S t, A t, R t } t 0 is called the behavior policy. If µ, the learning is called on-policy learning, otherwise it is off-policy learning. Sarsa: For a given sample transition S, A, R, S, A, Sarsa Rummery and Niranjan, 1994 is a on-policy learning algorithm and it updates Q value as follows: Q k+1 S, A Q k S, A + α k δ S k, 3 δ S k R + γq k S, A Q k S, A, 4 where δ S k is the k-th TD error, α k is stepsize. Expected-Sarsa: Expected-Sarsa Van Seijen et al., 2009 uses expectation of all the next state-action value pairs according to the target policy to estimate Q value as follows: Q k+1 S, A Q k S, A + α k δ ES k, δ ES k R + γe Q k S, Q k S, A, 5 R + a A S, aq k S, a Q k S, A, where δk ES is the k-th expected TD error. Expected-Sarsa is a off-policy learning algorithm if µ, for example, when is greedy with respect to Q then Expected-Sarsa is restricted to Q-Learning Watkins, 1989. If the trajectory is generated by, Expected-Sarsa is a on-policy algorithm Van Seijen et al., 2009. The above two algorithms are guaranteed convergence under some conditions Singh et al., 2000; Van Seijen et al., 2009. Q: One-step Q Sutton and Barto, 2017; De Asis et al., 2018 is a weighted average between the Sarsa update and Expected Sarsa update through a sampling parameter : Q k+1 S, A Q k S, A + α k δ k, δk δk S + 1 δk ES, 6 where 0, 1 is degree of sampling. When 1, Q denotes a full-sampling, and 0, Q denotes a pureexpectation with no sampling. δt S and δt ES are defined in 4 and 5. 2.2 -Return Algorithm One-step TD learning algorithm can be generalized to multistep bootstrapping learning method. The -return algorithm Watkins, 1989 is a particular way to mix many multi-step TD learning algorithms through weighting n-step returns proportionally to n 1. -operator 1 T is a flexible way to express -return algorithm, for a given trajectory {S t, A t, R t } t 0 that is generated by policy, T qs, a { 1 n0 } n T n+1 q s, a 1 n E G n S 0 s, A 0 a n0 qs, a + γ n E δ n, n0 1 The notation is coincident with Bertsekas et al., 2012. 2985

where G n n γt R t + γ n QS n+1, A n+1 is n-step returns from initial state-action pair S 0, A 0, the term n0 1 n G n is called -returns, and δ n R n + γqs n+1, A n+1 QS n, A n. Based on the fact that q is fixed point of T, thus q remains the fixed point of T. When 0, T is equal to the usual Bellman operator T. When 1, the evaluation iteration Q k+1 T 1Q k becomes Monte Carlo method. It is well-known that trades off the bias of the bootstrapping with an approximate q, with the variance of sampling multi-step returns estimation Kearns and Singh, 2000. In practice, a high and intermediate value of could be typically better Singh and Dayan, 1998; Sutton, 1996. 3 Mixed-sampling Operator In this section, we present the mixed-sampling operator T,µ, which is one of our key contribution and is flexible to analysis our new algorithm later. By introducing a sampling parameter 0, 1, the mixed-sampling operator varies continuously from pure-expectation method to full-sampling method. In this section, we analysis the contraction of T,µ firstly. Then we introduce the -return vision of mixed-sampling operator T,µ. Finally, we give a upper error bound of the corresponding policy evaluation algorithm. 3.1 Contraction of Mixed-sampling Operator Definition 1. Mixed-sampling operator T,µ is a map on R S A to R S A, s S, a A, 0, 1 : T,µ : R S A R S A qs, a qs, a + E µ γ t δ, t where δ, t R t + γqs t+1, A t+1 QS t, A t +1 R t + γe QS t+1, QS t, A t E QS t+1, a A S t+1, aqs t+1, a. The parameter is also degree of sampling that is introduced by the Q algorithm De Asis et al., 2018. In one of extreme end 0, pure-expectation, T,µ 0 deduces the n-step returns G n in Q Harutyunyan, 2016, where G n t+n + γ n+1 E QS t+n+1,, δk ES is the k- kt γk t δk ES th expected TD error. Multi-step Sarsa Sutton and Barto, 2017 is in another extreme end 1, full-sampling. Every intermediate value creates a mixed method varies continuously from pure-expectation to full-sampling which is why we call T,µ mixed-sample operator. -Return Version We now define the -version of T,µ and denote it as T,µ : T,µ qs, a qs, a + E µ 7, γ t δ, t 8 where the is the parameter takes the from TD0 to Monte Carlo version as usual. When 0, T,µ 0, is restricted to T,µ Harutyunyan, 2016, when 1, T,µ 1, is restricted to -operator. The next theorem provides a basic property of T,µ. Theorem 1. The operator T,µ is a γ-contraction: for any q 1, q 2, T,µ q 1 T,µ q 2 γ q 1 q 2. Furthermore, for any initial Q 0, the sequence {Q} k0 is generated by the iteration then {Q k } k0 Q k+1 T,µ Q k, converges to the unique fixed point of T,µ. Proof. Unfolding the operator T,µ, we have T,µ q q + BT µ q q T µ q + 1 q + BT q q, 9 T,µ where B I γp µ 1. Based the fact that both T µ,µ Bertsekas et al., 2012 and T Harutyunyan, 2016; Munos et al., 2016 are γ-contraction operators, and T,µ is the convex combination of above operators, thus T,µ is a γ-contraction. 3.2 Upper Error Bound of Policy Evaluation In this section we discuss the ability of policy evaluation iteration Q k+1 T,µ Q k in Theorem 1. Our results show that when µ and are sufficiently close, the ability of the policy evaluation iteration increases gradually as the decreases from 1 to 0. Lemma 1. If a positive sequence {a k } k1 satisfies a k+1 αa k + β, then for any α < 1, we have a k β 1 α αk a 1 β 1 α. Furthermore, for any ɛ > 0, K, s.t, k > K has the following estimation a k β 1 α + ɛ. Theorem 2 Upper error bound of policy evaluation. Consider the policy evaluation algorithm Q k+1 T,µ Q k, if the behavior policy µ is ɛ-away from the target policy, in the sense that max s S s, a µs, a 1 ɛ, ɛ < 1 γ γ, and γ1 + 2 < 1, then K, s.t, k > K, the policy evaluation sequence{q k } k0 satisfies Q k+1 q M + γc ɛ 1 γ1 + 2 + 1, where for a given policy, M, C is determined by the learning system. q 2986

Proof. Firstly, we provide an equation which could be used later: q + BT µ q q q BI γp µ q q + T µ q q B T q + T µ q T µ q + T µ q + γp µ q q B R µ R + γp µ P q T q +T µ q + γp µ q q T µ q +T µ q + γp µ q q. 10 Rewrite the policy evaluation iteration: Q k+1 T µ Q k + 1 T,µ Q k. Note q is fixed point of T,µ Harutyunyan, 2016, then we merely consider next estimator: Lemma1 Q k+1 q Q k + BT µ Q k Q k q ɛm + γ q + 1 γ M + γc ɛ 1 γ1 + 2 + 1. γ1 + 1 γ Q k q The first equation is derived by replacing q in 10 with Q k. Since µ is ɛ-away from, the first inequality is determined the following fact: R s R µ s max { s, a µs, a A ara s } ɛ A max R a s ɛm s, a R R µ ɛm, where M s A max a R a s is determined by the reinforcement learning system and is independent of, µ. M max s S M s. For the given policy, q is a constant that is determined by learning system, we denote it C. Remark 1: The proof in Theorem 2 strictly dependent on the assumption that ɛ is smaller but never to be zero, where the ɛ is a bound of discrepancy between the behavior policy µ and target policy. That is to say, the ability of the prediction of policy evaluation iteration is dependent on the gap between µ and. A more profound discussion about this gap is related to -ɛ trade off Harutyunyan,2016 which is beyond the scope in this paper. 4 Q, Control Algorithm In this section, we present Q, 2 algorithm for control. We analyze the off-line version of Q, which converges to optimal value function exponentially fast. Considering the typical iteration Q k, k, where k is calculated by the following two steps: {µ k } k 0 is a sequence of corresponding behavior policies, 2 The work in Dumke, 2017 proposes a similar method, called Q, control algorithm. Our Q, is different from theirs due to the different version of eligibility trace updating. Step1: policy evaluation Q k+1 T k,µ k Q k, Step2: policy improvement T k+1 Q k+1 T Q k+1, that is k+1 is greedy policy with repect to Q k+1. We call the approach introduced by above step1 and step2 Q, control algorithm. In the following Theorem 3, we presents the convergence rate of Q, control algorithm. Theorem 3 Convergence of Q, Control Algorithm. Considering the sequence {Q k, k } k 0 generated by the Q, control algorithm, for the given, γ 0, 1, then Q k+1 q η Q k q, where η γ1+ 2 1 γ. Particularly, if < 1 γ 2γ, then 0 < η < 1 and sequence {Q k } k 1 converges to q exponentially fast: Q k+1 q Oη k+1. Proof. By the definition of T,µ T,µ, q T µ,µ q + 1 T q we have 3 : Q k+1 q T µ k Q k q + 1 T k,µ k Q k q γ1 + + 1 γ1 Q k q 1 γ 1 γ γ1 + 2 Q k q 1 γ η Algorithm1:On-line Q, algorithm Require:Initialize Q 0 s, a arbitrarily, s S, a A Require:Initialize µ k to be the behavior policy Parameters: step-size α t 0, 1 Repeat for each episode: Zs, a 0 s S, a A Q k+1 s, a Q k s, a s S, a A Initialize state-action pair S 0, A 0 For t 0, 1, 2, T k : Obersive a sample { R t, S t+1, A t+1 µ k δ, k t R t + γ 1 E k Q k+1 S t+1, } +Q k+1 S t+1, A t+1 Q k+1 S t, A t For s S, a A: Zs, a γzs, a+i{s t, A t s, a} Q k+1 s, a Q k+1 s, a + α k δ, k t Zs, a End For S t+1 S t, A t+1 A t If S t+1 is terminal: Break End For 3 The section inequality is based on the next two results: Munos et al., 2016 Theorem2 and Bertsekas et al., 2012 Proposition6.3.10. 2987

5 On-line Implementation of Q, We have discussed the contraction property of mixedsampling operator T,µ, and via it we have introduced the Q, control algorithm. Both of the iterations in Theorem 2 and Theorem 3 are the version of offline. In this section, we give the on-line version of Q, and discuss its convergence. 5.1 On-line Learning Off-line learning is too expensive due to the learning process must be carried out at the end of an episode, however, online learning updates value function with a lower computational cost, better performance. There is a simple interpretation of equivalence between off-line learning and on-line learning which means that, by the end of an episode, the total updates of the forward viewoff-line learning is equal to the total updates of the backward viewon-line learning Sutton and Barto, 1998. By the view of equivalence 4, on-line learning can be seen as an implementation of offline algorithm in an inexpensive manner. Another interpretation of online learning was provided by Singh and Sutton, 1996, TD learning with accumulate trace comes to approximate everyvisit Monte-Carlo method and TD learning with replace trace comes to approximate first-visit Monte-Carlo method. The iterations in Theorem 2 and Theorem 3 are the version of expectations. In practice, we can only access to the trajectory {S t, A t, R t } t 0. By statistical approaches, we can utilize the trajectory to estimate the value function. Algorithm 1 corresponds to online form of Q,. 5.2 On-line Learning Convergence Analysis We make some common assumptions which are similar to Bertsekas and Tsitsiklis, 1996; Harutyunyan, 2016. Assumption 1. t 0 P S t, A t s, a > 0, minimum visit frequency, which implies a complete exploration. Assumption 2. For every historical chain F t in a MDPs, P N t s, a k F t γρ k, where ρ is a positive constants, k is a positive integer and N t s, a denotes the times of the pair s, a is visited in the t-th trajectory F t. For the convenience of expression, we give some notations firstly. Let Q o k,t be the vector obtained after t iterations in the k-th trajectory, and the superscript o emphasizes online learning. We denote the k-th trajectory as {S t, A t, R t } t 0 sampled by the policy µ k. Then the online update rules can be expressed as follows: s, a S A : Q o k,0s, a Q o ks, a { δk,t o R t + γ 1 E k Q o k,ts t+1, } +Q o k,ts t+1, A t+1 Q o k,ts t, A t Q o k,t+1s, a Q o k,ts, a + α k s, azk,ts, o aδk,t o Q o k+1s, a Q o k,t k s, a, where T k is the length of the k-th trajectory. 4 The true online learning was firstly introduced by Seijen and Sutton, 2014, more details in Van Seijen et al., 2016. Theorem 4. Based on the Assumption 1 and Assumption 2, step-size α t satisfying, t α t, t α2 t <, k is greedy with respect to Q o k, then Qo k q as k, where is short for with probability one. Proof. After some simple algebra: Q o k+1s, a Q o ks, a + α k G o ks, a N ks, a EN k s, a Qo ks, a, G o ks, a 1 EN k s, a T k z o k,ts, aδ o k,t, where α k EN k s, aα k s, a. We rewrite the off-line update: Q f k+1 s, a Q f k s, a + α kg f k s, a N ks, a EN k s, a Qf k s, a, N k s,a G f k 1 Q EN k s, a k,ts, a, where Q k,t s, a is the -returns at time t when the pair s, a is visited in the k-th trajectory, the superscript f in Q f k+1 s, a emphasizes the forward off-line update. N k s, a denotes the times of the pair s, a visited in the k-th trajectory. We define Res k s, a as the residual between on-line estimate G o k and off-line estimate Gf k s, a in the k-th trajectory: Res k s, a Q o ks, a Q f k s, a. Set k s, a Q o k s, a q s, a which is the error between after k-episode the learned value function Q o k and optimal value function q, then we consider the next random iterative process: k+1 s, a 1 ˆα k s, a k s, a + ˆβ k F k s, a, 11 where ˆα k s, a N ks, aα k s, a, E µk N k s, a ˆβ k s, a α k s, a, F k s, a G o ks, a N ks, a E µk N k s, a q s, a. Step1:Upper bound on Res k s, a: E µk Res k s, a C k max Q o k+1s, a q, 12 max s,a where C k 0. Res k,t s, a 1 EN k s, a t m0 s,a zk,ms, o aδk,m o Q k,ms, a, 2988

where C is a consist and k,t kqok,t s, a q s, ak, αm max0ttk {αt s, a}. Based on the condition of step-size in the Theorem 4, αm 0, then we have 12. Step2: maxs,a Eµk Fk s, a γ maxs,a k k s, ak. In fact: γρt max Qfk s, a q. 0.15 0.10 0.00 Random walk,replace trace 0.40 0.35 0.30 0.25 0.20 0.15 0.0 0.2 0.4 0.6 0.8 1.0 0.10 0.05 0 20 40 60 Episodes 80 0.00 Mountain Car 0 20 40 60 80 Episodes 132 140 145 150 155 160 Q, Q 165 170 Mountain Car 130 135 0 50 150 200 250 300 350 134 136 138 140 0 1 Dynamic 142 144 40 60 Episode 80 120 Episode 140 160 180 200 Figure 2: The plot shows the the average returns per episode. A right-centered moving average with a window of 20 successive episodes was employed in order to smooth the results. The right plot shows the result of Q, comparing with Q. The left plot shows the result of Q, comparing with Q 0 and Sarsa 1. γ 0.99, step-size α 0.3. Eµk Qk,t s, a q P Nk s, a teµk Qk s, a q 0.20 130 From the property of eligibility tracemore details refer to Bertsekas et al., 2012 and Assumption 2, we have: 0.25 0.0 0.2 0.4 0.6 0.8 1.0 Reward per episode Eµk Fk s, a 0.30 Figure 1: Root-mean-squareRMS error of state values as a function of episodes in 19-state random walk, we consider both accumulating trace and replacing trace. The plot shows the prediction ability of Q, varying, when is fixed to 0.8,γ 1. Gfk s, a + Resk s, a Nk s, a q s, a, Eµk Nk s, a PNk s,a Eµk Qk,t s, a q Eµk Nk s, a +Resk s, a. 0.05 Returns Fk s, a Random walk,accumulate trace 0.35 RMS error kresk,t+1 s, ak αm C k,t + kresk,t s, ak, 0.40 RMS error where 0 t Tk. Resk,t s, a is the difference between the total on-line updates of first t steps and the first t times off-line update in k-th trajectory. By induction on t, we have: s,a Then according to 11, for some t > 0: Eµk Fk s, a t γρ + αt max k k s, a s,a γ max k k s, ak. s,a Step3: Qok q as k. Considering the iteration 11 and Theorem 1 in Jaakkola et al., 1994, then we have Qok q. 6 6.1 Experiments Experiment for Prediction Capability In this section, we test the prediction abilities of Q, in 19-state random walk environment De Asis et al., 2018. The agent at each state has two action : left and right, and taking each action with equal probability. We compare the rootmean-squarerms error as a function of episodes, varies dynamically from 0 to 1 with steps of 0.2. In this experiment, we set behavior policy µ0.5-d,0.5+d, D U 0.01,0.01, where U is uniform distribution. Results in Figure 1 show that the performance of Q, increases gradually as the decreases from 1 to 0, which just verifies the upper error bound in Theorem2. 6.2 Experiment for Control Capability We test the control capability of Q, in the classical episodic task, mountain car Sutton and Barto, 1998. Because the state space in this environment is continuous, we use tile coding function approximation Sutton and Barto, 2989 1998, and use the version 3 of Sutton s tile coding software n.d. with 8 tilings. In the right part of Figure 2, we collect the data by varing from 0 to 1 with steps of 0.02. Results show that Q, significantly converges faster than Q. In the left part of Figure 2, results show that the Q, with in an intermediate value can outperform Q and Sarsa. Table1 and Table2 summarize the average return after 50 and 200 episodes. In order to gain more insight into the nature of the results, we run from 0 to 1 with steps of 0.02, we take the statistical method according to De Asis et al., 2018, lower LB and upper UB 95% confidence interval bounds are provided to validate the results. Dynamic in the table mean that does not need to remain constant throughout every episode De Asis et al., 2018.In this experiment, is a function of time, a normal distribution, t N 0.5, 0.12. The average return after only 50 episodes could be interpreted as a measure of initial performance, whereas the average return after 200 episodes shows how well an algorithm is capable of learningde Asis et al., 2018. Results show that Q, with a intermediate value had the best final performance. Algorithm Q 0,,Q Q 1,,Sarsa Q 0.5, Dynamic Mean -193.56-196.84-195.99-195.01 UB -179.33-182.69-181.60-177.14 LB -197.06-200.42-199.62-195.01 Table 1: Average return per episode after 50 Episodes.

Algorithm Mean UB LB Q 0,,Q -144.04-138.49-146.44 Q 1,,Sarsa -145.72-140.04-148.21 Q 0.5, -143.71-137.92-146.12 Dynamic -142.62-137.24-145.09 Table 2: Average return per episode after 200 episodes. 7 Conclusion In this paper we presented a new method, called Q,, which unifies Sarsa and Q. We solved a upper error bound of Q, for the ability of policy evaluation. Furthermore, we discussed the convergence of Q, control algorithm to q under some conditions. The proposed approach was compared with one-step and multi-step TD learning methods and the results demonstrated its effectiveness. Acknowledgements This work was partly supported by National Key Research and Development Program of China 2017YFB2503, Natural Science Foundation of China No.61772460, and Zhejiang Provincial Natural Science Foundation of China LR15F020001. References Bertsekas and Tsitsiklis, 1996 Dimitri P. Bertsekas and John N. Tsitsiklis. Neuro Dynamic Programming. Athena scientific Belmont, MA, 1996. Bertsekas et al., 2012 Dimitri P Bertsekas, Dimitri P Bertsekas, Dimitri P Bertsekas, and Dimitri P Bertsekas. Dynamic programming and optimal control, volume 2. Athena scientific Belmont, MA, 2012. De Asis et al., 2018 Kristopher De Asis, J Fernando Hernandez-Garcia, G Zacharias Holland, and Richard S Sutton. Multi-step reinforcement learning: A unifying algorithm. AAAI, 2018. Dumke, 2017 Markus Dumke. Double q and q, : Unifying reinforcement learning control algorithms. arxiv preprint arxiv:1711.01569, 2017. Harutyunyan, 2016 Rémi Harutyunyan. Q with offpolicy corrections. In Algorithmic Learning Theory: 27th International Conference, ALT 2016, Bari, Italy, October 19-21, 2016, Proceedings, volume 9925, page 305. Springer, 2016. Jaakkola et al., 1994 Tommi Jaakkola, Michael I Jordan, and Satinder P Singh. Convergence of stochastic iterative dynamic programming algorithms. In Advances in neural information processing systems, pages 703 710, 1994. Kearns and Singh, 2000 Michael J Kearns and Satinder P Singh. Bias-variance error bounds for temporal difference updates. In COLT, pages 142 147, 2000. Munos et al., 2016 Rémi Munos, Tom Stepleton, Anna Harutyunyan, and Marc Bellemare. Safe and efficient offpolicy reinforcement learning. In Advances in Neural Information Processing Systems, pages 1054 1062, 2016. Rummery and Niranjan, 1994 Gavin A Rummery and Mahesan Niranjan. On-line Q-learning using connectionist systems, volume 37. University of Cambridge, Department of Engineering, 1994. Seijen and Sutton, 2014 Harm Seijen and Rich Sutton. True online td lambda. In International Conference on Machine Learning, pages 692 700, 2014. Singh and Dayan, 1998 Satinder Singh and Peter Dayan. Analytical mean squared error curves for temporal difference learning. Machine Learning, 321:5 40, 1998. Singh and Sutton, 1996 Satinder P Singh and Richard S Sutton. Reinforcement learning with replacing eligibility traces. Machine learning, 221-3:123 158, 1996. Singh et al., 2000 Satinder Singh, Tommi Jaakkola, Michael L Littman, and Csaba Szepesvári. Convergence results for single-step on-policy reinforcement-learning algorithms. Machine learning, 383:287 308, 2000. Sutton and Barto, 1998 Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, volume 1. MIT press Cambridge, 1998. Sutton and Barto, 2017 Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, volume 1. MIT press Cambridge, 2017. Sutton, 1984 Richard S Sutton. Temporal credit assignment in reinforcement learning. PhD thesis, University of Massachusetts, 1984. Sutton, 1988 Richard S Sutton. Learning to predict by the methods of temporal differences. Machine learning, 31:9 44, 1988. Sutton, 1996 Richard S Sutton. Generalization in reinforcement learning: Successful examples using sparse coarse coding. In Advances in neural information processing systems, pages 1038 1044, 1996. Van Seijen et al., 2009 Harm Van Seijen, Hado Van Hasselt, Shimon Whiteson, and Marco Wiering. A theoretical and empirical analysis of expected sarsa. In Adaptive Dynamic Programming and Reinforcement Learning, 2009. ADPRL 09. IEEE Symposium on, pages 177 184. IEEE, 2009. Van Seijen et al., 2016 Harm Van Seijen, A Rupam Mahmood, Patrick M Pilarski, Marlos C Machado, and Richard S Sutton. True online temporal-difference learning. Journal of Machine Learning Research, 17145:1 40, 2016. Watkins, 1989 Christopher John Cornish Hellaby Watkins. Learning from delayed rewards. PhD thesis, King s College, Cambridge, 1989. 2990