Robust Q-Learning under Corrupted Rewards

Sreejeet Maity, Aritra Mitra

TL;DR

Standard Q-learning algorithms can be completely derailed by even a small amount of reward corruption. This paper introduces an $\epsilon$-Robust Q-Learning algorithm that uses robust statistics and dynamic thresholding to achieve near-optimal convergence rates, even when an adversary arbitrarily manipulates a fraction of the reward signals.

What Problem Does This Paper Address?

Reinforcement Learning (RL) agents learn by trial and error, guided by a reward signal. Most theoretical guarantees for RL assume this signal is "clean"—meaning it comes directly from the environment's true distribution. However, in real-world deployments (like autonomous vehicles or industrial IoT), sensors can be noisy, malfunction, or be intentionally manipulated by an adversary.

The authors focus on the strong-contamination attack model. In this scenario, an omniscient adversary can observe everything the learner does and arbitrarily change the rewards in an $\epsilon$-fraction of the training steps. The paper first proves a "nightmare scenario": vanilla Q-learning can be biased by an arbitrarily large amount under this attack, even if the corruption fraction $\epsilon$ is tiny. The core challenge is: How can we distinguish between a legitimate "heavy-tailed" reward and a malicious adversarial injection?

Methods

The authors propose a novel robust synchronous Q-learning algorithm. Its architecture relies on two primary "layers of safety":

  1. Reward Filtering (Robust Trimmed-Mean): Instead of using a simple average of observed rewards to update the Q-values, the algorithm employs a Univariate Trimmed-Mean Estimator. It collects a history of rewards for each state-action pair, sorts them, and "trims" the extreme values based on calculated quantiles. This prevents outliers (adversarial or otherwise) from skewing the mean estimate.
  2. Dynamic Thresholding: Robust estimators usually require a minimum number of samples to be reliable. To handle the "early-game" where data is scarce, the authors introduce a time-varying threshold ($G_t$). If the filtered reward estimate exceeds this threshold, it is capped. This ensures that the Q-value estimates (iterates) remain bounded at all times, preventing the adversary from "blowing up" the algorithm before it has enough data to be robust.

The analysis is conducted in the synchronous sampling setting, where a generative model provides independent samples for all state-action pairs at each step.

Datasets

As a theoretical work, this paper does not use standard empirical benchmarks (like Atari or MuJoCo). Instead, it uses:

  • Synthetic MDP Construction: The authors design a specific 5-state Markov Decision Process (MDP) to prove Theorem 2. This "counter-example" MDP demonstrates how an adversary can use a Huber attack to flip the optimal action of a vanilla agent, leading to infinite error.
  • Mathematical Proofs: The bulk of the "evaluation" is a rigorous finite-time convergence analysis using martingale theory and concentration inequalities (specifically Azuma-Hoeffding).

Key Insights and Ideas

  • The Propagation of Bias: The paper highlights that the Bellman operator (the heart of Q-learning) is a contraction, but it also propagates errors. A single corrupted reward can "leak" into the value estimates of all other states over time.
  • Robustness for "Free": A major "aha moment" is that the proposed algorithm doesn't just handle adversaries; it also naturally handles heavy-tailed reward distributions (rewards with infinite support but finite variance). Standard RL often assumes rewards are sub-Gaussian (light-tailed); this algorithm works even when the environment itself is naturally "swingy."
  • The Inevitable Error: The authors show that you cannot achieve perfect convergence under corruption. There is an inevitable error term of $O(\sqrt{\epsilon})$. This is because an adversary can always hide a small bias within the natural variance of the reward distribution, and no statistical tool can perfectly separate the two.

Key Results

The main result is a finite-time convergence bound (Theorem 4). For a corruption fraction $\epsilon < 1/16$, the error $d_T$ after $T$ iterations is:

$$d_T \leq \frac{d_0}{T} + \tilde{O}\left(\frac{1}{\sqrt{T}}\right) + O\left(\frac{\sqrt{\epsilon}}{1-\gamma}\right)$$

  • Efficiency: The $\tilde{O}(1/\sqrt{T})$ term matches the state-of-the-art convergence rates for clean data. This means the robust algorithm doesn't sacrifice learning speed to gain security.
  • Robustness: The $O(\sqrt{\epsilon})$ term quantifies the "price of corruption." As long as the adversary's budget $\epsilon$ is small, the agent's performance remains close to the true optimum.

Limitations and Future Work

  • Knowledge of Bounds: The current algorithm requires knowing an upper bound ($\bar{r}$) on the mean and variance of the rewards to set the dynamic thresholds. In many real-world cases, this bound might be unknown.
  • Synchronous vs. Asynchronous: The paper assumes a "generative model" (synchronous). Most practical RL involves an agent wandering through an environment (asynchronous), where some state-action pairs are visited much more often than others. Extending this to the asynchronous case is a non-trivial next step.
  • Function Approximation: This work is "tabular," meaning it treats every state and action as a discrete entry in a table. Scaling these robust techniques to Deep Q-Networks (DQN) or other function approximation methods remains an open research direction.

Summary updated

BibTeX
@inproceedings{maity2024robust,
  author = {Sreejeet Maity and Aritra Mitra},
  title = {{Robust Q-Learning under Corrupted Rewards}},
  booktitle = {CDC},
  year = {2024},
  url = {https://openreview.net/forum?id=f1O8rxyyEv},
}

Loading related content...

Figure