Adversarial Reprogramming of Sequence Classification Neural Networks

Paarth Neekhara, Shehzeen Hussain, Shlomo Dubnov, Farinaz KoushanfararXiv 2018

Introduction

Adversarial attacks in machine learning are typically categorized as destructive, aiming to induce misclassification through subtle perturbations. However, researchers at UC San Diego have introduced a "constructive" paradigm: Adversarial Reprogramming. This technique allows an attacker to repurpose a pre-trained model to perform a completely new task without modifying the original network's weights.

Adversarial reprogramming overview: repurposing a Question Classifier for Name Classification.

While previously demonstrated in the continuous domain of computer vision, reprogramming text models presents a significant challenge due to the discrete nature of language. This paper details a method to hijack sequence-based models like LSTMs and CNNs by learning an input transformation that maps data from a new task into the input space of a victim model.

Methodology

The core of the attack is a Context-Based Vocabulary Remapping function ($f_\theta$). Unlike a simple one-to-one mapping, this function considers a window of surrounding tokens (context) to determine the transformation, providing the necessary representational capacity for complex tasks.

The authors propose two primary attack vectors:

  1. White-box Attack: Utilizing full access to the victim model's parameters. To handle discrete text inputs, the Gumbel-Softmax trick is employed to create a differentiable approximation of the selection process, enabling standard backpropagation.
  2. Black-box Attack: Operating solely on the model's output labels. This is framed as a Reinforcement Learning problem using the REINFORCE algorithm, where the reprogramming function acts as a policy rewarded for correct predictions on the target task.
Architectural diagrams for white-box (Gumbel-Softmax) and black-box (REINFORCE) reprogramming attacks.

Experimental Setup

The framework was evaluated across several NLP benchmarks, including surname origin classification (Names-18/5), question type categorization (Questions), and sentiment analysis (Arabic Sentiment, IMDB). The experiments focused on "cross-reprogramming"—for instance, hijacking a word-level question classifier to perform character-level name identification.

Results and Analysis

The results demonstrate that adversarial reprogramming can achieve performance levels comparable to models specifically trained for the target tasks. For example, a Bi-LSTM question classifier was successfully reprogrammed to classify names with 99.66% accuracy in a white-box setting and 94.96% in a black-box setting.

Key insights from the study include:

  • Resource Theft: This technique poses a security risk where attackers can exploit the computational resources (e.g., GPUs) of cloud-hosted models.
  • The Role of Context: Increasing the convolutional window size (e.g., $k=5$) significantly improves the success rate, as it allows the remapping function to capture more complex patterns.
  • Feature Scavenging: Reprogramming is more effective on pre-trained models than on random initializations, suggesting the attack leverages the high-level linguistic features already learned by the victim model.
  • Architectural Flexibility: The attack is robust across various architectures (LSTM, Bi-LSTM, CNN) and can bridge significant gaps in vocabulary size and data granularity.

Conclusion

Adversarial reprogramming reveals a critical vulnerability in "Models-as-a-Service" deployments. While the current method is limited by the number of output classes in the victim model, it proves that static, pre-trained models can be hijacked for unintended purposes. Future research must focus on developing defensive strategies to prevent such unauthorized repurposing of neural assets.

Summary updated

BibTeX
@misc{neekhara2018adversarial,
  author = {Paarth Neekhara and Shehzeen Hussain and Shlomo Dubnov and Farinaz Koushanfar},
  title = {{Adversarial Reprogramming of Sequence Classification Neural Networks}},
  year = {2018},
  eprint = {1809.01829},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1809.01829},
}
Figure