Abstract
Offline reinforcement learning (RL) recently gains growing interests from RL researchers. However, the performance of offline RL suffers from the out-of-distribution problem, which can be corrected by feedback in online RL. Previous offline RL research focuses on restricting the offline algorithm in in-distribution even in-sample action sampling. In contrast, fewer work pays attention to the influence of the batch data. In this paper, we first build a bridge over the batch data and the performance of offline RL algorithms theoretically, from the perspective of model-based offline RL optimization. We draw a conclusion that, with mild assumptions, the distance between the state-action pair distribution generated by the behavioural policy and the distribution generated by the optimal policy, accounts for the performance gap between the policy learned by model-based offline RL and the optimal policy. Secondly, we reveal that in task-agnostic settings, a series of policies trained by unsupervised RL can minimize the worst-case regret in the performance gap. Inspired by the theoretical conclusions, UDG (Unsupervised Data Generation) is devised to generate data and select proper data for offline training under tasks-agnostic settings. Empirical results demonstrate that UDG can outperform supervised data generation on solving unknown tasks.
Introduction
Offline Reinforcement Learning (RL) holds the promise of training intelligent agents using only historical logs, bypassing the need for expensive or dangerous real-world interaction. This is particularly vital for high-stakes domains like robotics and autonomous driving. However, offline RL is plagued by the "out-of-distribution" (OOD) problem: when an agent attempts an action not represented in the training data, the learned model may hallucinate high rewards, leading to catastrophic failures.
While most research focuses on algorithmic constraints to keep the agent within the data distribution, this paper argues that the quality and diversity of the initial dataset are equally critical. In "task-agnostic" settings, data is collected before the specific goal is known. If the initial data collection is narrow—for instance, an ant robot only ever walking forward—it becomes impossible to train an offline agent for a different task, such as walking sideways. This work theoretically links the distribution of the "batch data" to the final performance of model-based offline RL.
Methodology: Unsupervised Data Generation (UDG)
The authors bridge the gap between data and performance using a theoretical framework based on Model-based Offline Policy Optimization (MOPO). They prove that the performance gap between an offline-trained policy and the true optimal policy is bounded by the Wasserstein distance between the behavioral data distribution and the optimal policy's distribution. To minimize this distance for any potential future task, they propose the Unsupervised Data Generation (UDG) framework.
The UDG pipeline consists of four distinct stages:
- Unsupervised Training: A fleet of $K$ different policies is trained simultaneously using diversity rewards (e.g., WURL or DIAYN). These policies are incentivized to explore and occupy different regions of the state space.
- Data Collection: Each policy performs rollouts in the environment to populate its own data buffer.
- Relabeling & Selection: Once a specific task and its associated reward function are defined, all buffers are relabeled. The buffer (or a mixture of top buffers) with the highest average return is selected for training.
- Offline Training: A standard model-based offline RL algorithm, such as MOPO, is trained on this optimized, diverse dataset.
Experimental Evaluation
The researchers evaluated UDG on custom MuJoCo locomotive environments designed to test generalization to unknown tasks:
- Ant-Angle: An Ant robot must move in one of six specific directions ($0^\circ$ to $300^\circ$).
- Cheetah-Jump/Crawl: A HalfCheetah agent is rewarded for either jumping high or crawling low while moving forward.
Unlike standard benchmarks like D4RL, these environments require the agent to generalize to tasks that were not the primary focus during the initial data collection phase.
Key Results and Insights
UDG demonstrated superior generalization across all test cases. On the Ant-Angle task, UDG successfully solved all six directional tasks. In contrast, supervised data generation (training on a single direction) failed completely when the target direction deviated significantly from the training data.
Key takeaways from the empirical study include:
- Diversity as Insurance: Maximizing policy diversity serves as a proxy for minimizing "worst-case regret" across future tasks. Trajectory plots show that unsupervised policies "fan out" to cover the entire 2D plane, ensuring a viable path exists for the offline learner regardless of the target angle.
- The Benefit of Data Mixing: Experiments revealed that mixing the "Top 2" best-performing buffers often outperformed using a single buffer. This suggests that additional "spread" in the data helps the transition model generalize better, even if some data is slightly sub-optimal.
- Data Selection as a Lever: While most offline RL research focuses on learning algorithms, this paper highlights that selecting the right subset of data from a diverse pool is a powerful and under-utilized lever for performance.
Limitations and Future Work
The theoretical foundations of UDG rely on the environment being Lipschitz continuous (smooth), which may not hold for pixel-based tasks or environments with non-smooth reward functions. Additionally, the current diversity reward requires prior knowledge of which low-dimensional features matter (e.g., x-y coordinates). Future research could explore calculating diversity rewards directly from raw pixels and extending the UDG framework to model-free offline RL methods.
Summary updated