The Generalization Gap in Offline Reinforcement Learning

Ishita Mediratta, Qingfei You, Minqi Jiang, Roberta Raileanu · DOI

Introduction

Reinforcement learning (RL) has traditionally relied on online interaction, where an agent learns through continuous trial and error. However, in high-stakes domains like healthcare, finance, or autonomous driving, online exploration is often prohibitively expensive or dangerous. Offline Reinforcement Learning addresses this by training agents on static, pre-collected datasets.

While offline RL has seen significant algorithmic progress, most research evaluates agents in "singleton" environments—where training and testing occur on the exact same setup. This paper exposes a critical "generalization gap": agents that excel in training often fail catastrophically when deployed in even slightly different environments. By introducing new benchmarks based on Procgen and WebShop, the authors demonstrate that current state-of-the-art offline RL methods struggle with robustness, often being outperformed by simple supervised learning baselines.

Benchmarking Generalization

To rigorously measure the generalization gap, the researchers developed a benchmark using two distinct environments that emphasize different types of diversity:

  1. Procgen: A suite of 16 procedurally generated 2D games. Agents are trained on a limited subset of levels (e.g., 200) and tested on a vast set of unseen levels to evaluate visual and structural generalization.
  2. WebShop: A simulated e-commerce environment with over 1 million products. Here, generalization is tested against unseen natural language instructions, requiring the agent to map diverse text queries to specific shopping actions.
Overview of the Procgen and WebShop benchmarks used to evaluate generalization. (a) shows visual variations in Procgen games between train and test sets; (b) displays example natural language instructions for WebShop.

Methodology

The study evaluates several classes of learning algorithms to identify which are most robust to distribution shifts:

  • Behavioral Cloning (BC): A simple supervised learning approach that mimics the actions in the dataset.
  • Offline RL: State-of-the-art (SOTA) methods designed for offline data, including Conservative Q-Learning (CQL), Implicit Q-Learning (IQL), and Batch Constrained Q-Learning (BCQ).
  • Sequence Modeling: Decision Transformer (DT) and Behavioral Cloning Transformer (BCT), which frame RL as a conditional sequence prediction task.
  • Online RL: Proximal Policy Optimization (PPO) serves as the gold-standard baseline for comparison.

Key Insights and Results

The "BC is King" Surprise

In a major departure from expectations in the offline RL community, simple Behavioral Cloning (BC) often outperformed sophisticated offline RL and sequence modeling approaches when tested on new environments. While offline RL methods use "risk-aware" or "conservative" mechanisms to handle gaps in the training data, these same mechanisms appear to hinder the agent's ability to generalize to unseen states.

Min-Max Normalized IQM Returns on the Procgen 1M Expert dataset. BC significantly outperforms more complex offline RL methods like CQL and IQL in test performance.

Diversity Over Volume

A critical finding for practitioners is that data diversity is far more important than data volume for generalization. Increasing the number of unique environments in the training set (e.g., from 200 to 100,000 levels in Procgen) significantly reduced the generalization gap. In contrast, simply increasing the number of trajectories from the same limited set of environments provided almost no benefit to test-time performance.

The Persistent Online Advantage

Despite the sophistication of modern offline methods, none could match the test-time performance of online RL (PPO). This suggests that the ability to interact and explore remains a fundamental advantage that current offline architectures and loss functions cannot yet replicate through data alone.

Conclusion and Future Directions

This research highlights that the current focus of the offline RL community—optimizing performance on fixed datasets—may be coming at the cost of real-world robustness. The surprising effectiveness of Behavioral Cloning suggests that future work should focus on combining BC's generalization strengths with the performance-optimizing capabilities of offline RL.

Future research directions include extending these benchmarks to continuous control tasks in robotics and investigating the theoretical reasons why conservative RL methods struggle with distribution shifts. As we move toward deploying RL in the real world, closing this generalization gap will be paramount.

Summary updated

BibTeX
@inproceedings{mediratta2024generalization,
  author = {Ishita Mediratta and Qingfei You and Minqi Jiang and Roberta Raileanu},
  title = {{The Generalization Gap in Offline Reinforcement Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=3w6xuXDOdY},
}
Figure