summaries: Popular RL (both online and offline) algorithms iterate between two stages: policy evaluation where a Q-function: $S \times A \rightarrow \mathbb{E} \sum r$ is estimated and policy improvement where the policy $\pi: S \rightarrow A$ which maximizes the rewards is constructed. Typically, the stages are interleaved through the training process. The paper evaluates and argues for the idea of using, in the case of offline RL, only a single step of policy improvement after training Q-function to convergence. # Offline RL Without Off-Policy Evaluation  ## Summary  The paper examines an issue with existing offline RL methods and proposes a way to prevent the issue that leads to a strong family of baselines. The key idea is not to perform multiple steps of off-policy evaluation and improvement in offline RL.  In addition to providing evidence to the claim that one-step methods outperform multistep and iterative ones, the paper also provides explantion and a toy example that shed light on the issues faced by multistep and iterative offline RL methods. I believe these examples can be useful in the future as "unit tests" for new offline RL methods.  ## For the response  Could you please comment on Gulcehre et al. (https://arxiv.org/pdf/2103.09575.pdf) in relation to your work?   Please include a discussion of the broader societal impact of your work. The paper investigates the well-known 1-step heuristic for Q-function based offline RL methods. The method is evaluated for a model-free, Q-function based offline RL method on various benchmarks and the overall good performance of the approach is shown. The paper differs from results published in [1] mainly by the benchmarks used and the analysis of the reasons for the good performance.   [1] Gulcehre et al, Addressing Extrapolation Error in Deep Offline Reinforcement Learning, preprint 2021.  The authors study the notion of iterative policy improvement in offline reinforcement learning, notably finding that a single policy improvement step can outperform standard iterative benchmarks on the D4RL benchmark. To provide more insight on this, the authors also compare to an intermediate version, “multi-step”, and analyze the performance of the three variants (one-step, multi-step, and iterative) with different regularization hyperparameters. They also show results for the MSE of the estimated Q function, as well as illustrate multi-step overestimation on Gridworld environments. Finally, the authors discuss when multi-step algorithms are better, namely when noise signal is low and more propagation of signal can help. This paper applies a simple baseline to the offline-RL paradigm. Rather than iterating through steps of policy evaluation and improvement as done by most current offline-RL algorithms, in this work the authors investigate the performance of one-step of constrained policy improvement on the D4RL benchmark. This simple baseline is shown to perform considerably well when compared to existing methods. The paper then claims that the reason for this is likely due to the deleterious effects of off-policy evaluation. A simple experiment of different algorithms shows that strong regularization against the behavior policy during learning can be crucial in the offline setting. The authors then analyze the potential pitfalls of off policy evaluation through simple analysis on an existing task and a convincing gridworld experiment. Finally the paper tries to shed some intuition as to when multi-step approaches may perform better than the one-step methods.  
abstractText: Most prior approaches to offline reinforcement learning (RL) have taken an iterative actor-critic approach involving off-policy evaluation. In this paper we show that simply doing one step of constrained/regularized policy improvement using an on-policy Q estimate of the behavior policy performs surprisingly well. This onestep algorithm beats the previously reported results of iterative algorithms on a large portion of the D4RL benchmark. The one-step baseline achieves this strong performance while being notably simpler and more robust to hyperparameters than previously proposed iterative algorithms. We argue that the relatively poor performance of iterative approaches is a result of the high variance inherent in doing off-policy evaluation and magnified by the repeated optimization of policies against those estimates. In addition, we hypothesize that the strong performance of the one-step algorithm is due to a combination of favorable structure in the environment and behavior policy.
authors.name: David Brandfonbrener
authors.name: William F. Whitney
authors.name: Rajesh Ranganath
authors.name: Joan Bruna
references.authors: Joshua Achiam David Held Aviv Tamar Pieter Abbeel
references.title: Constrained policy optimization
references.venue: In International Conference on Machine Learning,
references.authors: Alekh Agarwal Nan Jiang S. Kakade
references.title: Reinforcement learning: Theory and algorithms
references.authors: P. Amortila Nan Jiang Tengyang Xie
references.title: A variant of the wang-foster-kakade lower bound for the discounted setting
references.venue: ArXiv, abs/2011.01075,
references.authors: Jacob Buckman Carles Gelada Marc G. Bellemare
references.title: The importance of pessimism in fixed-dataset policy optimization, 2020
references.authors: John Burkhardt
references.title: The truncated normal distribution
references.authors: Jinglin Chen Nan Jiang
references.title: Information-theoretic considerations in batch reinforcement learning
references.venue: In Proceedings of the 36th International Conference on Machine Learning
references.authors: Xinyue Chen Zijian Zhou Zheng Wang Che Wang Yanqiu Wu Keith Ross
references.title: Bail: Bestaction imitation learning for batch deep reinforcement learning
references.venue: Advances in Neural Information Processing Systems,
references.authors: Yaqi Duan Zeyu Jia Mengdi Wang
references.title: Minimax-optimal off-policy evaluation with linear function approximation
references.venue: In International Conference on Machine Learning,
references.authors: Justin Fu Aviral Kumar Ofir Nachum George Tucker Sergey Levine
references.title: D4rl: Datasets for deep data-driven reinforcement learning
references.venue: arXiv preprint arXiv:2004.07219,
references.authors: Scott Fujimoto David Meger Doina Precup
references.title: Off-policy deep reinforcement learning without exploration
references.venue: arXiv preprint arXiv:1812.02900,
references.authors: Scott Fujimoto Herke van Hoof David Meger
references.title: Addressing function approximation error in actor-critic methods
references.venue: arXiv preprint arXiv:1802.09477,
references.authors: Scott Fujimoto Edoardo Conti Mohammad Ghavamzadeh Joelle Pineau
references.title: Benchmarking batch deep reinforcement learning algorithms
references.venue: arXiv preprint arXiv:1910.01708,
references.authors: Wonjoon Goo Scott Niekum
references.title: You only evaluate once – a simple baseline algorithm for offline rl
references.venue: In Offline Reinforcement Learning Workshop at Neural Information Processing Systems,
references.authors: Caglar Gulcehre Ziyu Wang Alexander Novikov Tom Le Paine Sergio Gómez Colmenarejo Konrad Zolna Rishabh Agarwal Josh Merel Daniel Mankowitz Cosmin Paduraru
references.title: Rl unplugged: Benchmarks for offline reinforcement learning
references.venue: arXiv preprint arXiv:2006.13888,
references.authors: Caglar Gulcehre Sergio Gómez Colmenarejo Ziyu Wang Jakub Sygnowski Thomas Paine Konrad Zolna Yutian Chen Matthew Hoffman Razvan Pascanu Nando de Freitas
references.title: Regularized behavior value estimation
references.venue: arXiv preprint arXiv:2103.09575,
references.authors: Natasha Jaques Asma Ghandeharioun Judy Hanwen Shen Craig Ferguson Agata Lapedriza Noah Jones Shixiang Gu Rosalind Picard
references.title: Way off-policy batch deep reinforcement learning of implicit human preferences in dialog, 2019
references.authors: Sham Kakade John Langford
references.title: Approximately optimal approximate reinforcement learning
references.venue: In ICML,
references.authors: Diederik P Kingma Jimmy Ba
references.title: Adam: A method for stochastic optimization
references.venue: arXiv preprint arXiv:1412.6980,
references.authors: Ilya Kostrikov Jonathan Tompson Rob Fergus Ofir Nachum
references.title: Offline reinforcement learning with fisher divergence critic regularization
references.venue: arXiv preprint arXiv:2103.08050,
references.authors: Aviral Kumar Justin Fu Matthew Soh George Tucker Sergey Levine
references.title: Stabilizing off-policy q-learning via bootstrapping error reduction
references.venue: In Advances in Neural Information Processing Systems,
references.authors: Aviral Kumar Aurick Zhou George Tucker Sergey Levine
references.title: Conservative q-learning for offline reinforcement learning
references.venue: arXiv preprint arXiv:2006.04779,
references.authors: Romain Laroche Paul Trichelair Remi Tachet Des Combes
references.title: Safe policy improvement with baseline bootstrapping
references.venue: In International Conference on Machine Learning,
references.authors: Sergey Levine Aviral Kumar George Tucker Justin Fu
references.title: Offline reinforcement learning: Tutorial, review, and perspectives on open problems
references.venue: arXiv preprint arXiv:2005.01643,
references.authors: Timothy P Lillicrap Jonathan J Hunt Alexander Pritzel Nicolas Heess Tom Erez Yuval Tassa David Silver Daan Wierstra
references.title: Continuous control with deep reinforcement learning
references.venue: arXiv preprint arXiv:1509.02971,
references.authors: Volodymyr Mnih Koray Kavukcuoglu David Silver Andrei A Rusu Joel Veness Marc G Bellemare Alex Graves Martin Riedmiller Andreas K Fidjeland Georg Ostrovski
references.title: Human-level control through deep reinforcement learning
references.authors: Rémi Munos Tom Stepleton Anna Harutyunyan Marc Bellemare
references.title: Safe and efficient off-policy reinforcement learning
references.venue: In Advances in Neural Information Processing Systems,
references.authors: Ofir Nachum Bo Dai Ilya Kostrikov Yinlam Chow Lihong Li Dale Schuurmans
references.title: Algaedice: Policy gradient from arbitrary experience
references.authors: Kimia Nadjahi Romain Laroche Rémi Tachet des Combes
references.title: Safe policy improvement with soft baseline bootstrapping, 2019
references.authors: Tom Le Paine Cosmin Paduraru Andrea Michi Caglar Gulcehre Konrad Zolna Alexander Novikov Ziyu Wang Nando de Freitas
references.title: Hyperparameter selection for offline reinforcement learning, 2020
references.authors: Xue Bin Peng Aviral Kumar Grace Zhang Sergey Levine
references.title: Advantage-weighted regression: Simple and scalable off-policy reinforcement learning
references.authors: Martin L Puterman Moon Chirl Shin
references.title: Modified policy iteration algorithms for discounted markov decision problems
references.venue: Management Science,
references.authors: Aravind Rajeswaran Vikash Kumar Abhishek Gupta Giulia Vezzani John Schulman Emanuel Todorov Sergey Levine
references.title: Learning complex dexterous manipulation with deep reinforcement learning and demonstrations
references.venue: arXiv preprint arXiv:1709.10087,
references.authors: Bruno Scherrer Victor Gabillon Mohammad Ghavamzadeh Matthieu Geist
references.title: Approximate modified policy iteration
references.venue: arXiv preprint arXiv:1205.3054,
references.authors: John Schulman Sergey Levine Pieter Abbeel Michael Jordan Philipp Moritz
references.title: Trust region policy optimization
references.venue: In International conference on machine learning,
references.authors: Noah Siegel Jost Tobias Springenberg Felix Berkenkamp Abbas Abdolmaleki Michael Neunert Thomas Lampe Roland Hafner Nicolas Heess Martin Riedmiller
references.title: Keep doing what worked: Behavior modelling priors for offline reinforcement learning
references.venue: In International Conference on Learning Representations,
references.authors: Richard S Sutton Andrew G Barto
references.title: Reinforcement learning: An introduction
references.venue: MIT press,
references.authors: Hado Van Hasselt Arthur Guez David Silver
references.title: Deep reinforcement learning with double qlearning
references.venue: In Thirtieth AAAI conference on artificial intelligence,
references.authors: Cameron Voloshin Hoang M Le Nan Jiang Yisong Yue
references.title: Empirical study of off-policy policy evaluation for reinforcement learning
references.authors: Qing Wang Jiechao Xiong Lei Han Han Liu Tong Zhang
references.title: Exponentially weighted imitation learning for batched historical data
references.venue: In Advances in Neural Information Processing Systems,
references.authors: Ruosong Wang Dean P. Foster Sham M. Kakade
references.title: What are the statistical limits of offline rl with linear function approximation?, 2020a
references.authors: Ruosong Wang Yifan Wu Ruslan Salakhutdinov Sham M Kakade
references.title: Instabilities of offline rl with pre-trained neural representation
references.venue: arXiv preprint arXiv:2103.04947,
references.authors: Ziyu Wang Alexander Novikov Konrad Zolna Josh S Merel Jost Tobias Springenberg Scott E Reed Bobak Shahriari Noah Siegel Caglar Gulcehre Nicolas Heess
references.title: Critic regularized regression
references.venue: Advances in Neural Information Processing Systems,
references.authors: Yifan Wu George Tucker Ofir Nachum
references.title: Behavior regularized offline reinforcement learning, 2019
references.authors: Andrea Zanette
references.title: Exponential lower bounds for batch reinforcement learning: Batch rl can be exponentially harder than online
sections.heading: 1 Introduction
sections.text: An important step towards effective real-world RL is to improve sample efficiency. One avenue towards this goal is offline RL (also known as batch RL) where we attempt to learn a new policy from data collected by some other behavior policy without interacting with the environment. Recent work in offline RL is well summarized by Levine et al. [2020]. In this paper, we challenge the dominant paradigm in the deep offline RL literature that primarily relies on actor-critic style algorithms that alternate between policy evaluation and policy improvement [Fujimoto et al., 2018a, 2019, Peng et al., 2019, Kumar et al., 2019, 2020, Wang et al., 2020b, Wu et al., 2019, Kostrikov et al., 2021, Jaques et al., 2019, Siegel et al., 2020, Nachum et al., 2019]. All these algorithms rely heavily on off-policy evaluation to learn the critic. Instead, we find that a simple baseline which only performs one step of policy improvement using the behavior Q function often outperforms the more complicated iterative algorithms. Explicitly, we find that our one-step algorithm beats prior results of iterative algorithms on most of the gym-mujoco [Brockman et al., 2016] and Adroit [Rajeswaran et al., 2017] tasks in the the D4RL benchmark suite [Fu et al., 2020]. We then dive deeper to understand why such a simple baseline is effective. First, we examine what goes wrong for the iterative algorithms. When these algorithms struggle, it is often due to poor off-policy evaluation leading to inaccurate Q values. We attribute this to two causes: (1) distribution shift between the behavior policy and the policy to be evaluated, and (2) iterative error exploitation whereby policy optimization introduces bias and dynamic programming propagates this bias across the state space. We show that empirically both issues exist in the benchmark tasks and that one way to avoid these issues is to simply avoid off-policy evaluation entirely. Finally, we recognize that while the the one-step algorithm is a strong baseline, it is not always the best choice. In the final section we provide some guidance about when iterative algorithms can perform better than the simple one-step baseline. Namely, when the dataset is large and behavior policy has good coverage of the state-action space, then off-policy evaluation can succeed and iterative
  35th Conference on Neural Information Processing Systems (NeurIPS 2021).
  algorithms can be effective. In contrast, if the behavior policy is already fairly good, but as a result does not have full coverage, then one-step algorithms are often preferable. Our main contributions are:
  • A demonstration that a simple baseline of one step of policy improvement outperforms more complicated iterative algorithms on a broad set of offline RL problems.
  • An examination of failure modes of off-policy evaluation in iterative offline RL algorithms. • A description of when one-step algorithms are likely to outperform iterative approaches.
sections.heading: 2 Setting and notation
sections.text: We will consider an offline RL setup as follows. LetM = {S,A, ρ, P,R, γ} be a discounted infinitehorizon MDP. In this work we focus on applications in continuous control, so we will generally assume that both S andA are continuous and bounded. We consider the offline setting where rather than interacting withM, we only have access to a dataset DN of N tuples of (si, ai, ri) collected by some behavior policy β with initial state distribution ρ. Let r(s, a) = Er|s,a[r] be the expected reward. Define the state-action value function for any policy π by Qπ(s, a) := EP,π|s0=s, a0=a[ ∑∞ t=0 γ
  tr(st, at)]. The objective is to maximize the expected return J of the learned policy:
  J(π) := E ρ,P,π [ ∞∑ t=0 γtr(st, at) ] = E s∼ρ a∼π|s [Qπ(s, a)]. (1)
  Following Fu et al. [2020] and others in this line of work, we allow access to the environment to tune a small (< 10) set of hyperparameters. See Paine et al. [2020] for a discussion of the active area of research on hyperparameter tuning for offline RL. We also discuss this further in Appendix C.
sections.heading: 3 Related work
sections.text: Iterative algorithms. Most prior work on deep offline RL consists of iterative actor-critic algorithms. The primary innovation of each paper is to propose a different mechanism to ensure that the learned policy does not stray too far from the data generated by the behavior policy. Broadly, we group these methods into three camps: policy constraints/regularization, modifications of imitation learning, and Q regularization:
  1. The majority of prior work acts directly on the policy. Some authors have proposed explicit constraints on the learned policy to only select actions where (s, a) has sufficient support under the data generating distribution [Fujimoto et al., 2018a, 2019, Laroche et al., 2019]. Another proposal is to regularize the learned policy towards the behavior policy [Wu et al., 2019] usually either with a KL divergence [Jaques et al., 2019] or MMD [Kumar et al., 2019]. This is a very straighforward way to stay close to the behavior with a hyperparameter that determines just how close. All of these algorithms are iterative and rely on off-policy evaluation.
  2. Siegel et al. [2020], Wang et al. [2020b], Chen et al. [2020] all use algorithms that filter out datapoints with low Q values and then perform imitation learning. Wang et al. [2018], Peng et al. [2019] use a weighted imitation learning algorithm where the weights are determined by exponentiated Q values. These algorithms are iterative.
  3. Another way to prevent the learned policy from choosing unknown actions is to incorporate some form of regularization to encourage staying near the behavior and being pessimistic about unknown state, action pairs [Wu et al., 2019, Nachum et al., 2019, Kumar et al., 2020, Kostrikov et al., 2021, Gulcehre et al., 2021]. However, being able to properly quantify uncertainty about unknown states is notoriously difficult when dealing with neural network value functions [Buckman et al., 2020].
  One-step algorithms. Some recent work has also noted that optimizing policies based on the behavior value function can perform surprisingly well. As we do, Goo and Niekum [2020] studies the continuous control tasks from the D4RL benchmark, but they examine a complicated algorithm involving ensembles, distributional Q functions, and a novel regularization technique. In contrast, we analyze a substantially simpler algorithm and get better performance on the D4RL tasks. We also focus more of our contribution on understanding and explaining this performance. Gulcehre et al. [2021] studies the discrete action setting and finds that a one-step algorithm (which they call “behavior value estimation”) outperforms prior work on Atari games and other discrete action tasks from the RL Unplugged benchmark [Gulcehre et al., 2020]. They also introduce a novel regularizer for the evaluation step. In contrast, we consider the continuous control setting. This is a substantial difference in setting since continuous control requires actor-critic algorithms with parametric policies while in the discrete setting the policy improvement step can be computed exactly from the Q function. Moreover, while Gulcehre et al. [2021] attribute the poor performance of iterative algorithms to “overestimation”, we define and separate the issues of distribution shift and iterative error exploitation which can combine to cause overestimation. This separation helps to expose the difference between the fundamental limits of off-policy evaluation from the specific problems induced by iterative algorithms, and will hopefully be a useful distinction to inspire future work. Finally, a one-step variant is also briefly discussed in Nadjahi et al. [2019], but is not the focus of that work. There are also important connections between the one-step algorithm and the literature on conservative policy improvement [Kakade and Langford, 2002, Schulman et al., 2015, Achiam et al., 2017], which we discuss in more detail in Appendix B.
sections.heading: 4 Defining the algorithms
sections.text: In this section we provide a unified algorithmic template for model-free offline RL algorithms as offline approximate modified policy iteration. We show how this template captures our one-step algorithm as well as a multi-step policy iteration algorithm and an iterative actor-critic algorithm. Then any choice of policy evaluation and policy improvement operators can be used to define one-step, multi-step, and iterative algorithms.
sections.heading: 4.1 Algorithmic template
sections.text: Algorithm 1: OAMPI
  input :K, dataset DN , estimated behavior β̂ Set π0 = β̂. Initialize Q̂π−1 randomly. for k = 1, . . . , K do
  Policy evaluation: Q̂πk−1 = E(πk−1, DN , Q̂πk−2) Policy improvement: πk = I(Q̂πk−1 , β̂,DN , πk−1)
  end We consider a generic offline approximate modified policy iteration (OAMPI) scheme, shown in Algorithm 1 (and based off of Puterman and Shin [1978], Scherrer et al. [2012]). Essentially the algorithm alternates between two steps. First, there is a policy evaluation step where we estimate the Q function of the current policy πk−1 by Q̂πk−1 using only the dataset DN . Implementations also often use the prior Q estimate Q̂πk−2 to warm-start the approximation process. Second, there is a policy improvement step. This step takes in the estimated Q function Q̂πk−1 , the estimated behavior β̂, and the dataset DN and produces a new policy πk. Again an algorithm may use πk−1 to warm-start the optimization. Moreover, we expect this improvement step to be regularized or constrained to ensure that πk remains in the support of β and DN . Choices for this step are discussed below. Now we discuss a few ways to instantiate the template.
  One-step. The simplest algorithm sets the number of iterations K = 1. We learn β̂ by maximum likelihood and train the policy evaluation step to estimate Qβ . Then we use any one of the policy improvement operators discussed below to learn π1. Importantly, this algorithm completely avoids off-policy evaluation.
  Multi-step. The multi-step algorithm now sets K > 1. The evaluation operator must evaluate off-policy since DN is collected by β, but evaluation steps for K ≥ 2 require evaluating policies πk−1 6= β. Each iteration is trained to convergence in both the estimation and improvement steps.
  Iterative actor-critic. An actor critic approach looks somewhat like the multi-step algorithm, but does not attempt to train to convergence at each iteration and uses a much larger K. Here each iteration consists of one gradient step to update the Q estimate and one gradient step to improve the policy. Since all of the evaluation and improvement operators that we consider are gradient-based, this algorithm can adapt the same evaluation and improvement operators used by the multi-step algorithm. Most algorithms from the literature fall into this category [Fujimoto et al., 2018a, Kumar et al., 2019, 2020, Wu et al., 2019, Wang et al., 2020b, Siegel et al., 2020].
sections.heading: 4.2 Policy evaluation operator
sections.text: Following prior work on continuous state and action problems, we always evaluate by simple fitted Q evaluation [Fujimoto et al., 2018a, Kumar et al., 2019, Siegel et al., 2020, Wang et al., 2020b, Paine et al., 2020, Wang et al., 2021]. In practice this is optimized by TD-style learning with the use of a target network [Mnih et al., 2015] as in DDPG [Lillicrap et al., 2015]. We do not use any double Q learning or Q ensembles [Fujimoto et al., 2018b]. For the one-step and multi-step algorithms we train the evaluation procedure to convergence on each iteration and for the iterative algorithm each iteration takes a single stochastic gradient step. See Voloshin et al. [2019], Wang et al. [2021] for more comprehensive examinations of policy evaluation and some evidence that this simple fitted Q iteration approach is reasonable. It is an interesting direction for future work to consider other operators that use things like importance weighting [Munos et al., 2016] or pessimism [Kumar et al., 2020, Buckman et al., 2020].
sections.heading: 4.3 Policy improvement operators
sections.text: To instantiate the template, we also need to choose a specific policy improvement operator I. We consider the following improvement operators selected from those discussed in the related work section. Each operator has a hyperparameter controlling deviation from the behavior policy.
  Behavior cloning. The simplest baseline worth including is to just return β̂ as the new policy π. Any policy improvement operator ought to perform at least as well as this baseline.
  Constrained policy updates. Algorithms like BCQ [Fujimoto et al., 2018a] and SPIBB [Laroche et al., 2019] constrain the policy updates to be within the support of the data/behavior. In favor of simplicity, we implement a simplified version of the BCQ algorithm that removes the “perturbation network” which we call Easy BCQ. We define a new policy π̂Mk by drawing M samples from β̂ and then executing the one with the highest value according to Q̂β . Explicitly:
  π̂Mk (a|s) = 1[a = argmax aj {Q̂πk−1(s, aj) : aj ∼ πk−1(·|s), 1 ≤ j ≤M}]. (2)
  Regularized policy updates. Another common idea proposed in the literature is to regularize towards the behavior policy [Wu et al., 2019, Jaques et al., 2019, Kumar et al., 2019]. For a general divergence D we can define an algorithm that maximizes a regularized objective:
  π̂αk = argmax π ∑ i E a∼π|s [Q̂πk−1(si, a)]− αD(β̂(·|si), π(·|si)) (3)
  A comprehensive review of different variants of this method can be found in Wu et al. [2019] which does not find dramatic differences across regularization techniques. In practice, we will use reverse KL divergence, i.e. KL(π(·|si)‖β̂(·|si)). To compute the reverse KL, we draw samples from π(·|si) and use the density estimate β̂ to compute the divergence. Intuitively, this regularization forces π to remain within the support of β rather than incentivizing π to cover β.
  Variants of imitation learning. Another idea, proposed by [Wang et al., 2018, Siegel et al., 2020, Wang et al., 2020b, Chen et al., 2020] is to modify an imitation learning algorithm either by filtering or weighting the observed actions to incentivize policy improvement. The weighted version that we implement uses exponentiated advantage estimates to weight the observed actions:
  π̂τk = argmax π ∑ i exp(τ(Q̂πk−1(si, ai)− V̂ (si))) log π(ai|si). (4)
  With these definitions, we can now move on to testing various combinations of algorithmic template (one-step, multi-step, or iterative) and improvement operator (Easy BCQ, reverse KL regularization, or exponentially weighted imitation).
sections.heading: 5 Benchmark Results
sections.text: Our main empirical finding is that one step of policy improvement is sufficient to beat state of the art results on much of the D4RL benchmark suite [Fu et al., 2020]. This is striking since prior work focuses on iteratively estimating the Q function of the current policy iterate, but we only use one step derived from Q̂β . Results are shown in Table 1. Full experimental details are in Appendix C and code can be found at https://github.com/davidbrandfonbrener/onestep-rl.
  As we can see in the table, all of the one-step algorithms usually outperform the best iterative algorithms tested by Fu et al. [2020]. The one notable exception is the case of random data (especially on halfcheetah), where iterative algorithms have a clear advantage. We will discuss potential causes of this further in Section 7. To give a more direct comparison that controls for any potential implementation details, we use our implementation of reverse KL regularization to create multi-step and iterative algorithms. We are not using algorithmic modifications like Q ensembles, regularized Q values, or early stopping that have been used in prior work. But, our iterative algorithm recovers similar performance to prior regularized actor-critic approaches. These results are shown in Table 2.
  Put together, these results immediately suggest some guidance to the practitioner: it is worthwhile to run the one-step algorithm as a baseline before trying something more elaborate. The one-step algorithm is substantially simpler than prior work, but frequently achieves better performance.
sections.heading: 6 What goes wrong for iterative algorithms?
sections.text: The benchmark experiments show that one step of policy improvement often beats iterative and multi-step algorithms. In this section we dive deeper to understand why this happens. First, by examining the learning curves of each of the algorithms we note that iterative algorithms require stronger regularization to avoid instability. Then we identify two causes of this instability: distribution shift and iterative error exploitation. Distribution shift causes evaluation error by reducing the effective sample size in the fixed dataset for evaluating the current policy and has been extensively considered in prior work as discussed below. Iterative error exploitation occurs when we repeatedly optimize policies against our Q estimates and exploit their errors. This introduces a bias towards overestimation at each step (much like the training error in supervised learning is biased to be lower than the test error). Moreover, by iteratively re-using the data and using prior Q estimates to warmstart training at each step, the errors from one step are amplified at the next. This type of error is particular to multi-step and iterative algorithms.
sections.heading: 6.1 Learning curves and hyperparameter sensitivity
sections.text: To begin to understand why iterative and multi-step algorithms can fail it is instructive to look at the learning curves. As shown in Figure 2, we often observe that the iterative algorithm will begin to learn and then crash. Regularization can help to prevent this crash since strong enough regularization towards the behavior policy ensures that the evaluation is nearly on-policy.
  In contrast, the one-step algorithm is more robust to the regularization hyperparameter. The rightmost panel of the figure shows this clearly. While iterative and multi-step algorithms can have their performance degrade very rapidly with the wrong setting of the hyperparameter, the one-step approach is more stable. Moreover, we usually find that the optimal setting of the regularization hyperparameter is lower for the one-step algorithm than the iterative or multi-step approaches.
sections.heading: 6.2 Distribution shift
sections.text: Any algorithm that relies on off-policy evaluation will struggle with distribution shift in the evaluation step. Trying to evaluate a policy that is substantially different from the behavior reduces the effective sample size and increases the variance of the estimates. Explicitly, by distribution shift we mean the shift between the behavior distribution (the distribution over state-action pairs in the dataset) and the evaluation distribution (the distribution that would be induced by the policy π we want to evaluate).
  Prior work. There is a substantial body of prior theoretical work that suggests that off-policy evaluation can be difficult and this difficulty scales with some measure of distribution shift. Wang et al. [2020a], Amortila et al. [2020], Zanette [2021] give exponential (in horizon) lower bounds on sample complexity in the linear setting even with good feature representations that can represent the desired Q function and assuming good data coverage. Upper bounds generally require very strong assumptions on both the representation and limits on the distribution shift [Wang et al., 2021, Duan et al., 2020, Chen and Jiang, 2019]. Moreover, the assumed bounds on distribution shift can be exponential in horizon in the worst case. On the empirical side, Wang et al. [2021] demonstrates issues with distribution shift when learning from pre-trained features and provides a nice discussion of why distribution shift causes error amplification. Fujimoto et al. [2018a] raises a similar issue under the name “extrapolation error”. Regularization and constraints are meant to reduce issues stemming from distribution shift, but also reduce the potential for improvement over the behavior.
  Empirical evidence. Both the multi-step and iterative algorithms in our experiments rely on offpolicy evaluation as a key subroutine. We examine how easy it is to evaluate the policies encountered along the learning trajectory. To control for issues of iterative error exploitation (discussed in the next subsection), we train Q estimators from scratch on a heldout evaluation dataset sampled from the behavior policy. We then evaluate these trained Q function on rollouts from 1000 datapoints sampled from the replay buffer. Results are shown in Figure 3. The results show a correlation betweed KL and MSE. Moreover, we see that the MSE generally increases over training. One way to mitigate this, as seen in the figure, is to use a large value of α. We just cannot take a very large step before running into problems with distribution shift. But, when we take such a small step, the information from the on-policy Q̂β is about as useful as the newly estimated Q̂π. This is seen, for example, in Figure 2 where we get very similar performance across algorithms at high levels of regularization.
sections.heading: 6.3 Iterative error exploitation
sections.text: The previous subsection identifies how any algorithm that uses off-policy evaluation is fundamentally limited by distribution shift, even if we were given fresh data and trained Q functions from scratch at every iteration. But, in practice, iterative algorithms repeatedly iterate between optimizing policies against estimated Q functions and re-estimating the Q functions using the same data and using the Q function from the previous step to warm-start the re-estimation. This induces dependence between steps that causes a problem that we call iterative error exploitation.
  Intuition about the problem. In short, iterative error exploitation happens because πi tends to choose overestimated actions in the policy improvement step, and then this overestimation propagates via dynamic programming in the policy evaluation step. To illustrate this issue more formally, consider the following: at each s, a we suffer some Bellman error επβ(s, a) based on our fixed dataset collected by β. Formally,
  Q̂π(s, a) = r(s, a) + γ E s′|s,a a′∼π|s′ [Q̂π(s′, a′)] + επβ(s, a). (5)
  Intuitively, επβ will be larger at state-actions with less coverage in the dataset collected by β. Note that επβ can absorb all error whether it is caused by the finite sample size or function approximation error.
  All that is needed to cause iterative error exploitation is that the πβ are highly correlated across different π, but for simplicity, we will assume that επβ is the same for all policies π estimated from our fixed offline dataset and instead write εβ . Now that the errors do not depend on the policy we can treat the errors as auxiliary rewards that obscure the true rewards and see that
  Q̂π(s, a) = Qπ(s, a) + Q̃πβ(s, a), Q̃ π β(s, a) := E
  π|s0,a0=s,a [ ∞∑ t=0 γtεβ(st, at) ] . (6)
  This assumption is somewhat reasonable since we expect the error to primarily depend on the data. And, when the prior Q function is used to warm-start the current one (as is generally the case in practice), the approximation errors are automatically passed between steps. Now we can explain the problem. Recall that under our assumption the εβ are fixed once we have a dataset and likely to have larger magnitude the further we go from the support of the dataset. So, with each step πi is able to better maximize εβ , thus moving further from β and increasing the magnitude of Q̃πiβ relative to Q πi . Even though Qπi may provide better signal than Qβ , it can easily be drowned out by Q̃πiβ . In contrast, Q̃ β β has small magnitude, so the one-step algorithm is robust to errors 1.
  An example. Now we consider a simple gridworld example to illustrate iterative error exploitation. This example fits exactly into the setup outlined above since all errors are due to reward estimation so the εβ is indeed constant over all π. The gridworld we consider has one deterministic good state with reward 1 and many stochastic bad states that have rewards distributed as N (−0.5, 1). We collect a dataset of 100 trajectories, each of length 100. One run of the multi-step offline regularized policy iteration algorithm is illustrated in Figure 4. In the example we see that one step often outperforms multiple steps of improvement. Intuitively, when there are so many noisy states, it is likely that a few of them will be overestimated. Since the data is re-used for each step, these overestimations persist and propagate across the state space due to iterative error exploitation. This property of having many bad, but poorly estimated states likely also exists in the high-dimensional control problems encountered in the benchmark where there are many ways for the robots to fall down that are not observed in the data for non-random behavior. Moreover, both settings have larger errors in areas where we have less data. So even though the errors in the gridworld are caused by noise in the rewards, while errors in D4RL are caused by function approximation, we think this is a useful mental model of the problem.
  1We should note that iterative error exploitation is similar to the overestimation addressed by double Q learning [Van Hasselt et al., 2016, Fujimoto et al., 2018b], but distinct. Since we are in the offline setting, the errors due to our finite dataset can be iteratively exploited more and more, while in the online setting considered by double Q learning, fresh data prevents this issue. We are also considering an algorithm based on policy iteration rather than value iteration.
  Empirical evidence. In practice we cannot easily visualize the progression of errors. However, the dependence between steps still arises as overestimation of the Q values. We can track the overestimation of the Q values over training as a way to measure how much bias is being induced by optimizing against our dependent Q estimators. As a control we can also train Q estimators from scratch on independently sampled evaluation data. These independently trained Q functions do not have the same overestimation bias even though the squared error does tend to increase as the policy moves further from the behavior (as seen in Figure 3). Explicitly, we track 1000 state, action pairs from the replay buffer over training. For each checkpointed policy we perform 3 rollouts at each state to get an estimate of the true Q value and compare this to the estimated Q value. Results are shown in Figure 5.
sections.heading: 7 When are multiple steps useful?
sections.text: So far we have focused on why the one-step algorithm often works better than the multi-step and iterative algorithms. However, we do not want to give the impression that one-step is always better. Indeed, our own experiments in Section 5 show a clear advantage for the multi-step and iterative approaches when we have randomly collected data. While we cannot offer a precise delineation of when one-step will outperform multi-step, in this section we offer some intuition as to when we can expect to see benefits from multiple steps of policy improvement. As seen in Section 6, multi-step and iterative algorithms have problems when they propagate estimation errors. This is especially problematic in noisy and/or high dimensional environments. While the multi-step algorithms propagate this noise more widely than the one-step algorithm, they also
  propagate the signal. So, when we have sufficient coverage to reduce the magnitude of the noise, this increased propagation of signal can be beneficial. The D4RL experiments suggest that we are usually on the side of the tradeoff where the errors are large enough to make one-step preferable. In Appendix A we illustrate a simple gridworld example where a slight modification of the behavior policy from Figure 4 makes multi-step dramatically outperform one-step. This modified behavior policy (1) has better coverage of the noisy states (which reduces error, helping multi-step), and (2) does a worse job propagating the reward from the good state (hurting one-step). We can also test empirically how the behavior policy effects the tradeoff between error and signal propagation. To do this we construct a simple experiment where we mix data from the random behavior policy with data from the medium behavior policy. Explicitly we construct a dataset D out of the datasets Dr for random and Dm for medium such that each trajectory in D comes from the medium dataset with probability pm. So for pm = 0 we have the random dataset and pm = 1 we have the medium dataset, and in between we have various mixtures. Results are shown in Figure 6. It takes surprisingly little data from the medium policy for one-step to outperform the iterative algorithm.
sections.heading: 8 Discussion, limitations, and future work
sections.text: This paper presents the surprising effectiveness of a simple one-step baseline for offline RL. We examine the failure modes of iterative algorithms and the conditions where we might expect them to outperform the simple one-step baseline. This provides guidance to a practitioner that the simple one-step baseline is a good place to start when approaching an offline RL problem. But, we leave many questions unanswered. One main limitation is that we lack a clear theoretical characterization of which environments and behaviors can guarantee that one-step outperforms multi-step or visa versa. Such results will likely require strong assumptions, but could provide useful insight. We don’t expect this to be easy as it requires understanding policy iteration which has been notoriously difficult to analyze, often converging much faster than the theory would suggest [Sutton and Barto, 2018, Agarwal et al., 2019]. Another limitation is that while only using one step is perhaps the simplest way to avoid the problems of off-policy evaluation, there are possibly other more elaborate algorithmic solutions that we did not consider here. However, our strong empirical results suggest that the one-step algorithm is at least a strong baseline.
  Broader impact. Our paper studies a simple and effective baseline approach to the offline RL problem. The effectiveness of this baseline raises some serious questions about the utility of prior work proposing substantially more complicated methods. By making this observation of prior shortcomings, our paper has the potential to encourage researchers to derive new and better methods for offline RL. This has many potential impacts on fields as diverse as robotics and healthcare where better offline decision making can lead to better real-world performance. As always, we note that machine learning improvements come in the form of “building machines to do X better”. For a sufficiently malicious or ill-informed choice of X, almost any progress in machine learning might indirectly lead to a negative outcome, and our work is not excluded from that.
sections.heading: Acknowledgements
sections.text: This work is partially supported by the Alfred P. Sloan Foundation, NSF RI-1816753, NSF CAREER CIF 1845360, NSF CHS-1901091, Samsung Electronics, and the Institute for Advanced Study. DB is supported by the Department of Defense (DoD) through the National Defense Science & Engineering Graduate Fellowship (NDSEG) Program.
title: Offline RL Without Off-Policy Evaluation