Data Poisoning Attacks against Online Learning

Yizhen Wang, Kamalika ChaudhuriarXiv 2018

Abstract

As machine learning models are increasingly deployed in dynamic environments, understanding their vulnerabilities to adversarial manipulation is critical. This paper presents the first systematic investigation into data poisoning attacks against online learning algorithms. Unlike traditional offline poisoning, online attacks must account for the sequential nature of data, where the timing and order of malicious injections significantly influence the model's trajectory. By framing the attack as a white-box optimization problem, we demonstrate that strategic adversaries can drastically degrade model performance—often reducing accuracy to near zero—using efficient gradient-based methods and specialized search strategies.

1. Introduction

Machine learning models are no longer static entities; they are frequently deployed in "online" settings where they update continuously as new data arrives. Applications ranging from high-frequency trading and spam filters to recommendation engines rely on Online Gradient Descent (OGD) to adapt to shifting data distributions. However, this adaptability introduces a unique vulnerability: data poisoning. While poisoning in offline settings (where the training set is fixed) is well-studied, the "streaming" nature of online learning presents a new frontier for adversaries.

In the online world, the order of data matters. A single malicious data point injected early in a stream can alter the model's weights in a way that cascades through all subsequent updates. This paper formalizes the threat model for online data poisoning and proposes a suite of optimization-based attacks designed to exploit the temporal dynamics of streaming learners.

2. Problem Formulation

The authors categorize the adversary's goals into two primary settings:

  1. Semi-Online Attack: The attacker aims to corrupt the final state of the model after a fixed number of time steps $T$. This is relevant when a model is trained on a stream and then deployed for static use.
  2. Fully-Online Attack: The attacker seeks to maximize the cumulative loss over the entire lifetime of the model. This is the more damaging scenario for systems that are "always-on," as it ensures the model remains ineffective throughout its operation.

In both cases, the attacker is assumed to have white-box knowledge, including the learner’s algorithm (OGD), the data stream, and the hyperparameters (such as the learning rate).

3. Attack Methodology

To overcome the non-differentiable nature of classification error and the computational complexity of tracking updates over time, the paper introduces three core technical innovations:

3.1 Objective Smoothing and Label Inversion

Since standard classification loss is "jumpy" and difficult to optimize directly, the authors utilize a smooth logistic loss surrogate. To maximize damage, they employ a "label inversion" trick: rather than simply trying to increase the model's error, they optimize the model to perform well on a validation set where all labels have been intentionally flipped. This provides a clear, differentiable gradient for the attacker to follow.

3.2 Efficient Gradient Computation

In offline poisoning, researchers often rely on KKT conditions to find optimal perturbations. These do not apply in sequential settings. Instead, the authors utilize the Chain Rule and a "recurrent prefix" method. This approach allows the attacker to efficiently calculate how a modification at time $t$ ripples through future model weights, reducing the computational complexity to $O(Td^2)$, where $d$ is the feature dimension.

3.3 Strategic Search Schemes

Because searching for the optimal subset of points to poison is a combinatorial challenge, the authors propose three heuristic strategies:

  • Incremental Attack: A greedy approach that identifies and modifies the single most impactful point in each iteration.
  • Interval Attack: Focuses on finding a contiguous window of data to poison, which can be more effective for shifting the model's "momentum."
  • Teach-and-Reinforce: A sophisticated hybrid strategy that "teaches" the model a corrupted concept early in the stream and then uses lighter, strategic poisoning to "reinforce" that error, preventing the model from recovering even when it encounters clean data.

4. Experimental Evaluation

The attacks were evaluated across four datasets: a synthetic 2D Gaussian Mixture, MNIST (digits 1 vs. 7), Fashion MNIST (Sandals vs. Boots), and UCI Spambase.

The results were stark. On the MNIST dataset, the proposed online attacks were able to drop test accuracy from over 90% to nearly 0% by perturbing only a small fraction of the data stream. The gradient-based feature modifications consistently outperformed simpler baselines, such as random label-flipping or "oblivious" offline attacks that do not account for the sequence of updates.

5. Vulnerability Analysis

The research highlights several key factors that determine a model's susceptibility to poisoning:

  • The Power of Sequence: Adversaries who understand the streaming nature of data are significantly more potent. Knowing when to strike is as vital as what to inject.
  • Learning Rate Decay: Models with "Fast Decay" learning rates are particularly vulnerable. Because these models stop "listening" to new data quickly to achieve convergence, an early-stream attack can lock in a poisoned concept before the model has a chance to see enough clean data to self-correct.
  • Timing of Attack: For Semi-Online goals, attacking the end of the stream is often most efficient. For Fully-Online goals, attacking the beginning is superior as it derails the model's entire trajectory from the start.

6. Conclusion and Future Work

This study demonstrates that online learning is highly vulnerable to strategic data poisoning. While the current work focuses on linear models and OGD, the principles of sequential optimization-based attacks likely extend to more complex architectures like Recurrent Neural Networks (RNNs).

To defend against these threats, the authors suggest exploring Averaged Stochastic Gradient Descent (ASGD), which may be more resilient because it prevents the model from depending too heavily on a narrow window of data points. Future research should also address "black-box" scenarios where the attacker has limited knowledge of the learner's parameters or the incoming data stream.

Summary updated

BibTeX
@misc{wang2018data,
  author = {Yizhen Wang and Kamalika Chaudhuri},
  title = {{Data Poisoning Attacks against Online Learning}},
  year = {2018},
  eprint = {1808.08994},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1808.08994},
}
Figure