paper-with-me

Papers

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

2022-12-19 · Bairu Hou, Jinghan Jia, Yihua Zhang, Guanhua Zhang, Yang Zhang, Sijia Liu, Shiyu Chang

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.

📄 PDF Abstract BibTeX arXiv:2212.09254

Code (1)

ucsb-nlp-chang/textgrad 공식 구현 pytorch

Tasks

Adversarial DefenseAdversarial RobustnessLanguage Modelling

Similar Papers 제목 키워드 기반

TextualVerifier: Verify TextGrad Step-by-Step

2025-10-29 · Eugenius Mario Situmorang, Adila Alfa Krisnadhi, Ari Wibisono arxiv

TextGrad is a novel approach to text-based automatic differentiation that enables composite AI systems to perform optimization without explicit numerical equations. However, it currently lacks self-verification mechanism…

Decision Making

Can Textual Gradient Work in Federated Learning?

2025-02-27 · Minghui Chen, Ruinan Jin, Wenlong Deng, YuanYuan Chen 외

Recent studies highlight the promise of LLM-based prompt optimization, especially with TextGrad, which automates differentiation'' via texts and backpropagates textual feedback. This approach facilitates training in vari…

Federated Learning

Reflection-Enhanced Meta-Optimization Integrating TextGrad-style Prompt Optimization with Memory-Driven Self-Evolution

2025-08-26 · Chunlong Wu, Zhibo Qu arxiv

Recent advances in prompt optimization, exemplified by methods such as TextGrad, enable automatic, gradient-like refinement of textual prompts to enhance the performance of large language models (LLMs) on specific downst…

Mathematical Reasoning

TextGrad: Automatic "Differentiation" via Text

2024-06-11 · Mert Yuksekgonul, Federico Bianchi, Joseph Boen, Sheng Liu 외

AI is undergoing a paradigm shift, with breakthroughs achieved by systems orchestrating multiple large language models (LLMs) and other complex components. As a result, developing principled and automated optimization me…

Question AnsweringSpecificity

TextResNet: Decoupling and Routing Optimization Signals in Compound AI Systems via Deep Residual Tuning

2026-02-09 · Suizhi Huang, Mei Li, Han Yu, Xiaoxiao Li arxiv

Textual Gradient-style optimizers (TextGrad) enable gradient-like feedback propagation through compound AI systems. However, they do not work well for deep chains. The root cause of this limitation stems from the Semanti…