Lune

ICLR2023Top-tier venue

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

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

Abstract

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 (CV) 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 in 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. From the attack perspective, we show that TEXTGRAD achieves remarkable improvements in both the attack success rate and the perplexity score over five state-of-the-art baselines. From the defense perspective, TEXTGRAD-enabled adversarial training yields the most robust NLP model against a wide spectrum of NLP attacks.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

6 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Robustness in Both Domains: CLIP Needs a Robust Text Encoder cites TextBugger: Generating Adversarial Text Against Real-world Applications
  • Robustness in Both Domains: CLIP Needs a Robust Text Encoder cites Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks
  • Robustness in Both Domains: CLIP Needs a Robust Text Encoder cites Fast is better than free: Revisiting adversarial training
  • Robustness in Both Domains: CLIP Needs a Robust Text Encoder cites Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailment
  • TextBugger: Generating Adversarial Text Against Real-world Applications cites Towards Evaluating the Robustness of Neural Networks
  • MMA-Diffusion: MultiModal Attack on Diffusion Models cites Towards Evaluating the Robustness of Neural Networks
  • MMA-Diffusion: MultiModal Attack on Diffusion Models cites Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailment
  • Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks cites Towards Evaluating the Robustness of Neural Networks
  • Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks cites Fast is better than free: Revisiting adversarial training
  • Fast is better than free: Revisiting adversarial training cites Towards Evaluating the Robustness of Neural Networks
  • Defensive Unlearning with Adversarial Training for Robust Concept Erasure in Diffusion Models cites Towards Evaluating the Robustness of Neural Networks
  • Defensive Unlearning with Adversarial Training for Robust Concept Erasure in Diffusion Models cites Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks
  • Defensive Unlearning with Adversarial Training for Robust Concept Erasure in Diffusion Models cites Fast is better than free: Revisiting adversarial training
  • Defensive Unlearning with Adversarial Training for Robust Concept Erasure in Diffusion Models cites Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailment
  • Universally Unfiltered and Unseen: Input-Agnostic Multimodal Jailbreaks against Text-to-Image Model Safeguards cites MMA-Diffusion: MultiModal Attack on Diffusion Models
  • Universally Unfiltered and Unseen: Input-Agnostic Multimodal Jailbreaks against Text-to-Image Model Safeguards cites Defensive Unlearning with Adversarial Training for Robust Concept Erasure in Diffusion Models
  • Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailment cites TextBugger: Generating Adversarial Text Against Real-world Applications
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers6

  1. Defensive Unlearning with Adversarial Training for Robust Concept Erasure in Diffusion ModelsYimeng Zhang, Xin Chen, Jinghan Jia, Yihua Zhang et al.NeurIPS 2024 · 200 citations
  2. MMA-Diffusion: MultiModal Attack on Diffusion ModelsYijun Yang, Ruiyuan Gao, Xiaosen Wang, Tsung-Yi Ho et al.CVPR 2024 · 31 citations
  3. Robustness in Both Domains: CLIP Needs a Robust Text EncoderElías Abad-Rocamora, Christian Schlarmann, Naman Deep Singh, Yongtao Wu et al.NeurIPS 2025 · 4 citations
  4. Certified Robustness Under Bounded Levenshtein DistanceElías Abad-Rocamora, Grigorios Chrysos, Volkan CevherICLR 2025
  5. Universally Unfiltered and Unseen: Input-Agnostic Multimodal Jailbreaks against Text-to-Image Model SafeguardsSong Yan, Hui Wei, Jinlong Fei, Guoliang Yang et al.ACM MM 2025

Builds on15

  1. Towards Evaluating the Robustness of Neural NetworksNicholas Carlini, David A. WagnerS&P 2017 · 9,786 citations
  2. Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacksFrancesco Croce, Matthias HeinICML 2020 · 2,337 citations
  3. Fast is better than free: Revisiting adversarial trainingEric Wong, Leslie Rice, J. Zico KolterICLR 2020 · 1,352 citations
  4. Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and EntailmentDi Jin, Zhijing Jin, Joey Tianyi Zhou, Peter SzolovitsAAAI 2020 · 1,333 citations
  5. TextBugger: Generating Adversarial Text Against Real-world ApplicationsJinfeng Li, Shouling Ji, Tianyu Du, Bo Li et al.NDSS 2019 · 876 citations

Related papers

  1. Bridge the Gap Between CV and NLP! A Gradient-based Textual Adversarial Attack FrameworkLifan Yuan, Yichi Zhang, Yangyi Chen, Wei WeiACL Findings 2023 · 27 citations
  2. How do humans perceive adversarial text? A reality check on the validity and naturalness of word-based adversarial attacksSalijona Dyrmishi, Salah Ghamizi, Maxime CordyACL 2023 · 4 citations
  3. From Adversarial Arms Race to Model-centric Evaluation: Motivating a Unified Automatic Robustness Evaluation FrameworkYangyi Chen, Hongcheng Gao, Ganqu Cui, Lifan Yuan et al.ACL Findings 2023 · 5 citations
  4. Generative Adversarial Training with Perturbed Token Detection for Model RobustnessJiahao Zhao, Wenji MaoEMNLP 2023 · 3 citations
  5. Weight Perturbation as Defense against Adversarial Word SubstitutionsJianhan Xu, Linyang Li, Jiping Zhang, Xiaoqing Zheng et al.EMNLP Findings 2022 · 5 citations
Dusk over the sea between two cliffs drawn in fine vertical lines