arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2211.02878cs.CLcs.CRcs.LG
收藏

基于文本流形的自然语言对抗性实例防御

Textual Manifold-based Defense Against Natural Language Adversarial Examples

VinAI Research(VinAI研究院);Nanyang Technological University(南洋理工大学)

Dang Minh Nguyen, Luu Anh Tuan

摘要:

最近对对抗图像的研究表明,它们往往会留下底层的低维数据流形,这使得当前模型做出正确预测的挑战性大大增加。这种所谓的非流形猜想激发了一种新的防御图像对抗攻击的方法。在这项研究中,我们发现了一个类似的现象发生在由预训练的语言模型诱导的语境化嵌入空间中,其中敌对文本倾向于使其嵌入偏离自然文本的流形。基于这一发现,我们提出了基于文本流形的防御(TMD),一种防御机制,在分类之前将文本嵌入投影到近似的嵌入流形上。它降低了潜在对抗性示例的复杂性,最终增强了受保护模型的鲁棒性。通过大量的实验,我们的方法在各种攻击设置下始终显着优于以前的防御,而不会牺牲干净的准确性。据我们所知,这是第一个利用流形结构对抗对抗攻击的NLP防御。我们的代码可在\url{https://github.com/dangne/tmd}上获得。

英文摘要:

Recent studies on adversarial images have shown that they tend to leave the underlying low-dimensional data manifold, making them significantly more challenging for current models to make correct predictions. This so-called off-manifold conjecture has inspired a novel line of defenses against adversarial attacks on images. In this study, we find a similar phenomenon occurs in the contextualized embedding space induced by pretrained language models, in which adversarial texts tend to have their embeddings diverge from the manifold of natural ones. Based on this finding, we propose Textual Manifold-based Defense (TMD), a defense mechanism that projects text embeddings onto an approximated embedding manifold before classification. It reduces the complexity of potential adversarial examples, which ultimately enhances the robustness of the protected model. Through extensive experiments, our method consistently and significantly outperforms previous defenses under various attack settings without trading off clean accuracy. To the best of our knowledge, this is the first NLP defense that leverages the manifold structure against adversarial attacks. Our code is available at \url{https://github.com/dangne/tmd}.

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

↑