通过词重要性与嵌入稳定性检测对抗文本,无需重训练
Guided Perturbation Sensitivity (GPS): Detecting Adversarial Text via Embedding Stability and Word Importance
- 基于词重要性排序,检测关键词被掩码时的嵌入变化
- 跨数据集攻击检测准确率超85%,计算成本更低
- 适用于未见攻击和模型,适合实际部署场景
对抗文本攻击持续威胁Transformer模型,现有防御方法通常针对特定攻击或需昂贵重训练,难以实现通用检测。本文提出引导扰动敏感性(GPS)框架,通过测量重要词被掩码时嵌入表示的变化来识别对抗样本。首先使用重要性启发式对词进行排序,再检测前k个关键词被掩码时的嵌入敏感度,并用BiLSTM分类器处理结果模式。实验表明,对抗扰动词的掩码敏感度显著高于自然重要词。在三个数据集、三种攻击类型和两个受害者模型上,GPS检测准确率超过85%,性能优于现有先进方法,且计算开销更低。采用归一化折扣累积收益(NDCG)评估扰动识别质量,梯度排序显著优于注意力、混合及随机选择方法,词级攻击下识别质量与检测性能强相关(ρ=0.65)。GPS无需重训练即可泛化至未见数据集、攻击和模型,提供实用的对抗文本检测方案。
原文摘要 · Abstract (English)
Adversarial text attacks remain a persistent threat to transformer models, yet existing defenses are typically attack-specific or require costly model retraining, leaving a gap for attack-agnostic detection. We introduce Guided Perturbation Sensitivity (GPS), a detection framework that identifies adversarial examples by measuring how embedding representations change when important words are masked. GPS first ranks words using importance heuristics, then measures embedding sensitivity to masking top-k critical words, and processes the resulting patterns with a BiLSTM detector. Experiments show that adversarially perturbed words exhibit disproportionately high masking sensitivity compared to naturally important words. Across three datasets, three attack types, and two victim models, GPS achieves over 85% detection accuracy and demonstrates competitive performance compared to existing state-of-the-art methods, often at lower computational cost. Using Normalized Discounted Cumulative Gain (NDCG) to measure perturbation identification quality, we demonstrate that gradient-based ranking significantly outperforms attention, hybrid, and random selection approaches, with identification quality strongly correlating with detection performance for word-level attacks ($ρ= 0.65$). GPS generalizes to unseen datasets, attacks, and models without retraining, providing a practical solution for adversarial text detection.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。