Adversarial Training for Large Neural Language Models

Xiaodong Liu, Hao Cheng, Pengcheng He, Weizhu Chen, Yu Wang, Hoifung Poon, Jianfeng GaoarXiv 2020

Introduction

In the development of Large Language Models (LLMs), researchers have long grappled with a perceived trade-off between generalization and robustness. Traditionally, adversarial training—the process of hardening a model against malicious or noisy inputs—has come at the cost of performance on standard, "clean" benchmarks. This "no free lunch" scenario suggested that making a model tougher inevitably made it less accurate for general tasks.

A team from Microsoft Research has challenged this paradigm with ALUM (Adversarial training for Large LangUage Models). Their research demonstrates that when adversarial perturbations are integrated correctly into the pre-training phase, they act as a powerful regularizer that enhances both the model's robustness and its fundamental linguistic intelligence.

The ALUM Framework

The core challenge in applying adversarial training to NLP is the discrete nature of text; unlike image pixels, words cannot be "slightly" altered in a differentiable way. ALUM bypasses this by applying perturbations directly to the word embeddings—the continuous vector representations within the model.

Technical Methodology

ALUM utilizes Virtual Adversarial Training (VAT) to smooth the model's decision boundaries. Instead of merely training the model to predict correct labels for noisy inputs, ALUM regularizes the model to ensure its output for a perturbed input remains consistent with its output for the original, clean input. The training objective combines standard cross-entropy loss with an adversarial term designed to maximize the divergence between original and perturbed outputs.

Furthermore, the researchers employed a curriculum learning strategy. They found that "continual pre-training"—starting with a standard pre-trained model and then introducing ALUM—provided greater stability and performance than starting adversarial training from scratch.

Figure 1: Comparison of MNLI accuracy between standard BERT and ALUM-enhanced BERT over 1 million pre-training steps.

Experimental Results

The authors evaluated ALUM across a wide array of benchmarks, including GLUE, SQuAD, and adversarial datasets like ANLI.

Generalization and Robustness Synergy

The most significant finding is that adversarial pre-training improves standard benchmark scores. For instance, applying ALUM to BERT-base resulted in a jump from 88.5 F1 to 90.8 F1 on SQuAD v1.1. This suggests that forcing the model to remain stable under embedding perturbations helps it learn more robust linguistic patterns rather than overfitting to surface-level noise.

Figure 5: Performance comparison on SQuAD and MNLI benchmarks, showing significant gains for ALUM over standard BERT baselines.

Performance on Saturated Models

Even highly optimized models like RoBERTa, which are trained on massive datasets, benefited from ALUM. While standard continual pre-training often yields diminishing returns for such models, ALUM-based continual pre-training squeezed out significant additional performance. On the challenging ANLI (Adversarial NLI) dataset, ALUM-RoBERTa-Large achieved 57.0% accuracy, substantially outperforming the standard RoBERTa-Large baseline of 49.7%.

Domain Transferability

The benefits of ALUM extend beyond general language tasks. When tested on biomedical Named Entity Recognition (NER) tasks (BC2GM, NCBI, JNLPBA), ALUM-BERT-base outperformed standard BERT across the board. This indicates that the foundational robustness baked in during pre-training transfers effectively to specialized domains, even when the model was originally trained on general corpora like Wikipedia.

Conclusion and Future Directions

While ALUM offers clear empirical benefits, it introduces a computational overhead, with each training step taking approximately 1.5 times longer than standard training due to the additional forward and backward passes required for perturbation calculation.

The theoretical underpinnings of why adversarial training aids generalization in NLP—while often hindering it in Computer Vision—remain a subject for future study. Future work will also explore the scalability of ALUM to massive models like GPT-3 and its applicability to multi-modal architectures. Ultimately, ALUM suggests that robustness is not a secondary feature to be added later, but a foundational property that should be integrated into the very beginning of a model's life cycle.

Summary updated

BibTeX
@misc{liu2020adversarial,
  author = {Xiaodong Liu and Hao Cheng and Pengcheng He and Weizhu Chen and Yu Wang and Hoifung Poon and Jianfeng Gao},
  title = {{Adversarial Training for Large Neural Language Models}},
  year = {2020},
  eprint = {2004.08994},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.08994},
}
Figure