Skip to main content
QUICK REVIEW

[Paper Review] Be Careful about Poisoned Word Embeddings: Exploring the Vulnerability of the Embedding Layers in NLP Models

Wenkai Yang, Lei Li|arXiv (Cornell University)|Mar 29, 2021
Adversarial Robustness in Machine LearningComputer Science23 references11 citations
TL;DR

This paper proposes a data-free backdoor attack on NLP models by poisoning only a single word embedding vector, using gradient descent to craft a super vector that induces malicious behavior when the trigger word appears. The method achieves 100% attack success rate while preserving clean accuracy, demonstrating a stealthier and more efficient vulnerability than prior data-poisoning approaches.

ABSTRACT

Recent studies have revealed a security threat to natural language processing (NLP) models, called the Backdoor Attack. Victim models can maintain competitive performance on clean samples while behaving abnormally on samples with a specific trigger word inserted. Previous backdoor attacking methods usually assume that attackers have a certain degree of data knowledge, either the dataset which users would use or proxy datasets for a similar task, for implementing the data poisoning procedure. However, in this paper, we find that it is possible to hack the model in a data-free way by modifying one single word embedding vector, with almost no accuracy sacrificed on clean samples. Experimental results on sentiment analysis and sentence-pair classification tasks show that our method is more efficient and stealthier. We hope this work can raise the awareness of such a critical security risk hidden in the embedding layers of NLP models. Our code is available at https://github.com/lancopku/Embedding-Poisoning.

Motivation & Objective

  • To investigate whether backdoor attacks in NLP models can be executed without access to task-specific datasets.
  • To explore the vulnerability of word embedding layers as a low-cost, high-impact attack surface.
  • To develop a method that injects backdoors by modifying only one word embedding vector, minimizing detectability and model disruption.
  • To evaluate the robustness of the attack under fine-tuning and domain shift scenarios.
  • To raise awareness of the security risks posed by poisoned embeddings in pre-trained NLP models.

Proposed method

  • The attack uses gradient descent to optimize a single word embedding vector to maximize the model's misclassification of inputs containing a specific trigger word.
  • The crafted embedding vector is substituted directly into the pre-trained model's embedding layer, bypassing the need for data poisoning or model retraining.
  • The method operates in a data-free setting, requiring no access to the target dataset or proxy data.
  • The attack is designed to be stealthy: model predictions remain unchanged on clean inputs not containing the trigger word.
  • The approach is evaluated across multiple NLP tasks, including sentiment analysis and sentence-pair classification, under various settings (FDK, DS, DF).
  • The method is compared against existing backdoor attacks like BadNets and RIPPLES to demonstrate superiority in stealth and effectiveness.

Experimental results

Research questions

  • RQ1Can a backdoor be successfully injected into an NLP model by modifying only a single word embedding vector, without access to any training data?
  • RQ2How effective is the proposed method in maintaining high clean accuracy while achieving 100% attack success rate across different NLP tasks?
  • RQ3Does the backdoor persist after the model undergoes fine-tuning on downstream datasets, particularly when the source and target domains differ?
  • RQ4How does the proposed method compare to data-poisoning-based attacks in terms of stealth, efficiency, and robustness?
  • RQ5Can the attack be executed in a truly data-free manner, without requiring any dataset for crafting the trigger?

Key findings

  • The proposed embedding poisoning (EP) method achieves 100% attack success rate on both sentiment analysis and sentence-pair classification tasks under the FDK (fully data-free) setting.
  • Clean accuracy remains nearly unchanged across all settings, with values of 91.56% on QNLI and 91.38% on QQP, demonstrating high stealth.
  • Even after fine-tuning on downstream datasets like IMDb and SST-2, the EP method maintains high attack success (100% on SST-2, 98.84% on IMDb) and clean accuracy (93.23% on IMDb).
  • In domain-shift settings (DS), where poisoned and target datasets differ (e.g., QNLI vs. QQP), the EP method still achieves 100% attack success, while BadNets suffer from severe accuracy degradation (e.g., 26.97% on QNLI when trained on QQP).
  • The DFEP variant (data-free embedding poisoning) achieves 100% attack success and maintains clean accuracy in all tested settings, confirming the method's robustness and feasibility in real-world data-restricted scenarios.
  • The results show that embedding-layer poisoning is a more efficient and stealthier attack vector than traditional data-poisoning methods, as it modifies only one parameter and preserves model behavior on clean inputs.

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.