TL;DR
When offline reinforcement learning (RL) data comes from multiple distinct sources, standard algorithms often fail because they pool the data and ignore the demonstrator's identity. This paper introduces DIMORL (Domain-Invariant Model-based Offline RL), which frames multi-demonstrator offline RL as a domain generalization problem. By applying Risk Extrapolation (REx) to train robust environment models, DIMORL mitigates policy-induced distributional shifts, stabilizes policy training, and achieves superior performance across various MuJoCo benchmarks.
What Problem Does This Paper Address?
Offline RL aims to train effective policies entirely from pre-collected datasets, avoiding risky or expensive real-world exploration. However, a major hurdle is policy-induced distributional shift: as the learning agent tries to optimize its policy, it drifts away from the state-action distribution of the training data. In model-based offline RL, this leads to "model exploitation," where the policy learns to exploit errors in the learned dynamics or reward models, leading to catastrophic failure in the real environment.
Existing methods typically assume training data is either generated by a single known policy or comes from an entirely unknown origin. This paper targets a realistic middle ground: multi-demonstrator offline RL. Here, data is collected from multiple human operators or distinct legacy algorithms. While we know which demonstrator generated which subset of data, we don't know their underlying policies. Standard approaches simply pool all this data together, which washes out valuable context and results in models that generalize poorly to unseen distributions.
Methods
The core idea of this paper is to treat each demonstrator as a distinct domain within a domain generalization framework.
The authors introduce DIMORL (Domain-Invariant Model-based Offline RL), which builds on top of the MOPO (Model-based Offline Policy Optimization) algorithm. Instead of standard Empirical Risk Minimization (ERM) which minimizes average loss across pooled data, DIMORL utilizes Variance-Risk Extrapolation (V-REx) to train the environment models (dynamics and rewards).
V-REx modifies the loss function by penalizing the variance of the training risks across the different demonstrators:
$$R_{\text{V-REx}}(\theta) = \beta \text{Var}(\{R_1(\theta), ..., R_M(\theta)\}) + \sum_{e=1}^M R_e(\theta)$$
where $\beta$ controls the strength of the variance regularization. This forces the learned environment models to perform consistently well across all demonstrators, encouraging the model to learn features that are invariant to any single demonstrator's behavioral quirks.
Datasets
The authors evaluated their approach using the standard OpenAI Gym MuJoCo benchmarks: HalfCheetah, Hopper, and Walker2d.
To simulate a multi-demonstrator environment, they generated custom datasets using snapshots of Soft Actor-Critic (SAC) agents at various stages of online training, utilizing two different code implementations (Softlearning and D3RLPY) alongside a completely random policy. For each environment, they constructed three types of multi-demonstrator datasets (each containing 5 distinct demonstrators contributing 20,000 transitions each, totaling 100,000 records):
- Novice: Data from poorly trained or random policies.
- Mixed: A combination of novice, intermediate, and expert policies.
- Experienced: Data primarily from highly trained, expert-level policies.
Key Insights and Ideas
- Demonstrator Identity as Metadata: Knowing who generated the data is a powerful signal. Even without explicit knowledge of the demonstrator's policy, minimizing performance variance across demonstrators acts as a strong regularizer against overfitting to specific data distributions.
- Smoothing the Optimization Landscape: Standard offline models often suffer from severe Q-function degeneracy during policy training due to extreme, erroneous reward predictions. Applying REx stabilizes the environment model, preventing it from outputting wild, out-of-distribution reward artifacts.
- The Diversity Paradox: The method performs exceptionally well on Novice and Mixed datasets but struggles to show consistent gains on Experienced datasets. This reinforces a known RL truth: model-based methods thrive on action diversity. Expert data is often too narrow, limiting the benefits of domain generalization.
Key Results
1. Improved Out-of-Distribution (OOD) Generalization
Environment models trained with REx ($\beta > 0$) consistently achieved higher average and worst-case log-likelihoods when evaluated on held-out demonstrators not seen during training.
2. Higher Policy Returns
Policies trained using DIMORL models obtained the highest average returns in two-thirds of the evaluated datasets. Notably, on the Novice datasets, DIMORL learned policies that significantly outperformed the best individual demonstrator in the dataset (e.g., achieving a score of 9056 vs. the max demonstrator return of 7663 in HalfCheetah).
3. Enhanced Training Stability
During policy optimization, standard MOPO baselines ($\beta=0$) frequently suffered from catastrophic training failures where learned Q-values exploded or collapsed. DIMORL ($\beta \in \{10, 20\}$) successfully suppressed this instability, maintaining steady Q-value estimation throughout training.
Limitations and Future Work
While DIMORL shows clear benefits for training stability and OOD model performance, the authors note that improved model log-likelihoods did not perfectly correlate with higher policy returns. This suggests that log-likelihood alone might not capture the exact model qualities required for successful policy optimization.
Additionally, the choice of the REx penalty coefficient $\beta$ remains a sensitive hyperparameter that requires careful tuning. Future work includes exploring alternative domain generalization techniques (like Invariant Risk Minimization) and conducting a deeper trajectory analysis to pinpoint exactly how robust dynamics models translate to better policy exploration.
Summary updated