Skip to main content
QUICK REVIEW

[Paper Review] Universal Adversarial Perturbation for Text Classification

Hang Gao, Tim Oates|arXiv (Cornell University)|Oct 10, 2019
Adversarial Robustness in Machine LearningComputer Science29 references11 citations
TL;DR

This paper proposes a method to generate universal adversarial perturbations in the embedding space for text classifiers, where a single, small perturbation vector is applied to each token (token-agnostic) to mislead state-of-the-art models with high probability. The approach achieves high fooling rates across multiple NLP tasks while preserving semantic neighborhood, demonstrating deep neural networks' vulnerability to minimal, transferable perturbations.

ABSTRACT

Given a state-of-the-art deep neural network text classifier, we show the existence of a universal and very small perturbation vector (in the embedding space) that causes natural text to be misclassified with high probability. Unlike images on which a single fixed-size adversarial perturbation can be found, text is of variable length, so we define the "universality" as "token-agnostic", where a single perturbation is applied to each token, resulting in different perturbations of flexible sizes at the sequence level. We propose an algorithm to compute universal adversarial perturbations, and show that the state-of-the-art deep neural networks are highly vulnerable to them, even though they keep the neighborhood of tokens mostly preserved. We also show how to use these adversarial perturbations to generate adversarial text samples. The surprising existence of universal "token-agnostic" adversarial perturbations may reveal important properties of a text classifier.

Motivation & Objective

  • To investigate the existence of universal, small perturbations in the embedding space that can mislead deep neural network text classifiers.
  • To develop an algorithm that computes such universal adversarial perturbations for text, independent of input sample length.
  • To generate adversarial text samples that maintain semantic and syntactic plausibility while evading classification.
  • To evaluate the robustness of state-of-the-art text classifiers under these universal perturbations across diverse NLP tasks.

Proposed method

  • The method formulates a universal adversarial perturbation as an optimization problem to maximize misclassification loss across all training samples, constrained by a small p-norm (p=2).
  • It uses gradient ascent on the perturbation vector δ, with normalized gradients to ensure the perturbation stays within the ε-boundary of the l_p norm.
  • The algorithm iteratively updates δ using mini-batches of training data, projecting it back into the l_p ball after each step to maintain the norm constraint.
  • The perturbation is applied uniformly to each token in the input sequence, making it 'token-agnostic'—the same δ is used per token regardless of context.
  • Adversarial samples are generated by replacing each token with its nearest neighbor in the perturbed embedding space, maximizing cosine similarity to the perturbed vector.
  • The method is trained using Adam with normalized gradients and early stopping on validation data, using a fixed ε to ensure imperceptibility.

Experimental results

Research questions

  • RQ1Can a single, small perturbation in the embedding space universally fool a deep neural network text classifier across diverse inputs and tasks?
  • RQ2How effective is a token-agnostic perturbation strategy in generating adversarial examples while preserving semantic neighborhood?
  • RQ3What is the minimal amount of training data required to train a universal adversarial perturbation with high fooling performance?
  • RQ4How does the proposed method compare to random or vocabulary-based baseline perturbations in terms of fooling rate and semantic preservation?
  • RQ5To what extent can the perturbation be transferred across different NLP tasks and model architectures?

Key findings

  • The proposed method achieves a fooling rate of 95.9% on the MRPC task, outperforming all baselines including random and vocabulary-based perturbations.
  • With only 10% of the training data, the method achieves 87.7% accuracy on SST-2, indicating strong data efficiency and scalability.
  • The NI(V) score of 0.959 on MRPC shows that the perturbation preserves the neighborhood of tokens better than vocabulary-based baselines.
  • The method maintains high fooling performance even when ε is set to 0.2, indicating that perturbations remain imperceptible in terms of embedding norm.
  • Adversarial samples generated via the method are linguistically plausible and cause consistent misclassification, as shown in Table 5, where syntactic changes alone flip predictions.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.