arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2212.09254cs.CL
收藏

TextGrad:通过约束驱动优化在NLP中推进鲁棒性评估

TextGrad: Advancing Robustness Evaluation in NLP by Gradient-Driven Optimization

UC Santa Barbara(加州大学圣巴巴拉分校);Michigan State University(密歇根州立大学);MIT-IBM Watson AI Lab(麻省理工学院-IBM沃森人工智能实验室)

Bairu Hou, Jinghan Jia, Yihua Zhang, Guanhua Zhang, Yang Zhang, Sijia Liu, Shiyu Chang

摘要:

对抗性示例的鲁棒性评估对于揭示自然语言处理(NLP)中流行的深度模型的可信度变得越来越重要。然而,在计算机视觉领域中,一阶投影梯度下降(PGD)被用作基准方法来生成对抗性示例以进行鲁棒性评估,与此相反,在NLP中缺乏原则性的基于一阶梯度的鲁棒性评估框架。新出现的优化挑战在于1)文本输入的离散性质以及扰动位置与实际内容之间的强耦合,以及2)扰动文本应该流畅并且在语言模型下实现低困惑度的附加约束。这些挑战使得开发类似于PGD的NLP攻击变得困难。为了弥补这一差距,我们提出了TextGrad,这是一种使用梯度驱动优化的新攻击生成器,支持NLP中对抗鲁棒性的高精度和高质量评估。具体来说,我们在一个统一的优化框架中解决了上述挑战。我们开发了一种有效的凸松弛方法来共同优化连续松弛的选址和扰动变量,并利用一种有效的采样方法来建立从连续优化变量到离散文本扰动的精确映射。此外,作为一阶攻击生成方法,TextGrad可以被烘焙到对抗训练中,以进一步提高NLP模型的鲁棒性。大量的实验证明了TextGrad的有效性,不仅在攻击生成的鲁棒性评估,而且在对抗性防御。

英文摘要:

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.

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

↑