On Minimizing Adversarial Counterfactual Error in Adversarial RL

Roman Belaire, Arunesh Sinha, Pradeep Varakantham

This paper, presented at ICLR 2025, tackles the inherent fragility of Deep Reinforcement Learning (DRL) agents when faced with adversarial perturbations to their observations.

TL;DR

The authors reframe adversarial attacks in RL as a partial observability problem, introducing a novel objective called Adversarial Counterfactual Error (ACoE) to balance robustness and performance. By explicitly reasoning about an attacker's intent through belief estimation (A2B and A3B), their methods achieve state-of-the-art robustness across robotics, gaming, and autonomous driving benchmarks without sacrificing performance in benign settings.

What Problem Does This Paper Address?

Deep Reinforcement Learning has shown remarkable success, but it remains notoriously "brittle." A tiny, often imperceptible amount of noise added to an agent's observation (like a slightly altered pixel in a camera feed) can lead to catastrophic failure.

Existing defenses generally fall into two camps:

  1. Consistency-based: They try to ensure the agent takes the same action for all similar-looking observations. These often fail if the attack is strong enough to push the observation outside the "safe" zone.
  2. Maximin-based: They optimize for the absolute worst-case scenario. While robust, these methods are often overly conservative, leading to sluggish or suboptimal performance when no adversary is present.

The authors identify a fundamental gap: most methods treat adversarial noise as just another type of noise, failing to recognize that an intentional attack turns a standard Markov Decision Process (MDP) into a Partially Observable MDP (POMDP). In an attack, the agent no longer sees the true state; it sees a deceptive version of it.

Methods

The core contribution is the Adversarial Counterfactual Error (ACoE). Intuitively, ACoE measures the difference in expected return between a "counterfactual" scenario where no attack occurred and the actual scenario under attack.

To make this practical for model-free RL, they derive Cumulative-ACoE (C-ACoE), a recursive surrogate objective that can be integrated into standard algorithms like PPO and DQN. The key is how the agent estimates its belief about the true state given a perturbed observation ($s_o$). They propose two methods:

  • Adversary-Aware Belief Estimation (A2B): This assigns higher belief to states in the neighborhood of $s_o$ where the agent's policy would have prescribed a very different action distribution.
  • Adversary-Attack-Aware Belief Estimation (A3B): A more sophisticated approach that reasons about the attacker's preferences. It uses a surrogate attack (like PGD) to determine the "most damaging" perturbation for any candidate true state. If the observed $s_o$ is close to that "most damaging" perturbation, that candidate state is given a higher belief.
Figure 1: A3B belief construction. Let the dotted line sisj have magnitude representing the damage when perturbing si →sj. In this example, our method should discount the pos- sibility that ν(s2) = s0, and lessen the score z(s2).

These belief mechanisms allow the agent to minimize C-ACoE (reducing the impact of attacks) while simultaneously maximizing standard rewards.

Datasets

The authors evaluated their approach on three diverse and standard DRL benchmarks:

  • MuJoCo: Continuous control tasks for robotics (Hopper, Walker2d, HalfCheetah, Ant).
  • Atari: Discrete action classic games (Pong, Freeway, BankHeist, RoadRunner).
  • Highway-env: Autonomous driving simulations involving high-speed navigation and merging.

They tested against both myopic adversaries (which attack frame-by-frame, like PGD and MAD) and strategic, long-horizon adversaries (which plan sequences of attacks to cause long-term failure, like PA-AD).

Key Insights and Ideas

  • Adversarial RL as a POMDP: The most significant "aha moment" is explicitly treating the perturbed observation as a source of partial observability. This shifts the focus from just "being consistent" to "reasoning about what is actually happening."
  • Attacker-Intent Reasoning: A3B is particularly clever. Instead of assuming all nearby states are equally likely to be the true state, it weights them based on how much an intelligent adversary would want to show you the current observation if that state were true.
  • Stability vs. Speed: Subjective analysis of the MuJoCo agents showed that while standard PPO agents exploit physics engines for speed (often resulting in unstable gaits), A3B-trained agents develop more balanced, realistic, and stable movements that are naturally harder for an adversary to exploit.

Key Results

The proposed methods, particularly A3B, consistently achieved state-of-the-art results.

  • Highway-env: As shown in the table below, A3B significantly outperformed all baselines under MAD and PGD attacks while maintaining high performance in unperturbed settings.
  • Strategic Attacks: Against the potent PA-AD strategic attacker, A3B maintained much higher scores than previous leading methods like RAD or WocaR. For example, in the Walker2d environment, A3B achieved a score of 4931 under attack, while the next best non-adaptive baseline (RAD) scored 3864.
  • No Test-Time Adaptation: Unlike the recent "Protected" framework, which requires hundreds of adaptation runs at test time (impractical for real-world use like self-driving), ACoE methods work immediately at test time.
Table 1: Experimental results versus myopic adversaries. Each row shows the mean scores of each RL method against different attacks. The most robust scores are in bold. Our approaches are A2B and A3B, which are highlighted .

Limitations and Future Work

  • Belief Accuracy: The effectiveness of A3B relies on the accuracy of using KL Divergence to measure attack strength. While empirically strong, other measures might be even more effective.
  • Single-Step Focus: The primary work focused on belief estimation from single-step observations. While they provided a preliminary LSTM-based extension for multi-step history, they noted that the computational complexity of multi-step belief construction is a challenge for future work.
  • Model-Free Constraints: While C-ACoE is theoretically grounded, computing it exactly requires transition dynamics, which are unavailable in model-free settings, necessitating the surrogate belief constructions used here.

Summary updated

BibTeX
@inproceedings{belaire2025minimizing,
  author = {Roman Belaire and Arunesh Sinha and Pradeep Varakantham},
  title = {{On Minimizing Adversarial Counterfactual Error in Adversarial RL}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=eUEMjwh5wK},
}
Figure