arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2302.05892cs.CLcs.AIcs.CR
收藏

TextDefense:基于词重要性熵的敌对文本检测

TextDefense: Adversarial Text Detection based on Word Importance Entropy

Zhejiang University(浙江大学);Shandong University(山东大学);National University of Defense Technology(国防科技大学)

Lujia Shen, Xuhong Zhang, Shouling Ji, Yuwen Pu, Chunpeng Ge, Xing Yang, Yanghe Feng

摘要:

当前,自然语言处理(NLP)模型被广泛用于各种场景。然而,NLP模型,像所有的深度模型一样,很容易受到逆向生成文本的影响。许多工作一直致力于减轻来自对抗攻击的脆弱性。然而,有没有全面的防御,在现有的作品中,每个工作针对一个特定的攻击类别或遭受的计算开销的限制,不可抗拒的自适应攻击等。在本文中,我们详尽地调查了自然语言处理中的对抗攻击算法,我们的实证研究发现,攻击算法主要是破坏文本中的单词的重要性分布。一个经过良好训练的模型可以区分干净文本和对抗性文本之间细微的重要性分布差异。基于这种直觉,我们提出了TextDefense,这是一种新的对抗性示例检测框架,它利用目标模型的能力来防御对抗攻击,同时不需要先验知识。TextDefense与以前的方法不同,它利用目标模型进行检测,因此与攻击类型无关。我们广泛的实验表明,TextDefense可以应用于不同的架构,数据集和攻击方法,并优于现有的方法。我们还发现,影响TextDefense性能的主要因素是目标模型的泛化能力。通过分析目标模型的性质和对抗样本的性质,对自然语言处理中的对抗攻击进行了深入的分析,并提出了相应的防御方法。

英文摘要:

Currently, natural language processing (NLP) models are wildly used in various scenarios. However, NLP models, like all deep models, are vulnerable to adversarially generated text. Numerous works have been working on mitigating the vulnerability from adversarial attacks. Nevertheless, there is no comprehensive defense in existing works where each work targets a specific attack category or suffers from the limitation of computation overhead, irresistible to adaptive attack, etc. In this paper, we exhaustively investigate the adversarial attack algorithms in NLP, and our empirical studies have discovered that the attack algorithms mainly disrupt the importance distribution of words in a text. A well-trained model can distinguish subtle importance distribution differences between clean and adversarial texts. Based on this intuition, we propose TextDefense, a new adversarial example detection framework that utilizes the target model's capability to defend against adversarial attacks while requiring no prior knowledge. TextDefense differs from previous approaches, where it utilizes the target model for detection and thus is attack type agnostic. Our extensive experiments show that TextDefense can be applied to different architectures, datasets, and attack methods and outperforms existing methods. We also discover that the leading factor influencing the performance of TextDefense is the target model's generalizability. By analyzing the property of the target model and the property of the adversarial example, we provide our insights into the adversarial attacks in NLP and the principles of our defense method.

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

↑