Source-linked AI summary

MOReL : Model-Based Offline Reinforcement Learning

Rahul Kidambi, Aravind Rajeswaran, Praneeth Netrapalli, Thorsten Joachims

arXiv:2005.05951v3cs.LGcs.AIstat.ML

TL;DR

Offline RL seeks rewarding policies from static data, but distribution shift and limited support make policy evaluation difficult. MOReL learns a pessimistic MDP and optimizes within it, obtaining near-minimax theoretical guarantees and state-of-the-art benchmark performance. Its modular design supports alternative model learning, uncertainty estimation, and planning components.

  • Problem

    Offline RL must learn policies from static datasets despite distribution shift between candidate-policy and logging-policy state visitation distributions.

  • Method

    MOReL learns a pessimistic MDP from offline data, partitions states into known and unknown regions, and learns a near-optimal policy in that P-MDP.

  • Results

    MOReL’s sub-optimality bound matches the worst-case offline-RL lower bound up to logarithmic factors and achieves state-of-the-art results on standard benchmarks.

  • Takeaways & Limitations

    MOReL combines generalization with pessimism to improve policies in predictable states while preventing drift into states whose dynamics cannot be accurately predicted.

  • Takeaways & Limitations

    Reward-function design requires checks and scrutiny because maliciously designed rewards can produce negative consequences for any RL agent.

Abstract

from arXiv · show

In offline reinforcement learning (RL), the goal is to learn a highly rewarding policy based solely on a dataset of historical interactions with the environment. The ability to train RL policies offline can greatly expand the applicability of RL, its data efficiency, and its experimental velocity. Prior work in offline RL has been confined almost exclusively to model-free RL approaches. In this work, we present MOReL, an algorithmic framework for model-based offline RL. This framework consists of two steps: (a) learning a pessimistic MDP (P-MDP) using the offline dataset; and (b) learning a near-optimal policy in this P-MDP. The learned P-MDP has the property that for any policy, the performance in the real environment is approximately lower-bounded by the performance in the P-MDP. This enables it to serve as a good surrogate for purposes of policy evaluation and learning, and overcome common pitfalls of model-based RL like model exploitation. Theoretically, we show that MOReL is minimax optimal (up to log factors) for offline RL. Through experiments, we show that MOReL matches or exceeds state-of-the-art results in widely studied offline RL benchmarks. Moreover, the modular design of MOReL enables future advances in its components (e.g. generative modeling, uncertainty estimation, planning etc.) to directly translate into advances for offline RL.

1 Introduction

Offline RL learns policies from static datasets, avoiding online exploration but facing distribution shift and model-based extrapolation challenges. MOReL addresses these issues with a pessimistic MDP and achieves strong theoretical and benchmark results.

  • Motivation: Offline RL learns rewarding policies from static datasets, enabling data-driven policy learning without collecting new interactions.This setting is relevant to safety-sensitive applications and domains with large historical datasets.
  • Challenges: Distribution shift makes offline policy evaluation difficult because candidate policies can visit states differently from logging policies.Directly applying off-policy RL algorithms to offline data can perform poorly because of distribution shift and function approximation errors.
  • Challenges: Model-based RL offers learned dynamics and planning, but offline use is challenging when the dataset does not cover the states visited by candidate policies.The same distribution-shift problem can lead model-based policies to exploit inaccurate model predictions.
  • MOReL: MOReL learns a pessimistic MDP from offline data and then learns a near-optimal policy within that P-MDP.The P-MDP partitions state-action space into known and unknown regions and assigns unknown regions a large negative reward.
  • Results: 12 of 20 environment-dataset configurations achieve state-of-the-art results, compared with 5 of 20 for the best prior algorithm.MOReL performs competitively in the remaining configurations.

2 Related Work

Offline RL research includes importance sampling, model-free methods, and model-based approaches, while MOReL builds on known-versus-unknown state partitioning to induce pessimism.

  • Offline RL: Offline RL methods include importance sampling, planning with learned importance weights, and other categories developed for applications such as healthcare and recommendation systems.The literature also covers dialogue systems and autonomous driving.
  • Pessimistic modeling: MOReL uses a known-versus-unknown state partition inspired by earlier exploration methods but applies it to encourage pessimism in offline RL.The paper distinguishes its focus from related online RL and imitation-learning settings.
  • Pessimistic modeling: Practical instantiations of E3 and metric-E3 with function approximation have remained elusive, whereas MOReL develops a practical construction for offline RL.The P-MDP construction is presented as crucial to MOReL’s approach.

3 Problem Formulation

Offline RL optimizes a policy using only a static dataset generated by unknown logging policies. The problem is to minimize performance loss relative to the optimal policy despite limited dataset support.

  • MDP formulation: An MDP specifies states, actions, rewards, transition dynamics, an initial-state distribution, and a discount factor.A policy maps states to probability distributions over actions.
  • MDP formulation: Policy performance is the expected value from the initial-state distribution, and the optimal policy maximizes this performance.The formulation may restrict policies to a parameterized class whose parameters are optimized.
  • Offline setting: Offline RL receives a static dataset of environment interactions collected by one or more logging policies, whose identities need not be known.The dataset consists of state, action, reward, and next-state transitions.
  • Offline setting: The objective is to output a policy with minimal sub-optimality, measured as the performance gap from the optimal policy in the true MDP.With a static dataset, achieving the optimal policy is not generally possible.
  • Model-based formulation: Model-based RL learns an approximate MDP using learned transitions, while this formulation assumes the reward function is known.The initial-state distribution may be learned from data or used directly when known.

4 Algorithmic Framework

MOReL builds a pessimistic MDP from offline data, marks insufficiently supported state-action regions as unknown, and plans within this surrogate. Its guarantees relate policy suboptimality to model, initialization, distribution-shift, and optimization errors, while its practical version uses ensemble dynamics models.

  • Framework: MOReL learns approximate dynamics, constructs an unknown state-action detector, builds a pessimistic MDP, and plans a policy within it.The framework optionally initializes planning with an estimated behavior policy.
  • Unknown state-action detection: The unknown state-action detector flags pairs where model accuracy cannot be guaranteed, using data availability and representation quality to support its confidence assessment.A state-action may be accurate yet still be flagged unknown when accuracy cannot be guaranteed.
  • Pessimistic MDP construction: Unknown regions transition to an absorbing HALT state and receive reward −κ, while known state-actions retain the environment reward.This construction penalizes policies that visit unfamiliar regions and safeguards against model exploitation.
  • Theoretical results: Theorem 1 bounds the difference between policy values in the true and pessimistic MDPs using initial-distribution error, model error α, and unknown-state hitting time.The relevant quantities are DT V(ρ0, ˆρ0), the maximum model discrepancy over known state-actions, and T π∗ U.
  • Theoretical results: MOReL’s suboptimality bound contains sampling, optimization, and distribution-shift terms, and the distribution-shift term depends on offline-data coverage and overlap with the optimal policy.The sampling term decreases with larger datasets, while optimization error can be reduced with additional computation.
  • Theoretical results: MOReL replaces the unobserved state-action set with a smaller learned unknown set, permits incomplete support coverage, and bounds performance using unknown-state hitting time.The lower bound matches the asymptotic upper bound up to an additional logarithmic factor in the stated regime.
  • Practical instantiation: The practical MOReL implementation specializes the framework with model-based natural policy gradients and an ensemble of learned dynamics models.Its Gaussian dynamics parameterization models state differences to enforce local continuity.

5 Experiments

MOReL is evaluated on continuous-control offline RL benchmarks, where it generally outperforms prior methods and provides more stable learning than naive model-based RL. Experiments also examine dataset quality and whether P-MDP performance tracks real-environment performance.

  • Experimental setup: The experiments use Hopper-v2, HalfCheetah-v2, Ant-v2, and Walker2d-v2 with five logged datasets per environment, totaling 20 combinations.Each dataset contains the equivalent of 1 million environment-interaction timesteps.
  • Comparison to prior work: MOReL achieves state-of-the-art results in 12 of 20 environment-dataset configurations, compared with 5 of 20 for the next-best BRAC variant.
  • D4RL benchmark: MOReL achieves the highest normalized score in 5 of 12 D4RL domains, while CQL leads in 3 of 12 and MOReL significantly outperforms prior algorithms on average.
  • Importance of pessimism: MOReL produces stable, nearly monotonic learning, whereas naive MBRL is unstable and can degrade after several hundred policy-improvement steps.The degradation is observed particularly in Hopper-v2, HalfCheetah-v2, and Walker2d-v2.
  • Quality of logging policy: Policies learned from the partially trained Pure-partial dataset substantially outperform those learned from the same-sized Pure-random dataset.The experiment indicates that the value of the logging policy affects the performance achievable with offline RL.
  • Transfer from P-MDP to environment: P-MDP performance closely tracks real-environment performance and never substantially exceeds it during learning on the Pure-partial dataset.This supports using P-MDP policy value as a surrogate for offline policy evaluation and learning.

6 Conclusions

The paper concludes that MOReL combines model generalization with pessimism to improve within known states while avoiding poorly predictable unknown states. Its suboptimality guarantees improve over prior work and are unimprovable in the worst case by any offline RL algorithm, while experiments achieve state-of-the-art benchmark results.

  • MOReL uses generalization for policy improvement in predictable states and pessimism to prevent drift into unknown states.
  • MOReL’s suboptimality bounds improve over prior work and cannot be improved in the worst case by any offline RL algorithm.
  • MOReL achieves state-of-the-art results on standard continuous-control offline RL benchmarks.
  • MOReL’s modular structure permits alternative approaches to model learning, uncertainty estimation, and model-based planning.The paper identifies multi-step prediction, abstention, and model-predictive control as possible future directions.

Broader Impact

Offline RL can broaden RL applications by removing the need for online exploration, but its societal impact depends on careful reward design.

  • Offline RL abstracts away exploration and data collection because policies are learned from pre-collected datasets.
  • Reward functions require checks, vetting, and scrutiny to ensure RL algorithms align with societal norms.

A Theoretical Results: Proofs For Section 4.1

The theoretical analysis studies MOReL through a pessimistic MDP and establishes both performance bounds and a matching lower-bound construction.

  • MOReL’s proof uses a pessimistic MDP with an added absorbing HALT state and modified rewards and transitions.Known state-action pairs use the true transition probability, while unknown regions transition to HALT according to the pessimistic construction.
  • The analysis bounds value differences using total-variation error in the initial-state distribution and transition uncertainty.The displayed bounds include terms involving DT V(ρ0, ρ̂0) and α, scaled by γ and Rmax.
  • For any policy, coupling its trajectories in the pessimistic and actual MDPs establishes a lower-bound relationship on performance.The coupling remains valid until the policy encounters an unknown state, after which the pessimistic MDP assigns a large negative continuation reward.
  • Proposition 4 constructs an MDP where the offline dataset covers only selected state-action pairs, leaving the optimal policy’s path largely unknown.The construction uses k + 1 states and three actions, with the behavior policy’s observed transitions shown explicitly.
  • The lower-bound construction shows that any policy learned from the dataset can suffer substantial suboptimality, with a tight worst-case dependence on log 1/(1−γ).The stated worst-case tightness appears in the discussion following Figure 5.

C Additional Experimental Details And Setup

The experiments evaluate offline RL on four continuous-control environments with shortened planning horizons and reward computation based on augmented observations.

  • Experiments use Hopper-v2, HalfCheetah-v2, Ant-v2, and Walker2d-v2 from OpenAI Gym, simulated with MuJoCo.
  • Planning horizons are reduced to 400 or 500 for these environments.
  • The state representation is augmented with center-of-mass velocity to compute rewards from observations.

C.2 Dynamics Model, Policy Network And Evaluation

The implementation uses neural dynamics and policy models, ensemble-based uncertainty estimation, and several behavior-policy exploration strategies.

  • The dynamics model uses a two-hidden-layer ReLU MLP with 512 or 1024 units per layer, depending on the environment.
  • An ensemble of four dynamics models is used to build the USAD, while the policy uses a two-hidden-layer MLP with 32 tanh units per layer.
  • Dynamics parameters are learned with Adam, and policy parameters are learned using model-based NPG steps.
  • The experimental setup distinguishes behavior, random, partially trained, and noisy behavior policies for comparing exploration strategies.

C.4 Datasets And Exploration Strategies

The experiments use 1-million-timestep offline datasets assembled from behavior, noisy behavior, and random policies, then train ensemble dynamics models and optimize policies with model-based NPG.

  • Each environment uses behavior, noisy behavior, and pure random processes to collect datasets containing 1 million interaction timesteps.
  • Five exploration configurations vary the mixture of behavior, noisy behavior, and random-policy data, including Pure, Eps-1, Eps-3, Gauss-1, and Gauss-3.Pure uses only the behavioral policy; the other configurations combine behavioral, noisy, and random data in specified proportions.
  • MOReL learns two-layer ReLU MLP dynamics models with Adam and uses four models to define the unknown-state detector.The absorbing unknown-state reward is set from the dataset minimum reward minus a searched penalty of 30, 50, 100, or 200.
  • Unknown state-action pairs are identified from maximum pairwise disagreement among ensemble dynamics models evaluated on dataset state-action pairs.The procedure computes the mean, standard deviation, and maximum disagreement over those dataset pairs.
  • Policy optimization uses a (32, 32) tanh MLP with normalized model-based NPG steps.
  • Tables 4–6 summarize environment hyperparameters, policy-optimization hyperparameters, and results across four environments and five exploration configurations.

C.6 Ablation Study with the Pure-partial dataset

The ablation examines how the discrepancy threshold controls pessimism in the Pure-partial setting, with intermediate pessimism producing the best true-MDP results and extremes causing different problems.

  • Discrepancy definition: The maximum dataset discrepancy is defined using the largest ensemble disagreement over state-action pairs in D.Here, D denotes the offline dataset and f_i denotes the ith dynamics model in the ensemble.
  • Ablation setup: Table 7 evaluates discrepancy thresholds on Hopper-v2 using unknown-region termination and reports average value over the final 100 of 1000 training iterations.
  • Pessimism effects: 0.1 × discD provides the most pessimism, whereas Naive-MBRL provides the least or no pessimism.
  • Pessimism effects: Intermediate pessimism achieves the best true-MDP results, while excessive pessimism complicates policy optimization and insufficient pessimism can degrade true-MDP performance.High pessimism can make optimization slow or noisy; low pessimism can cause the P-MDP to substantially overestimate true-MDP value.
Loading 2005.05951v3…