Paper Reading AI Learner

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

2025-10-05 20:15:56
Anindya Sundar Das, Kangjie Chen, Monowar Bhuyan

Abstract

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.

Abstract (translated)

预训练语言模型在广泛的自然语言处理(NLP)任务中取得了显著的成功,特别是在大规模、领域相关的数据集上进行微调时。然而,它们仍然容易受到后门攻击的威胁,在这种攻击中,对手会在训练数据中嵌入恶意行为使用触发模式。这些触发器在正常使用期间处于休眠状态,但在被激活时会导致目标误分类。 在这项工作中,我们调查了带有后门预训练编码器语言模型内部的行为,重点关注处理受污染输入时注意力和梯度归因的一致性变化;在这种情况下,触发令牌主导了注意力和梯度信号,覆盖了周围的上下文。我们提出了一种在推理时间进行防御的方法,通过结合标记级别的注意力和梯度信息来构建异常分数。我们在各种后门攻击场景下的文本分类任务中进行了广泛的实验,结果表明我们的方法显著降低了现有基准的攻击成功率。 此外,我们提供了对评分机制的可解释性驱动分析,揭示了触发器定位和所提议防御措施鲁棒性的新见解。

URL

https://arxiv.org/abs/2510.04347

PDF

https://arxiv.org/pdf/2510.04347.pdf


Tags
3D Action Action_Localization Action_Recognition Activity Adversarial Agent Attention Autonomous Bert Boundary_Detection Caption Chat Classification CNN Compressive_Sensing Contour Contrastive_Learning Deep_Learning Denoising Detection Dialog Diffusion Drone Dynamic_Memory_Network Edge_Detection Embedding Embodied Emotion Enhancement Face Face_Detection Face_Recognition Facial_Landmark Few-Shot Gait_Recognition GAN Gaze_Estimation Gesture Gradient_Descent Handwriting Human_Parsing Image_Caption Image_Classification Image_Compression Image_Enhancement Image_Generation Image_Matting Image_Retrieval Inference Inpainting Intelligent_Chip Knowledge Knowledge_Graph Language_Model LLM Matching Medical Memory_Networks Multi_Modal Multi_Task NAS NMT Object_Detection Object_Tracking OCR Ontology Optical_Character Optical_Flow Optimization Person_Re-identification Point_Cloud Portrait_Generation Pose Pose_Estimation Prediction QA Quantitative Quantitative_Finance Quantization Re-identification Recognition Recommendation Reconstruction Regularization Reinforcement_Learning Relation Relation_Extraction Represenation Represenation_Learning Restoration Review RNN Robot Salient Scene_Classification Scene_Generation Scene_Parsing Scene_Text Segmentation Self-Supervised Semantic_Instance_Segmentation Semantic_Segmentation Semi_Global Semi_Supervised Sence_graph Sentiment Sentiment_Classification Sketch SLAM Sparse Speech Speech_Recognition Style_Transfer Summarization Super_Resolution Surveillance Survey Text_Classification Text_Generation Time_Series Tracking Transfer_Learning Transformer Unsupervised Video_Caption Video_Classification Video_Indexing Video_Prediction Video_Retrieval Visual_Relation VQA Weakly_Supervised Zero-Shot