mlsanityData to 7 Oct 2026

Improving the Robustness of Transformer-based Large Language Models with Dynamic Attention

arXiv 2311.17400 ↗First posted 29 Nov 2023cs.CL cs.CR cs.LGcited by 10

Not on the map. Why?

Abstract (arXiv)

Transformer-based models, such as BERT and GPT, have been widely adopted in natural language processing (NLP) due to their exceptional performance. However, recent studies show their vulnerability to textual adversarial attacks where the model's output can be misled by intentionally manipulating the text inputs. Despite various methods that have been proposed to enhance the model's robustness and mitigate this vulnerability, many require heavy consumption resources (e.g., adversarial training) or only provide limited protection (e.g., defensive dropout). In this paper, we propose a novel method called dynamic attention, tailored for the transformer architecture, to enhance the inherent robustness of the model itself against various adversarial attacks. Our method requires no downstream task knowledge and does not incur additional costs. The proposed dynamic attention consists of two modules: (I) attention rectification, which masks or weakens the attention value of the chosen tokens, and (ii) dynamic modeling, which dynamically builds the set of candidate tokens. Extensive experiments demonstrate that dynamic attention significantly mitigates the impact of adversarial attacks, improving up to 33% better performance than previous methods against widely-used adversarial attacks. The model-level design of dynamic attention enables it to be easily combined with other defense methods (e.g., adversarial training) to further enhance the model's robustness. Furthermore, we demonstrate that dynamic attention preserves the state-of-the-art robustness space of the original model compared to other dynamic modeling methods.

Key facts. Cited by 10 papers in the map (data through 7 Oct 2026). Builds on 49 of its 84 references that are in the map. First posted on arXiv 29 Nov 2023.

Builds on

49 of 84 references.

References · 49

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  5. 2014Explaining and Harnessing Adversarial Examplescited by 7,287
  6. 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,878
  7. 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,769
  8. 2015Character-level Convolutional Networks for Text Classificationcited by 2,293
  9. 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,222
  10. 2020Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecastingcited by 2,141
  11. 2022BLOOM: A 176B-Parameter Open-Access Multilingual Language Modelcited by 1,968
  12. 2019Certified Adversarial Robustness via Randomized Smoothingcited by 1,324
37 more
  1. 2018Obfuscated Gradients Give a False Sense of Security: Circumventing Defenses to Adversarial Examplescited by 1,259
  2. 2019Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailmentcited by 663
  3. 2021Dynamic Neural Networks: A Surveycited by 405
  4. 2021A Survey of Transformerscited by 399
  5. 2018TextBugger: Generating Adversarial Text Against Real-world Applicationscited by 376
  6. 2018Black-box Generation of Adversarial Text Sequences to Evade Deep Learning Classifierscited by 341
  7. 2021Recent Advances in Adversarial Training for Adversarial Robustnesscited by 276
  8. 2019FreeLB: Enhanced Adversarial Training for Natural Language Understandingcited by 261
  9. 2021Adversarial Graph Augmentation to Improve Graph Contrastive Learningcited by 200
  10. 2018Stochastic Activation Pruning for Robust Adversarial Defensecited by 171
  11. 2019Adversarial Training Can Hurt Generalizationcited by 131
  12. 2020Adversarial Training for Large Neural Language Modelscited by 109
  13. 2016Crafting Adversarial Input Sequences for Recurrent Neural Networkscited by 102
  14. 2020SoK: Certified Robustness for Deep Neural Networkscited by 100
  15. 2019Achieving Verified Robustness to Symbol Substitutions via Interval Bound Propagationcited by 87
  16. 2021Towards Improving Adversarial Training of NLP Modelscited by 79
  17. 2021Backdoor Pre-trained Models Can Transfer to Allcited by 79
  18. 2020Robustness Verification for Transformerscited by 76
  19. 2019Learning to Discriminate Perturbations for Blocking Adversarial Attacks in Text Classificationcited by 55
  20. 2018A Statistical Approach to Assessing Neural Network Robustnesscited by 54
  21. 2020Frequency-Guided Word Substitutions for Detecting Textual Adversarial Examplescited by 54
  22. 2021Random Noise Defense Against Query-Based Black-Box Attackscited by 46
  23. 2021Fast Certified Robust Training with Short Warmupcited by 45
  24. 2022Gradient Obfuscation Gives a False Sense of Security in Federated Learningcited by 37
  25. 2020Blacklight: Scalable Defense for Neural Networks against Query-Based Black-Box Attackscited by 34
  26. 2021Detecting Adversarial Examples from Sensitivity Inconsistency of Spatial-Transform Domaincited by 29
  27. 2019A Research Agenda: Dynamic Models to Defend Against Correlated Attackscited by 18
  28. 2020Lipschitz Bounds and Provably Robust Training by Laplacian Smoothingcited by 17
  29. 2020ALONE: A Dataset for Toxic Behavior among Adolescents on Twittercited by 17
  30. 2021On the Effectiveness of Small Input Noise for Defending Against Query-based Black-Box Attackscited by 17
  31. 2022Improving the Adversarial Robustness of NLP Models by Information Bottleneckcited by 17
  32. 2021Adversarial Examples can be Effective Data Augmentation for Unsupervised Machine Learningcited by 16
  33. 2018Defensive Dropout for Hardening Deep Neural Networks under Adversarial Attackscited by 13
  34. 2022Why adversarial training can hurt robust accuracycited by 12
  35. 2020Defense of Word-level Adversarial Attacks via Random Substitution Encodingcited by 9
  36. 2021Detecting Textual Adversarial Examples through Randomized Substitution and Votecited by 8
  37. 2021Dynamic Defense Approach for Adversarial Robustness in Deep Neural Networks via Stochastic Ensemble Smoothed Modelcited by 4

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 4; 2025: 2; 2026: 4.

10 papers.