Original: Understanding and Mitigating the Limitations of Prioritized  Replay
Revised: Understanding and Mitigating the Limitations of Prioritized Experience Replay

Original: Abstract
Revised: Abstract

Original: Prioritized Experience Replay (ER) has been empirically shown to improve sample efficiency across many domains and attracted great attention; however, there is little theoretical understanding of why such prioritized sampling helps and its limitations.
Revised: Prioritized Experience Replay (ER) has been empirically shown to improve sample efﬁciency across many domains and attracted great attention; however, there is little theoretical understanding of why such prioritized sampling helps and its limitations.

Original: In this work, we take a deep look at the prioritized ER.
Revised: In this work, we take a deep look at the prioritized ER.

Original: In a supervised learning setting, we show the equivalence between the error-based prioritized sampling method for mean squared error and uniform sampling for cubic power loss.
Revised: In a supervised learning setting, we show the equivalence between the error-based prioritized sampling method for mean squared error and uniform sampling for cubic power loss.

Original: We then provide theoretical insight into why it improves convergence rate upon uniform sampling during early learning.
Revised: We then provide theoretical insight into why it improves convergence rate upon uniform sampling during early learning.

Original: Based on the insight, we further point out two limitations of the prioritized ER method: 1) outdated priorities and 2) insufficient coverage of the sample space.
Revised: Based on the insight, we further point out two limitations of the prioritized ER method: 1) outdated priorities and 2) insufﬁcient coverage of the sample space.

Original: To mitigate the limitations, we propose our model-based stochastic gradient
Revised: To mitigate the limitations, we propose our model-based stochastic gradient

Original: Langevin dynamics sampling method.
Revised: Langevin dynamics sampling method.

Original: We show that our method does provide states distributed close to an ideal prioritized sampling distribution estimated by the brute-force method, which does not suffer from the two limitations.
Revised: We show that our method does provide states distributed close to an ideal prioritized sampling distribution estimated by the brute-force method, which does not suffer from the two limitations.

Original: We conduct experiments on both discrete and continuous control problems to show our approach’s efficacy and examine the practical implication of our method in an autonomous driving application.
Revised: We conduct experiments on both discrete and continuous control problems to show our approach’s efﬁcacy and examine the practical implication of our method in an autonomous driving application.

Original:  INTRODUCTION
Revised:  INTRODUCTION

Original: Experience Replay (ER)
Revised: Experience Replay (ER)

Original: [Lin, 1992] has been a popular method for training large-scale modern Reinforcement
Revised: [Lin, 1992] has been a popular method for training large-scale modern Reinforcement

Original: Learning (RL) systems [Degris et al., 2012, Adam and Busoniu, 2012, Mnih et al., 2015a, Hessel et al., 2018, FrançoisLavet et al., 2018].
Revised: Learning (RL) systems [Degris et al., 2012, Adam and Buso- niu, 2012, Mnih et al., 2015a, Hessel et al., 2018, FrançoisLavet et al., 2018].

Original: In ER, visited experiences are stored in a buffer, and at each time step, a mini-batch of experiences is uniformly sampled to update the training parameters in the value or policy function.
Revised: In ER, visited experiences are stored in a buffer, and at each time step, a mini-batch of experiences is uniformly sampled to update the training parameters in the value or policy function.

Original: Such a method is empirically shown to effectively stabilize the training and improve the sample efficiency of deep RL algorithms.
Revised: Such a method is empirically shown to effectively stabilize the training and improve the sample efﬁciency of deep RL algorithms.

Original: Several follow-up works proposedifferent variants to improve upon it 
Revised: Several follow-up works propose to improve upon it by designing non-uniform sampling distributions or re-weighting mechanisms of experiences [Schaul et al., 2016, Andrychowicz et al., 2017,

Original: [Schaul et al., 2016, Andrychowicz et al., 2017, Oh et al., 2018, de Bruin et al., 2018, Horgan et al., 2018,Zha et al., 2019,
Revised: Oh et al., 2018, de Bruin et al., 2018, Horgan et al., 2018,

Original:  Novati and Koumoutsakos, 2019,  Sun et al., 2020].
Revised: Zha et al., 2019, Novati and Koumoutsakos, 2019, Kumar et al., 2020, Sun et al., 2020, Liu et al., 2021, Lee et al., 2021, Sinha et al., 2022].

Original: The most relevant one to our work is prioritized ER [Schaul et al., 2016], which attempts to improve the vanilla ER method by sampling those visited experiences proportional to their absolute Temporal Difference (TD) errors.
Revised: The most relevant one to our work is prioritized ER [Schaul et al., 2016], which attempts to improve the vanilla ER method by sampling those visited experiences proportional to their absolute Temporal Difference (TD) errors.

Original: Empirically, it can significantly improve sample efficiency upon vanilla ER on many domains [Schaul et al., 2016].
Revised: Empirically, it can signiﬁcantly improve sample efﬁciency upon vanilla ER on many domains.

Original: ER methods have a close connection to Model-Based RL (MBRL) methods [Kaelbling et al., 1996, Bertsekas, 2009,
Revised: ER methods have a close connection to Model-Based RL (MBRL) methods [Kaelbling et al., 1996, Bertsekas, 2009,

Original: Sutton and Barto, 2018].
Revised: Sutton and Barto, 2018].

Original: ER can be thought of as an instance of a classical model-based RL architecture—Dyna [Sutton, 1991], using a (limited) non-parametric model given by the buffer [van Seijen and Sutton, 2015, van Hasselt et al., 2019].
Revised: ER can be thought of as an instance of a classical model-based RL architecture—Dyna [Sutton, 1991], using a (limited) non-parametric model given by the buffer [van Seijen and Sutton, 2015, van Hasselt et al., 2019].

Original: A Dyna agent uses real experience to update its policy as well as its reward and dynamics model.
Revised: A Dyna agent uses real experience to update its policy as well as its reward and dynamics model.

Original: In-between taking actions, the agent can get hypothetical experiences from the model and use them just like the real experiences to further improve the policy.
Revised: In-between taking actions, the agent can get hypothetical experiences from the model and use them just like the real experiences to further improve the policy.

Original: The mechanism of generating those hypothetical experiences is termed as search-control .
Revised: The mechanism of generating those hypothetical experiences is termed as search-control .

Original: When defining the search-control as sampling experiences from a ER buffer, the Dyna agent reduces to an ER agent.
Revised: When deﬁning the search-control as sampling experiences from a ER buffer, the Dyna agent reduces to an ER agent.

Original: Existing works show that smart search-control strategies can further improve sample efficiency of a Dyna agent [Sutton et al., 2008, Gu et al., 2016, Goyal et al., 2019, Holland et al., 2018, Pan et al., 2018, Corneil et al., 2018, Janner et al., 2019, Chelu et al., 2020].
Revised: Existing works show that smart search-control strategies can further improve sample efﬁciency of a Dyna agent [Sutton et al., 2008, Gu et al., 2016, Goyal et al., 2019, Holland et al., 2018, Pan et al., 2018, Corneil et al., 2018, Janner et al., 2019, Chelu et al., 2020].

Original: Particularly, prioritized sweeping [Moore and Atkeson,1993] is among the earliest work that improves upon vanilla Dyna.
Revised: Particularly, prioritized sweeping [Moore and Atkeson, among the earliest work that improves upon vanilla Dyna.

Original: The idea behind prioritized sweeping is quite intuitive: we should give high priority to states whose absolute TD errors are large because they are likely to cause the most change in value estimates.
Revised: The idea behind prioritized sweeping is quite intuitive: we should give high priority to states whose absolute TD errors are large because they are likely to cause the most change in value estimates.

Original: Hence, the prioritized ER by Schaul et al.
Revised: Hence, the prioritized ER by Schaul et al.

Original: [2016], which applies TD error-based prioritized sampling to ER, is a natural idea in a model-free RL setting.
Revised: [2016], which applies TD error-based prioritized sampling to ER, is a natural idea in a model-free RL setting.

Original: However, there is little rigorous understanding towards prioritized ER method about why it can help and its limitations.
Revised: However, there is little rigorous understanding towards prioritized ER method about why it can help and its limitations.

Original: This work provides a theoretical insight into the prioritized
Revised: This work provides a theoretical insight into the prioritized

Original: ER’s advantage and points out its two drawbacks: outdated priorities and insufficient sample space coverage, which may significantly weaken its efficacy.
Revised: ER’s advantage and points out its two drawbacks: outdated priorities and insufﬁcient sample space coverage, which may signiﬁcantly weaken its efﬁcacy.

Original: To mitigate the two issues, we propose to use the Stochastic Gradient Langevin Dynamics (SGLD) sampling method to acquire states.
Revised: To mitigate the two issues, we propose to use the Stochastic Gradient Langevin Dynamics (SGLD) sampling method to acquire states.

Original: Our method relies on applying an environment model to 1) simulate priorities of states and 2) acquire hypothetical experiences.
Revised: Our method relies on applying an environment model to 1) simulate priorities of states and 2) acquire hypothetical experiences.

Original: Then these experiences are used for further improving the policy.
Revised: Then these experiences are used for further improving the policy.

Original: We demonstrate that the hypothetical experiences generated by our method are distributed closer to the TD error-based sampling distribution, which does not suffer from the two drawbacks.
Revised: We demonstrate that the hypothetical experiences generated by our method are distributed closer to the TD error-based sampling distribution, which does not suffer from the two drawbacks.

Original: Finally, we demonstrate the utility of our approach on various benchmark discrete and continuous control domains and an autonomous driving application.
Revised: Finally, we demonstrate the utility of our approach on various benchmark discrete and continuous control domains and an autonomous driving application.

Original:  BACKGROUND
Revised:  BACKGROUND

Original: In this section, we firstly review basic concepts in RL.
Revised: In this section, we ﬁrstly review basic concepts in RL.

Original: Then we briefly introduce the prioritized ER method, which will be examined in-depth in the next section.
Revised: Then we brieﬂy introduce the prioritized ER method, which will be examined in-depth in the next section.

Original: We conclude this section by discussing a classic MBRL architecture called
Revised: We conclude this section by discussing a classic MBRL architecture called

Original: Dyna [Sutton, 1991] and its recent variants, which are most relevant to our work.
Revised: Dyna [Sutton, 1991] and its recent variants, which are most relevant to our work.

Original: Basic notations.
Revised: Basic notations.

Original: We consider a discounted Markov Decision Process (MDP) framework [Szepesvári, 2010].
Revised: We consider a discounted Markov Decision Process (MDP) framework [Szepesvári, 2010].

Original: A
Revised: A

Original: MDP can be denoted as a tuple ( S , A , P , R, γ ) including state space S , action space A , probability transition kernel P , reward function R , and discount rate γ ∈ [0 , 1] .
Revised: MDP can be denoted as a tuple ( S , A , P , R,  ) including state space S , action space A , probability transition kernel P , reward function R , and discount rate  2 [0 , 1] .

Original: At each environment time step t , an RL agent observes a state s t ∈ S , takes an action a t ∈ A , and moves to the next state s t +1 ∼ P ( ·| s t , a t ) , and receives a scalar reward signal r t +1 =
Revised: At each environment time step t , an RL agent observes a state s t 2 S , takes an action a t 2 A , and moves to the next state s t +1 ⇠ P ( ·| s t , a t ) , and receives a scalar reward signal r t +1 =

Original: R ( s t , a t , s t +1 ) .
Revised: R ( s t , a t , s t +1 ) .

Original: A policy is a mapping π : S × A → [0 , 1] that determines the probability of choosing an action at a given state.
Revised: A policy is a mapping ⇡ : S ⇥ A ! [0 , 1] that determines the probability of choosing an action at a given state.

Original: A popular algorithm to find an optimal policy is Qlearning [Watkins and Dayan, 1992].
Revised: A popular algorithm to ﬁnd an optimal policy is Qlearning [Watkins and Dayan, 1992].

Original: With function approximation, parameterized action-values Q θ are updated using θ = θ + αδ t ∇ θ Q θ ( s t , a t ) for stepsize α > 0 with TD-error δ t def = r t +1 + γ max a ′ ∈A Q θ ( s t +1 , a ′ )
Revised: With function approximation, parameterized action-values Q ✓ are updated using ✓ = ✓ + ↵ t r ✓ Q ✓ ( s t , a t ) for stepsize ↵ > 0 with TD-error  t def = r t +1 +  max a 0 2 A Q ✓ ( s t +1 , a 0 )

Original: − Q θ ( s t , a t ) .
Revised:  Q ✓ ( s t , a t ) .

Original: The policy is defined by acting greedily w.r.t.
Revised: The policy is deﬁned by acting greedily w.r.t.

Original: these action-values.
Revised: these action-values.

Original: ER methods.
Revised: ER methods.

Original: ER is critical when using neural networks to estimate Q θ , as used in DQN [Mnih et al., 2015b], both to stabilize and speed up learning.
Revised: ER is critical when using neural networks to estimate Q ✓ , as used in DQN [Mnih et al., 2015b], both to stabilize and speed up learning.

Original: ER method uniformly samples a mini-batch of experiences from those visited ones in the form of ( s t , a t , s t +1 , r t +1 ) to update neural network parameters.
Revised: ER method uniformly samples a mini-batch of experiences from those visited ones in the form of ( s t , a t , s t +1 , r t +1 ) to update neural network parameters.

Original: Prioritized ER
Revised: Prioritized ER

Original: [Schaul et al., 2016] improves upon it by prioritized sampling experiences, where the probability of sampling a certain experience is proportional to its TD error magnitude, i.e., p ( s t , a t , s t +1 , r t +1 ) 
Revised: [Schaul et al., 2016] improves upon it by prioritized sampling experiences, where the probability of sampling a certain experience is proportional to its TD error magnitude, i.e., p ( s t , a t , s t +1 , r t +1 ) /

Original: ∝ | δ t | .
Revised: |  t | .

Original: However, the underlying theoretical mechanism behind this method is still not well understood.
Revised: However, the underlying theoretical mechanism behind this method is still not well understood.

Original: MBRL and Dyna.
Revised: MBRL and Dyna.

Original: With a model, an agent has more flexibility to sample hypothetical experiences.
Revised: With a model, an agent has more ﬂexibility to sample hypothetical experiences.

Original: We consider a one-step model which maps a state-action pair to its possible next state and reward: P : S ×A (cid:55)→ S × R .
Revised: We consider a one-step model which takes a state-action pair as input and provides a distribution over the next state and reward.

Original: We build on the Dyna formalism [Sutton, 1991] for MBRL, and more specifically, the recently proposed HC-Dyna [Pan et al., 2019] as shown in Algorithm 1.
Revised: We build on the Dyna formalism [Sutton, 1991] for MBRL, and more speciﬁcally, the recently proposed HC-Dyna [Pan et al., 2019] as shown in Algorithm 1.

Original: HC-Dyna provides some smart approach to Search-Control (SC)—the mechanism of generating states or state-action pairs from which to query the model to get the next states and rewards.
Revised: HC-Dyna provides some smart approach to Search-Control (SC)—the mechanism of generating states or state-action pairs from which to query the model to get the next states and rewards.

Original: Mathematically, designing search-control can be thought of as designing a sampling distribution.
Revised: Mathematically, designing search-control can be thought of as designing a sampling distribution.

Original: HC-Dyna proposes to employ stochastic gradient Langevin dynamics (SGLD) for sampling states, which relies on some criterion function h ( · ) .
Revised: HC-Dyna proposes to employ stochastic gradient Langevin dynamics (SGLD) for sampling states, which relies on some criterion function h ( · ) .

Original: The naming “Hill Climbing (HC)” is used for short as the SGLD sampling process can be thought of as doing some modified gradient ascent [Pan et al., 2019, 2020].
Revised: The term “Hill Climbing (HC)” is used for generality as the SGLD sampling process can be thought of as doing some modiﬁed gradient ascent [Pan et al., 2019, 2020].

Original: The algorithmic framework maintains two buffers: the conventional ER buffer storing experiences (i.e., an experience/transition has the form of ( s t , a t , s t +1 , r t +1 ) ) and a search-control queue storing the states acquired by searchcontrol mechanisms (i.e., SLGD sampling).
Revised: The algorithmic framework maintains two buffers: the conventional ER buffer storing experiences (i.e., an experience/transition has the form of ( s t , a t , s t +1 , r t +1 ) ) and a search-control queue storing the states acquired by searchcontrol mechanisms (i.e., SLGD sampling).

Original: At each time step t , a real experience ( s t , a t , s t +1 , r t +1 ) is collected and stored into ER buffer.
Revised: At each time step t , a real experience ( s t , a t , s t +1 , r t +1 ) is collected and stored into ER buffer.

Original: Then the HC search-control process starts to collect states and store them into the search-control queue.
Revised: Then the HC search-control process starts to collect states and store them into the search-control queue.

Original: A hypothetical experience is obtained by first selecting a state s from the search-control queue, then selecting an action a according to the current policy, and then querying the model to get the next state s ′ and reward r to form an experience ( s, a, s ′ , r ) .
Revised: A hypothetical experience is obtained by ﬁrst selecting a state s from the search-control queue, then selecting an action a according to the current policy, and then querying the model to get the next state s 0 and reward r to form an experience ( s, a, s 0 , r ) .

Original: These hypothetical transitions are combined with real experiences into a single mini-batch to update the training parameters.
Revised: These hypothetical transitions are combined with real experiences into a single mini-batch to update the training parameters.

Original: The n updates, performed before taking the next action, are called planning updates [Sutton and Barto, 2018], as they improve the value/policy by using a model.
Revised: The n updates, performed before taking the next action, are called planning updates [Sutton and Barto, 2018], as they improve the value/policy by using a model.

Original: The choice of pairing states with on-policy actions to form hypothetical experiences has been reported to be beneficial
Revised: The choice of pairing states with on-policy actions to form hypothetical experiences has been reported to be beneﬁcial

Original: [Gu et al., 2016, Pan et al., 2018, Janner et al., 2019].
Revised: [Gu et al., 2016, Pan et al., 2018, Janner et al., 2019].

Original: Two instances have been proposed for h ( · ) : the value function v ( s )
Revised: Two instances have been proposed for h ( · ) : the value function v ( s )

Original: [Pan et al., 2019] and the gradient magnitude ||∇ s v ( s ) ||
Revised: [Pan et al., 2019] and the gradient magnitude || r s v ( s ) ||

Original: [Pan et al., 2020].
Revised: [Pan et al., 2020].

Original: The former is used as a measure of the utility of a state: doing HC on the learned value function should find high-value states without being constrained by the physical environment dynamics.The latter is considered as a measure of the value approximation difficulty, then doing HC provides additional states whose values are difficult to learn.
Revised: The former is used as a measure of the utility of a state: doing HC on the learned value function should ﬁnd high-value states without being constrained by the physical environment dynamics.

Original: The two suffer from several issues as we discuss in the Appendix A.1.
Revised: The latter

Original: This paper will introduce a HC search-control method motivated by overcoming the limitations of the prioritized ER. Input: Hill Climbing (HC) criterion function h : S (cid:55)→ R , batch-size b ; Initialize empty search-control queue B sc ; empty ER buffer B er ; initialize policy and model P ; HC stepsize α h ; mini-batch size b ; environment P ; mixing rate ρ decides the proportion of hypothetical experiences in a mini-batch.
Revised: Input: Hill Climbing (HC) criterion function h : S 7! R , batch-size b ; Initialize empty search-control queue B sc ; empty ER buffer B er ; initialize policy and model P ; HC stepsize ↵ h ; mini-batch size b ; environment P ; mixing rate ⇢ decides the proportion of hypothetical experiences in a mini-batch.

Original: for t = 1 , 2 , . . .
Revised: for t = 1 , 2 , . . .

Original: do
Revised: do

Original: Add ( s t , a t , s t +1 , r t +1 ) to B er while within some budget time steps do // SGLD sampling for states s← s + α h ∇ s h ( s ) + Gaussian noise // Searchcontrol, see Section 4 for details about SGLD
Revised: Add ( s t , a t , s t +1 , r t +1 ) to B er while within some budget time steps do // SGLD sampling for states s s + ↵ h r s h ( s ) + Gaussian noise // Searchcontrol, see Section 4 for details about SGLD

Original: samplingAdd s into B sc // n planning updates/steps for n times do
Revised: samplingAdd s into B sc // n planning updates/steps for n times do

Original: B ← ∅ // initialize an empty mini-batch B for bρ times do
Revised: B ; // initialize an empty mini-batch B for b ⇢ times do

Original: Sample s ∼ B sc , on-policy actiona
Revised: Sample s ⇠ B sc , on-policy action

Original:  Sample s ′ , r ∼ P ( s, a )
Revised: a Sample s 0 , r ⇠ P ( s, a )

Original: B← ( s, a, s ′ , r )
Revised: B ( s, a, s 0 , r )

Original: Sample b (1 − ρ ) experiences from B er , add to B // NOTE: if we only uniformly sample b experiences from B er and use them as B , the algorithm reduces to ER
Revised: Sample b (1  ⇢ ) experiences from B er , add to B // NOTE: if we only uniformly sample b experiences from B er and use them as B , the algorithm reduces to ER

Original: Update policy/value on mixed mini-batch B 
Revised: Update policy/value on mixed mini-batch B is considered as a measure of the value approximation difﬁculty, then doing HC provides additional states whose values are difﬁcult to learn. The two suffer from several issues as we discuss in the Appendix A.1. This paper will introduce a HC search-control method motivated by overcoming the limitations of the prioritized ER.

Original:  A DEEPER LOOK AT ERROR-BASED PRIORITIZED SAMPLING
Revised:  A DEEPER LOOK AT ERROR-BASED PRIORITIZED SAMPLING

Original: In this section, we provide theoretical motivation for errorbased prioritized sampling by showing its equivalence to optimizing a cubic power objective with uniform sampling in a supervised learning setting.
Revised: In this section, we provide theoretical motivation for errorbased prioritized sampling by showing its equivalence to optimizing a cubic power objective with uniform sampling in a supervised learning setting.

Original: We prove that optimizing the cubic objective provides a faster convergence rate during early learning.
Revised: We prove that optimizing the cubic objective provides a faster convergence rate during early learning.

Original: Based on the insight, we discuss two limitations of the prioritized ER: 1) outdated priorities and 2) insufficient coverage of the sample space.
Revised: Based on the insight, we discuss two limitations of the prioritized ER: 1) outdated priorities and 2) insufﬁcient coverage of the sample space.

Original: We then empirically study thesuch limitations.
Revised: We then empirically study the limitations.

Original: 3.1 THEORETICAL INSIGHT INTO ERROR-BASED PRIORITIZED SAMPLING
Revised: 3.1 THEORETICAL INSIGHT INTO ERROR-BASED PRIORITIZED SAMPLING

Original: In the l 2 regression, we minimize the mean squared error min θ 1 2 n[-(cid:80) ni =
-]
Revised: In the l 2 regression, we minimize the mean squared error min ✓ 12 n[-(cid:80) ni =
-]

Original:  ( f θ ( x i ) − y i ) 2 , for training set T = { ( x i , y i ) } ni =1 and function approximator f θ , such as a neural network.
Revised: P ni =1 ( f ✓ ( x i )  y i ) 2 , for training set T = { ( x i , y i ) } ni =1 and function approximator f ✓ , such as a neural network.

Original: In error-based prioritized sampling, we define the priority of a sample ( x, y ) ∈ T as | f θ ( x ) − y | ; the probability of drawing a sample ( x, y ) ∈ T is typically q ( x, y ; θ ) ∝ | f θ ( x ) − y | .
Revised: In error-based prioritized sampling, we deﬁne the priority of a sample ( x, y ) 2 T as | f ✓ ( x )  y | ; the probability of drawing a sample ( x, y ) 2 T is typically q ( x, y ; ✓ ) / | f ✓ ( x )  y | .

Original: We employ the following form to compute the probability of a point ( x, y ) ∈ T :
Revised: We employ the following form to compute the probability of a point ( x, y ) 2 T :

Original: [Equation]
Revised: [Equation]

Original: We can show an equivalence between the gradients of the squared objective with this prioritization and the cubic power objective 13 n(cid:80) ni
Revised: We can show an equivalence between the gradients of the squared objective with this prioritization and the cubic power objective 13 n

Original: =1 | f θ ( x i ) − y
Revised: [Equation]

Original: i | 3 in the Theorembelow.
Revised: in the Theorembelow.

Original: See Appendix A.3 for the proof.
Revised: See Appendix A.3 for the proof.

Original: Theorem 1.
Revised: Theorem 1.

Original: For a constant c determined by θ, T , we have
Revised: For a constant c determined by ✓ , T , we have

Original: [Equation]
Revised: [Equation]

Original: We empirically verify this equivalence in the Appendix A.7.
Revised: We empirically verify this equivalence in the Appendix A.7.

Original: This simple theorem provides an intuitive reason for why prioritized sampling can help improve sample efficiency: the gradient direction of the cubic function is sharper than that of the square function when the error is relatively large (Figure 8).
Revised: This simple theorem provides an intuitive reason for why prioritized sampling can help improve sample efﬁciency: the gradient direction of the cubic function is sharper than that of the square function when the error is relatively large (Figure 8).

Original: We refer readers to the work by Fujimoto et al.
Revised: We refer readers to the work by Fujimoto et al.

Original: [2020] regarding more discussions about the equivalence between prioritized sampling and of uniform sampling.
Revised: [2020] regarding more discussions about the equivalence between prioritized sampling and of uniform sampling.

Original: Our below Theorem 2 further proves that optimizing the cubic power objective by gradient descent has faster convergence rate than the squared objective, and this provides a solid motivation for using error-based prioritized sampling.
Revised: Our below Theorem 2 further proves that optimizing the cubic power objective by gradient descent has faster convergence rate than the squared objective, and this provides a solid motivation for using error-based prioritized sampling.

Original: See
Revised: See

Original: Appendix A.4 for the proof of the below theorem and its empirical simulations.
Revised: Appendix A.4 for the proof of the below theorem and its empirical simulations.

Original: Theorem 2 (Fast early learning, concise version) .
Revised: Theorem 2 (Fast early learning, concise version) .

Original: Let n be a positive integer (i.e., the number of training samples).
Revised: Let n be a positive integer (i.e., the number of training samples).

Original: Let x t , ˜ x t ∈ R n be the target estimates of all samples at time t, t ≥ 0 .
Revised: Let x t , ˜ x t 2 R n be the target estimates of all samples at time t, t  0 .

Original: Let x t ( i )( i ∈ [ n ] , [ n ] def = { 1 , 2 , ..., n } ) denote the i th element in the vector.
Revised: Let x t ( i )( i 2 [ n ] , [ n ] def = { 1 , 2 , ..., n } ) denote the i th element in the vector.

Original: We define the objectives:
Revised: We deﬁne the objectives:

Original: [Equation]
Revised: [Equation]

Original: The total absolute prediction errors:
Revised: The total absolute prediction errors:

Original: [Equation]
Revised: [Equation]

Original: where y ( i ) ∈ R is the training target for the i th training sample.
Revised: where y ( i ) 2 R is the training target for the i th training sample.

Original: Let { x t } t ≥ 0 and { ˜ x t } t ≥ 0 be generated by using ℓ 2 , ℓ 3 objectives respectively.
Revised: Let { x t } t  0 and { ˜ x t } t  0 be generated by using ` 2 , ` 3 objectives respectively.

Original: That is, ∀ i ∈ [ n ] ,
Revised: That is, 8 i 2 [ n ] ,

Original: [Equation]
Revised: [Equation]

Original: Given any 0 < ϵ ≤ δ 0 = (cid:80) ni =1 δ 0 ( i ) , define the following hitting time,
Revised: Given any 0 < ✏   0 = P ni =1  0 ( i ) , deﬁne the following hitting time,

Original: [Equation]
Revised: [Equation]

Original: Assume the same initialization x 0 = ˜ x 0 .
Revised: Assume the same initialization x 0 = ˜ x 0 .

Original: We have the following conclusion .
Revised: We have the following conclusion .

Original: If there exists δ 0 ∈ R and 0 < ϵ ≤ δ 0 such that
Revised: If there exists  0 2 R and 0 < ✏   0 such that

Original: [Equation]
Revised: [Equation]

Original: then we have t ϵ ≥ ˜ t ϵ , which means gradient descent using the cubic loss function will achieve the total absolute error threshold ϵ faster than using the squared objective function.
Revised: then we have t ✏  ˜ t ✏ , which means gradient descent using the cubic loss function will achieve the total absolute error threshold ✏ faster than using the squared objective function.

Original: This theorem illustrates that when the total loss of all training examples is greater than some threshold, cubic power learns faster.
Revised: This theorem illustrates that when the total loss of all training examples is greater than some threshold, cubic power learns faster.

Original: For example, let the number of samples n = 1000 , and each sample has initial loss δ 0 ( i ) = 2 .
Revised: For example, let the number of samples n = 1000 , and each sample has initial loss  0 ( i ) = 2 .

Original: Then δ 0 = 2000 .
Revised: Then  0 = 2000 .

Original: Setting ϵ = 570 (i.e., ϵ ( i ) ≈ 0 . 57 ) satisfies the inequality (2).
Revised: Setting ✏ = 570 (i.e., ✏ ( i ) ⇡ 0 . 57 ) satisﬁes the inequality (2).

Original: This implies using the cubic objective is faster when reducing the total loss from 2000 to 570 .
Revised: This implies using the cubic objective is faster when reducing the total loss from 2000 to 570 .

Original: Though it is not our focus here to investigate the practical utility of the high power objectives, we include some empirical results and discuss the practical utilities of such objectives in Appendix A.6.
Revised: Though it is not our focus here to investigate the practical utility of the high power objectives, we include some empirical results and discuss the practical utilities of such objectives in Appendix A.6.

Original: Note that, although the original PER raises the importance ratio to a certain power, which is annealing from 1 at the beginning to 

Revised: Note that, although the original PER raises the importance ratio to a certain power, which is annealing from 1 at the beginning to

Original: [Schaul et al., 2016]; our theorem still explains the improvement of sample efficiency during the early learning stage.
Revised: [Schaul et al., 2016]; our theorem still explains the improvement of sample efﬁciency during the early learning stage.

Original: It is because, the power is close to one and hence it is equivalent to using a higher power loss.
Revised: It is because, the power is close to one and hence it is equivalent to using a higher power loss.

Original: This point has also been confirmed by a concurrent work [Fujimoto et al., 2020, Sec 5.1, Theorem 3].
Revised: This point has also been conﬁrmed by a concurrent work [Fujimoto et al., 2020, Sec 5.1, Theorem 3].

Original: 3.2 LIMITATIONS OF THE PRIORITIZED ER
Revised: 3.2 LIMITATIONS OF THE PRIORITIZED ER

Original: Inspired by the above theorems, we now discuss two drawbacks of prioritized sampling: outdated priorities and insufficient sample space coverage .
Revised: Inspired by the above theorems, we now discuss two drawbacks of prioritized sampling: outdated priorities and insufﬁcient sample space coverage .

Original: Then we empirically examine their importance and effects in the next section.
Revised: Then we empirically examine their importance and effects in the next section.

Original: The above two theorems show that the advantage of prioritized sampling comes from the faster convergence rate of cubic power objective during early learning.
Revised: The above two theorems show that the advantage of prioritized sampling comes from the faster convergence rate of cubic power objective during early learning.

Original: By Theorem 1, such advantage requires to update the priorities of all training samples by using the updated training parameters θ at each time step.
Revised: By Theorem 1, such advantage requires to update the priorities of all training samples by using the updated training parameters ✓ at each time step.

Original: In RL, however, at the each time step t , the original prioritized ER method only updates the priorities of those experiences from the sampled mini-batch, leaving the priorities of the rest of experiences unchanged [Schaul et al., 2016].
Revised: In RL, however, at the each time step t , the original prioritized ER method only updates the priorities of those experiences from the sampled mini-batch, leaving the priorities of the rest of experiences unchanged [Schaul et al., 2016].

Original: We call this limitation outdated priorities .
Revised: We call this limitation outdated priorities .

Original: It is typically infeasible to update the priorities of all experiences at each time step.
Revised: It is typically infeasible to update the priorities of all experiences at each time step.

Original: In fact, in RL, “ all training samples ” in RL are restricted to those visited experiences in the ER buffer, which may only contain a small subset of the whole state space, making the estimate of the prioritized sampling distribution inaccurate.
Revised: In fact, in RL, “ all training samples ” in RL are restricted to those visited experiences in the ER buffer, which may only contain a small subset of the whole state space, making the estimate of the prioritized sampling distribution inaccurate.

Original: There can be many reasons for the small coverage: the exploration is difficult, the state space is huge, or the memory resource of the buffer is quite limited, etc.
Revised: There can be many reasons for the small coverage: the exploration is difﬁcult, the state space is huge, or the memory resource of the buffer is quite limited, etc.

Original: We call this issue insufficient sample space coverage , which is also noted by Fedus et al.
Revised: We call this issue insufﬁcient sample space coverage , which is also noted by Fedus et al.

Original: Note that insufficient sample space coverage should not be considered equivalent to off-policy distribution issue.
Revised: Note that insufﬁcient sample space coverage should not be considered equivalent to off-policy distribution issue.

Original: The latter refers to some old experiences in the ER buffer may be unlikely to appear under the current policy [Novati and
Revised: The latter refers to some old experiences in the ER buffer may be unlikely to appear under the current policy [Novati and

Original: Koumoutsakos, 2019, Zha et al., 2019, Sun et al., 2020, Oh et al., 2021].
Revised: Koumoutsakos, 2019, Zha et al., 2019, Sun et al., 2020, Oh et al., 2021].

Original: In contrast, the issue of insufficient sample space coverage can raise naturally.
Revised: In contrast, the issue of insufﬁcient sample space coverage can raise naturally.

Original: For example, the state space is large and an agent is only able to visit a small subset of the state space during early learning stage.
Revised: For example, the state space is large and an agent is only able to visit a small subset of the state space during early learning stage.

Original: We visualize the state space coverage issue on a RL domain in Section 4.
Revised: We visualize the state space coverage issue on a RL domain in Section 4.

Original: 3.3 NEGATIVE EFFECTS OF THE LIMITATIONS
Revised: 3.3 NEGATIVE EFFECTS OF THE LIMITATIONS

Original: In this section, we empirically show that the outdated priorities and insufficient sample space coverage significantly blur the advantage of the prioritized sampling method.
Revised: In this section, we empirically show that the outdated priorities and insufﬁcient sample space coverage signiﬁcantly blur the advantage of the prioritized sampling method.

Original: Experiment setup .
Revised: Experiment setup .

Original: We conduct experiments on a supervised learning task.
Revised: We conduct experiments on a supervised learning task.

Original: We generate a training set T by uniformly sampling x ∈ [ − 2 , 2] and adding zero-mean Gaussian noise with standard deviation σ = 0 .
Revised: We generate a training set T by uniformly sampling x 2 [  2 , 2] and adding zero-mean Gaussian noise with standard deviation  = 0 .

Original: 5 to the target f sin ( x ) values.
Revised: 5 to the target f sin ( x ) values.

Original: Define f sin ( x ) def = sin(8 πx ) if x ∈ [ − 2 , 0) and f sin ( x ) = sin( πx ) if x ∈ [0 , 2] .
Revised: Deﬁne f sin ( x ) def = sin(8 ⇡ x ) if x 2 [  2 , 0) and f sin ( x ) = sin( ⇡ x ) if x 2 [0 , 2] .

Original: The testing set contains 1 k samples where the targets are not noise-contaminated.
Revised: The testing set contains 1 k samples where the targets are not noise-contaminated.

Original: Previous work Pan et al. [2020] show that the high frequency region [ − 2 , 0] usually takes long time to learn.
Revised: Previous work [Pan et al., 2020] shows that the high frequency region [  2 , 0] usually takes long time to learn.

Original: Hence we expect error-based prioritized sampling to make a clear difference in terms of sample efficiency on this dataset.
Revised: Hence we expect error-based prioritized sampling to make a clear difference in terms of sample efﬁciency on this dataset.

Original: We use 32 × 32 tanh layers neural network for all algorithms.
Revised: We use 32 ⇥ 32 tanh layers neural network for all algorithms.

Original: We refer to Appendix A.8 for missing details and A.7 for additional experiments.
Revised: We refer to Appendix A.8 for missing details and A.7 for additional experiments.

Original: Naming of algorithms .
Revised: Naming of algorithms .

Original: L2 : the l 2 regression with uniformly sampling from T .
Revised: L2 : the l 2 regression with uniformly sampling from T .

Original: Full-PrioritizedL2 : the l 2 regression with prioritized sampling according to the distribution defined in (1), the priorities of all samples in the training set are updated after each mini-batch update.
Revised: Full-PrioritizedL2 : the l 2 regression with prioritized sampling according to the distribution deﬁned in (1), the priorities of all samples in the training set are updated after each mini-batch update.

Original: PrioritizedL2 : the only difference with Full-PrioritizedL2 is that only the priorities of those training examples sampled in the minibatch are updated at each iteration, the rest of the training samples use the original priorities.
Revised: PrioritizedL2 : the only difference with Full-PrioritizedL2 is that only the priorities of those training examples sampled in the minibatch are updated at each iteration, the rest of the training samples use the original priorities.

Original: This resembles the approach taken by the prioritized ER in RL [Schaul et al.,2016].
Revised: This resembles the approach taken by the prioritized ER in RL [Schaul et al.,

Original: We show the learning curves in Figure 1.
Revised: We show the learning curves in Figure 1.

Original: Outdated priorities.
Revised: Outdated priorities.

Original: Figure 1 (a) shows that PrioritizedL without updating all priorities can be significantly worse than Full-PrioritizedL2.
Revised: Figure 1 (a) shows that PrioritizedL without updating all priorities can be signiﬁcantly worse than Full-PrioritizedL2.

Original: Correspondingly, we further ver- ify this phenomenon on the classical Mountain Car domain [Brockman et al., 2016].
Revised: Correspondingly, we further verify this phenomenon on the classical Mountain Car domain [Brockman et al., 2016].

Original: Figure 1(c) shows the evaluation learning curves of different DQN variants in an RL setting.
Revised: Figure 1(c) shows the evaluation learning curves of different DQN variants in an RL setting.

Original: We use a small 16 × 16 ReLu NN as the Q -function, which should highlight the issue of priority updating: every mini-batch update potentially perturbs the values of many other states.
Revised: We use a small 16 ⇥ 16 ReLu NN as the Q -function, which should highlight the issue of priority updating: every mini-batch update potentially perturbs the values of many other states.

Original: Hence many experiences in the ER buffer have the wrong priorities.
Revised: Hence many experiences in the ER buffer have the wrong priorities.

Original: Full-PrioritizedER does perform significantly better.
Revised: Full-PrioritizedER does perform signiﬁcantly better.

Original: Sample space coverage.
Revised: Sample space coverage.

Original: To check the effect of insufficient sample space coverage, we examine how the relative performances of L2 and Full-PrioritizedL2 change when we train them on a smaller training dataset with only 400 examples as shown in Figure 1(b).
Revised: To check the effect of insufﬁcient sample space coverage, we examine how the relative performances of L2 and Full-PrioritizedL2 change when we train them on a smaller training dataset with only 400 examples as shown in Figure 1(b).

Original: The small training set has a small coverage of the sample space.
Revised: The small training set has a small coverage of the sample space.

Original: Unsurprisingly, using a small training set makes all algorithms perform worse; however, it significantly narrows the gap between Full-PrioritizedL and L2.
Revised: Unsurprisingly, using a small training set makes all algorithms perform worse; however, it signiﬁcantly narrows the gap between Full-PrioritizedL and L2.

Original: This indicates that prioritized sampling needs sufficient samples across the sample space to estimate the prioritized sampling distribution reasonably accurate.
Revised: This indicates that prioritized sampling needs sufﬁcient samples across the sample space to estimate the prioritized sampling distribution reasonably accurate.

Original: We further verify the sample space coverage issue in prioritized ER on a RL problem in the next section.
Revised: We further verify the sample space coverage issue in prioritized ER on a RL problem in the next section.

Original:  ADDRESSING THE LIMITATIONS
Revised:  ADDRESSING THE LIMITATIONS

Original: In this section, we propose a Stochastic Gradient Langevin
Revised: In this section, we propose a Stochastic Gradient Langevin

Original: Dynamics (SGLD) sampling method to mitigate the limitations of the prioritized ER method mentioned in the above section.
Revised: Dynamics (SGLD) sampling method to mitigate the limitations of the prioritized ER method mentioned in the above section.

Original: Then we empirically examine our sampling distribution.
Revised: Then we empirically examine our sampling distribution.

Original: We also describe how our sampling method is used for the search-control component in Dyna.
Revised: We also describe how our sampling method is used for the search-control component in Dyna.

Original: 4.1 SAMPLING METHOD
Revised: 4.1 SAMPLING METHOD

Original: SGLD sampling method.
Revised: SGLD sampling method.

Original: Let v π ( · 
Revised: Let v ⇡ ( · ; ✓ ) :

Original: ; θ ) : S (cid:55)→ R be a differentiable value function under policy π parameterized by θ .
Revised: S 7! R be a differentiable value function under policy ⇡ parameterized by ✓ .

Original: For s ∈ S , define y ( s ) def = E r,s ′ ∼P{+
+}
Revised: For s 2 S , deﬁne y ( s ) def = E r,s {+
+}

Original: π ( s ′ ,r | s )
Revised: ⇠ P ⇡ ( s 0 ,r | s )

Original: [ r + γv π ( s ′ ; θ )] , and denote the TD error as δ ( s, y ; θ t ) def =
Revised: [ r +  v ⇡ ( s 0 ; ✓ )] , and denote the TD error as  ( s, y ; ✓ t ) def =

Original: y ( s ) − v ( s ; θ t ) .
Revised: y ( s )  v ( s ; ✓ t ) .

Original: Given some initial state s 0 ∈ S , let the state sequence { s i } be the one generated by updating rule 
Revised: Given some initial state s 0 2 S , let the state sequence { s i } be the one generated by updating rule s i

Original: s i +1 ← s i
Revised: + s i

Original: + α h ∇ s log | δ
Revised: + ↵ h r s log |  ( s i , y ( s i ); ✓ t ) | + X

Original: ( s i , y ( s i ); θ t ) | + X i , where α h is a stepsize and X i is a Gaussian random variable with some constant variance.
Revised: i , where ↵ h is a stepsize and X i is a Gaussian random variable with some constant variance.

Original: Then { s i } converges to the distribution p ( s ) ∝ | δ ( s, y ( s ))
Revised: Then { s i } converges to the distribution p ( s ) / |  ( s, y ( s ))

Original: | as i → ∞ .
Revised: | as i ! 1 .

Original: The proof is a direct consequence of the convergent behavior of Langevin dynamics stochastic differential equation (SDE)
Revised: The proof is a direct consequence of the convergent behavior of Langevin dynamics stochastic differential equation (SDE)

Original: [Roberts, 1996,
Revised: [Roberts, 1996,

Original: Welling and Teh, 2011, Zhang et al., 2017].
Revised: Welling and Teh, 2011, Zhang et al., 2017].

Original: We include a brief background knowledge in Appendix A.2.
Revised: We include a brief background knowledge in Appendix A.2.

Original: It should be noted that, this sampling method enables us to acquire states 1) whose absolute TD errors are estimated by using current parameter θ t and 2) that are not restricted to those visited ones .
Revised: It should be noted that, this sampling method enables us to acquire states 1) whose absolute TD errors are estimated by using current parameter ✓ t and 2) that are not restricted to those visited ones .

Original: We empirically verify the two points in
Revised: We empirically verify the two points in

Original: Section 4.2.
Revised: Section 4.2.

Original: Implementation .
Revised: Implementation .

Original: In practice, we can compute the state value estimate by v ( s ) = max a Q ( s, a ; θ t ) as suggested by Pan et al.
Revised: In practice, we can compute the state value estimate by v ( s ) = max a Q ( s, a ; ✓ t ) as suggested by Pan et al.

Original: In the case that a true environment model is not available, we compute an estimate ˆ y ( s ) of y ( s ) by a learned model.
Revised: In the case that a true environment model is not available, we compute an estimate ˆ y ( s ) of y ( s ) by a learned model.

Original: Then at each time step t , states approximately following the distribution p ( s ) ∝ | δ ( s, y ( s )) | can be generated by
Revised: Then at each time step t , states approximately following the distribution p ( s ) / |  ( s, y ( s )) | can be generated by

Original: [Equation]
Revised: [Equation]

Original:  where X is a Gaussian random variable with zero-mean and some small variance.
Revised: ) where X is a Gaussian random variable with zero-mean and some small variance.

Original: Observing that α h is small, we consider ˆ y ( s ) as a constant given a state s without backpropagating through it.
Revised: Observing that ↵ h is small, we consider ˆ y ( s ) as a constant given a state s without backpropagating through it.

Original: Though this updating rule introduces bias due to the usage of a learned model, fortunately, the difference between the sampling distribution acquired by the true model and the learned model can be upper bounded as we show in Theorem 3 in Appendix A.5.
Revised: Though this updating rule introduces bias due to the usage of a learned model, fortunately, the difference between the sampling distribution acquired by the true model and the learned model can be upper bounded as we show in Theorem 3 in Appendix A.5.

Original: Algorithmic details.
Revised: Algorithmic details.

Original: We present our algorithm called DynaTD in the Algorithm 3 in Appendix A.8.
Revised: We present our algorithm called DynaTD in the Algorithm 3 in Appendix A.8.

Original: Our algorithm follows the general steps in Algorithm 1.
Revised: Our algorithm follows the general steps in Algorithm 1.

Original: Particularly, we choose the function h ( s ) def = log | ˆ y ( s ) − max a Q ( s, a ; θ t ) | for HC search-control process, i.e., run the updating ruleto generate states.
Revised: Particularly, we choose the function h ( s ) def = log | ˆ y ( s )  max a Q ( s, a ; ✓ t ) | for HC search-control process, i.e., run the updating ruleto generate states.

Original: 4.2 EMPIRICAL VERIFICATION OF TD ERROR-BASED SAMPLING METHOD
Revised: 4.2 EMPIRICAL VERIFICATION OF TD ERROR-BASED SAMPLING METHOD

Original: We visualize the distribution of the sampled states by our method and those from the buffer of the prioritized ER, verifying that our sampled states have an obviously larger coverage of the state space.
Revised: We visualize the distribution of the sampled states by our method and those from the buffer of the prioritized ER, verifying that our sampled states have an obviously larger coverage of the state space.

Original: We then empirically verify that our sampling distribution is closer to a brute-force calculated prioritized sampling distribution—which does not suffer from the two limitations—than the prioritized ER method.
Revised: We then empirically verify that our sampling distribution is closer to a brute-force calculated prioritized sampling distribution—which does not suffer from the two limitations—than the prioritized ER method.

Original: Finally, we discuss concerns regarding computational cost.
Revised: Finally, we discuss concerns regarding computational cost.

Original: Please see Appendix A.8 for any missing details.
Revised: Please see Appendix A.8 for any missing details.

Original: Large sample space coverage .
Revised: Large sample space coverage .

Original: During early learning, we visualize 2 k states sampled from 1) DQN’s buffer trained by prioritized ER and 2) our algorithm Dyna-TD’s SearchControl (SC) queue on the continuous state GridWorld (Figure 2(a)).
Revised: During early learning, we visualize 2 k states sampled from 1) DQN’s buffer trained by prioritized ER and 2) our algorithm Dyna-TD’s SearchControl (SC) queue on the continuous state GridWorld (Figure 2(a)).

Original: Figure2 (b-c) visualize state distributions with different sampling methods via heatmap.
Revised: Figure different sampling methods heatmap

Original: Darker color indicates higher density. (b)(c) show that DQN’s ER buffer, no matter with or without prioritized sampling, does not cover well the top-left part and the right half part on the 
Revised: Darker color indicates higher density c) show that DQN’s ER buffer, no matter with or without prioritized sampling, does not cover well the top-left part and the right half part on the [Figure]

Original: GridWorld.
Revised: GridWorld.

Original: In contrast, Figure 2 (d) shows that states from our SC queue are more diversely distributed on the square.
Revised: In contrast, Figure 2 (d) shows that states from our SC queue are more diversely distributed on the square.

Original: These visualizations verify that our sampled states cover better the sample space than the prioritized ER does.
Revised: These visualizations verify that our sampled states cover better the sample space than the prioritized ER does.

Original: [Figure] [Figure] [Figure] Notations and experiment setting .
Revised: Notations and experiment setting .

Original: We denote our sampling distribution as p 1 ( · ) , the one acquired by conventional prioritized ER as p 2 ( · ) , and the one computed by thorough priority updating of enumerating all states in the state space as p ∗ ( · ) (this one should be unrealistic in practice and we call it the ideal distribution as it does not suffer from the two limitations we discussed).
Revised: We denote our sampling distribution as p 1 ( · ) , the one acquired by conventional prioritized ER as p 2 ( · ) , and the one computed by thorough priority updating of enumerating all states in the state space as p ⇤ ( · ) (this one should be unrealistic in practice and we call it the ideal distribution as it does not suffer from the two limitations we discussed).

Original: We visualize how well p 1 ( · ) and p 2 ( · ) can approximate p ∗ ( · ) on the GridWorld domain, where the state distributions can be conveniently estimated by discretizing the continuous state GridWorld to a 50 × 50 one.
Revised: We visualize how well p 1 ( · ) and p 2 ( · ) can approximate p ⇤ ( · ) on the GridWorld domain, where the state distributions can be conveniently estimated by discretizing the continuous state GridWorld to a 50 ⇥ 50 one.

Original: We compute the distances of p 1 , p 2 to p ∗ by two sensible weighting schemes: 1) on-policy weighting:[-(cid:80) 
-]
Revised: We compute the distances of p 1 , p 2 to p ⇤ by two sensible weighting schemes: 1) on-policy weighting:[-(cid:80) 
-]

Original: j =1 d π ( s j ) | p
Revised: [Equation]

Original: i ( s j ) − p ∗ ( s j ) | , i ∈ { 1 , 2 } , where d π is approximated by uniformly sample 3 k states from a recency buffer; 2) uniform [-weighting:2500 (cid:80) 
-]
Revised: { 1 , 2 } , where d ⇡ is approximated by uniformly sample 3 k states from a recency buffer; 2) uniform [-weighting:2500 (cid:80) 
-]weighting:

Original: j =1 | p i ( s j ) − p ∗ ( s j ) | , i ∈ { 1 , 2 } .
Revised: [Figure] [Equation]

Original: Sampling distribution is close to the ideal one .
Revised: Sampling distribution is close to the ideal one .

Original: We plot the distances change when we train our Algorithm 3 and the prioritized ER in Figure 3(a)(b).
Revised: We plot the distances change when we train our Algorithm 3 and the prioritized ER in Figure 3(a)(b).

Original: They show that the
Revised: They show that the

Original: HC procedure in our algorithm Dyna-TD-Long produces a state distribution with a significantly closer distance to the desired sampling distribution p ∗ than PrioritizedER under both weighting schemes.
Revised: HC procedure in our algorithm Dyna-TD-Long produces a state distribution with a signiﬁcantly closer distance to the desired sampling distribution p ⇤ than PrioritizedER under both weighting schemes.

Original: In contrast, the state distribution acquired from PrioritizedER, which suffers from the two limitations, is far away from p ∗ .
Revised: In contrast, the state distribution acquired from PrioritizedER, which suffers from the two limitations, is far away from p ⇤ .

Original: Note that the suffix “-Long” of Dyna-TD-Long indicates that we run a large number of
Revised: Note that the sufﬁx “-Long” of Dyna-TD-Long indicates that we run a large number of

Original: SGLD steps (i.e., 1 k) to reach stationary behavior.
Revised: SGLD steps (i.e., 1 k) to reach stationary behavior.

Original: This is a sanity check but impractical; hence, we test the version with only a few SGLD steps.
Revised: This is a sanity check but impractical; hence, we test the version with only a few SGLD steps.

Original: Sampling distribution with much fewer SGLD steps .
Revised: Sampling distribution with much fewer SGLD steps .

Original: In practice, we probably only want to run a small number of
Revised: In practice, we probably only want to run a small number of

Original: SGLD steps to save time.
Revised: SGLD steps to save time.

Original: As a result, we include a practical version of Dyna-TD, which only runs 30 SGLD steps, with either a true or learned model.
Revised: As a result, we include a practical version of Dyna-TD, which only runs 30 SGLD steps, with either a true or learned model.

Original: Figure 3(a)(b) show that even a few SGLD steps can give better sampling distribution than the conventional PrioritizedER does.
Revised: Figure 3(a)(b) show that even a few SGLD steps can give better sampling distribution than the conventional PrioritizedER does.

Original: Computational cost.
Revised: Computational cost.

Original: Let the mini-batch size be b , and the number of HC steps be k HC .
Revised: Let the mini-batch size be b , and the number of HC steps be k HC .

Original: If we assume one mini-batch update takes O ( c ) , then the time cost of our sampling is
Revised: If we assume one mini-batch update takes O ( c ) , then the time cost of our sampling is

Original: O ( ck HC /b ) , which is reasonable.
Revised: O ( ck HC /b ) , which is reasonable.

Original: On the GridWorld, Figure 3(c) shows that given the same time budget, our algorithm achieves better performance.
Revised: On the GridWorld, Figure 3(c) shows that given the same time budget, our algorithm achieves better performance.

Original: This makes the additional time spent on search-control worth it.
Revised: This makes the additional time spent on search-control worth it.

Original:  EXPERIMENTS
Revised:  EXPERIMENTS

Original: In this section, we  design experiments  to answer the following questions.
Revised: In this section, we ﬁrstly introduce baselines and the basic experimental setup. Then we design experiments in the three paragraphs 1) performances on benchmarks , 2) Dyna variants comparison , and 3) a demo for continuous control to answer below corresponding three questions.

Original: (1) By mitigating the limitations of conventional prioritized ER method, can Dyna-TD outperform the prioritized ER under various planning budgets in different environments? 
Revised: By mitigating the limitations of conventional prioritized ER method, can Dyna-TD outperform the prioritized ER under various planning budgets in different environments? 2.

Original: (2) Can Dyna-TD outperforms the[Figure] existing Dyna variants?
Revised: Can Dyna-TD outperform the existing Dyna variants?

Original: (3) How effective is Dyna-TD under an online learned model, particularly for more realistic applications where actions are continuous?
Revised: How effective is Dyna-TD under an online learned model, particularly for more realistic applications where actions are continuous?

Original: Baselines.
Revised: Baselines and basic setup.

Original: ER is DQN with a regular ER buffer without prioritized sampling.
Revised: ER is DQN with a regular ER buffer without prioritized sampling.

Original: PrioritizedER is the one by Schaul et al.
Revised: PrioritizedER is the one by Schaul et al.

Original: [2016], which has the drawbacks as discussed in our paper.
Revised: [2016], which has the drawbacks as discussed in our paper.

Original: Dyna-Value
Revised: Dyna-Value

Original: [Pan et al., 2019] is the Dyna variant which performs HC on the learned value function to acquire states to populate the SC queue.
Revised: [Pan et al., 2019] is the Dyna variant which performs HC on the learned value function to acquire states to populate the SC queue.

Original: Dyna-Frequency [Pan et al., 2020] is the Dyna variant which performs HC on the norm of the gradient of the value function to acquire states to populate the SC queue. 
Revised: DynaFrequency [Pan et al., 2020] is the Dyna variant which performs HC on the norm of the gradient of the value function to acquire states to populate the SC queue. For fair compari- [Figure] [Figure]

Original: For fair comparison, at each environment time step, we stochastically sample the same number of mini-batches to train those model-free baselines as the number of planning updates in Dyna variants.
Revised: son, at each environment time step, we stochastically sample the same number of mini-batches to train those modelfree baselines as the number of planning updates in Dyna variants.

Original: We are able to fix the same HC hyper-parameter setting across all environments.
Revised: We are able to ﬁx the same HC hyper-parameter setting across all environments.

Revised: Whenever it involves an online learned model, we use the mean squared error to learn a deterministic model, which we found to be reasonably good on those tested domains in this paper.

Original: Please see Appendix A.8 for experiment details.
Revised: Please see Appendix A.8 for experiment details 2 .

Original: We also refer readers to Appendix A.7.4 for experiments on autonomous driving domain.
Revised: We also refer readers to Appendix A.7.4 for experiments on autonomous driving domain.

Original: Performances on benchmarks.
Revised: Performances on benchmarks.

Original: Figure 4 shows the performances of different algorithms on MountainCar, Acrobot,
Revised: Figure 4 shows the performances of different algorithms on MountainCar, Acrobot,

Original: GridWorld (Figure 2(a)), and CartPole.
Revised: GridWorld (Figure 2(a)), and CartPole.

Original: On these small domains, we focus on studying our sampling distribution and hence we need to isolate the effect of model errors (by using a true environment model), though we include our algorithm
Revised: On these small domains, we focus on studying our sampling distribution and hence we need to isolate the effect of model errors (by using a true environment model), though we include our algorithm

Original: Dyna-TD with an online learned model for curiosity.
Revised: Dyna-TD with an online learned model for curiosity.

Original: We have the following observations.
Revised: We have the following observations.

Original: First, our algorithm DynaTD consistently outperforms PrioritizedER across domains and planning updates.
Revised: First, our algorithm Dyna- TD consistently outperforms PrioritizedER across domains and planning updates.

Original: In contrast, the PrioritizedER may not even outperform regular ER, as occurred in the previous supervised learning experiment.
Revised: In contrast, the PrioritizedER may not even outperform regular ER, as occurred in the previous supervised learning experiment.

Original: Second, Dyna-TD’s performance significantly improves and even outperforms other Dyna variants when increasing the planning budget (i.e., planning updates n ) from 10 to 30 .
Revised: Second, Dyna-TD’s performance signiﬁcantly improves and even outperforms other Dyna variants when increasing the planning budget (i.e., planning updates n ) from 10 to 30 .

Original: This validates the utility of those additional hypothetical experiences acquired by our sampling method.
Revised: This validates the utility of those additional hypothetical experiences acquired by our sampling method.

Original: In contrast, both ER and PrioritizedER show limited gain when increasing the planning budget (i.e., number of mini-batch updates), which implies the limited utility of those visited experiences.
Revised: In contrast, both ER and PrioritizedER show limited gain when increasing the planning budget (i.e., number of mini-batch updates), which implies the limited utility of those visited experiences.

Original: Dyna variants comparison .
Revised: Dyna variants comparison .

Original: Dyna-Value occasionally finds a sub-optimal policy when using a large number of planning updates, while Dyna-TD always finds a better one.
Revised: Dyna-Value occasionally ﬁnds a sub-optimal policy when using a large number of planning updates, while Dyna-TD always ﬁnds a better one.

Original: We hypothesize that Dyna-Value results in a heavy sampling distribution bias even during the late learning stage.
Revised: We hypothesize that Dyna-Value results in a heavy sampling distribution bias even during the late learning stage.

Original: They result in a highly biased sampling distribution with density always concentrated around the high-value regions.
Revised: They result in a highly biased sampling distribution with density always concentrated around the high-value regions.

Original: We verified our hypothesis by checking the entropy of the sampling distribution in the late training stage, as shown in Figure 5. 
Revised: We veriﬁed our hypothesis by checking the entropy of the sampling distribution in the late training stage, as shown in Figure 5. [Figure]

Original: A high entropy indicates the sampling distribution is more dispersed than the one with low entropy.
Revised: A high entropy indicates the sampling distribution is more dispersed than the one with low entropy.

Original: We found that the sampling distribution of Dyna-Value has lower entropy than
Revised: We found that the sampling distribution of Dyna-Value has lower entropy than

Original: Dyna-TD.
Revised: Dyna-TD.

Original: Dyna-Frequency suffers from explosive or zero gradients.
Revised: Dyna-Frequency suffers from explosive or zero gradients.

Original: It requires computing third-order differentiation ∇ s
Revised: It requires computing third-order differentiation r s

Original: || H v ( s ) ||
Revised: || H v ( s ) ||

Original: (i.e., taking the gradient of the Hessian).
Revised: (i.e., taking the gradient of the Hessian).

Original: It is hence sensitive to domains and parameter settings such as learning rate choice and activation type.
Revised: It is hence sensitive to domains and parameter settings such as learning rate choice and activation type.

Original: This observation is consistent with the description from Pan et al. 
Revised: This observation is consistent with the description from Pan et al. [Figure]

Original: A demo for continuous control.
Revised: A demo for continuous control.

Original: We demonstrate that our approach can be applied for Mujoco [Todorov et al., 2012] continuous control problems with an online learned model and still achieve superior performance.
Revised: We demonstrate that our approach can be applied for Mujoco [Todorov et al., 2012] continuous control problems with an online learned model and still achieve superior performance.

Original: We use DDPG (Deep
Revised: We use DDPG (Deep

Original: Deterministic Policy Gradient)
Revised: Deterministic Policy Gradient)

Original: [Lillicrap et al., 2016, Silver et al., 2014] as an example for use inside our Dyna-TD.
Revised: [Lillicrap et al., 2016, Silver et al., 2014] as an example for use inside our Dyna-TD.

Original: Let π θ ′ :
Revised: Let ⇡

Original: S

Original: [Equation]
Revised: [Equation]

Original: A be the actor, then we set the HC function as
Revised: A be the actor, then we set the HC function as

Original: [Equation]
Revised: [Equation]

Original:  y is the TD target.
Revised: ˆ y is the TD target.

Original: Figure 6 (a)(b) shows the learning curves of DDPG trained with ER, PrioritizedER, and our Dyna-TD on Hopper and
Revised: Figure 6 (a)(b) shows the learning curves of DDPG trained with ER, PrioritizedER, and our Dyna-TD on Hopper and

Original: Walker2d respectively.
Revised: Walker2d respectively.

Original: Since other Dyna variants never show an advantage and are not relevant to the purpose of this experiment, we no longer include them.
Revised: Since other Dyna variants never show an advantage and are not relevant to the purpose of this experiment, we no longer include them.

Original: Dyna-TD shows quick improvement as before.
Revised: Dyna-TD shows quick improvement as before.

Original: This indicates our sampled hypothetical experiences could be helpful for actor-critic algorithms that are known to be prone to local optimums.
Revised: This indicates our sampled hypothetical experiences could be helpful for actor-critic algorithms that are known to be prone to local optimums.

Original: Additionally, we note again that ER outperforms PrioritizedER, as occurred in the discrete control and supervised learning (PrioritizedL2 is worse than L2) experiments.
Revised: Additionally, we note again that ER outperforms PrioritizedER, as occurred in the discrete control and supervised learning (PrioritizedL2 is worse than L2) experiments.

Original: [Figure]
Revised: [Figure]

Revised: a window of size

Original:  DISCUSSION
Revised:  DISCUSSION

Original: We provide theoretical insight into the error-based prioritized sampling by establishing its equivalence to the uniform sampling for a cubic power objective in a supervised learning setting.
Revised: We provide theoretical insight into the error-based prioritized sampling by establishing its equivalence to the uniform sampling for a cubic power objective in a supervised learning setting.

Original: Then we identify two drawbacks of prioritized
Revised: Then we identify two drawbacks of prioritized

Original: ER: outdated priorities and insufficient sample space coverage.
Revised: ER: outdated priorities and insufﬁcient sample space coverage.

Original: We mitigate the two limitations by SGLD sampling method with empirical verification.
Revised: We mitigate the two limitations by SGLD sampling method with empirical veriﬁcation.

Original: Our empirical results on both discrete and continuous control domains show the efficacy of our method.
Revised: Our empirical results on both discrete and continuous control domains show the efﬁcacy of our method.

Original: There are several promising future directions.
Revised: There are several promising future directions.

Original: First, a natural question is how a model should be learned to benefit a  sampling method.
Revised: First, a natural question is how a model should be learned to beneﬁt a particular sampling method, as this work mostly focuses on sampling hypothetical experiences without considering model learning algorithms.

Original: Existing results show that learning a[Figure] [Figure] model while considering how to use it should make the policy robust to model errors [Farahmand et al., 2017, Farahmand, 2018].
Revised: Existing results show that learning a model while considering how to use it should make the policy robust to model errors [Farahmand et al., 2017, Farahmand, 2018].

Original: Second, one may apply our approach with a model in latent space [Hamilton et al., 2014, Wahlström et al., 2015, Ha and Schmidhuber, 2018, Hafner et al., 2019,
Revised: Second, one may apply our approach with a model in latent space [Hamilton et al., 2014, Wahlström et al., 2015, Ha and Schmidhuber, 2018, Hafner et al., 2019,

Original: Schrittwieser et al., 2020], which enables our method to scale to large domains.
Revised: Schrittwieser et al., 2020], which enables our method to scale to large domains.

Original: Third, since there are existing works examining how ER is affected by bootstrap return [Daley and Amato, 2019], by buffer or mini-batch size [Zhang and
Revised: Third, since there are existing works examining how ER is affected by bootstrap return [Daley and Amato, 2019], by buffer or mini-batch size [Zhang and

Original: Sutton, 2017, Liu and Zou, 2017], and by environment steps taken per gradient step [Fu et al., 2019, van Hasselt et al., 2018, Fedus et al., 2020]. It is worth studying the theoretical implications of those design choices and their effects on prioritized ER’s efficacy.
Revised: Sutton, 2017, Liu and Zou, 2017], and by environment steps taken per gradient step [Fu et al., 2019, van Hasselt et al., 2018, Fedus et al., 2020], it is worth studying the theoretical implications of those design choices and their effects on prioritized ER’s efﬁcacy.

Original: Last, as our cubic objective explains only one version of the error-based prioritization, efforts should also be made to theoretically interpret other sampling distributions, such as distribution location or reward-based prioritization [Lambert et al., 2020].
Revised: Last, as our cubic objective explains only one version of the error-based prioritization, efforts should also be made to theoretically interpret other sampling distributions, such as distribution location or reward-based prioritization [Lambert et al., 2020].

Original: It is interesting to explore whether these alternatives can be formulated as surrogate objectives.
Revised: It is interesting to explore whether these alternatives can be formulated as surrogate objectives.

Original: Furthermore, a recent work by Fujimoto et al.
Revised: Furthermore, a recent work by Fujimoto et al.

Original: [2020] establishes an equivalence between various distributions and uniform sampling for different loss functions.
Revised: [2020] establishes an equivalence between various distributions and uniform sampling for different loss functions.

Original: It is interesting to study if those general loss functions have faster convergence rate as shown in our Theorem 2. A APPENDIX The appendix includes the following contents: Section A.1: background in Dyna architecture and two Dyna variants.
Revised: Studying if those general loss functions have faster convergence rate as shown in our Theorem 2 could help illuminate their beneﬁts

Original: Section A.2: background of Langevin dynamics.

Original: Section A.3: the full proof of Theorem 1. 4.

Original: Section A.4: the full proof of Theorem 2 and its simulations.

Original: Section A.5: the theorem characterizing the error bound between the sampling distribution estimated by using a true model and a learned model.

Original: It includes the the full proof.

Original: Section A.6: a discussion and some empirical study of using high power objectives.

Original: Section A.7: supplementary experimental results: training error results to check the negative effects of the limitations of prioritized sampling; results to verify the equivalence between prioritized sampling and cubic power; additional results on the discrete control domains A.7.3; results on the autonomous driving application; results

Original: MazeGridWorld

Original: Pan

Original: Section A.8: details for reproducible research.

Original: A.1 BACKGROUND IN DYNA

Original: Dyna integrates model-free and model-based policy updates in an online RL setting [Sutton, 1990].

Original: As shown in Algorithm 2, at each time step, a Dyna agent uses the real experience to learn a model and performs a model-free policy update.

Original: During the planning stage, simulated experiences are acquired from the model to further improve the policy.

Original: It should be noted that, in Dyna, the concept of planning refers to any computational process which leverages a model to improve policy, according to Sutton and Barto [2018], Chapter 8.

Original: The mechanism of generating states or state-action pairs from which to query the model is called search-control , which is of critical importance to improving sample efficiency.

Original: The below algorithm shows a naive search-control strategy: simply use visited state-action pairs and store them into the search-control queue.

Original: During the planning stage, these pairs are uniformly sampled according to the original paper.

Original: The recent works by Pan et al.

Original: [2019, 2020] propose two search-control strategies to generate states.

Original: The first one is to search high-value states actively, and the second one is to search states whose values are difficult to learn.

Original: However, there are several limitations of the two previous works.

Original: First, they do not provide any theoretical justification to use the stochastic gradient ascent trajectories for search-control.

Original: Second, HC on gradient norm and Hessian norm of the learned value function [Pan et al., 2020] suffers from great computation cost and zero or explosive gradient due to the high order differentiation (i.e., ∇ s ||∇ s v ( s ) || ) as suggested by the authors.

Original: When using ReLu as activation functions, such high order differentiation almost results in zero gradients.

Original: We empirically verified this phenomenon.

Original: And this phenomenon can also be verified by intuition from the work by Goodfellow et al.

Original: [2015], which suggests that ReLU neural networks are locally almost linear.

Original: Then it is not surprising to have zero higher order derivatives.

Original: Third, the two methods are prone to result in sub-optimal policies: consider that the values of states are relatively well-learned and fixed, then value-based search-control (Dyna-Value) would still find those high-value states even though they might already have low TD error.

Original: Algorithm

Original: Initialize Q ( s, a ) ; initialize model M ( s, a ) , ∀ ( s, a ) ∈ S

Original: × A while true do observe s , take action a

Original: by ϵ -greedy w.r.t Q ( s, · ) execute a , observe reward R and next State s ′

Original: Q-learning update for Q ( s, a ) update model M ( s, a ) (i.e. by counting) store ( s, a ) into search-control queue //

Original: this is a naive search-control strategy for i=1:

Original: d do sample (˜ s, ˜ a ) from search-control queue (˜ s ′ , ˜ R ) ← M (˜ s, ˜ a ) //

Original: simulated transition

Original: Q-learning update for Q (˜ s, ˜ a ) // planning updates/steps

Original: A.2 DISCUSSION ON THE LANGEVIN DYNAMICS MONTE CARLO METHOD

Original: Theoretical mechanism .

Original: Define a SDE: d W ( t ) =

Original: ∇ U

Original: ( W t )

Original: d t + √ 2d B t , where B t ∈ R

Original: d is a d -dimensional Brownian motion and U is a continuous differentiable function.

Original: It turns out that the Langevin diffusion ( W t ) t ≥ 0 converges to a unique invariant distribution p ( x ) ∝ exp ( U ( x ))

Original: [Chiang et al., 1987].

Original: By applying the Euler-Maruyama discretization scheme to the SDE, we acquire the discretized version Y k

Original: [-+
-]
Revised: [-+
-]

Original: =

Original: Y k

Original: + α k +1 ∇ U

Original: ( Y k )

Original: [-+ √ 
-]
Revised: [-+ √ 
-]

Original: α k +1 Z k +1 where ( Z k ) k ≥ 1 is an i.i.d.

Original: sequence of standard d -dimensional Gaussian random vectors and ( α k ) k ≥ 1 is a sequence of step sizes.

Original: It has been proved that the limiting distribution of the sequence ( Y k ) k ≥ 1 converges to the invariant distribution of the underlying SDE [Roberts, 1996, Durmus and Moulines, 2017].

Original: As a result, considering U ( · ) as log | δ ( · ) | , Y as s justifies our SGLD sampling method..

Original: A.3 PROOF FOR THEOREM

Original: Theorem 1.

Original: For a constant c determined by θ, T , we have

Original: [Equation] Proof. For the l.h.s. , we have,
Revised: Acknowledgements

Original: [Equation]

Original: On the other hand

Original: [Equation]

Original: for the r

Original: [Equation]

Original: h

Original: [Equation]

Original: s.

Original: [Equation]

Original: we have,

Original: [Equation]

Original: Setting

Original: [Equation]

Original: θ ( x i )

Original: − y i | n completes the proof.

Original: A.4 PROOF FOR THEOREM

Original: Theorem 2.

Original: Let n be a positive integer (i.e., the number of training samples).

Original: Let x t , ˜ x t ∈ R n be the target estimates of all samples at time t .

Original: Let x t ( i )( i ∈ [ n ] , [ n ] def = { 1 , 2 , ..., n } ) denote the i th element in the vector.

Original: We define the following notations.

Original: [Equation]

Original: n (cid:88) i = |

Original: [Equation]

Original: n

Original: [Equation]

Original: n

Original: [Equation]

Original: n (cid:88)

Original: [Equation]

Original: where y ( i ) ∈ R is the training target for the i th training sample.

Original: Let { x t } t ≥ 0 and { ˜ x t } t ≥ 0 be generated by using ℓ 2 , ℓobjectives respectively.

Original: That is, ∀ i ∈ [ n ] ,

Original: [Equation]

Original: Assume the same initialization x 0 = ˜ x 0 .

Original: Then: (i) For all i ∈ [ n ] , define the following hitting time, which is the minimum time that the absolute error takes to be ≤ ϵ ( i ) , [Equation] Then, ∀ i ∈ [ n ] s.t.
Revised: We would like to thank all anonymous reviewers for their helpful feedback during multiple submissions of this paper.

Original: [-δ 
-]
Revised: [-δ 
-]

Original: [-( i ) > ηη ′ , given an absolute error threshold ϵ ( i ) ≥ 0 , there exists ϵ 
-]
Revised: [-( i ) > ηη ′ , given an absolute error threshold ϵ ( i ) ≥ 0 , there exists ϵ 
-]

Original: ( i ) ∈ (0 , ηη ′ ) , such that for all ϵ ( i ) >

Original: [-ϵ 
-]
Revised: [-ϵ 
-]

Original: ( i ) , t ϵ ( i ) ≥ ˜

Original: t ϵ ( i ) .

Original: (ii) Define the following quantity, for all t ≥ 0 ,

Original: [Equation]

Original: Given any 0 < ϵ ≤ δ 0 = (cid:80) ni =1 δ 0 ( i ) , define the following hitting time, which is the minimum time that the total absolute error takes to be ≤ ϵ ,

Original: [Equation]

Original: If there exists δ 0 ∈ R and 0 < ϵ ≤ δ 0 such that the following holds,

Original: [Equation]

Original: then we have, t ϵ ≥ ˜

Original: t ϵ , which means gradient descent using the cubic loss function will achieve the total absolute error threshold ϵ faster than using the square loss function.

Original: Proof.

Original: First part.

Original: (i).

Original: For the ℓ 2 loss function, for all i ∈ [ n ] and t ≥ 0 , we have,

Original: [Equation]

Original: [Equation]

Original: [Equation]

Original: [Equation]

Original: [Equation]

Original: [Equation]

Original: 21) which implies that,

Original: [Equation]

Original: Taking integral, we have,

Original: [Equation]

Original: Let δ t ( i )

Original: =

Original: ϵ ( i ) .

Original: We have,

Original: [Equation]

Original: On the other hand, for the ℓ 3 loss function, we have,

Original: [Equation]

Original: Taking integral, we have,

Original: [Equation]

Original: Let ˜ δ t ( i ) =

Original: ϵ ( i ) .

Original: We have,

Original: [Equation]

Original: Then we have,

Original: [Equation]

Original: [Equation]

Original: According to x 0 ( i ) =

Original: ˜ x 0 ( i ) , we have

Original: [Equation]

Original: Define the following function, for all x > 0 ,

Original: [Equation]

Original: We have, the continuous function f is monotonically increasing for x ∈ (0 , ηη ′ ] and monotonically decreasing for x ∈ ( ηη ′ , ∞ ) .

Original: Also, note that, max x> 0 f ( x ) =

Original: f ( ηη ′ )

Original: =

Original: log η ′ η − 1 , lim x → 0 f ( x ) =

Original: lim x →∞ f ( x ) =

Original: −∞ .

Original: Given δ 0 ( i ) =

Original: ˜

Original: [-δ 
-]
Revised: [-δ 
-]

Original: ( i ) > ηη ′ , we have f ( δ 0 ( i )) < f ( ηη ′ ) =
Revised: We acknowledge the funding from the Canada CIFAR AI

Original: log η ′ η − 1 .

Original: [-According to the intermediate value theorem, there exists ϵ 
-]
Revised: [-According to the intermediate value theorem, there exists ϵ 
-]

Original: ( i ) ∈ (0 , ηη ′ ) ,

Original: such that f ( ϵ 0 ( i )) =

Original: f ( δ 0 ( i )) .

Original: Since f ( · ) is monotonically increasing on (0 , ηη ′ ] and monotonically decreasing on ( ηη ′ , ∞ ) , for all ϵ ( i ) ∈

Original: [ ϵ 0 ( i ) , δ 0 ( i )] , we have f ( ϵ ( i )) ≥ f ( δ 0 ( i )) 2 .

Original: Therefore, we have,

Original: [Equation]

Original: Second part.

Original: (ii).

Original: For the square loss function, we have, for all t ≥ 0 ,

Original: [Equation]

Original: [Equation]

Original: [Equation]

Original: [Equation]

Original: 42) which implies that,

Original: [Equation]

Original: Taking integral, we have,

Original: [Equation]

Original: Let δ t

Original: = ϵ .

Original: We have,

Original: [Equation]

Original: After t ϵ time, for all i ∈ [ n ] , we have,

Original: [Equation]

Original: On the other hand, for the cubic loss function, we have, for all t ≥ 0 ,

Original: [Equation]

Original: Taking integral, we have,

Original: [Equation]

Original: which means given a H − 1 t value, we can calculate the hitting time as,

Original: [Equation]

Original: [Equation]

Original: Now consider after t ϵ time, using gradient descent with the square loss function we have δ t ϵ ( i ) =

Original: [-δ 
-]
Revised: [-δ 
-]

Original: ( i ) · exp {− η · t ϵ } for all i ∈ [ n ] , which corresponds to,

Original: [Equation]

Original: Therefore, the hitting time of using gradient descent with the cubic loss function to achieve the H − 1 t ϵ value is,

Original: [Equation]

Original: finishing the proof.

Original: Remark .

Original: Figure 7 shows the function f ( x ) =

Original: ln 1 x − 1 x , x > 0 .

Original: Fix arbitrary x ′ > 1 , there will be another root ϵ 0 < 1 s.t.

Original: f

Original: ( ϵ 0 )

Original: =

Original: f ( x ′ ) .

Original: However, there is no real-valued solution for ϵ 0 .

Original: The solution in C is ϵ 0 = −

Original: [Equation]

Original: δ

Original: [Equation]

Original: − πi

Original: [Equation]

Original: , where

Original: W ( · ) is a Wright Omega function.

Original: Hence, finding the exact value of ϵ 0 would require a definition of ordering on complex plane.

Original: Our current theorem statement is sufficient for the purpose of characterizing convergence rate.

Original: The theorem states that there always exists some desired low error level < 1 , minimizing the square loss converges slower than the cubic loss.

Original: [Figure]

Original: [Equation]

Original: [Figure]

Original: [Equation]

Original: [Figure]

Original: Simulations .

Original: The theorem says that if we want to minimize our loss function to certain small nonzero error level, the cubic loss function offers faster convergence rate.

Original: Intuitively, cubic loss provides sharper gradient information when the loss is large as shown in Figure 8(a)(b).

Original: Here we provides a simulation.

Original: Consider the following minimization problems: min x ≥ 0 xand min x ≥ 0 x 3 .

Original: For implementation and visualization convenience, we use the hitting time formulae t ϵ = 1 η · ln (cid:8) δ 0 ϵ (cid:9) ,

Original: ˜ t ϵ = 1 η · (cid:16) 1 ϵ − 1 δ 0 (cid:17) derived in the proof, to compute the hitting time ratio t ϵ ˜ t ϵ under different initial values x 0 and final error value ϵ .

Original: In Figure 8(c)(d), we can see that it usually takes a significantly shorter time for the cubic loss to reach a certain x t with various initial x 0 values.

Original: A.5 ERROR BOUND BETWEEN SAMPLING DISTRIBUTIONS

Original: We now provide the error bound between the sampling distribution estimated by using a true model and a learned model.

Original: We denote the transition probability distribution under policy π and the true model as P π

Original: ( r, s ′ | s ) , and the learned model as ˆ

Original: P π ( r, s ′ | s ) .

Original: Let p ( s ) and ˆ p ( s ) be the convergent distributions described in the above sampling method by using the true and learned models respectively.

Original: Let d tv ( · , · ) be the total variation distance between the two probability distributions.

Original: Define u ( s ) def = | δ ( s, y ( s ))

Original: | , ˆ u ( s ) def = | δ ( s, ˆ y ( s ))

Original: | , Z def = (cid:82) s ∈S u ( s ) ds, ˆ Z def = (cid:82) s ∈S

Original: ˆ u ( s ) ds.

Original: Then we have the following bound.

Original: Theorem 3.

Original: Assume: 1) the reward magnitude is bounded | r | ≤ R max and define V max def

Original: = R max 1 − γ ; 2) the largest model error for a single state is ϵ s def = max s d tv ( P π ( ·| s ) , ˆ P π ( ·| s )) and the total model error is bounded, i.e. ϵ def = (cid:82) s ∈S

Original: ϵ s ds < ∞ .

Original: Then ∀ s ∈ S , | p ( s ) − ˆ p ( s ) | ≤ min( V max ( p ( s ) ϵ + ϵ s )

Original: ˆ Z , V max (ˆ p ( s ) ϵ + ϵ s ) Z ) .

Original: Proof.

Original: First, we bound the estimated temporal difference error.

Original: Fix an arbitrary state s ∈ S , it is sufficient the consider the case u ( s ) >

Original: ˆ u ( s ) , then

Original: [Equation]

Original: Now, we show that | Z − ˆ Z | ≤ V max ϵ .

Original: [Equation]

Original: Consider the case p ( s ) >

Original: ˆ p ( s ) first.

Original: [Equation]

Original: Meanwhile, below inequality should also hold:

Original: [Equation]

Original: [Figure]

Original: Because both the two inequalities must hold, when p ( s ) − ˆ p ( s ) > 0 , we have:

Original: [Equation]

Original: It turns out that the bound is the same when p ( s ) ≤

Original: ˆ p ( s ) .

Original: This completes the proof.

Original: A.6 HIGH POWER LOSS FUNCTIONS

Original: We would like to point out that directly using a high power objective in general problems is unlikely to have an advantage.

Original: First, notice that our convergence rate is characterized w.r.t.

Original: to the expected updating rule, not stochastic gradient updating rule.

Original: When using a stochastic sample to estimate the gradient, high power objectives are sensitive to the outliers as they augment the effect of noise.

Original: Robustness to outliers is also the motivation behind the Huber loss Huber [1964] which, in fact, uses low power error in most places so it can be less sensitive to outliers.

Original: We conduct experiments to examine the effect of noise on using high power objectives.

Original: We use the same dataset as described in Section 3.3.

Original: We use a training set with 4 k training examples.

Original: The naming rules are as follows.

Original: Cubic is minimizing the cubic objective (i.e. min θ 1 n (cid:80) ni

Original: =1 | f θ ( x i ) − y

Original: i | 3 ) by uniformly sampling, and Power4 is min θ 1 n (cid:80) ni

Original: [-=
-]
Revised: [-=
-]

Original: ( f θ ( x i ) − y i ) 4 by uniformly sampling.

Original: Figure 9 (a)(b) shows the learning curves of uniformly sampling for Cubic and for Power4 trained by adding noises with standard deviation σ = 0 .

Original: 5 respectively to the training targets.

Original: It is not surprising that all algorithms learn slower when we increase the noise variance added to the target variables.

Original: However, one can see that high power objectives is more sensitive to noise variance added to the targets than the regular L2 : when σ = 0 . 1 , the higher power objectives perform better than the regular L2; after increasing σ to 0 .

Original: 5 , Cubic becomes almost the same as L2, while Power4 becomes worse than L2.

Original: Second, it should be noted that in our theorem, we do not characterize the convergence rate to the minimum; instead, we show the convergence rate to a certain low error solution, corresponding to early learning performance.

Original: In optimization literature, it is known that cubic power would converge slower to the minimizer as it has a relatively flat bottom.

Original: However, it may be an interesting future direction to study how to combine objectives with different powers so that optimizing the hybrid objective leads to a faster convergence rate to the optimum and is robust to outliers.

Original: A.7 ADDITIONAL EXPERIMENTS

Original: In this section, we include the following additional experimental results:

Original: As a supplementary to Figure 1 from Section 3.3, we show the learning performance measured by training errors

Original: to show

Original: the negative effects of the two limitations.

Original: [Figure]

Original: A.7.1 Training Error Corresponding to Figure 1 from Section 3.

Original: Note that our Theorem 1 and 2 characterize the expected gradient calculated on the training set; hence it is sufficient to examine the learning performances measured by training errors.

Original: However, the testing error is usually the primary concern, so we put the testing error in the main body.

Original: As a sanity check we also investigate the learning performances measured by training error and find that those algorithms behave similarly as shown in Figure 10 where the algorithms are trained by using training sets with decreasing training examples from (a) to (b).

Original: As we reduce the training set size, Full-PrioritizedL2 is closer to L2.

Original: Furthermore, PrioritizedL2 is always worse than Full-PrioritizedL2.

Original: These observations show the negative effects resulting from the issues of outdated priorities and insufficient sample space coverage.

Original: A.7.2 Empirical verification of Theorem

Original: Theorem 1 states that the expected gradient of doing prioritized sampling on mean squared error is equal to the gradient of doing uniformly sampling on cubic power loss.

Original: As a result, we expect that the learning performance on the training set (note that we calculate gradient by using training examples) should be similar when we use a large mini-batch update as the estimate of the expectation terms become close.

Original: We use the same dataset as described in Section 3.3 and keep using training size 4 k. Figure 11(a)(b) shows that when we increase the mini-batch size, the two algorithms Full-PrioritizedL2 and Cubic are becoming very close to each other , verifying our theorem.

Original: Note that our theorem characterizes the expected gradient calculated on the training set; hence it is sufficient to examine the learning performances measured by training errors.

Original: However, usually, the testing error is the primary concern.

Original: For completeness, we also investigate the learning performances measured by testing error and find that the tested algorithms behave similarly as shown in Figure 11(c)(d).

Original: A.7.3 Additional Results on Discrete Benchmark Domains

Original: Figure 12 shows the empirical results of our algorithm on the discrete domains with plan steps = 5 .

Original: [Figure]

Original: [Figure]

Original: A.7.4 Autonomous Driving Application

Original: We study the practical utility of our method in a relatively large autonomous driving application [Leurent, 2018] with an online learned model.

Original: We use the roundabout-v0 domain (Figure 13 (a)).

Original: The agent learns to go through a roundabout by lane change and longitude control.

Original: The reward is designed such that the car should go through the roundabout as fast as possible without collision.

Original: We observe that all algorithms perform similarly when evaluating algorithms by episodic return (Figure 13 (d)).

Original: In contrast, there is a significantly lower number of car crashes with the policy learned by our algorithm, as shown in Figure 13(b).

Original: Figure 13 (c) suggests that ER and PrioritizedER gain reward mainly due to fast speed which potentially incur more car crashes.

Original: The conventional prioritized ER method still incurs many crashes, which may indicate its prioritized sampling distribution does not provide enough crash experiences to learn

Original: [Figure]

Original: roundabout domain with S ⊂ R crashes v s time

Original: [Figure]

Original: A.7.5 Results on MazeGridWorld Domain

Original: In Figure 14, we demonstrate that our algorithm can work better than Dyna-Frequency on a MazeGridWorld domain Pan et al.

Original: [2020], where Dyna-Frequency was shown to be superior to Dyna-Value and model-free baselines.

Original: This result further confirms the usefulness of our sampling approach.

Original: A.8 REPRODUCIBLE RESEARCH

Original: [-Our implementations are based on tensorflow with version 1 . 13 . 
-]
Revised: [-Our implementations are based on tensorflow with version 1 . 13 . 
-]

Original: Abadi et al. We use Adam optimizer Kingma and Ba [2014] for all experiments. A.8.1 Reproduce experiments before Section
Revised: Chairs program and Alberta Machine Intelligence Institute.

Original: Supervised learning experiment.

Original: For the supervised learning experiment shown in section 3, we use 32 × 32 tanh units neural network, with learning rate swept from { 0 . 01 , 0 . 001 , 0 . 0001 , 0 . 00001 } for all algorithms.

Original: We compute the constant c as specified in the Theorem 1 at each time step for Cubic loss.

Original: We compute the testing error every 500 iterations/minibatch updates and our evaluation learning curves are plotted by averaging 50 random seeds.

Original: For each random seed, we randomly split the dataset to testing set and training set and the testing set has 1 k data points.

Original: Note that the testing set is not noise-contaminated.

Original: Reinforcement Learning experiments in Section 3.

Original: We use a particularly small neural network 16 × 16 to highlight the issue of incomplete priority updating.

Original: Intuitively, a large neural network may be able to memorize each state’s value and thus updating one state’s value is less likely to affect others.

Original: We choose a small neural network, in which case a complete priority updating for all states should be very important.

Original: We set the maximum ER buffer size as 10 k and mini-batch size as 32 .

Original: The learning rate is chosen from { 0 . 0001 , 0 . 001 } and the target network is updated every 1 k steps.

Original: Distribution distance computation in Section 4.

Original: We now introduce the implementation details for Figure 3.

Original: The distance is estimated by the following steps.

Original: First, in order to compute the desired sampling distribution, we discretize the domain into 50 × 50 grids and calculate the absolute TD error of each grid (represented by the left bottom vertex coordinates) by using the true environment model and the current learned Q function.

Original: We then normalize these priorities to get probability distribution p ∗ .

Original: Note that this distribution is considered as the desired one since we have access to all states across the state space with priorities computed by current Q-function at each time step.

Original: Second, we estimate our sampling distribution by randomly sampling 3 k states from search-control queue and count the number of states falling into each discretized grid and normalize these counts to get p 1 .

Original: Third, for comparison, we estimate the sampling distribution of the conventional prioritized ER Schaul et al.

Original: [2016] by sampling 3 k states from the prioritized ER buffer and count the states falling into each grid and compute its corresponding distribution p 2 by normalizing the counts.

Original: [-Then we compute the distances of p 1 , p 2 to p ∗ by two weighting schemes: 1) on-policy weighting: (cid:80) 
-]
Revised: [-Then we compute the distances of p 1 , p 2 to p ∗ by two weighting schemes: 1) on-policy weighting: (cid:80) 
-]

Original: j =1 d π ( s j ) | p

Original: [-i ( s j ) − p ∗ ( s j ) | , i ∈ { 1 , 2 } , where d π is approximated by uniformly sample 3 k states from a recency buffer and normalizing their visitation counts on the discretized GridWorld; 2) uniform weighting: 1 2500 (cid:80) 
-]
Revised: [-i ( s j ) − p ∗ ( s j ) | , i ∈ { 1 , 2 } , where d π is approximated by uniformly sample 3 k states from a recency buffer and normalizing their visitation counts on the discretized GridWorld; 2) uniform weighting: 1 2500 (cid:80) 
-]

Original: j =1 | p i ( s j ) − p ∗ ( s j ) | , i ∈ { 1 , 2 } .

Original: We examine the two weighting schemes because of two considerations: for the on-policy weighting, we concern about the asymptotic convergent behavior and want to down-weight those states with relatively high TD error but get rarely visited as the policy gets close to optimal; uniform weighting makes more sense during early learning stage, where we consider all states are equally important and want the agents to sufficiently explore the whole state space.

Original: Computational cost v.s. performance in Section 4.

Original: The setting is the same as we used for Section 5.

Original: We use plan step/updates= 10 to generate that learning curve.

Original: A.8.2 Reproduce experiments in Section

Original: For our algorithm, the pseudo-code with concrete parameter settings is presented in Algorithm 4.

Original: Common settings.

Original: For all discrete control domains other than roundabout-v0, we use 32 × 32 neural network with ReLu hidden units except the Dyna-Frequency which uses tanh units as suggested by the author Pan et al.

Original: This is one of its disadvantages: the search-control of Dyna-Frequency requires the computation of Hessian-gradient product and it is empirically observed that the Hessian is frequently zero when using ReLu as hidden units.

Original: Except the output layer parameters which were initialized from a uniform distribution [ − 0 .

Original: 003 , 0 . 003] , all other parameters are initialized using

Original: Xavier initialization Glorot and Bengio [2010].

Original: We use mini-batch size b = 32 and maximum ER buffer size 50 k. All algorithms use target network moving frequency 1000 and we sweep learning rate from { 0 . 001 , 0 . 0001 } .

Original: We use warm up steps = 5000 (i.e. random action is taken in the first 5 k time steps) to populate the ER buffer before learning starts.

Original: We keep exploration noise as 0 .

Original: 1 without decaying.

Original: Hyper-parameter settings.

Original: Across RL experiments including both discrete and continuous control tasks, we are able to fix the same parameters for our hill climbing updating rule 3 s ← s + α h ∇ s log | ˆ y ( s ) − max a Q ( s, a ; θ t ) | + X , where we fix α h = 0 .

Original: 1 , X ∼ N (0 , 0 . 01) .

Original: For our algorithm Dyna-TD, we are able to keep the same parameter setting across all discrete domains: c = 20 and learning rate 0 .

Original: For all Dyna variants, we fetch the same number of states ( m = 20 ) from hill climbing (i.e. search-control process) as Dyna-TD does, and use ϵ accept = 0 . 1 and set the maximum number of gradient step as k = 100 unless otherwise specified.

Original: Our Prioritized ER is implemented as the proportional version with sum tree data structure.

Original: To ensure fair comparison, since all model-based methods are using mixed mini-batch of samples, we use prioritized ER without importance ratio but half of mini-batch samples are uniformly sampled from the ER buffer as a strategy for bias correction.

Original: For Dyna-Value and

Original: Dyna-Frequency, we use the setting as described by the original papers.

Original: For the purpose of learning an environment model on those discrete control domains, we use a 64 × 64 ReLu units neural network to predict s ′ − s and reward given a state-action pair s, a ; and we use mini-batch size 128 and learning rate 0 .to minimize the mean squared error objective for training the environment model.

Original: Environment-specific settings.

Original: All of the environments are from OpenAI

Original: [Brockman et al., 2016]

Original: except that: 1) the

Original: GridWorld envirnoment is taken from Pan et al.

Original: [2019] and the MazeGridWorld is from Pan et al.

Original: [2020]; 2) Roundabout-v is from Leurent et al.

Original: For all OpenAI environments, we use the default setting except on Mountain Car where we set the episodic length limit to 2 k. The GridWorld has state space S =

Original: [0 , 1] 2 and each episode starts from the left bottom and the goal area is at the top right [0 .

Original: There is a wall in the middle with a hole to allow the agent to pass.

Original: MazeGridWorld is a more complicated version where the state and action spaces are the same as GridWorld, but there are two walls in the middle and it takes a long time for model-free methods to be successful.

Original: On the this domain, we use the same setting as the original paper for all Dyna variants.

Original: We use exactly the same setting as described above except that we change the Q − network size to 64 × 64 ReLu units, and number of search-control samples is m = 50 as used by the original paper.

Original: We refer readers to the original paper Pan et al.

Original: [2020] for more details.

Original: On roundabout-v0 domain, we use 64 × 64 ReLu units for all algorithms and set mini-batch size as 64 .

Original: The environment model is learned by using a 200 × 200 ReLu neural network trained by the same way mentioned above.

Original: [-For Dyna-TD, we start using the model after 5 k steps and set m = 100 , k = 
-]
Revised: [-For Dyna-TD, we start using the model after 5 k steps and set m = 100 , k = 
-]

Original: and we do search-control every 50 environment time steps to reduce computational cost.

Original: To alleviate the effect of model error, we use only 16 out of 64 samples from the search-control queue in a mini-batch.

Original: Observe ( a s t r t add absolute TD error while do a if continue

Original: On Mujoco domains Hopper and Walker2d, we use 200 × 100 ReLu units for all algorithms and set mini-batch size as 64 .

Original: The environment model is learned by using a 200 × 200 ReLu neural network trained by the same way mentioned above.

Original: [-For Dyna-TD, we start using the model after 10 k steps and set m = 100 , k = 
-]
Revised: [-For Dyna-TD, we start using the model after 10 k steps and set m = 100 , k = 
-]

Original: and we do search-control every 50 environment time steps to reduce computational cost.

Original: To alleviate the effect of model error, we use only 16 out ofsamples from the search-control queue in a mini-batch.

Original: Algorithm

Original: Input or notations: k = 20 : number search-control states to acquire by hill climbing, k b = 100 : the budget of maximum number of hill climbing steps; ρ = 0 .

Original: 5 : percentage of samples from search-control queue, d : S ⊂ R d ; empty search-control queue B sc and ER buffer B er empirical covariance matrix: ˆΣ s ← I µ ss ← 0 ∈ R d × d , µ s ← 0 ∈ R d (auxiliary variables for computing empirical covariance matrix, sample average will be maintained for µ ss , µ s ) n τ ← 0 : count for parameter updating times, τ ← 1000 target network updating frequency ϵ accept ← 0 : threshold for accepting a state

Original: Initialize Q network Q θ and target Q network Q θ ′ for t = 1 , 2 , . . .

Original: do

Original: Observe ( s, a, s ′ , r ) and add it to B er µ ss ← µ ss ( t − 1)+ ss ⊤ t , µ s ← µ s ( t − 1)+ s t ˆΣ s ← µ ss − µ s µ ⊤ s ϵ accept ← (1 − β ) ϵ accept

Original: +

Original: β

Original: || s ′

Original: − s || 2 for β = 0 .//

Original: Hill climbing on absolute TD error

Original: Sample s from B er , c ← 0 , ˜ s ← s, i ←while c < k and i < k b do // since environment is deterministic, the environment model becomes a Dirac-delta distribution and we denote it as a deterministic function M :

Original: S × A (cid:55)→ S

Original: × R s ′ , r ← M ( s, a ) ˆ y ← r + γ max a Q θ ( s ′ , a ) // add a smooth constant 10 − 5 inside the logarithm s ← s + α h ∇ s log( | ˆ y − max a Q ( s, a ; θ t ) | + 10 − 5 ) + X, X ∼ N (0 , 0 .

Original: 01ˆΣ s ) if s is out of the state space

Original: then // restart hill climbing

Original: Sample s from B er , ˜ s ← s continue if || ˜ s − s || 2 / √ d ≥ ϵ accept then

Original: Add s into B sc , s c c

Original: i ← i

Original: for n times do if mod ( n then

Original: Q

Original: Q