Domain Generalization for Robust Model-Based Offline Reinforcement Learning

Alan Clark, Shoaib Ahmed Siddiqui, Robert Kirk, Usman Anwar, Stephen Chung, David Krueger · DOI

TL;DR

This paper introduces Domain-Invariant Model-based Offline RL (DIMORL), a new approach for offline reinforcement learning that leverages knowledge of which "demonstrator" (e.g., human operator) generated specific data. By treating each demonstrator as a distinct "domain," DIMORL uses Risk Extrapolation (REx) to train more robust environment models, leading to more stable and potentially better-performing policies.

What Problem Does This Paper Address?

Offline Reinforcement Learning (RL) aims to train agents from pre-collected datasets without further interaction with the environment. A major challenge is "distributional shift," where the data distribution from the training policy differs from the distribution the learned policy will encounter. Existing offline RL methods often assume either that the data comes from a single, known policy, or that the origin of the data is completely unknown. This paper addresses a more realistic scenario: multi-demonstrator offline RL, where we know which demonstrator generated each piece of data, but not their specific policies. This is common when collecting data from multiple human operators. The challenge here is that different demonstrators create different data distributions, which can confuse standard model-based RL algorithms.

Methods

The core of the proposed method, DIMORL, is to adapt model-based offline RL by incorporating Domain Generalization techniques. Specifically, they apply Risk Extrapolation (REx) [15] during the training of the environment's dynamics and reward models. REx is a technique designed to make models invariant to shifts across different domains. In this context, each demonstrator's dataset is treated as a separate domain. By minimizing the variance of the model's "risk" (e.g., loss) across these demonstrator domains, REx encourages the learned models to generalize better. The authors build upon the MOPO algorithm, a model-based offline RL method, by integrating REx into its environment model training phase.

Datasets

The experiments utilize standard MuJoCo environments (Hopper, HalfCheetah, and Walker2d). To simulate demonstrator data, they train a selection of Soft Actor-Critic (SAC) policies online using the Softlearning and D3RLPY libraries. Snapshots of these policies at various training stages are used to create pseudo-demonstrator datasets. These individual datasets are then combined to form three types of multi-demonstrator datasets: Novice, Mixed, and Experienced, reflecting varying levels of demonstrator skill.

Key Insights and Ideas

  • Demonstrators as Domains: The key insight is reframing the multi-demonstrator offline RL problem as a domain generalization task, where each demonstrator represents a distinct domain. This allows leveraging existing domain generalization techniques.
  • REx for Model Robustness: Applying Risk Extrapolation (REx) during environment model training significantly improves the models' ability to generalize to data from unseen demonstrators. This leads to more stable policy learning.
  • Beyond Pooling: Simply pooling all demonstrator data together (a common baseline) is less effective than explicitly accounting for individual demonstrator distributions using REx.
  • Stability and Exploration: Robust environment models trained with REx appear to lead to more stable policy learning (less prone to Q-function degeneracy) and potentially enable increased exploration of the state-action space.

Key Results

  • Environment models trained with REx achieved higher average and worst-case out-of-distribution (OOD) log-likelihoods across all tested environments and datasets.
  • Policies trained using DIMORL (with REx-trained models) achieved higher average returns in two-thirds of the multi-demonstrator datasets compared to baseline methods.
  • In the HalfCheetah environment, Q-functions learned during policy training were less prone to becoming degenerate when using REx with higher penalty coefficients (β ∈ {10, 20}).
  • DIMORL showed improved robustness to noisy initial state distributions during policy training.

Limitations and Future Work

  • Correlation vs. Causation: While REx-trained models show better OOD performance, the paper notes no direct correlation between environment model OOD performance and policy evaluation returns. This suggests other factors, like action diversity in the datasets, play a crucial role.
  • Hyperparameter Tuning: The REx penalty coefficient (β) is a hyperparameter that requires tuning, as evidenced by a peak in performance for Hopper at β=10, suggesting it's not a simple monotonic relationship.
  • Extreme Distributional Shifts: While REx improves generalization, the paper found that no good policies could be learned when attempting to train with roll-out starting locations from datasets that were too dissimilar from the training data.
  • Future Work: The authors suggest further investigation into alternative domain generalization techniques, combining DIMORL with different model-based RL algorithms, and more in-depth analysis of exploration mechanisms. They also highlight the need for more diverse demonstrator datasets and further research into the relationship between model calibration and policy performance.

Summary updated

BibTeX
@misc{clark2022domain,
  author = {Alan Clark and Shoaib Ahmed Siddiqui and Robert Kirk and Usman Anwar and Stephen Chung and David Krueger},
  title = {{Domain Generalization for Robust Model-Based Offline Reinforcement Learning}},
  year = {2022},
  eprint = {2211.14827},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.14827},
}
Figure