Robust Reinforcement Learning on State Observations with Learned Optimal Adversary

Huan Zhang, Hongge Chen, Duane S Boning, Cho-Jui Hsieh

Reinforcement Learning (RL) agents are notoriously fragile: even tiny, imperceptible perturbations to their state observations—such as sensor noise in the real world—can cause them to fail catastrophically. This paper introduces a framework to find the optimal adversary (the worst-case noise possible) and a training method called ATLA (Alternating Training with Learned Adversaries) that uses this "master" attacker to train agents that are significantly more robust than those produced by previous state-of-the-art methods.

The Vulnerability of RL Agents

Deep Reinforcement Learning (DRL) has seen massive success in simulation, but deploying these agents in the real world is risky due to noisy sensors and potential malicious actors exploiting the "black-box" nature of neural networks. The authors identify two main weaknesses in current RL agents:

  1. Function Approximator Vulnerability: Neural networks are inherently sensitive to high-frequency noise, a phenomenon well-documented in standard adversarial examples.
  2. Intrinsic Policy Weakness: Even if the network perfectly understands the state, the underlying policy might be brittle. A small change in the perceived environment could lead to a logic error in the agent's decision-making, trapping it in suboptimal loops or causing catastrophic failures.
Gridworld example showing an agent trapped in a suboptimal loop by an adversary.

Existing defenses often focus on smoothing the neural network via regularization, but they fail to address the intrinsic logic of the policy or prepare the agent for the absolute worst-case scenario.

Alternating Training with Learned Adversaries (ATLA)

Building on the State-Adversarial Markov Decision Process (SA-MDP) framework, the researchers propose a two-fold approach to harden RL agents.

First, they prove that for a fixed agent, finding the most damaging state perturbation is itself an RL problem. They train a separate "adversary" neural network whose sole goal is to minimize the agent's reward. By treating the attacker as a competing RL agent rather than a simple mathematical formula (like a gradient step), the attacker learns complex, multi-step strategies to trip up the victim. This "learned optimal adversary" is much stronger than previous heuristic-based attacks.

To defend against this, they introduce ATLA.

The ATLA framework alternates between training an optimal adversary to attack the agent and training the agent to resist those specific perturbations.

The ATLA training loop works in two phases:

  1. Fix the agent, train the adversary: The adversary learns to find the agent's specific weaknesses.
  2. Fix the adversary, train the agent: The agent learns to overcome those specific adversarial perturbations.

Furthermore, the authors note that when an adversary is present, the agent no longer sees the "true" state, turning the problem into a Partially Observable MDP (POMDP). Because standard RL agents are "forgetful," they fail under noise. By using LSTM-based policies (which have memory), the agent can use the consistency of past observations to ignore momentary adversarial "hallucinations."

Key Results and Insights

The researchers evaluated their methods on standard continuous control environments from the OpenAI Gym MuJoCo suite (Hopper, Walker2d, Ant, and HalfCheetah).

  • Devastating Attacks: The learned optimal attack proved highly effective. In the Ant environment, while previous strong attacks reduced the agent's reward to a small positive number, the new attack tricked the agent into running in the opposite direction, resulting in a massive negative reward (e.g., -872 vs. +5851 for an unattacked agent).
  • Superior Defense: ATLA-trained agents outperformed previous state-of-the-art defenses like SA-PPO. In the Hopper environment, ATLA achieved a reward of 1772 under the strongest attack, whereas the previous best method only managed 1076.
  • The Power of Memory: The results confirmed that LSTM-based policies are inherently more robust to state perturbations than standard Multi-Layer Perceptron (MLP) policies when combined with the ATLA training framework. By training against a learned optimal adversary, the agent is essentially forced to prepare for the most difficult possible "reality gap" between simulation and the real world.

Limitations and Future Work

While highly effective, the ATLA framework does come with computational costs. Alternating training effectively doubles the training time and complexity since two separate agents must be optimized. Additionally, while proven in continuous MuJoCo environments, addressing intrinsic policy weaknesses in discrete environments (like Atari games) or scaling these defenses to high-dimensional pixel inputs remains an open challenge for future research.

Summary updated

BibTeX
@inproceedings{zhang2021robust,
  author = {Huan Zhang and Hongge Chen and Duane S Boning and Cho-Jui Hsieh},
  title = {{Robust Reinforcement Learning on State Observations with Learned Optimal Adversary}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=sCZbhBvqQaU},
}
Figure