揭示后门:通过梯度-注意力异常评分对预训练语言模型进行可解释防御
Unmasking Backdoors: An Explainable Defense via Gradient-Attention Anomaly Scoring for Pre-trained Language Models
AI总结:
本文提出通过梯度-注意力异常评分对预训练语言模型进行可解释防御,有效降低后门攻击成功率。
摘要:
预训练语言模型在广泛自然语言处理(NLP)任务中取得了显著成功,特别是在在大规模、领域相关数据集上微调时。然而,它们仍然容易受到后门攻击的影响,攻击者通过在训练数据中嵌入恶意行为来利用触发模式。这些触发器在正常使用时保持沉睡状态,但一旦被激活,就会导致目标性误分类。在本工作中,我们研究了被植入后门的预训练编码器语言模型的内部行为,重点关注在处理受污染输入时注意力和梯度归因的一致性偏移;其中触发词主导了注意力和梯度信号,覆盖了周围的上下文。我们提出了一种在推理时的防御方法,通过结合令牌级注意力和梯度信息构建异常评分。在多样化的后门攻击场景下的文本分类任务中进行的大量实验表明,我们的方法相比现有基线显著降低了攻击成功率。此外,我们还提供了以可解释性为导向的评分机制分析,揭示了触发词定位和所提出防御的鲁棒性。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。