Adversarial Self-Attention for Language Understanding

25 Jun 2022  ·  Hongqiu Wu, Ruixue Ding, Hai Zhao, Pengjun Xie, Fei Huang, Min Zhang ·

Deep neural models (e.g. Transformer) naturally learn spurious features, which create a ``shortcut'' between the labels and inputs, thus impairing the generalization and robustness. This paper advances the self-attention mechanism to its robust variant for Transformer-based pre-trained language models (e.g. BERT). We propose \textit{Adversarial Self-Attention} mechanism (ASA), which adversarially biases the attentions to effectively suppress the model reliance on features (e.g. specific keywords) and encourage its exploration of broader semantics. We conduct a comprehensive evaluation across a wide range of tasks for both pre-training and fine-tuning stages. For pre-training, ASA unfolds remarkable performance gains compared to naive training for longer steps. For fine-tuning, ASA-empowered models outweigh naive models by a large margin considering both generalization and robustness.

PDF Abstract
Task Dataset Model Metric Name Metric Value Global Rank Result Benchmark
Machine Reading Comprehension DREAM ASA + RoBERTa Accuracy 69.2 # 1
Machine Reading Comprehension DREAM ASA + BERT-base Accuracy 64.3 # 3
Natural Language Inference MultiNLI ASA + RoBERTa Matched 88 # 15
Natural Language Inference MultiNLI ASA + BERT-base Matched 85 # 28
Natural Language Inference QNLI ASA + BERT-base Accuracy 91.4% # 28
Natural Language Inference QNLI ASA + RoBERTa Accuracy 93.6% # 20
Paraphrase Identification Quora Question Pairs ASA + RoBERTa F1 73.7 # 8
Paraphrase Identification Quora Question Pairs ASA + BERT-base F1 72.3 # 11
Sentiment Analysis SST-2 Binary classification ASA + BERT-base Accuracy 94.1 # 35
Sentiment Analysis SST-2 Binary classification ASA + RoBERTa Accuracy 96.3 # 17
Semantic Textual Similarity STS Benchmark ASA + RoBERTa Spearman Correlation 0.892 # 8
Semantic Textual Similarity STS Benchmark ASA + BERT-base Spearman Correlation 0.865 # 20
Named Entity Recognition (NER) WNUT 2017 ASA + RoBERTa F1 57.3 # 6
Named Entity Recognition (NER) WNUT 2017 ASA + BERT-base F1 49.8 # 15

Methods