Unveiling Vulnerability of Self-Attention
Not on the map. Why?
Abstract (arXiv)
Pre-trained language models (PLMs) are shown to be vulnerable to minor word changes, which poses a big threat to real-world systems. While previous studies directly focus on manipulating word inputs, they are limited by their means of generating adversarial samples, lacking generalization to versatile real-world attack. This paper studies the basic structure of transformer-based PLMs, the self-attention (SA) mechanism. (1) We propose a powerful perturbation technique textitHackAttend, which perturbs the attention scores within the SA matrices via meticulously crafted attention masks. We show that state-of-the-art PLMs fall into heavy vulnerability that minor attention perturbations (1%) can produce a very high attack success rate (98%). Our paper expands the conventional text attack of word perturbations to more general structural perturbations. (2) We introduce textitS-Attend, a novel smoothing technique that effectively makes SA robust via structural perturbations. We empirically demonstrate that this simple yet effective technique achieves robust performance on par with adversarial training when facing various text attackers. Code is publicly available at urlgithub.com/liongkj/HackAttend.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 31 of its 42 references that are in the map. First posted on arXiv 26 Feb 2024.
Builds on
31 of 42 references.
References · 31
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2014Explaining and Harnessing Adversarial Examplescited by 7,287
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,462
- 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,018
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,772
- 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
- 2019Right for the Wrong Reasons: Diagnosing Syntactic Heuristics in Natural Language Inferencecited by 864
- 2019Are Sixteen Heads Really Better than One?cited by 803
- 2019Is BERT Really Robust? A Strong Baseline for Natural Language Attack on Text Classification and Entailmentcited by 663
19 more
- 2020BERT-ATTACK: Adversarial Attack Against BERT Using BERTcited by 488
- 2018Generating Natural Language Adversarial Examplescited by 422
- 2019MoverScore: Text Generation Evaluating with Contextualized Embeddings and Earth Mover Distancecited by 415
- 2019PAWS: Paraphrase Adversaries from Word Scramblingcited by 395
- 2018TextBugger: Generating Adversarial Text Against Real-world Applicationscited by 376
- 2018Black-box Generation of Adversarial Text Sequences to Evade Deep Learning Classifierscited by 341
- 2019FreeLB: Enhanced Adversarial Training for Natural Language Understandingcited by 261
- 2019DREAM: A Challenge Dataset and Models for Dialogue-Based Reading Comprehensioncited by 156
- 2020Self-Attention Attribution: Interpreting Information Interactions Inside Transformercited by 124
- 2019SG-Net: Syntax-Guided Machine Reading Comprehensioncited by 52
- 2021SparseBERT: Rethinking the Importance Analysis in Self-attentioncited by 46
- 2020Hard-Coded Gaussian Attention for Neural Machine Translationcited by 42
- 2022SemAttack: Natural Textual Attacks via Different Semantic Spacescited by 42
- 2021Mask Attention Networks: Rethinking and Strengthen Transformercited by 28
- 2022Query-Efficient and Scalable Black-Box Adversarial Attacks on Discrete Sequential Data via Bayesian Optimizationcited by 22
- 2023Toward Adversarial Training on Contextualized Language Representationcited by 10
- 2021Attention Head Masking for Inference Time Content Selection in Abstractive Summarizationcited by 9
- 2022Adversarial Self-Attention for Language Understandingcited by 8
- 2023Empower Nested Boolean Logic via Self-Supervised Curriculum Learningcited by 7
Built on by
Not cited yet.