arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2302.02023cs.CLcs.AI
收藏

TextShield:在文本分类中成功检测敌对句子之外

TextShield: Beyond Successfully Detecting Adversarial Sentences in Text Classification

Johns Hopkins University(约翰斯·霍普金斯大学);Tsinghua University(清华大学);Tencent AI Lab(腾讯人工智能实验室);China Agricultural University(中国农业大学)

Lingfeng Shen, Ze Zhang, Haiyun Jiang, Ying Chen

摘要:

对抗攻击是NLP中神经网络模型面临的主要挑战,这阻碍了模型在安全关键应用中的部署。最近的一项工作,基于检测的防御,旨在区分敌对的句子和良性的句子。然而,{以前的检测方法的核心限制是无法对对抗性句子给出正确的预测,这与其他范式的防御方法不同。针对这一问题,本文提出了文本屏蔽:(1)发现文本攻击与显著性信息之间的联系,提出了一种基于显著性的检测器,可以有效地检测输入句子是否具有对抗性。(2)我们设计了一个基于显著性的校正器,它将检测到的敌对句子转换为良性的。通过结合基于显著性的检测器和校正器,TextShield将仅检测范式扩展为检测-校正范式,从而填补了现有基于检测的防御的空白。综合实验表明,(a)在不同基准的各种攻击中,TextShield始终比最先进的防御方法具有更高或相当的性能。(b)我们的基于显著性的检测器在检测对抗性句子方面优于现有的检测器。

英文摘要:

Adversarial attack serves as a major challenge for neural network models in NLP, which precludes the model's deployment in safety-critical applications. A recent line of work, detection-based defense, aims to distinguish adversarial sentences from benign ones. However, {the core limitation of previous detection methods is being incapable of giving correct predictions on adversarial sentences unlike defense methods from other paradigms.} To solve this issue, this paper proposes TextShield: (1) we discover a link between text attack and saliency information, and then we propose a saliency-based detector, which can effectively detect whether an input sentence is adversarial or not. (2) We design a saliency-based corrector, which converts the detected adversary sentences to benign ones. By combining the saliency-based detector and corrector, TextShield extends the detection-only paradigm to a detection-correction paradigm, thus filling the gap in the existing detection-based defense. Comprehensive experiments show that (a) TextShield consistently achieves higher or comparable performance than state-of-the-art defense methods across various attacks on different benchmarks. (b) our saliency-based detector outperforms existing detectors for detecting adversarial sentences.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑