mlsanityData to 7 Oct 2026

Unmasking Backdoors: An Explainable Defense via Gradient-Attention Anomaly Scoring for Pre-trained Language Models

arXiv 2510.04347 ↗First posted 5 Oct 2025cs.CL cs.LGcited by 3

On the map: LLM safety and security → Backdoor and data poisoning attacks

Abstract (arXiv)

Pre-trained language models have achieved remarkable success across a wide range of natural language processing (NLP) tasks, particularly when fine-tuned on large, domain-relevant datasets. However, they remain vulnerable to backdoor attacks, where adversaries embed malicious behaviors using trigger patterns in the training data. These triggers remain dormant during normal usage, but, when activated, can cause targeted misclassifications. In this work, we investigate the internal behavior of backdoored pre-trained encoder-based language models, focusing on the consistent shift in attention and gradient attribution when processing poisoned inputs; where the trigger token dominates both attention and gradient signals, overriding the surrounding context. We propose an inference-time defense that constructs anomaly scores by combining token-level attention and gradient information. Extensive experiments on text classification tasks across diverse backdoor attack scenarios demonstrate that our method significantly reduces attack success rates compared to existing baselines. Furthermore, we provide an interpretability-driven analysis of the scoring mechanism, shedding light on trigger localization and the robustness of the proposed defense.

Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Placed in Backdoor and data poisoning attacks, one of 12 directions in LLM safety and security. Builds on 29 of its 37 references that are in the map. First posted on arXiv 5 Oct 2025.

Builds on

29 of 37 references.

Closest ancestors · 14

Same direction, newest first

  1. 2023TextGuard: Provable Defense against Backdoor Attacks on Text Classification19 Nov
  2. 2023Diffusion Theory as a Scalpel: Detecting and Purifying Poisonous Dimensions in Pre-trained Language Models Caused by Backdoor or Bias8 May
  3. 2022Fine-mixing: Mitigating Backdoors in Fine-tuned Language Models18 Oct
  4. 2022A Unified Evaluation of Textual Backdoor Learning: Frameworks and Benchmarks17 Jun
  5. 2022BITE: Textual Backdoor Attacks with Iterative Trigger Injection25 May
  6. 2022Constrained Optimization with Dynamic Bound-scaling for Effective NLPBackdoor Defense11 Feb
  7. 2021Triggerless Backdoor Attack for NLP Tasks with Clean Labels15 Nov
  8. 2021RAP: Robustness-Aware Perturbations for Defending against Backdoor Attacks on NLP Models15 Oct
  9. 2021Mind the Style of Text! Adversarial and Backdoor Attacks Based on Text Style Transfer14 Oct
  10. 2021BadPre: Task-agnostic Backdoor Attacks to Pre-trained NLP Foundation Models6 Oct
  11. 2021BFClass: A Backdoor-free Text Classification Framework22 Sep
  12. 2021Turn the Combination Lock: Learnable Textual Backdoor Attacks via Word Substitution11 Jun
2 more
  1. 2021Hidden Killer: Invisible Textual Backdoor Attacks with Syntactic Trigger26 May
  2. 2021Be Careful about Poisoned Word Embeddings: Exploring the Vulnerability of the Embedding Layers in NLP Models29 Mar

Other references · 15

  1. 2017Attention Is All You Needcited by 59,932
  2. 2014Explaining and Harnessing Adversarial Examplescited by 7,287
  3. 2015Character-level Convolutional Networks for Text Classificationcited by 2,293
  4. 2017BadNets: Identifying Vulnerabilities in the Machine Learning Model Supply Chaincited by 1,052
  5. 2017Targeted Backdoor Attacks on Deep Learning Systems Using Data Poisoningcited by 1,012
  6. 2019Universal Adversarial Triggers for Attacking and Analyzing NLPcited by 709
  7. 2019STRIP: A Defence Against Trojan Attacks on Deep Neural Networkscited by 437
  8. 2020Weight Poisoning Attacks on Pre-trained Modelscited by 318
  9. 2020ONION: A Simple and Effective Defense Against Textual Backdoor Attackscited by 231
  10. 2019A backdoor attack against LSTM-based text classification systemscited by 214
  11. 2020BadNL: Backdoor Attacks against NLP Models with Semantic-preserving Improvementscited by 191
  12. 2021Backdoor Attacks on Pre-trained Models by Layerwise Weight Poisoningcited by 103
3 more
  1. 2020Mitigating backdoor attacks in LSTM-based Text Classification Systems by Backdoor Keyword Identificationcited by 80
  2. 2020Trojaning Language Models for Fun and Profitcited by 80
  3. 2022A Study of the Attention Abnormality in Trojaned BERTscited by 47

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 3.

3 papers.