arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.04346cs.LGcs.AIcs.CLstat.ML
收藏

重新审视语言模型的字符级对抗攻击

Revisiting Character-level Adversarial Attacks for Language Models

École Polytechnique Fédérale de Lausanne(洛桑联邦理工学院);University of Warwick(华威大学);University of Wisconsin-Madison(威斯康星大学麦迪逊分校)

Elias Abad Rocamora, Yongtao Wu, Fanghui Liu, Grigorios G. Chrysos, Volkan Cevher

AI总结:

本文提出Charmer,一种高效的基于查询的字符级对抗攻击方法,在保持语义相似性的同时提升攻击成功率,并成功攻击BERT和Llama 2模型。

摘要:

自然语言处理中的对抗攻击在字符或词元级别施加扰动。词元级攻击因使用基于梯度的方法而日益突出,但容易改变句子语义,导致无效的对抗样本。字符级攻击虽然易于保持语义,但由于难以采用流行的基于梯度的方法,且被认为易于防御,因此受到的关注较少。挑战这些观点,我们提出了Charmer,一种高效的基于查询的对抗攻击方法,能够在生成高度相似的对抗样本的同时实现高攻击成功率(ASR)。我们的方法成功攻击了小规模(BERT)和大规模(Llama 2)模型。具体而言,在SST-2数据集上的BERT模型中,与先前技术相比,Charmer将ASR提高了4.84个百分点,并将USE相似度提高了8个百分点。我们的实现可在https://github.com/LIONS-EPFL/Charmer获取。

英文摘要:

Adversarial attacks in Natural Language Processing apply perturbations in the character or token levels. Token-level attacks, gaining prominence for their use of gradient-based methods, are susceptible to altering sentence semantics, leading to invalid adversarial examples. While character-level attacks easily maintain semantics, they have received less attention as they cannot easily adopt popular gradient-based methods, and are thought to be easy to defend. Challenging these beliefs, we introduce Charmer, an efficient query-based adversarial attack capable of achieving high attack success rate (ASR) while generating highly similar adversarial examples. Our method successfully targets both small (BERT) and large (Llama 2) models. Specifically, on BERT with SST-2, Charmer improves the ASR in 4.84% points and the USE similarity in 8% points with respect to the previous art. Our implementation is available in https://github.com/LIONS-EPFL/Charmer.

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

↑