Textual Manifold-based Defense Against Natural Language Adversarial Examples
Dang Minh Nguyen, Anh Tuan Luu
Abstract
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 https://github.com/dangne/tmd .
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.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Breaking the Adversarial Robustness-Performance Trade-off in Text Classification via Manifold Purification cites TextBugger: Generating Adversarial Text Against Real-world Applications
- Breaking the Adversarial Robustness-Performance Trade-off in Text Classification via Manifold Purification cites Extreme Miscalibration and the Illusion of Adversarial Robustness
- Breaking the Adversarial Robustness-Performance Trade-off in Text Classification via Manifold Purification cites BERT-ATTACK: Adversarial Attack Against BERT Using BERT
- Breaking the Adversarial Robustness-Performance Trade-off in Text Classification via Manifold Purification cites Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailment
- Extreme Miscalibration and the Illusion of Adversarial Robustness cites TextBugger: Generating Adversarial Text Against Real-world Applications
- Extreme Miscalibration and the Illusion of Adversarial Robustness cites BERT-ATTACK: Adversarial Attack Against BERT Using BERT
- BERT-ATTACK: Adversarial Attack Against BERT Using BERT cites TextBugger: Generating Adversarial Text Against Real-world Applications
- DiffuseDef: Improved Robustness to Adversarial Attacks via Iterative Denoising cites TextBugger: Generating Adversarial Text Against Real-world Applications
- DiffuseDef: Improved Robustness to Adversarial Attacks via Iterative Denoising cites BERT-ATTACK: Adversarial Attack Against BERT Using BERT
- DiffuseDef: Improved Robustness to Adversarial Attacks via Iterative Denoising cites Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailment
- Paladin: Defending LLM-enabled Phishing Emails with a New Trigger-Tag Paradigm cites Prompt as Triggers for Backdoor Attack: Examining the Vulnerability in Language 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
Cited by top-tier papers6
- Prompt as Triggers for Backdoor Attack: Examining the Vulnerability in Language ModelsShuai Zhao, Jinming Wen, Anh Tuan Luu, Junbo Zhao et al.EMNLP 2023 · 39 citations
- Paladin: Defending LLM-enabled Phishing Emails with a New Trigger-Tag ParadigmYan Pang, Wenlong Meng, Xiaojing Liao, Tianhao WangNDSS 2026 · 5 citations
- Breaking the Adversarial Robustness-Performance Trade-off in Text Classification via Manifold PurificationChenhao Dang, Jing MaAAAI 2026
- Extreme Miscalibration and the Illusion of Adversarial RobustnessVyas Raina, Samson Tan, Volkan Cevher, Aditya Rawal et al.ACL 2024
- DiffuseDef: Improved Robustness to Adversarial Attacks via Iterative DenoisingZhenhao Li, Huichi Zhou, Marek Rei, Lucia SpeciaACL 2025
Builds on15
- 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
- MagNet: A Two-Pronged Defense against Adversarial ExamplesDongyu Meng, Hao ChenCCS 2017 · 1,295 citations
- Image2StyleGAN: How to Embed Images Into the StyleGAN Latent Space?Rameen Abdal, Yipeng Qin, Peter WonkaICCV 2019 · 1,195 citations
- TextBugger: Generating Adversarial Text Against Real-world ApplicationsJinfeng Li, Shouling Ji, Tianyu Du, Bo Li et al.NDSS 2019 · 876 citations
- BERT-ATTACK: Adversarial Attack Against BERT Using BERTLinyang Li, Ruotian Ma, Qipeng Guo, Xiangyang Xue et al.EMNLP 2020 · 529 citations
Related papers
- Joint Character-Level Word Embedding and Adversarial Stability Training to Defend Adversarial TextHui Liu, Yongzheng Zhang, Yipeng Wang, Zheng Lin et al.AAAI 2020 · 43 citations
- Disentangled Information Bottleneck for Adversarial Text DefenseYidan Xu, Xinghao Yang, Wei Liu, Bao-di Liu et al.EMNLP 2025
- Adversarial Training with Fast Gradient Projection Method against Synonym Substitution Based Text AttacksXiaosen Wang, Yichen Yang, Yihe Deng, Kun HeAAAI 2021 · 98 citations
- Searching for an Effective Defender: Benchmarking Defense against Adversarial Word SubstitutionZongyi Li, Jianhan Xu, Jiehang Zeng, Linyang Li et al.EMNLP 2021 · 46 citations
- Weight Perturbation as Defense against Adversarial Word SubstitutionsJianhan Xu, Linyang Li, Jiping Zhang, Xiaoqing Zheng et al.EMNLP Findings 2022 · 5 citations
