Recent work has demonstrated that natural language processing techniques can support consumer protection by automatically detecting unfair clauses in the Terms of Service (ToS) Agreement. This work demonstrates that transformer-based ToS analysis systems are vulnerable to adversarial attacks. We conduct experiments attacking an unfair-clause detector with universal adversarial triggers. Experiments show that a minor perturbation of the text can considerably reduce the detection performance. Moreover, to measure the detectability of the triggers, we conduct a detailed human evaluation study by collecting both answer accuracy and response time from the participants. The results show that the naturalness of the triggers remains key to tricking readers.
translated by 谷歌翻译
现在,基于BERT的上下文排名模型已在各种段落和文档排名任务中已建立。但是,在对抗输入下基于BERT的排名模型的鲁棒性不足。在本文中,我们认为,伯特级居民对针对检索文件的对抗性攻击并不免疫。首先,我们提出了使用基于梯度的优化方法对高度相关和非相关文档的对抗扰动算法。我们的算法的目的是将少量令牌添加到高度相关或非相关的文档中,以引起大量降级或晋升。我们的实验表明,少数令牌已经可以导致文档等级发生很大变化。此外,我们发现伯特级速率在很大程度上依靠文档开始/头来进行相关性预测,从而使文档的初始部分更容易受到对抗攻击的影响。更有趣的是,我们发现一小部分反复出现的对抗性词,将这些单词添加到文档中后,这些单词分别导致任何相关/非相关/非相关文件的成功级别降级/促进。最后,我们的对抗令牌还显示了数据集内部和跨数据集内的特定主题偏好,从而暴露了BERT预训练或下游数据集中的潜在偏见。
translated by 谷歌翻译
神经文本排名模型已经见证了显着的进步,并越来越多地在实践中部署。不幸的是,它们还继承了一般神经模型的对抗性脆弱性,这些神经模型已被检测到,但仍未被先前的研究所忽视。此外,Blackhat SEO可能会利用继承的对抗性漏洞来击败受保护的搜索引擎。在这项研究中,我们提出了对黑盒神经通道排名模型的模仿对抗攻击。我们首先表明,可以通过列举关键查询/候选者,然后训练排名模仿模型来透明和模仿目标段落排名模型。利用排名模仿模型,我们可以精心操纵排名结果并将操纵攻击转移到目标排名模型。为此,我们提出了一种由成对目标函数授权的基于创新的基于梯度的攻击方法,以产生对抗性触发器,该触发器会导致有预谋的混乱,而具有很少的令牌。为了配备触发器的伪装,我们将下一个句子预测损失和语言模型流利度限制添加到目标函数中。对通过排名的实验结果证明了对各种SOTA神经排名模型的排名模仿攻击模型和对抗触发器的有效性。此外,各种缓解分析和人类评估表明,在面对潜在的缓解方法时,伪装的有效性。为了激励其他学者进一步研究这一新颖和重要的问题,我们将实验数据和代码公开可用。
translated by 谷歌翻译
尽管在许多机器学习任务方面取得了巨大成功,但深度神经网络仍然易于对抗对抗样本。虽然基于梯度的对抗攻击方法在计算机视野领域探索,但由于文本的离散性质,直接应用于自然语言处理中,这是不切实际的。为了弥合这一差距,我们提出了一般框架,以适应现有的基于梯度的方法来制作文本对抗性样本。在该框架中,将基于梯度的连续扰动添加到嵌入层中,并在前向传播过程中被放大。然后用掩模语言模型头解码最终的扰动潜在表示以获得潜在的对抗性样本。在本文中,我们将我们的框架与\ textbf {t} Extual \ TextBF {P} ROJECTED \ TextBF {G} Radient \ TextBF {D} excent(\ TextBF {TPGD})进行ronject \ textbf {p}。我们通过在三个基准数据集上执行转移黑匣子攻击来评估我们的框架来评估我们的框架。实验结果表明,与强基线方法相比,我们的方法达到了更好的性能,并产生更精细和语法的对抗性样本。所有代码和数据都将公开。
translated by 谷歌翻译
特洛伊木马攻击引起了严重的安全问题。在本文中,我们研究了Trojaned Bert模型的潜在机制。我们观察到木马模型的注意力焦点漂移行为,即,在遇到中毒输入时,触发令牌劫持了注意力的焦点,无论上下文如何。我们对这种现象提供了彻底的定性和定量分析,揭示了对特洛伊木马机制的见解。基于观察结果,我们提出了一个基于注意力的特洛伊木马检测器,以将木马模型与干净的模型区分开。据我们所知,这是第一篇分析特洛伊木马机制并根据变压器的注意力开发特洛伊木马检测器的论文。
translated by 谷歌翻译
在过去的几年中,保护NLP模型免受拼写错误的障碍是研究兴趣的对象。现有的补救措施通常会损害准确性,或者需要对每个新的攻击类别进行完整的模型重新训练。我们提出了一种新颖的方法,可以向基于变压器的NLP模型中的拼写错误增加弹性。可以实现这种鲁棒性,而无需重新训练原始的NLP模型,并且只有最小的语言丧失理解在没有拼写错误的输入上的性能。此外,我们提出了一种新的有效近似方法来产生对抗性拼写错误,这大大降低了评估模型对对抗性攻击的弹性所需的成本。
translated by 谷歌翻译
聊天机器人用于许多应用程序中,例如自动化代理,智能家庭助理,在线游戏中的互动角色等。因此,确保他们不会以不希望的方式行事,对用户提供令人反感或有毒的反应。这并不是一项琐碎的任务,因为最先进的聊天机器人模型是在从互联网公开收集的大型公共数据集上培训的。本文提出了对聊天机器人中毒性的首次大规模测量。我们表明,公开可用的聊天机器人很容易在喂养有毒的查询时提供有毒的反应。更令人担忧的是,一些无毒的查询也会触发有毒反应。然后,我们着手设计和实验攻击,即毒性,该攻击依赖于微调的GPT-2来产生无毒的查询,使聊天机器人以有毒的方式做出反应。我们广泛的实验评估表明,我们的攻击对公共聊天机器人模型有效,并且优于先前工作提出的手动制作的恶意查询。我们还评估了针对毒性的三种防御机制,表明它们要么以影响聊天机器人的效用而降低攻击性能,要么仅有效地减轻了一部分攻击。这强调了对计算机安全和在线安全社区进行更多研究的需求,以确保聊天机器人模型不会伤害其用户。总体而言,我们有信心有毒可以用作审计工具,我们的工作将为设计更有效的聊天机器人安全防御措施铺平道路。
translated by 谷歌翻译
Pre-trained programming language (PL) models (such as CodeT5, CodeBERT, GraphCodeBERT, etc.,) have the potential to automate software engineering tasks involving code understanding and code generation. However, these models operate in the natural channel of code, i.e., they are primarily concerned with the human understanding of the code. They are not robust to changes in the input and thus, are potentially susceptible to adversarial attacks in the natural channel. We propose, CodeAttack, a simple yet effective black-box attack model that uses code structure to generate effective, efficient, and imperceptible adversarial code samples and demonstrates the vulnerabilities of the state-of-the-art PL models to code-specific adversarial attacks. We evaluate the transferability of CodeAttack on several code-code (translation and repair) and code-NL (summarization) tasks across different programming languages. CodeAttack outperforms state-of-the-art adversarial NLP attack models to achieve the best overall drop in performance while being more efficient, imperceptible, consistent, and fluent. The code can be found at https://github.com/reddy-lab-code-research/CodeAttack.
translated by 谷歌翻译
现在,错误和虚假信息已成为我们安全和安全的全球威胁。为了应对在线错误信息的规模,一个可行的解决方案是通过检索和验证相关证据来自动对索赔进行事实检查。尽管在推动自动事实验证方面取得了最新进展,但仍缺乏对可能针对此类系统的攻击向量的全面评估。特别是,自动化事实验证过程可能容易受到其试图打击的确切虚假信息。在这项工作中,我们假设一个对手可以自动使用在线证据擦洗,以通过伪装相关证据或种植误导性的证据来破坏事实检查模型。我们首先提出了探索性分类法,该分类法涵盖了这两个目标和不同的威胁模型维度。在此指导下,我们设计并提出了几种潜在的攻击方法。我们表明,除了产生多样化和索赔一致的证据之外,还可以在证据中巧妙地修改索赔空位段。结果,我们在分类法的许多不同排列中高度降低了事实检查的表现。这些攻击也对索赔后的事后修改也很强大。我们的分析进一步暗示了在面对矛盾的证据时,模型推断的潜在局限性。我们强调,这些攻击可能会对此类模型的可检查和人类使用情况产生有害的影响,我们通过讨论未来防御的挑战和方向来得出结论。
translated by 谷歌翻译
Recently it has been shown that state-of-the-art NLP models are vulnerable to adversarial attacks, where the predictions of a model can be drastically altered by slight modifications to the input (such as synonym substitutions). While several defense techniques have been proposed, and adapted, to the discrete nature of text adversarial attacks, the benefits of general-purpose regularization methods such as label smoothing for language models, have not been studied. In this paper, we study the adversarial robustness provided by various label smoothing strategies in foundational models for diverse NLP tasks in both in-domain and out-of-domain settings. Our experiments show that label smoothing significantly improves adversarial robustness in pre-trained models like BERT, against various popular attacks. We also analyze the relationship between prediction confidence and robustness, showing that label smoothing reduces over-confident errors on adversarial examples.
translated by 谷歌翻译
While a substantial body of prior work has explored adversarial example generation for natural language understanding tasks, these examples are often unrealistic and diverge from the real-world data distributions. In this work, we introduce a two-stage adversarial example generation framework (NaturalAdversaries), for designing adversaries that are effective at fooling a given classifier and demonstrate natural-looking failure cases that could plausibly occur during in-the-wild deployment of the models. At the first stage a token attribution method is used to summarize a given classifier's behaviour as a function of the key tokens in the input. In the second stage a generative model is conditioned on the key tokens from the first stage. NaturalAdversaries is adaptable to both black-box and white-box adversarial attacks based on the level of access to the model parameters. Our results indicate these adversaries generalize across domains, and offer insights for future research on improving robustness of neural text classification models.
translated by 谷歌翻译
几年的研究表明,在理论和实践中,机器学习系统容易受到对抗的例子。到目前为止,这种攻击主要有针对性的视觉模型,利用人类和机器感知之间的差距。虽然基于文本的模型也被对抗例子遭到攻击,但这种攻击努力保持语义意义和无法区分。在本文中,我们探讨了大类的对抗示例,可用于在黑盒设置中攻击基于文本的模型,而不会对输入进行任何人类可知的视觉修改。我们使用对人眼不可察觉的编码特异性扰动来操纵从神经计算机翻译管道到网络搜索引擎的各种自然语言处理(NLP)系统的输出。我们发现,通过单一的难以察觉的编码注射 - 代表一个无形的字符,同型角色,重新排序或删除 - 攻击者可以显着降低易受伤害的模型的性能,并且三次注射大多数型号可以在功能上打破。除了由Facebook,IBM和HuggingFace发布的开源模型之外,我们攻击目前部署的商业系统这一新颖的一系列攻击对许多语言处理系统提供了重大威胁:攻击者可以以目标方式影响系统而没有任何关于底层模型的假设。我们得出结论,基于文本的NLP系统需要仔细的输入消毒,就像传统应用程序一样,并且考虑到这样的系统现在正在迅速地部署,需要建筑师和运营商的紧急注意。
translated by 谷歌翻译
最近的自然语言处理(NLP)技术在基准数据集中实现了高性能,主要原因是由于深度学习性能的显着改善。研究界的进步导致了最先进的NLP任务的生产系统的巨大增强,例如虚拟助理,语音识别和情感分析。然而,随着对抗性攻击测试时,这种NLP系统仍然仍然失败。初始缺乏稳健性暴露于当前模型的语言理解能力中的令人不安的差距,当NLP系统部署在现实生活中时,会产生问题。在本文中,我们通过以各种维度的系统方式概述文献来展示了NLP稳健性研究的结构化概述。然后,我们深入了解稳健性的各种维度,跨技术,指标,嵌入和基准。最后,我们认为,鲁棒性应该是多维的,提供对当前研究的见解,确定文学中的差距,以建议值得追求这些差距的方向。
translated by 谷歌翻译
深度神经网络在解决各种现实世界任务中具有广泛的应用,并在计算机视觉,图像分类和自然语言处理等域中实现了令人满意的结果。同时,神经网络的安全性和稳健性成为必要的,因为不同的研究表明了神经网络的脆弱方面。在点的情况下,在自然语言处理任务中,神经网络可以由秘密修改的文本欺骗,这与原始文本具有高相似性。根据以前的研究,大多数研究都集中在图像领域;与图像逆势攻击不同,文本以离散序列表示,传统的图像攻击方法不适用于NLP字段。在本文中,我们提出了一个单词级NLP情绪分类器攻击模型,包括一种基于自我关注机制的词选择方法和用于Word替换的贪婪搜索算法。我们通过在IMDB数据集中攻击GRU和1D-CNN受害者模型进行攻击模型进行实验。实验结果表明,我们的模型达到了更高的攻击成功率,并且比以前的方法更有效,因为由于有效的单词选择算法,并且最小化了单词替代数。此外,我们的模型可转换,可用于具有多种修改的图像域。
translated by 谷歌翻译
Machine learning algorithms are often vulnerable to adversarial examples that have imperceptible alterations from the original counterparts but can fool the state-of-the-art models. It is helpful to evaluate or even improve the robustness of these models by exposing the maliciously crafted adversarial examples. In this paper, we present TEXTFOOLER, a simple but strong baseline to generate adversarial text. By applying it to two fundamental natural language tasks, text classification and textual entailment, we successfully attacked three target models, including the powerful pre-trained BERT, and the widely used convolutional and recurrent neural networks. We demonstrate three advantages of this framework:(1) effective-it outperforms previous attacks by success rate and perturbation rate, (2) utility-preserving-it preserves semantic content, grammaticality, and correct types classified by humans, and (3) efficient-it generates adversarial text with computational complexity linear to the text length. 1
translated by 谷歌翻译
关于NLP模型的最先进攻击缺乏对成功攻击的共享定义。我们将思考从过去的工作蒸馏成统一的框架:一个成功的自然语言对抗性示例是欺骗模型并遵循一些语言限制的扰动。然后,我们分析了两个最先进的同义词替换攻击的产出。我们发现他们的扰动通常不会保留语义,38%引入语法错误。人类调查显示,为了成功保留语义,我们需要大大增加交换词语的嵌入和原始和扰动句子的句子编码之间的最小余弦相似之处。与更好的保留语义和语法性,攻击成功率下降超过70个百分点。
translated by 谷歌翻译
Robustness evaluation against adversarial examples has become increasingly important to unveil the trustworthiness of the prevailing deep models in natural language processing (NLP). However, in contrast to the computer vision domain where the first-order projected gradient descent (PGD) is used as the benchmark approach to generate adversarial examples for robustness evaluation, there lacks a principled first-order gradient-based robustness evaluation framework in NLP. The emerging optimization challenges lie in 1) the discrete nature of textual inputs together with the strong coupling between the perturbation location and the actual content, and 2) the additional constraint that the perturbed text should be fluent and achieve a low perplexity under a language model. These challenges make the development of PGD-like NLP attacks difficult. To bridge the gap, we propose TextGrad, a new attack generator using gradient-driven optimization, supporting high-accuracy and high-quality assessment of adversarial robustness in NLP. Specifically, we address the aforementioned challenges in a unified optimization framework. And we develop an effective convex relaxation method to co-optimize the continuously-relaxed site selection and perturbation variables and leverage an effective sampling method to establish an accurate mapping from the continuous optimization variables to the discrete textual perturbations. Moreover, as a first-order attack generation method, TextGrad can be baked into adversarial training to further improve the robustness of NLP models. Extensive experiments are provided to demonstrate the effectiveness of TextGrad not only in attack generation for robustness evaluation but also in adversarial defense.
translated by 谷歌翻译
随着预训练的语言模型(PLM)的继续增长,精细调整PLM的硬件和数据要求也会增长。因此,研究人员提出了一种称为\ textit {提示学习}的较轻方法。但是,在调查过程中,我们观察到及时的学习方法是脆弱的,很容易被一些非法构造的提示攻击,从而导致分类错误和PLM的严重安全问题。当前的大多数研究都忽略了基于及时方法的安全问题。因此,在本文中,我们提出了一种恶意提示模板构建方法(\ textbf {stressAttack})来探测PLM的安全性能。研究了几种不友好的模板构建方法,以指导模型错误分类任务。在三个数据集和三个PLM上进行了广泛的实验证明了我们提出的方法提示的有效性。我们还进行实验,以验证我们的方法是否适用于几种镜头。
translated by 谷歌翻译
文本后门攻击是对NLP系统的实际威胁。通过在训练阶段注入后门,对手可以通过预定义的触发器控制模型预测。由于已经提出了各种攻击和防御模型,因此进行严格的评估至关重要。但是,我们在以前的后门学习评估中重点介绍了两个问题:(1)忽略了现实世界情景(例如释放中毒的数据集或模型)之间的差异,我们认为每种情况都有其自身的限制和关注点,因此需要特定的评估。协议; (2)评估指标仅考虑攻击是否可以翻转模型对中毒样品的预测并保留对良性样品的表演,但是忽略了中毒样品也应该是隐秘和语义上的。为了解决这些问题,我们将现有作品分为三种实际情况,在这种情况下,攻击者分别释放数据集,预培训模型和微调模型,然后讨论其独特的评估方法。关于指标,为了完全评估中毒样本,我们使用语法误差增加和隐形性差异以及有效性的文本相似性。对框架进行正式化后,我们开发了一个开源工具包openbackdoor,以促进文本后门学习的实现和评估。使用此工具包,我们在建议的范式下进行基准攻击和防御模型进行广泛的实验。为了促进针对中毒数据集的不充分的防御能力,我们进一步提出了Cube,这是一个简单而强大的基于聚类的防御基线。我们希望我们的框架和基准可以作为未来模型开发和评估的基石。
translated by 谷歌翻译
Laws and their interpretations, legal arguments and agreements\ are typically expressed in writing, leading to the production of vast corpora of legal text. Their analysis, which is at the center of legal practice, becomes increasingly elaborate as these collections grow in size. Natural language understanding (NLU) technologies can be a valuable tool to support legal practitioners in these endeavors. Their usefulness, however, largely depends on whether current state-of-the-art models can generalize across various tasks in the legal domain. To answer this currently open question, we introduce the Legal General Language Understanding Evaluation (LexGLUE) benchmark, a collection of datasets for evaluating model performance across a diverse set of legal NLU tasks in a standardized way. We also provide an evaluation and analysis of several generic and legal-oriented models demonstrating that the latter consistently offer performance improvements across multiple tasks.
translated by 谷歌翻译