Introduction
Current offline reinforcement learning (RL) algorithms excel at memorizing specific tasks but often fail when asked to generalize to new environments. Offline RL is considered a "holy grail" for high-stakes applications like healthcare, robotics, and autonomous driving. It allows us to train agents using static, pre-collected datasets without the risks or costs of real-world trial and error.
However, there is a catch: most research evaluates these agents on the exact same environments they were trained on (e.g., the same level of an Atari game). In the real world, an agent will inevitably encounter a "new level"—a different hospital, a new road layout, or a slightly different set of instructions. This paper tackles the Generalization Gap: the massive drop in performance when an offline-trained agent moves from its training set to an unseen test environment. To address this, the authors introduce the first benchmark for offline RL generalization and reveal a surprising insight: simple Behavioral Cloning often outperforms sophisticated offline RL methods, and increasing data diversity is far more effective than simply collecting more data.
Methodology
The authors conduct a massive head-to-head comparison between three main families of learning:
- Standard Offline RL: Algorithms like BCQ, CQL, and IQL that use "pessimism" to avoid taking actions not seen in the data.
- Sequence Modeling: Approaches like Decision Transformers (DT) and Behavioral Cloning Transformers (BCT) that treat RL as a language-like prediction problem.
- Behavioral Cloning (BC): A simple supervised learning baseline that attempts to mimic the actions in the dataset.
They compare these against Online RL (PPO) to establish an upper bound and see how much performance is lost by removing the ability to interact with the environment during training.
Benchmark Datasets
The authors introduce a new benchmark specifically designed to test generalization, using two distinct domains:
- Procgen: 16 procedurally generated 2D games (like Maze, Ninja, and Caveflyer). Agents are trained on a fixed set of levels and tested on entirely new, unseen levels.
- WebShop: A simulated e-commerce environment with 1.1 million products. Here, generalization is tested against unseen natural language instructions (e.g., "Find a blue electric foot grinder under $50").
They curated datasets of varying quality (expert vs. suboptimal) and scales (from 100 to 10 million transitions) to see how data properties affect the final agent.
Key Insights and Ideas
- The BC Paradox: In a surprising twist, simple Behavioral Cloning (BC) often outperformed state-of-the-art offline RL and Decision Transformers. While offline RL methods are designed to be "risk-averse," this very trait makes them too timid to handle the unfamiliar states found in new environments. BC, by contrast, learns a more flexible representation that generalizes better.
- Diversity > Volume: If you want a better agent, don't just give it more of the same. The researchers found that increasing the size of the dataset (more transitions from the same levels) barely improved generalization. However, increasing diversity (transitions from more unique levels) drastically closed the generalization gap.
- The Singleton Trap: Algorithms that look like champions on standard benchmarks (which often use "singleton" environments) often collapse when the environment changes even slightly. This suggests our current "SOTA" rankings might be misleading for real-world deployment.
Experimental Results
- The Gap is Real: All offline methods performed significantly worse on new environments compared to online RL (PPO).
- Procgen Performance: On the 1M expert transition dataset, BC outperformed all other offline methods by a significant margin. Sequence modeling (DT/BCT) performed well on training levels but saw a much steeper drop-off on test levels than BC.
- WebShop Success: On human demonstration data, BC achieved higher scores than CQL and BCQ. While BCQ had a higher "success rate" (it only buys when it's very sure), BC was better at following instructions closely to get partial credit.
- Scaling Diversity: In Procgen, increasing the number of training levels from 200 to 100,000 (while keeping the total transitions at 1M) led to a massive boost in test performance for all algorithms.
Limitations and Future Work
The authors identify several hurdles for the community moving forward:
- Discrete vs. Continuous: The current benchmark focuses on discrete action spaces (button presses, clicks). Many real-world robotics tasks are continuous, and current offline RL losses don't always translate easily between the two.
- Transformer Context: Sequence models like Decision Transformers struggle with environments like WebShop because the "state" (text and HTML) is too long to fit into the model's memory (context window).
- The Need for "Generalization-Aware" RL: Most offline RL is designed to solve the "distribution shift" between the dataset and the agent's policy. This paper argues we need a new generation of algorithms designed to solve the shift between training environments and test environments.
The authors have open-sourced their codebase and datasets to encourage the community to move beyond "singleton" benchmarks and start building agents that can handle the variety of the real world.
Summary updated