Using hypothetical experience simulated from an environment model can significantly improve sample efficiency of RL agents (Ha and Schmidhuber, 2018; Holland et al., 2018; Pan et al., 2018; van Hasselt et al., 2019). Dyna (Sutton, 1991) is a classical MBRL architecture where the agent uses real experience to updates its policy as well as its reward and dynamics models. In-between taking actions, the agent can simulate hypothetical experience from the model to further improve the policy.
An important question for effective Dyna-style planning is search-control: from what states should the agent simulate hypothetical transitions? On each planning step in Dyna, the agent has to select a state and action from which to query the model for the next state and reward. This question, in fact, already arises in what is arguably the simplest variant of Dyna: Experience Replay (ER) (Lin, 1992)
. In ER, visited transitions are stored in a buffer and at each time step, a mini-batch of experiences is sampled to update the value function. ER can be seen as an instance of Dyna, using a (limited) non-parametric model given by the buffer (seevan Seijen and Sutton (2015) for a deeper discussion). Performance can be significantly improved by sampling proportionally to priorities based on errors, as in prioritized ER (Schaul et al., 2016; de Bruin et al., 2018), as well as specialized sampling for the off-policy setting (Schlegel et al., 2019).
Search-control strategies in Dyna similarly often rely on using priorities, though they can be more flexible in leveraging the model rather than being limited to only retrieving visited experiences. For example, a model enables the agent to sweep backwards by generating predecessors, as in prioritized sweeping (Moore and Atkeson, 1993; Sutton et al., 2008; Pan et al., 2018; Corneil et al., 2018). Other methods have tried alternatives to error-based prioritization, such as searching for states with high reward (Goyal et al., 2019), high value (Pan et al., 2019) or states that are difficult to learn (Pan et al., 2020). Another strategy has been to generate a more diverse set of states from which to sample (Gu et al., 2016; Holland et al., 2018), or to modulate the distance of such states from real experience (Janner et al., 2019). These methods are all supported by nice intuitions, but as yet lack solid theoretical reasons for why they can improve sample efficiency.
In this work, we provide new insights into how to choose the sampling distribution over states from which we generate hypothetical experience. In particular, we theoretically motivate why error-based prioritization is effective, and provide a mechanism to generate states according to more accurate error estimates. We first prove thatregression with error-based prioritized sampling is equivalent to minimizing a cubic objective with uniform sampling in an ideal setting. We then show that minimizing the cubic power objective has a faster convergence rate during early learning stage, providing theoretical motivation for error-based prioritization. We point out that this ideal setting is hard to achieve in practice using only ER due to two issues: insufficient sample space coverage and outdated priorities. Hence we propose a search-control strategy in Dyna that leverages a model to simulate errors and to find states with high expected error. Finally, we demonstrate the efficacy of our method on various benchmark domains and an autonomous driving application.
2 Problem Formulation
We formalize the problem as a Markov Decision Process (MDP), a tupleincluding state space , action space
, probability transition kernel, reward function , and discount rate . At each environment time step , an RL agent observes a state , and takes an action . The environment transitions to the next state , and emits a scalar reward signal . A policy is a mapping that determines the probability of choosing an action at a given state.
The agent’s objective is to find an optimal policy. A popular algorithm is Q-learning (Watkins and Dayan, 1992), where parameterized action-values are updated using for stepsize with TD-error
. The policy is defined by acting greedily w.r.t. these action-values. ER is critical when using neural networks to estimate, as used in DQN (Mnih et al., 2015), both to stabilize and speed up learning. MBRL has the potential to provide even further sample efficiency improvements.
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. It is featured by a special Hill Climbing (HC)111The term Hill Climbing is used for generality as the vanilla gradient ascent procedure is modified to resolve certain challenges (Pan et al., 2019). search-control—the mechanism of generating states or state-action pairs from which to query the model to get next states and rewards (i.e. hypothetical experiences)—which generates states by hill climbing on some criterion function . For example, is the value function from Pan et al. (2019) and is the gradient magnitude from Pan et al. (2020). The former is used as measure of “importance” of states and the latter is considered as a measure of value approximation difficulty.
These hypothetical transitions are treated just like real transitions. For this reason, HC-Dyna combines both real experience and hypothetical experience into mini-batch updates. These updates, performed before taking the next action, are called planning updates, as they improve the action-value estimates—and so the policy—by a model.
3 A Deeper Look at Error-based Prioritized Sampling
In this section, we provide theoretical motivation for error-based prioritized sampling, and empirically investigate several insights highlighted by this theory. We show that prioritized sampling can be reformulated as optimizing a cubic power objective with uniform sampling. We prove that optimizing the cubic objective provides a faster convergence rate during early learning. Based on these results, we point out that for error-based prioritization, such as prioritized ER, to manifest advantages relies on up-to-date priorities and sufficient coverage of the sample space, and empirically highlight issues when those two properties are not obtained.
3.1 Prioritized Sampling as a Cubic Objective
In regression, we minimize the mean squared error , for training set and function approximator , such as a neural network. In error-based prioritized sampling, we define the priority of a sample as ; the probability of drawing a sample is typically . We employ the following form to compute the probabilities:
We can show an equivalence between the gradients of the squared objective with this prioritization and the cubic power objective . See Appendix A.2 for the proof.
For a constant determined by , we have
This simple theorem provides an intuitive reason for why prioritized sampling can help improve sample efficiency: the gradient direction of cubic function is sharper than that of the square function when the error is relatively large (Figure 1). Theorem 2 further characterizes the difference between the convergence rates by optimizing the mean square error and the cubic power objective.
Theorem 2 (Fast early learning).
Consider the following two objectives: , and . Denote , and . Define the functional gradient flow updates on these two objectives:
Given error threshold , define the hitting time and . For any initial function value s.t. , such that .222Finding the exact value of would require a definition of ordering on complex plane, which leads to and is a Wright Omega function, then we have . Our theorem statement is sufficient for the purpose of characterizing convergence rate.
Please see Appendix A.3. Given the same and the same initial value of , first we derive Then we analyze the condition on to see when , i.e. minimizing the square error is slower than minimizing the cubic error. ∎
The above theorem says that when the initial error is relatively large, it is faster to get to a certain low error point with the cubic objective. We can test this in simulation, with the following minimization problems: and . We use the hitting time formulae derived in the proof, to compute the hitting time ratio under different initial values and final error value . In Figure 1(c)(d), we can see that it usually takes a significantly shorter time for the cubic loss to reach a certain with various values.
3.2 Empirical Demonstrations
In this section, we empirically show: 1) the practical performance of cubic objective; 2) the importance of sufficient sample space coverage and of updating priorities of all training samples; 3) the reasons for why high power objective should not be preferred in general. We refer readers to A.6 for missing details and to A.7 for additional experiments.
We conduct experiments on a supervised learning task. We use the dataset fromPan et al. (2020), where it is shown that the high frequency region is the main source of prediction error. Hence we expect prioritized sampling to make a clear difference in terms of sample efficiency. We generate a training set by uniformly sampling
and adding zero-mean Gaussian noise with standard deviationto the target values, where if and if . The testing set contains k samples and the targets are not noise-contaminated.
We compare the following algorithms. L2: the regression with uniformly sampling from . Full-PrioritizedL2: the 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. PrioritizedL2: the only difference with Full-PrioritizedL2 is that only the priorities of those training examples sampled in the mini-batch are updated at each iteration, the rest of the training samples keep the original priorities. Note that this resembles what the vanilla Prioritized ER does in RL setting (Schaul et al., 2016). Cubic: minimizing the cubic objective with uniformly sampling. Power4: with uniformly sampling. We include it to show that there is almost no gain and may get hurt by using higher powers.
We use tanh layers for all algorithms and optimize learning rate from the range . Figure 2 (a)-(d) show the learning curves in terms of testing error of all the above algorithms with various settings.333We show the testing error as it is finally concerned. The training error has similar comparative performance and is presented in Appendix 3, where we also include additional results with different settings. We identify five important observations: 1) with a small mini-batch size , there is a significant difference between Full-PrioritizedL2 and Cubic; 2) with increased mini-batch size, although all algorithms perform better, Cubic achieves largest improvement and its behavior tends to approximate the prioritized sampling algorithm; 3) as shown in Figure 2 (a), the prioritized sampling does not show advantage when the training set is small; 4) Prioritized without updating all priorities can be significantly worse than the vanilla (uniform sampling) regression; 5) when increasing noise standard deviation from to , all algorithms perform worse and the higher power the objective is, the more it can get hurt.
The importance of sample space coverage. Observation 1) and 2) show that high power objective has to use a much larger mini-batch size to achieve comparable performance with the with prioritized sampling. Though this coincides with Theorem 1 in that the two algorithms is equivalent in expectation, prioritized sampling seems to be robust to small mini-batch, which is an advantage in stochastic gradient methods. A possible reason is that prioritized sampling allows to immediately get many samples from those high error region; while uniformly sampling can get fewer those samples with limited mini-batch size. This motivates us to test prioritized sampling with a small training set where both algorithms can get fewer samples everywhere. Figure 2(a) together with (b) indicate that prioritized sampling needs sufficient samples across the sample space to maintain advantage. This requirement is intuitive but it illuminates an important limitation of prioritized ER in RL: only those visited real experiences from the ER buffer can get sampled. If the state space is large, the ER buffer likely contains only a small subset of the state space, indicating a very small training set.
Thorough priority updating. Observation 4) reminds us the importance of using an up-to-date sampling distribution at each time step. Outdated priorities change the sampling distribution in an unpredictable manner and the learning performance can get hurt. Though the effect of whether updating priorities of all samples or not is intuitive, it receives little attention in the existing RL literature. We further verify this phenomenon on the classical Mountain Car domain (Sutton and Barto, 2018; Brockman et al., 2016). Figure 2(e) shows the evaluation learning curves of different variants of Deep Q networks (DQN) corresponding to the supervised learning algorithms. We use a small ReLu NN as the -function. We expect that a small NN should highlight the issue of priority updating: every mini-batch update potentially perturbs the values of many other states. Hence it is likely that many experiences in the ER buffer have the wrong priorities without thorough priority updating. One can see that Full-PrioritizedER significantly outperforms the vanilla PrioritizedER algorithm which only updates priorities for those in the sampled mini-batch at each time step. However, updating the priorities of all samples at each time step in the ER buffer is usually computationally too expensive and is not scalable to number of visited samples.
Regarding high power objectives. As we discussed above, observation 1) and 2) tell us that that high power objective would require a large mini-batch size (ideally, use a batch algorithm, i.e. the whole training set) to manifest the advantage in improving convergence rate. This makes the algorithm not easily scalable to large training dataset. Observation 5) indicates another reason for why a high power objective should not be preferred: it augments the effect of noise added to the target variables. In Figure 2(d), the Power4 objective suffers most from the increased target noise.
or Guassian noises varianceadded to the training targets. (a) is using and a smaller training set (solid line for , dotted line for ) than others but has the same testing set size. (e) shows the a corresponding experiment in RL setting on the classical mountain car domain. The results are averaged over random seeds on (a)-(d) and
on (e). The shade indicates standard error.
4 Acquiring Samples From Temporal Difference Error-based Sampling Distribution on Continuous Domains
In this section, we propose a method attempting to sample states: 1) which are not restricted to those visited ones; 2) with probability proportional to the expected TD error magnitude and the probability is computed according to -function parameters at current time step (i.e. this typically would require to compute priorities of all samples at each time step). We start by the following theorem. We denote as the transition probability given a policy .
Sampling method. Given the state , let be a differentiable value function under policy parameterized by . Define: , and denote the TD error as . Given some initial state , define the state sequence as the one generated by state updating rule , where is a sufficiently small stepsize and is a Gaussian random variable with a sufficiently small variance. Then the sequence
is a Gaussian random variable with a sufficiently small variance. Then the sequenceconverges to the distribution .
The proof is a direct consequence of the convergent behavior of Langevin dynamics stochastic differential equation (SDE)(L., 1996; Welling and Teh, 2011; Zhang et al., 2017). We include a brief discussion and background knowledge in the Appendix A.4.
In practice, we can compute the state value estimate by as suggested by Pan et al. (2019). In the case that a true environment model is not available, we have to compute an estimate of by a learned model. Then at each time step , states approximately following the distribution can be generated by
where is a Gaussian random variable with zero-mean and reasonably small variance. In implementation, observing that is small, we opt to consider as a constant given a state
without backpropagating through it. We provide a upper bound in below theorem for the difference between the sampling distribution acquired by the true model and the learned model. We denote the transition probability distribution under policyand the true model as ; denote that with the learned model as . Let and be the convergent distributions described in Theorem 3 by using true and learned models respectively. Let be the total variation distance between two probability distributions. Define .
Assume: 1) the reward magnitude is bounded and define ; 2) the largest model error for a single state is some small value: . Then .
Please see Appendix A.5 for proof.
Algorithmic details. We present the key details of our algorithm called Dyna-TD (Temporal Difference error) in the Algorithm 3 in Appendix A.6. The algorithm closely follows the previous hill climbing Dyna by Pan et al. (2019). At each time step, we run the updating rule 3 and record the states along the gradient trajectories to populate the search-control queue. Then during planning stage, we sample states from the search-control queue and pair them with on-policy actions to get state-action pairs. We query the model those state-action pairs to acquire corresponding next states, rewards to acquire hypothetical experiences in the form of . Then we mix those hypothetical experiences with real experiences from the ER buffer to form a mixed mini-batch to update the NN parameters.
Empirical verification of sampling distribution. We validate the efficacy of our sampling method by empirically examining the distance between the sampling distribution acquired by our gradient ascent rule (3) (denoted as ) and the desired distribution computed by thorough priority updating of all states under the current parameter on the GridWorld domain (Pan et al., 2019) (Figure 3(a)), where the probability density can be conveniently approximated by discretization. We record the distance change when we train our Algorithm 3. The distance between the sampling distribution fo Prioritized ER (denoted as ) is also included for comparison. All those distributions are computed by normalizing visitation counts on the discretized GridWorld. We compute the distances of to by two sensible weighting schemes: 1) on-policy weighting: , where is approximated by uniformly sample k states from a recency buffer; 2) uniform weighting: . All details are in Appendix A.6
Figure 3(b)(c) show that our algorithm Dyna-TD, either with a true or an online learned model, maintains a significantly closer distance to the desired sampling distribution than PrioritizedER under both weighting schemes. Furthermore, despite there is mismatch between implementation and our above Theorem 3 in that Dyna-TD may not run enough gradient steps to reach stationary distribution, the induced sampling distribution is quite close to the one by running a long gradient steps (Dyna-TD-Long), which is closer to the theorem. This indicates that the we can reduce time cost by lowering the number of gradient steps, while keep the sampling distribution similar.
In this section, we empirically show that our algorithm achieves stable and consistent performances across different settings. We firstly show the overall comparative performances on various benchmark domains. We then show that our algorithm Dyna-TD is more robust to environment noise than PrioritizedER. Last, we demonstrate the practical utility of our algorithm on an autonomous driving vehicle application. Note that our Dyna-TD keeps using the same hill climbing parameter setting across all benchmark domains. We refer readers to the Appendix A.6 for any missing details.
Baselines. We include the following baseline competitors. ER is the DQN with a regular ER buffer without prioritized sampling. PrioritizedER is using a priority queue to store visited experiences and each experience is sampled proportional to its TD error magnitude. Note that according to the original paper (Schaul et al., 2016), after each mini-batch update, only the priorities of those samples in the mini-batch are updated. Dyna-Value (Pan et al., 2019) is the Dyna variant which performs hill climbing on value function to acquire states to populate the search-control queue. Dyna-Frequency (Pan et al., 2020) is the Dyna variant which performs hill climbing on the norm of the gradient of the value function to acquire states to populate the search-control queue.
Overall Performances. Figure 4 shows the overall performances of different algorithms on Acrobot, CartPole, GridWorld (Figure 3(a)) and MazeGridWorld (Figure 4(g)). Our key observations are: 1) Dyna-Value or Dyna-Frequency may converge to a sub-optimal policy when using a large number of planning steps; 2) Dyna-Frequency has clearly inconsistent performances across different domains; 3) our algorithm performs the best in most cases; and even with an online learned model, our algorithm outperforms others on most of the tasks; 4) in most cases, model-based methods (Dyna-) significantly outperform model-free methods.
Our interpretations of those observations are as following. First, for Dyna-Value, think about the case where some states have high value but low TD error, the valued-based hill climbing methods may still frequently acquire those states and this can waste of samples and meanwhile incurs sampling distribution bias which leads to a sub-optimal policy. This sub-optimality can be clearly observed on Acrobot, GridWorld and MazeGridWorld. Similar reasoning applies to Dyna-Frequency. Second, for Dyna-Frequency, as indicated by the original paper Pan et al. (2020), the gradient or hessian norm have very different numerical scales and highly depends on the choice of the function approximator or domain, this indicates that the algorithm requires finely tuned parameter setting as testing domain varies, which possibly explains its inconsistent performances across domains. Furthermore, the Hessian-gradient product can be expensive and we observe Dyna-Frequency takes much longer time to run the experiment than other Dyna variants. Third, since we fetch the same number of states during the search-control process for all Dyna variants, the superior performance of our Dyna-TD indicates the utility of the samples acquired by our approach. Fourth, notice that each algorithm runs the same number of planning steps, while model-based algorithms perform significantly better, this indicates the benefits of leveraging the generalization power of the learned value function. In contrast, model-free methods can only utilize visited states.
Robustness to Noise. As a correspondent experiment to the supervised learning setting in Section 3, we show that our algorithm is more robust to increased noise variance than the prioritized ER. Figure 5 show the evaluation learning curves on Mountain Car with planning steps and reward noise standard deviation . We would like to identify three key observations. First, our algorithm’s relative performance to PrioritizedER resembles the Full-PrioritizedL2 to PrioritizedL2 from the supervised learning setting, as Full-PrioritizedL2 is more robust to target noise than PrioritizedL2. Second, our algorithm achieves almost the same performance as Dyna-Frequency which is claimed to be robust to noise by Pan et al. (2020). Last, as observed on other environments, usually all algorithms can benefit from the increased number of planning steps; however, the PrioritizedER and ER get clearly hurt when using more planning steps with the noise presented, this illuminates the limitation of the model-free methods.
Practical Utility in Autonomous Driving Application. We study the practical utility of our method in an autonomous driving application (Leurent, 2018) with an online learned model. As shown in Figure 6 (a), we test on the roundabout-v0 domain, where the agent (i.e. the green car) should learn to go through a roundabout without collisions while maintaining as high speed as possible. We would like to emphasize that the domains are not difficult to train to reach some near optimal policy; this can be seen from the previous work by Leurent et al. (2019), which shows that different algorithms achieve similar episodic return. However, we observe that there is a significantly lower number of car crashes with the policy learned by our algorithm on both domains as we show in Figure 6(b). This coincides with our intuition—the crash should incur high temporal difference error and our method of actively searching such states by gradient ascent should make the agent get sufficient training during planning stage, hence the agent can better handle these scenarios than model-free methods.
In this work, we provide theoretical reason for why prioritized ER can help improve sample efficiency. We identify crucial factors for it to be effective: sample space coverage and thorough priority updating. We then propose to sample states by Langevine dynamics and conduct experiments to show the efficacy of our method. Interesting future directions include: 1) studying the effect of model error in sample efficiency with our search control; 2) applying our method with a feature-to-feature model, which can improve scalability of our method.
7 Broader Impact Discussion
This work is about methodology of how to efficiently sample hypothetical experiences in model-based reinforcement learning. Potential impact of this work is likely to be further improvement of sample efficiency of reinforcement learning methods, which should be generally beneficial to the reinforcement learning research community. We have not considered specific applications or scenarios as the goal of this work.
- TensorFlow: large-scale machine learning on heterogeneous systems. Software available from tensorflow.org. Cited by: §A.6.
- OpenAI Gym. Note: arXiv:1606.01540 Cited by: §A.6.2, §3.2.
- Diffusion for global optimization in . SIAM Journal on Control and Optimization, pp. 737–753. Cited by: §A.4.
- Efficient model-based deep reinforcement learning with variational state tabulation. In International Conference on Machine Learning, pp. 1049–1058. Cited by: §A.1, §1.
- Experience selection in deep reinforcement learning for control. Journal of Machine Learning Research. Cited by: §1.
- Nonasymptotic convergence analysis for the unadjusted Langevin algorithm. The Annals of Applied Probability, pp. 1551–1587. Cited by: §A.4.
Event labeling combining ensemble detectors and background knowledge.
Progress in Artificial Intelligence, pp. 1–15. Cited by: §A.7.
- Understanding the difficulty of training deep feedforward neural networks. In International Conference on Artificial Intelligence and Statistics, Cited by: §A.6.2.
- Recall traces: backtracking models for efficient reinforcement learning. In International Conference on Learning Representations, Cited by: §A.1, §1.
- Continuous Deep Q-Learning with Model-based Acceleration.. In International Conference on Machine Learning, pp. 2829–2838. Cited by: §A.1, §1.
- Recurrent world models facilitate policy evolution. Advances in Neural Information Processing Systems, pp. 2450–2462. Cited by: §1.
- The effect of planning shape on dyna-style planning in high-dimensional state spaces. CoRR abs/1806.01825. Cited by: §1, §1.
- When to trust your model: model-based policy optimization. Advances in Neural Information Processing Systems, pp. 12519–12530. Cited by: §A.1, §1.
- Adam: a method for stochastic optimization. International Conference on Learning Representations. Cited by: §A.6.
- Exponential convergence of langevin distributions and their discrete approximations. Bernoulli, pp. 341–363. Cited by: §A.4, §4.
- Approximate robust control of uncertain dynamical systems. CoRR abs/1903.00220. External Links: Cited by: §A.6.2, §5.
- An environment for autonomous driving decision-making. GitHub. Note: https://github.com/eleurent/highway-env Cited by: §5.
- Self-Improving Reactive Agents Based On Reinforcement Learning, Planning and Teaching.. Machine Learning. Cited by: §1.
- Human-level control through deep reinforcement learning.. Nature. Cited by: §2.
- Prioritized sweeping: reinforcement learning with less data and less time. Machine learning, pp. 103–130. Cited by: §A.1, §1.
- Frequency-based search-control in dyna. In International Conference on Learning Representations, Cited by: §A.6.2, §A.6.2, §1, §2, §3.2, Figure 4, §5, §5, §5, footnote 5.
- Hill climbing on value estimates for search-control in dyna. In International Joint Conference on Artificial Intelligence, Cited by: §A.1, §A.6.2, §1, §2, Figure 3, §4, §4, §4, §5, footnote 1.
- Organizing experience: a deeper look at replay mechanisms for sample-based planning in continuous state domains. In International Joint Conference on Artificial Intelligence, pp. 4794–4800. Cited by: §A.1, §1, §1.
- Prioritized Experience Replay. In International Conference on Learning Representations, Cited by: §A.6.1, §1, §3.2, §5.
- Importance resampling for off-policy prediction. Advances in Neural Information Processing Systems 32, pp. 1799–1809. Cited by: §1.
- Reinforcement learning: an introduction. Second edition, The MIT Press. Cited by: §A.1, §3.2.
- Dyna-style planning with linear function approximation and prioritized sweeping. In UAI, pp. 528–536. Cited by: §A.1, §1.
- Integrated architectures for learning, planning, and reacting based on approximating dynamic programming. In ML, Cited by: §A.1.
- Integrated modeling and control based on reinforcement learning and dynamic programming. In Advances in Neural Information Processing Systems, Cited by: §1, §2.
- When to use parametric models in reinforcement learning?. In Advances in Neural Information Processing Systems, pp. 14322–14333. Cited by: §1.
- A deeper look at planning as learning from replay. In International Conference on Machine Learning, pp. 2314–2322. Cited by: §1.
- Q-learning. Machine Learning, pp. 279–292. Cited by: §2.
- Bayesian learning via stochastic gradient Langevin dynamics. In International Conference on Machine Learning, pp. 681–688. Cited by: §4.
- A hitting time analysis of stochastic gradient langevin dynamics. In Conference on Learning Theory, pp. 1980–2022. Cited by: §4.
Appendix A Appendix
In Section A.1, we introduce some background in Dyna architecture. We then provide the full proof of Theorem 2 in Section A.3. We briefly discuss Langevin dynamics in Section A.4, and present the proof for Theorem 4 in Section A.5. Details for reproducible research are in Section A.6. We provide supplementary experimental results in Section A.7.
a.1 Background in Dyna
Dyna integrates model-free and model-based policy updates in an online RL setting (Sutton, 1990). As shown in Algorithm 2, at each time step, a Dyna agent uses the real experience to learn a model and performs model-free policy update. During the planning stage, simulated experiences are acquired from the model to further improve the policy. It should be noted that the concept of planning refers to any computational process which leverages a model to improve policy, according to Sutton and Barto (2018). 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 the sample efficiency. There are abundant existing works (Moore and Atkeson, 1993; Sutton et al., 2008; Gu et al., 2016; Pan et al., 2018; Corneil et al., 2018; Goyal et al., 2019; Janner et al., 2019; Pan et al., 2019) report different level of sample efficiency improvements by using different way of generating hypothetical experiences during the planning stage.
a.2 Proof for Theorem 1
Theorem 1. For a constant determined by , we have
The proof is very intuitive. The expected gradient of the uniform sampling method is
Setting completes the proof. ∎
a.3 Proof for Theorem 2
Theorem 2. Consider the following two objectives: , and . Denote , and . Define the functional gradient flow updates on these two objectives:
Given error threshold , define the hitting time and . For any initial function value s.t. , such that .
For the gradient flow update on the objective, we have,
Taking integral, we have,
which is equivalent to (letting ),
On the other hand, for the gradient flow update on the objective, we have,
Taking integral, we have,
which is equivalent to (letting ),
Then we have,
Define the function is continuous and . We have , and is monotonically increasing for and monotonically decreasing for .
Given , we have . Using the intermediate value theorem for on , we have , such that . Since is monotonically increasing on and monotonically decreasing on , for any , we have .444Note that by the design of using gradient descent updating rule. If the two are equal, holds trivially. Hence we have,
Remark 1. Figure 7 shows the function . Fix arbitrary , there will be another root s.t. . However, there is no real-valued solution for . The solution in is , where is a Wright Omega function. Hence, finding the exact value of would require a definition of ordering on complex plane. Our current theorem statement is sufficient for the purpose of characterizing convergence rate. The theorem states that there always exists some desired low error level , minimizing the square loss converges slower than the cubic loss.
a.4 Discussion on the Langevin Dynamics
Define a SDE: , where is a -dimensional Brownian motion and is a continuous differentiable function. It turns out that the Langevin diffusion converges to a unique invariant distribution (Chiang et al., 1987). By applying the Euler-Maruyama discretization scheme to the SDE, we acquire the discretized version where is an i.i.d. sequence of standard -dimensional Gaussian random vectors and is a sequence of step sizes. It has been proved that the limiting distribution of the sequence converges to the invariant distribution of the underlying SDE L. (1996); Durmus and Moulines (2017). As a result, considering as , as completes the proof for Theorem 3.
a.5 Proof for Theorem 4
We now provide the error bound for Theorem 4. We denote the transition probability distribution under policy with the true model as ; denote that with the learned model as . Let and be the convergent distributions described in Theorem 3 by using true model and learned model respectively. Let be the total variation distance between two probability distributions. Define . Then we have the following bound.
Theorem 4. Assume: 1) the reward magnitude is bounded and define ; 2) the largest model error for a single state is some small value: . Then .
First, we bound the estimated temporal difference error. Fix an arbitrary state , it is sufficient the consider the case , then
Then we take into consideration of the normalizer of the Gibbs distribution. Consider the case first.
This corresponds to the second term in the maximum operation. The first term corresponds to the case . This completes the proof. ∎
a.6 Reproducible Research
a.6.1 Reproduce experiments before Section 5
Supervised learning experiment.
For the supervised learning experiment shown in section 3, we use tanh units neural network, with learning rate swept from for all algorithms. We compute the constant as specified in the Theorem 1 at each time step for Cubic loss. We compute the testing error every iterations/mini-batch updates and our evaluation learning curves are plotted by averaging random seeds. For each random seed, we randomly split the dataset to testing set and training set and the testing set has k data points. Note that the testing set is not noise-contaminated.
Reinforcement Learning experiments in Section 3.
We use a particularly small neural network to highlight the issue of incomplete priority updating. 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. We choose a small neural network, in which case a complete priority updating for all states should be very important. We set the maximum ER buffer size as k and mini-batch size as . The learning rate is and the target network is updated every k steps.
Distribution distance computation in Section 4.
We now introduce the implementation details for Figure 3. The distance is estimated by the following steps. First, in order to compute the desired sampling distribution, we discretize the domain into