Adversarially Robust Decision Transformer

Xiaohang Tang, Afonso Marques, Parameswaran Kamalaruban, Ilija Bogunovic

TL;DR

Decision Transformers (DTs) are powerful tools for offline reinforcement learning, but they often fail spectacularly in adversarial environments. This is because they assume high returns in the training data are the result of good actions, rather than weak opponents. This paper introduces the Adversarially Robust Decision Transformer (ARDT), which relabels training data using "minimax returns-to-go" to teach the model the best worst-case actions. The result is a highly robust policy that survives powerful test-time adversaries in both discrete games and continuous physics simulations.

What Problem Does This Paper Address?

Reinforcement Learning via Supervised Learning (RvS)—most notably the Decision Transformer (DT)—turns RL into a sequence modeling problem. You feed the model a target return, and it predicts the sequence of actions needed to achieve it.

However, in adversarial settings (like competitive games, autonomous driving, or robust control), the return depends on both the agent (protagonist) and an adversary. If the offline training dataset was collected against a weak or suboptimal adversary, a high return might just be a stroke of luck. If you train a standard DT on this data and ask it for a high return at test time against a strong adversary, it crumbles. It has learned to exploit a weak opponent's specific mistakes rather than learning a fundamentally robust, defensive strategy. The authors tackle this gap by figuring out how to make DTs "worst-case-aware."

Methods: Making Transformers Worst-Case-Aware

The authors propose the Adversarially Robust Decision Transformer (ARDT). The core idea is to stop conditioning the Transformer on the observed returns and instead condition it on the worst-case returns.

  1. Minimax Expectile Regression: Instead of using the actual observed returns (like vanilla DT) or expected returns (like a variant called ESPER), ARDT calculates the in-sample minimax return-to-go. This represents the expected return when an adversary tries to minimize the score, and the agent subsequently tries to maximize it. To compute this efficiently without needing to query actions outside the dataset (which is dangerous in offline RL), they use Expectile Regression. By tuning an asymmetry parameter ($\alpha$), they can approximate minimum and maximum operators directly from the data distribution.
  2. Relabeling and Training: The original returns in the offline dataset are replaced with these newly calculated minimax returns. A standard causal Transformer is then trained via behavioral cloning to predict actions conditioned on these worst-case returns.
ARDT Architecture

Key Insights and Ideas

  • The "Luck" Factor in Offline RL: Standard DTs suffer from a distributional shift in the adversary's policy. They overfit to the behavior of the specific adversary present in the training data, mistaking a vulnerable opponent for a brilliant protagonist strategy.
  • Conditioning on high returns isn't enough: You can't just ask a vanilla DT for the "highest worst-case return" at test time. Because of how it was trained, it will still assign high probabilities to risky actions that only worked against weak opponents in the past, leading to catastrophic failure against an optimal adversary.
  • Expectile Regression is a cheat code: By using expectile regression with specific $\alpha$ values (close to 0 for min, close to 1 for max), the authors elegantly approximate the minimax math entirely offline. This avoids the dreaded out-of-distribution action querying problem that plagues standard Q-learning approaches.

Key Results

The authors evaluate ARDT across three distinct settings: toy games with full data coverage, a discrete long-horizon game (Connect Four) with partial coverage, and continuous adversarial RL (Noisy Action Robust MDPs using MuJoCo).

  • Perfect Play in Toy Games: Given full data coverage, ARDT successfully learns the Nash Equilibrium (the optimal maximin strategy). Standard DT and ESPER fail completely when the test-time adversary plays optimally.
Performance in Toy Games
  • Connect Four Dominance: When trained on mixed-quality datasets and tested against a strong (70% optimal) adversary, ARDT achieved a positive average return (+0.02), while DT (-0.57) and ESPER (-0.42) lost heavily.
  • Robustness in Physics Sims: In the continuous MuJoCo environments, ARDT achieved significantly higher worst-case returns against a population of adversaries. For example, in the Hopper environment trained on low-randomness data, ARDT achieved a worst-case return of 477.9, crushing vanilla DT (112.1) and ESPER (66.8).

Limitations and Future Work

  • Deterministic Assumption: The current practical implementation of ARDT estimates minimax returns without explicitly accounting for environmental stochasticity. It assumes transitions are deterministic given the joint actions of both players (which is true for games like Chess/Go and standard MuJoCo, but not all real-world environments).
  • Data Coverage Vulnerability: Because ARDT attempts to learn a single best worst-case outcome (rather than an expectation over many outcomes), it is theoretically more sensitive to low data coverage in continuous environments. However, it still performed very well empirically in the MuJoCo tests.
  • Future Work: The authors suggest expanding the framework to explicitly handle environments that are both highly stochastic and adversarial, further bridging the gap to unpredictable real-world deployments like autonomous driving.

Summary updated

BibTeX
@inproceedings{tang2024adversarially,
  author = {Xiaohang Tang and Afonso Marques and Parameswaran Kamalaruban and Ilija Bogunovic},
  title = {{Adversarially Robust Decision Transformer}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=WEf2LT8NtY},
}
Figure