Universal Black-Box Reward Poisoning Attack against Offline Reinforcement Learning

Yinglun Xu, Rohan Gumaste, Gagandeep SinghSubmission to ICLR 2025 · Withdrawn

TL;DR

This paper introduces the Policy Contrast Attack (PCA), the first universal, black-box reward-poisoning attack tailored for general offline reinforcement learning (RL). By identifying both high- and low-performing policies supported by the offline dataset and artificially flipping their perceived values, PCA tricks pessimistic offline RL agents into learning low-quality behaviors under tight perturbation budgets—without needing any knowledge of the victim’s specific learning algorithm.

What Problem Does This Paper Address?

In offline reinforcement learning, agents learn decision-making policies strictly from pre-collected, static datasets—such as human demonstrations or interaction logs—without environment interaction. Because collecting real-world data often relies on untrusted third parties or crowdsourced feedback (common in RLHF), malicious actors can subtly manipulate (poison) reward signals.

Attacking offline RL is fundamentally harder than attacking online RL:

  1. The dataset is fixed: Attackers cannot trick the agent into exploring bad states; expert trajectories remain present in the data.
  2. Algorithmic pessimism: Modern offline RL algorithms inherently avoid out-of-distribution actions and stick strictly to high-value behaviors supported by the dataset, giving them a natural resilience to random noise.
  3. Black-box setting: A realistic attacker does not know which neural network architecture or offline RL algorithm the agent is using, and must keep perturbations small and stealthy (bounded in both maximum per-step change $\| \Delta \|_\infty$ and total corruption $\| \Delta \|_1$).

Prior work either focused on simple tabular settings or relied on naive random reward flips, which modern algorithms easily brush off.

Methods

The authors propose the Adversarial Reward Engineering Framework and instantiate it via the Policy Contrast Attack (PCA):

  1. Find Supported Bad Policies: By training an offline RL algorithm on the dataset with completely inverted rewards ($-D$), the attacker extracts a policy $\pi_1$ that represents near-worst behavior among those covered by the data.
  2. Find Supported Good Policies: The attacker iteratively trains an offline RL algorithm on the data while penalizing previously discovered good actions, producing a diverse set of high-performing candidate policies $\Pi_2$.
  3. Contrastive Reward Shaping: The attacker alters dataset rewards using a distance metric $d_a(a_1, a_2) = \|a_1 - a_2\|_2$:
  4. Make bad policies look good: Add a linear bonus $\Delta_1 \cdot (1 - d_a(a, \pi_1(s))/d)$ to actions close to the bad policy.
  5. Make good policies look bad: Reduce rewards to $-\Delta_2$ for actions close to any policy in $\Pi_2$.
  6. Conflict resolution: If good and bad actions overlap, the bonus for the bad action takes precedence.
  7. Strict Black-Box Setup: The attacker uses one offline RL algorithm (e.g., IQL) to derive $\pi_1$ and $\Pi_2$, while the victim trains with a completely different algorithm (e.g., TD3-BC, CQL, AWAC).

Datasets

The authors evaluated PCA on standard continuous control benchmarks from D4RL across four environments (HalfCheetah, Hopper, Walker2d, Ant) using various dataset collection styles:

  • Medium (M): Suboptimal trajectories from a partially trained policy.
  • Medium-Replay (MR): The replay buffer recording training up to medium performance.
  • Medium-Expert (ME): A mixture of medium and expert demonstrations.

No new datasets were introduced.

Key Insights and Ideas

  • Targeting supported policies is mandatory: Because offline algorithms are pessimistic, poisoning arbitrary or out-of-distribution state-action pairs is wasted budget. The attack must invert the rankings of policies already supported by the dataset.
  • The "Contrast" is essential: Doing only one half of the attack (only boosting the bad policy or only penalizing good policies) significantly degrades attack effectiveness. Good policies must be actively suppressed so the agent does not simply converge to an alternative high-performing mode.
  • Transferability across algorithms: Even though offline RL algorithms optimize objectives differently (e.g., policy constraints in TD3-BC vs. value regularization in CQL), they all share the fundamental property of seeking near-optimal supported policies. Consequently, an adversarial reward engineered via one algorithm transfers reliably to others.

Key Results

Under matched $L_1$ and $L_\infty$ budgets equivalent to randomly flipping 30% of rewards:

  • Consistent Performance Degradation: Across D4RL benchmarks, PCA dropped cumulative agent scores across tasks from an unattacked sum of 488.4 down to 331.4, outperforming baseline attacks including Random 30% Inversion (414.3), Random Policy Promote (402.6), and Random Policy Invert (359.4).
  • Substantial Drops on Hard Datasets:
  • On Walker2D-MR with IQL, performance plummeted from 80.2 (clean) and 78.7 (random flip) to 31.9 under PCA.
  • On Hopper-MR with CQL, performance dropped from 85.2 (clean) to 30.3 under PCA.
  • Cross-Algorithm Universality: On Hopper-ME, PCA degraded performance across four distinct learning algorithms: TD3-BC, CQL, AWAC, and ReBRAC. Interestingly, AWAC retained higher performance than the others, demonstrating how PCA can serve as a benchmark for algorithmic robustness.

Limitations and Future Work

  • Full Dataset Access Required: The threat model assumes the adversary has access to inspect and modify the entire offline training dataset before the agent trains on it.
  • Metric Dependency: The current action-distance formulation relies on Euclidean distance in continuous action spaces, which may require adaptation for discrete domains or complex token sequences (e.g., language model fine-tuning).
  • Future Directions: Developing robust offline RL defense mechanisms against structured contrastive poisoning, and extending similar adversarial reward engineering frameworks to offline RLHF in large language models.

Summary updated

Abstract

We study the problem of universal black-boxed reward poisoning attacks against general offline reinforcement learning with deep neural networks. We consider a black-box threat model where the attacker is entirely oblivious to the learning algorithm, and its budget is limited by constraining the amount of corruption at each data point and the total perturbation. We require the attack to be universally efficient against any efficient algorithms that might be used by the agent. We propose an attack strategy called the `policy contrast attack.' The idea is to find low- and high-performing policies covered by the dataset and make them appear to be high- and low-performing to the agent, respectively. To the best of our knowledge, we propose the first universal black-box reward poisoning attack in the general offline RL setting. We provide theoretical insights on the attack design and empirically show that our attack is efficient against current state-of-the-art offline RL algorithms in different learning datasets.
BibTeX
@misc{xu2024universal,
  author = {Yinglun Xu and Rohan Gumaste and Gagandeep Singh},
  title = {{Universal Black-Box Reward Poisoning Attack against Offline Reinforcement Learning}},
  year = {2024},
  eprint = {2402.09695},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.09695},
}
Figure