Abstract
Adversarial training (AT) is traditionally employed as a defense against malicious attacks. However, this research demonstrates that AT also functions as a potent regularization technique for improving general model performance. By introducing calculated perturbations to word embeddings during the training of BERT-based models, we achieve consistent accuracy gains across multiple Machine Reading Comprehension (MRC) benchmarks, including SQuAD 1.1, SQuAD 2.0, and RACE. Our analysis reveals that AT is particularly effective at refining representations for rare words and improving the model's ability to handle unanswerable questions.
Introduction
State-of-the-art deep learning models are often "brittle," meaning small, imperceptible changes to input data can drastically alter their predictions. While this is a security concern, it is also a sign of poor generalization. In the context of Machine Reading Comprehension (MRC)—where models must extract or reason about answers from a given text—the specific reasons why adversarial training improves performance have remained largely unexplored. This paper aims to validate the universal benefits of AT across extractive and multiple-choice MRC tasks and to uncover the mechanisms driving these improvements.
Methodology
The proposed approach integrates two primary adversarial techniques into the BERT training pipeline:
- Adversarial Training (AT): The model is trained on "clean" data augmented with worst-case perturbations ($r_{AT}$) added to the word embeddings. These perturbations are calculated to maximize the model's current loss, forcing the network to become robust against local variations in the embedding space.
- Virtual Adversarial Training (VAT): A semi-supervised variant that does not require labeled data. It minimizes the KL divergence between the model's output distribution for a clean input and its distribution for a perturbed version of that same input.
Additionally, the authors introduce Negative Entropy Loss (NEL) for tasks involving unanswerable questions (e.g., SQuAD 2.0). NEL encourages a high-entropy (flat) probability distribution when no answer is present, preventing the model from making overconfident but incorrect predictions.
Experimental Results
The effectiveness of the adversarial training framework was evaluated on three major benchmarks: SQuAD 1.1 (extractive), SQuAD 2.0 (extractive with unanswerable questions), and RACE (multi-choice reasoning).
- SQuAD 1.1: The BERT+AT+VAT model achieved 86.9 EM and 92.6 F1 on the test set, significantly outperforming the standard BERT baseline.
- SQuAD 2.0: Combining data augmentation, NEL, and AT resulted in 82.9 EM and 86.0 F1, representing a statistically significant improvement over the baseline.
- RACE: On the BERT-Large architecture, accuracy improved from 70.5% to 72.4%, demonstrating that AT benefits complex reasoning tasks as well as extractive ones.
Analysis and Discussion
A key finding of this work is the "Rare Word Refiner" effect. Because low-frequency words appear rarely in training sets, their embeddings are often poorly optimized. The gradient-based perturbations in AT act as a specialized trainer for these words, "nudging" their embeddings and forcing the model to learn more robust, generalized representations.
Furthermore, the study highlights a distinction between mathematical and linguistic robustness. While AT improves general accuracy and mathematical smoothness, it offers limited protection against high-level linguistic traps, such as the AddSent attack. This suggests that while gradient-based AT helps models handle "noisy" data, it does not necessarily impart the high-level logic required to ignore human-crafted deceptive sentences.
Conclusion
Adversarial training provides a universal performance boost for BERT-based machine reading models. By refining the embeddings of rare words and improving the handling of unanswerable queries, AT serves as a valuable tool for enhancing model generalization. Future work will focus on bridging the gap between mathematical robustness and linguistic reasoning, as well as reducing the computational overhead associated with generating adversarial perturbations.
Summary updated