Abstract
Offline reinforcement learning aims to maximize the expected cumulative rewards with a fixed collection of data. The basic principle of current offline reinforcement learning methods is to restrict the policy to the offline dataset action space. However, they ignore the case where the dataset's trajectories fail to cover the state space completely. Especially, when the dataset's size is limited, it is likely that the agent would encounter unseen states during test time. Prior policy-constrained methods are incapable of correcting the state deviation, and may lead the agent to its unexpected regions further. In this paper, we propose the state deviation correction (SDC) method to constrain the policy's induced state distribution by penalizing the out-of-distribution states which might appear during the test period. We first perturb the states sampled from the logged dataset, then simulate noisy next states on the basis of a dynamics model and the policy. We then train the policy to minimize the distances between the noisy next states and the offline dataset. In this manner, we allow the trained policy to guide the agent to its familiar regions. Experimental results demonstrate that our proposed method is competitive with the state-of-the-art methods in a GridWorld setup, offline Mujoco control suite, and a modified offline Mujoco dataset with a finite number of valuable samples.
Introduction: The Challenge of State Deviation
Offline Reinforcement Learning (RL) is a promising paradigm for real-world AI applications, such as robotics and healthcare, where online exploration is risky or expensive. By training on fixed, pre-collected datasets, agents can learn optimal behaviors without direct environment interaction. However, a primary hurdle in offline RL is extrapolation error, where algorithms overestimate the value of unseen state-action pairs.
Current state-of-the-art methods typically address this by imposing policy constraints, forcing the agent to select actions that are well-represented in the training data. This paper argues that action constraints alone are insufficient. Even with "safe" actions, small errors in the learned dynamics or slight shifts in initial conditions can cause an agent to drift into out-of-distribution (OOD) states. Once in an unfamiliar state, the agent lacks a reliable policy to recover, leading to compounding errors and eventual failure.
Methodology: State Deviation Correction (SDC)
The proposed State Deviation Correction (SDC) framework proactively manages state distribution shifts. Instead of just constraining actions, SDC trains the policy to actively avoid OOD states by penalizing predicted trajectories that lead away from the training data's support.
The framework consists of three core components:
- State Transition Model ($U$): A Conditional Variational Auto-Encoder (CVAE) that learns the underlying distribution of state transitions $(s, s')$ present in the dataset, independent of specific actions. This serves as a generative model of "familiar" state regions.
- Dynamics Model ($M$): An ensemble of neural networks trained to predict the next state $s'$ and reward $r$ given a current state $s$ and action $a$.
- SDC Objective: During policy optimization, states from the dataset are perturbed with noise to simulate potential deviations. The dynamics model then predicts the next state under the current policy. The algorithm uses Maximum Mean Discrepancy (MMD) to measure and minimize the distance between these predicted next states and the distribution learned by the CVAE.
By minimizing this distance, the policy learns a "homing" behavior: if the agent finds itself in an unfamiliar state, it prioritizes actions that return it to the familiar manifold of the training data.
Experimental Evaluation
The researchers evaluated SDC against leading baselines like CQL (Conservative Q-Learning) and BEAR (Bootstrapping Error Accumulation Reduction) across three distinct benchmarks:
- Modified GridWorld: A continuous navigation task where test starting positions differ from training data, specifically designed to induce state deviation.
- D4RL Benchmarks: Standard offline RL tasks (e.g., HalfCheetah, Hopper, Walker2d) with various data quality levels.
- Limited Valuable Data: A scenario where expert trajectories are heavily diluted with random noise to test performance under data scarcity.
Key Results
SDC demonstrated superior robustness and performance across all tests:
- Navigation Success: In GridWorld, SDC successfully navigated around obstacles to reach the goal, whereas CQL and BEAR often failed due to their inability to correct for the initial state shift.
- Benchmark Performance: On D4RL tasks, SDC consistently matched or exceeded state-of-the-art results. Notably, on
Halfcheetah-medium-expert, SDC achieved a score of 101.3, significantly outperforming baseline methods. - Data Efficiency: In the "Limited Valuable Data" experiments, SDC's performance remained stable even as the proportion of expert data decreased, suggesting it is highly effective at identifying and staying within high-quality state regions.
Discussion and Conclusion
The primary insight of this work is that action constraints are necessary but not sufficient for robust offline RL. By incorporating a one-step state deviation penalty, SDC provides a vital "supervision signal" that prevents agents from drifting into regions where their value estimates are unreliable. While SDC shows great promise, its performance is inherently tied to the accuracy of the learned dynamics model. Nonetheless, SDC represents a significant step toward more reliable and deployable offline reinforcement learning agents.
Summary updated