探索梯度引导的掩码语言模型以检测文本对抗攻击
Exploring Gradient-Guided Masked Language Model to Detect Textual Adversarial Attacks
AI总结:
针对文本对抗样本威胁,基于对抗样本偏离正常文本流形的特性,提出MLMD方法利用掩码语言模型检测差异,再通过GradMLMD的梯度引导跳过非关键词,在保证性能的同时降低计算开销。
摘要:
文本对抗样本对自然语言处理系统的可靠性构成严重威胁。近期研究表明,对抗样本往往偏离正常文本的潜在流形,而预训练掩码语言模型可近似正常数据的流形。这些发现启发了探索掩码语言模型用于检测文本对抗攻击的思路。我们首先提出基于掩码语言模型的检测方法(MLMD),利用掩码语言建模(MLM)目标的掩码和非掩码操作,诱导正常文本与对抗文本在流形变化上的差异。尽管MLMD实现了有竞争力的检测性能,但其逐一枚举的掩码策略引入了显著的计算开销。我们的后验分析显示,输入中大量非关键词对检测不重要却消耗资源。基于此,我们提出梯度引导的MLMD(GradMLMD),利用梯度信息识别并跳过检测中的非关键词,在不影响检测性能的前提下显著降低资源消耗。
英文摘要:
Textual adversarial examples pose serious threats to the reliability of natural language processing systems. Recent studies suggest that adversarial examples tend to deviate from the underlying manifold of normal texts, whereas pre-trained masked language models can approximate the manifold of normal data. These findings inspire the exploration of masked language models for detecting textual adversarial attacks. We first introduce Masked Language Model-based Detection (MLMD), leveraging the mask and unmask operations of the masked language modeling (MLM) objective to induce the difference in manifold changes between normal and adversarial texts. Although MLMD achieves competitive detection performance, its exhaustive one-by-one masking strategy introduces significant computational overhead. Our posterior analysis reveals that a significant number of non-keywords in the input are not important for detection but consume resources. Building on this, we introduce Gradient-guided MLMD (GradMLMD), which leverages gradient information to identify and skip non-keywords during detection, significantly reducing resource consumption without compromising detection performance.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。