arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2205.01287cs.CL
收藏

SemAttack:基于不同语义空间的自然文本攻击

SemAttack: Natural Textual Attacks via Different Semantic Spaces

University of Illinois at Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校);Alibaba Group(阿里巴巴集团);Microsoft Research(微软研究院)

Boxin Wang, Chejian Xu, Xiangyu Liu, Yu Cheng, Bo Li

摘要:

最近的研究表明,预先训练的语言模型(LM)容易受到文本对抗攻击。然而,现有的攻击方法要么遭受低攻击成功率或未能有效地搜索在指数大扰动空间。我们提出了一个高效和有效的框架SemAttack通过构建不同的语义扰动函数来生成自然的对抗文本。特别地,SemAttack优化了约束在通用语义空间上的所生成的扰动,所述通用语义空间包括错别字空间、知识空间(例如,WordNet)、上下文化语义空间(例如,BERT聚类的嵌入空间)或这些空间的组合。因此,生成的对抗性文本在语义上更接近原始输入。大量的实验表明,最先进的(SOTA)大规模LM(例如,DeBERTa-v2)和防御策略(例如,FreeLB)仍然容易受到SemAttack的攻击。我们进一步证明了SemAttack是通用的,并且能够为不同的语言生成自然的对抗文本(例如,英语和汉语),攻击成功率高。人类的评估也证实了我们生成的对抗性文本是自然的,几乎不会影响人类的表现。我们的代码可在https://github.com/AI-secure/SemAttack上公开获取。

英文摘要:

Recent studies show that pre-trained language models (LMs) are vulnerable to textual adversarial attacks. However, existing attack methods either suffer from low attack success rates or fail to search efficiently in the exponentially large perturbation space. We propose an efficient and effective framework SemAttack to generate natural adversarial text by constructing different semantic perturbation functions. In particular, SemAttack optimizes the generated perturbations constrained on generic semantic spaces, including typo space, knowledge space (e.g., WordNet), contextualized semantic space (e.g., the embedding space of BERT clusterings), or the combination of these spaces. Thus, the generated adversarial texts are more semantically close to the original inputs. Extensive experiments reveal that state-of-the-art (SOTA) large-scale LMs (e.g., DeBERTa-v2) and defense strategies (e.g., FreeLB) are still vulnerable to SemAttack. We further demonstrate that SemAttack is general and able to generate natural adversarial texts for different languages (e.g., English and Chinese) with high attack success rates. Human evaluations also confirm that our generated adversarial texts are natural and barely affect human performance. Our code is publicly available at https://github.com/AI-secure/SemAttack.

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

↑