[论文解读] Detecting Textual Adversarial Examples through Randomized Substitution and Vote
该论文提出了一种名为随机替换与投票(RS&V)的新方法,这是一种与模型架构无关的文本对抗样本检测技术,专门针对通过同义词替换攻击生成的对抗样本。通过在多个扰动版本中随机替换词语为同义词,并对预测结果进行投票,RS&V在不重新训练模型的前提下,实现了比当前最先进方法更高的检测准确率,同时在干净样本上保持了高鲁棒性,充分利用了模型的泛化能力。
A line of work has shown that natural text processing models are vulnerable to adversarial examples. Correspondingly, various defense methods are proposed to mitigate the threat of textual adversarial examples, eg, adversarial training, input transformations, detection, etc. In this work, we treat the optimization process for synonym substitution based textual adversarial attacks as a specific sequence of word replacement, in which each word mutually influences other words. We identify that we could destroy such mutual interaction and eliminate the adversarial perturbation by randomly substituting a word with its synonyms. Based on this observation, we propose a novel textual adversarial example detection method, termed Randomized Substitution and Vote (RS&V), which votes the prediction label by accumulating the logits of k samples generated by randomly substituting the words in the input text with synonyms. The proposed RS&V is generally applicable to any existing neural networks without modification on the architecture or extra training, and it is orthogonal to prior work on making the classification network itself more robust. Empirical evaluations on three benchmark datasets demonstrate that our RS&V could detect the textual adversarial examples more successfully than the existing detection methods while maintaining the high classification accuracy on benign samples.
研究动机与目标
- 解决NLP系统中日益增长的基于同义词替换的文本对抗攻击威胁。
- 开发一种无需架构修改或微调即可广泛适用于现有神经网络的检测方法。
- 在保持良性输入上高分类性能的同时,提升检测准确率。
- 通过随机化破坏词级交互关系,利用对抗扰动的脆弱性。
提出的方法
- 使用可配置的替换率 $ p $,在输入文本中随机替换一部分词语为同义词。
- 通过独立的随机同义词替换,生成 $ k $ 个输入文本的扰动变体。
- 聚合所有 $ k $ 个扰动样本的模型logits,形成投票信号。
- 如果原始输入的预测标签与 $ k $ 个扰动样本的多数投票结果不同,则将其分类为对抗样本。
- 排除停用词进行替换,以保持语法连贯性,停用词选择比例可配置为 $ s $。
- 利用投票机制降低随机替换带来的方差,稳定检测性能。
实验结果
研究问题
- RQ1随机同义词替换能否有效破坏基于同义词的对抗攻击中的词间相互作用?
- RQ2扰动样本数量 $ k $ 如何影响检测性能与方差降低效果?
- RQ3何种最优替换率 $ p $ 能在检测准确率与干净样本鲁棒性之间取得平衡?
- RQ4排除停用词进行替换对检测效果与模型泛化能力有何影响?
- RQ5即使攻击者知晓检测模块,RS&V是否仍能超越现有检测方法?
主要发现
- 在AG’s News、IMDB和Rotten Tomatoes三个基准数据集上,RS&V的检测准确率高于当前最先进基线方法。
- 当 $ p = 60\text{\%} $,$ k = 25 $,且 $ s = 2\text{\%} $ 时,RS&V在所有数据集上对良性样本的分类准确率均保持在95%以上。
- 检测准确率随替换率提升至 $ p = 60\text{\%} $ 显著提高,之后性能趋于稳定。
- 当 $ k \geq 10 $ 时,检测性能稳定且表现优异,$ k = 25 $ 提供了最佳平衡。
- 当停用词选择比例 $ s $ 超过2%时,性能下降,表明排除过多词语会限制对抗扰动的消除能力。
- 即使在攻击者知晓检测机制的黑盒攻击设置下,RS&V仍保持有效性,展现出强大的鲁棒性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。