SAMBO-RL: Shifts-aware Model-based Offline Reinforcement Learning

Wang Luo, Haoran Li, Zicheng Zhang, Congying Han, Jiayu Lv, Tiande Guo · OpenReview

Abstract

Model-based offline reinforcement learning trains policies using pre-collected datasets and learned environment models, eliminating the need for direct real-world environment interaction. However, this paradigm is inherently challenged by distribution shift (DS). Existing methods address this issue by leveraging off-policy mechanisms and estimating model uncertainty, but they often result in inconsistent objectives and lack a unified theoretical foundation. This paper offers a comprehensive analysis that disentangles the problem into two fundamental components: model bias and policy shift. Our theoretical and empirical investigations reveal how these factors distort value estimation and restrict policy optimization. To tackle these challenges, we derive a novel Shifts-aware Reward (SAR) through a unified probabilistic inference framework, which modifies the vanilla reward to refine value learning and facilitate policy training. Building on this, we introduce Shifts-aware Model-based Offline Reinforcement Learning (SAMBO-RL), a practical framework that efficiently trains classifiers to approximate SAR for policy optimization. Empirical experiments show that SAR effectively mitigates DS, and SAMBO-RL achieves superior or comparable performance across various benchmarks, underscoring its effectiveness and validating our theoretical analysis.

Introduction

Offline Reinforcement Learning (RL) enables agents to learn optimal behaviors from static, pre-collected datasets, avoiding the risks and costs of live environment interaction. Model-based approaches enhance this by learning a transition model—a simulator—from the data. However, these methods are plagued by distribution shift (DS), where the agent's learned policy encounters states or actions poorly represented in the training data. This leads to two critical failures: the model may "hallucinate" high rewards in unexplored regions (model bias), and the policy may become unstable as it deviates from the behavior policy (policy shift).

Disentangling Distribution Shift

Decomposition of distribution shift into model bias and policy shift in a 1D grid world.

A core contribution of this work is the mathematical decomposition of the distribution shift problem into two distinct factors:

  1. Model Bias: Errors in the learned transition model compound over time. If the model overestimates transitions to high-reward states, the agent will learn a sub-optimal policy based on these inaccuracies.
  2. Policy Shift: As the agent optimizes its policy, it naturally drifts away from the behavior policy $\pi_b$ that generated the dataset. This shift creates a gap between the training objective and the true performance in the real environment, often leading to training instability.

The SAMBO-RL Framework

To address these shifts, we introduce the Shifts-aware Reward (SAR). SAR modifies the standard environment reward by subtracting penalties for both model bias and policy shift. Specifically, it incorporates KL divergence terms that penalize transitions where the model deviates from the true dynamics and actions where the policy deviates from the behavior data.

Since the true environment dynamics are unknown, SAMBO-RL employs a practical classifier-based approach. We train a transition classifier to distinguish between real data transitions and synthetic transitions generated by the model, and an action classifier to estimate the density of the behavior policy. This allows the agent to approximate the SAR objective without requiring complex model ensembles.

Experimental Results

We evaluated SAMBO-RL on the D4RL and NeoRL benchmarks. NeoRL is particularly challenging as it features "narrow" datasets that exacerbate distribution shift.

Performance comparison of SAMBO-RL against MOBILE and MOPO on the Hopper-H task.

Key Findings:

  • State-of-the-Art Performance: SAMBO-RL achieved an average normalized score of 60.2 on NeoRL, significantly outperforming previous leaders like MOBILE (51.7) and CQL (56.1).
  • Enhanced Stability: As shown in the training curves for tasks like Hopper-H, SAMBO-RL maintains a steady upward trajectory in performance, whereas baseline methods often suffer from instability or plateau early due to unaddressed policy shifts.
  • Ablation Validation: Removing either the model bias or policy shift penalty resulted in a marked decrease in performance, confirming that both components are essential for robust offline learning.

Conclusion

SAMBO-RL provides a theoretically grounded and practically efficient solution to the distribution shift problem in model-based offline RL. By explicitly penalizing model bias and policy shift through the Shifts-aware Reward, SAMBO-RL achieves superior stability and performance across diverse benchmarks. Future work will focus on improving classifier accuracy to further refine the SAR approximation.

Summary updated

BibTeX
@misc{luo2024sambo,
  author = {Wang Luo and Haoran Li and Zicheng Zhang and Congying Han and Jiayu Lv and Tiande Guo},
  title = {{SAMBO-RL: Shifts-aware Model-based Offline Reinforcement Learning}},
  year = {2024},
  eprint = {2408.12830},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.12830},
}
Figure