Offline Trajectory Generalization for Offline Reinforcement Learning

Ziqi Zhao, Zhaochun Ren, Liu Yang, Fajie Yuan, Pengjie Ren, Zhumin Chen, Jun Ma, Xin Xin · DOI

TL;DR

This paper introduces OTTO, a novel method for improving offline reinforcement learning (RL) by generating high-quality, long-horizon simulated trajectories. OTTO uses an ensemble of Transformers ("World Transformers") to model the environment and an uncertainty-based "World Evaluator" to correct potentially flawed simulations, leading to better policy generalization.

What Problem Does This Paper Address?

Offline RL aims to train agents from pre-collected datasets without further interaction with the real environment. This is crucial in scenarios where online exploration is costly or risky (e.g., healthcare, autonomous driving). A key challenge is that offline datasets often lack sufficient diversity, leading to policies that perform poorly when deployed. Model-based offline RL tackles this by learning a dynamics model of the environment to generate synthetic data. However, existing methods often produce short, low-quality simulations that offer only marginal improvements. Furthermore, they lack mechanisms to evaluate and correct these generated trajectories, potentially introducing unreliable data and hindering learning.

Methods

OTTO addresses these limitations with a two-pronged approach:

  • World Transformers: The core of OTTO is an ensemble of Transformer models trained to predict the environment's state transitions and reward functions. Unlike previous methods that might use single models, an ensemble provides robustness. These Transformers are designed to learn from long sequences of state-action pairs, enabling them to model complex dynamics.
  • Long-Horizon Trajectory Generation: OTTO generates longer simulated trajectories than prior work. It does this by perturbing actions in the original offline data and using the World Transformers to predict subsequent states and rewards. Three strategies are proposed for selecting which original trajectories to augment:
  • Random: Randomly selects start timesteps for augmentation.
  • Top-N: Selects the top N highest-reward trajectory segments.
  • Softmax: Selects segments based on a softmax probability distribution over their cumulative rewards.
  • World Evaluator: This novel component assesses the uncertainty in the World Transformers' predictions. If the model is uncertain about a state transition or reward, the World Evaluator applies a conservative penalty to correct the generated trajectory. This ensures that only high-confidence augmented data is used for training, preventing the introduction of misleading information.

OTTO is designed as a plug-in module that can be integrated with existing model-free offline RL algorithms.

Datasets

The paper evaluates OTTO on standard benchmarks from the D4RL (Datasets for Deep Data-Driven Reinforcement Learning) suite, including:

  • Gym MuJoCo: Environments like HalfCheetah, Hopper, and Walker2d, with datasets of varying quality (Medium, Medium-Replay, Medium-Expert).
  • AntMaze: A more challenging environment with sparse rewards, requiring navigation to a goal, with different maze sizes and dataset types (fixed, play, diverse).

Key Insights and Ideas

  • Longer is Better (with caveats): Simply generating longer trajectories isn't enough; their quality is paramount. OTTO demonstrates that generating high-quality long-horizon trajectories is key to improving generalization.
  • Uncertainty is Information: The World Evaluator's ability to identify and correct uncertain predictions is crucial. This prevents the model from being misled by potentially inaccurate simulations, a significant improvement over methods that blindly augment data.
  • Ensembles for Robustness: Using an ensemble of Transformers for environment modeling provides more reliable predictions and reduces variance compared to single models.
  • Plug-and-Play Power: OTTO's design as a module that enhances existing model-free methods makes it broadly applicable and easy to integrate into current RL pipelines.

Key Results

  • Significant Performance Gains: OTTO consistently improved the performance of representative model-free offline RL algorithms (IQL, TD3+BC, DT, CQL) across various MuJoCo and AntMaze benchmarks. For instance, in MuJoCo, OTTO-augmented algorithms often outperformed strong model-based baselines like COMBO and MOPO.
  • Effective in Sparse Rewards: OTTO showed particular effectiveness in the challenging AntMaze environment, demonstrating its ability to handle sparse rewards and complex state spaces.
  • Comparison to Diffusion Models: OTTO outperformed or achieved comparable results to state-of-the-art diffusion-based augmentation methods (SER, DStitch) in most settings, suggesting its approach to uncertainty-aware correction is highly effective.
  • Ablation Studies: Experiments confirmed the importance of both the ensemble of World Transformers and the World Evaluator. The ensemble improved accuracy, and the World Evaluator further boosted performance by correcting low-confidence data.

Limitations and Future Work

  • Hyperparameter Sensitivity: The paper notes that augmentation ratio ($\delta$) and noise range ($\epsilon$) can impact performance. Too much augmentation or too large a noise range can degrade results. Future work could explore more adaptive methods for selecting these parameters.
  • Computational Cost: While the ensemble approach offers robustness, it increases training time. The paper mentions that generating trajectories can take 4-8 hours depending on the dataset.
  • Future Directions: The authors suggest improving the World Evaluator and exploring methods to generate even larger volumes of augmented data as promising avenues for future research. They also highlight the potential for OTTO to further enhance policy learning.

Summary updated

BibTeX
@inproceedings{zhao2025offline,
  author = {Ziqi Zhao and Zhaochun Ren and Liu Yang and Fajie Yuan and Pengjie Ren and Zhumin Chen and Jun Ma and Xin Xin},
  title = {{Offline Trajectory Generalization for Offline Reinforcement Learning}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2025},
  doi = {10.1145/3711896.3737066},
}
Figure