Dynamics-Augmented Decision Transformer for Offline Dynamics Generalization

Changyeon Kim, Junsu Kim, Younggyo Seo, Kimin Lee, Honglak Lee, Jinwoo ShinOffline RL @ NeurIPS 2022

TL;DR

This paper introduces the Dynamics-Augmented Decision Transformer (DADT), a novel approach to train reinforcement learning agents that can generalize to environments with unseen dynamics, a critical challenge in real-world applications. By augmenting the standard Decision Transformer with a next-state prediction objective, DADT significantly improves generalization performance, even outperforming fine-tuned baselines without any adaptation.

What Problem Does This Paper Address?

Reinforcement learning (RL) agents are typically trained in a fixed environment. However, in real-world scenarios, agents often encounter situations where the environment's dynamics (e.g., friction, mass, inertia) change. This is known as the "dynamics generalization" problem. Traditional offline RL methods, which learn from pre-collected datasets without online interaction, often struggle to adapt to these unseen dynamics. This limitation hinders their deployment in dynamic and unpredictable real-world settings. The paper aims to bridge this gap by developing an agent that can robustly generalize to variations in environment dynamics using only offline data.

Methods

The core of DADT is the Decision Transformer (DT) architecture, which frames RL as a sequence modeling problem. DT takes a sequence of past states, actions, and a desired future return (return-to-go) as input and predicts the actions to achieve that return. The novelty of DADT lies in augmenting this with an auxiliary next-state prediction loss.

Here's a breakdown of the key components:

  • Decision Transformer (DT) Backbone: Leverages the transformer architecture to process sequential data (states, actions, returns). It's trained to predict actions conditioned on the desired return.
  • Next-State Prediction: DADT adds a secondary objective: predicting the next state given the current sequence of states, actions, and returns. This is achieved by adding a linear decoder on top of the transformer's output.
  • Joint Optimization: The model is trained to simultaneously optimize for both action prediction (to achieve the desired return) and next-state prediction. This joint training encourages the model to learn a richer representation of the environment's dynamics.
  • No Dynamics ID: Crucially, DADT does not require explicit "dynamics IDs" or annotations for the training data. It learns to infer dynamics from the raw state-action-return sequences, making it more practical for real-world scenarios where such labels are often unavailable.

Datasets

The experiments were conducted on standard simulated robotic control environments from OpenAI Gym: Walker, Hopper, HalfCheetah, SlimHumanoid, and Ant. For each environment, the authors created datasets by collecting trajectories from 20 different training dynamics and evaluating on 5 unseen test dynamics. These dynamics were varied by changing parameters like mass, inertia, damping, and friction. The data collection process involved training Soft Actor-Critic (SAC) policies for each dynamic and collecting trajectories.

Key Insights and Ideas

  • Next-State Prediction as a Dynamics Learner: The paper posits that explicitly training the model to predict the next state forces it to learn the underlying dynamics of the environment. This learned dynamics information is then implicitly used by the action prediction head to generalize better.
  • Transformer's Suitability for Dynamics Generalization: The success of transformers in other domains like NLP and vision, where they excel at generalization, is leveraged here. The paper suggests that the transformer's ability to model long-range dependencies and learn rich representations makes it well-suited for capturing subtle changes in dynamics.
  • Zero-Shot Generalization Power: A significant finding is that DADT, without any fine-tuning on the test dynamics, often outperforms other methods that do fine-tune. This highlights the effectiveness of the learned dynamics representation.
  • Robustness to Data Quality: DADT demonstrates strong performance even when trained on datasets with a higher proportion of suboptimal trajectories, suggesting resilience to noisy or low-quality offline data.

Key Results

  • State-of-the-Art Performance: DADT consistently outperforms prior state-of-the-art methods (FOCAL, MerPO, and Trajectory Transformer) across various environments and evaluation scenarios (zero-shot and adaptation).
  • Superior Zero-Shot Performance: In many cases, DADT without any adaptation (zero-shot) achieved better or comparable results to adapted baselines. For instance, in the Walker environment, DADT achieved 61.12 ± 4.99 in zero-shot, outperforming FOCAL's adapted score of 48.11 ± 6.95.
  • Reduced Prediction Error: DADT exhibits significantly lower next-state prediction errors on unseen dynamics compared to baselines like DT+, demonstrating its improved ability to model dynamics.
  • Compute Efficiency: DADT is shown to be more compute-efficient during training than some baselines, achieving higher throughput due to its unified transformer architecture.

Limitations and Future Work

  • Limited Dynamics Variation: The current work focuses on variations in dynamics parameters like mass, friction, and inertia. The authors acknowledge that real-world scenarios can involve more complex dynamics, such as navigating different maze shapes.
  • Future Directions: The authors suggest extending DADT to more complex environments like autonomous driving simulators (e.g., CARLA). They also propose exploring scenarios where reward functions change alongside dynamics, which would be a significant step towards more generalizable agents. Additionally, investigating the impact of different transformer architectures and further exploring the role of the balancing coefficient for state prediction loss are mentioned.

Summary updated

BibTeX
@inproceedings{kim2022dynamics,
  author = {Changyeon Kim and Junsu Kim and Younggyo Seo and Kimin Lee and Honglak Lee and Jinwoo Shin},
  title = {{Dynamics-Augmented Decision Transformer for Offline Dynamics Generalization}},
  booktitle = {Offline RL @ NeurIPS},
  year = {2022},
  url = {https://openreview.net/forum?id=ReNyLYfUdr},
}
Figure