Efficient Adversarial Training with Robust Early-Bird Tickets

Zhiheng Xi, Rui Zheng, Tao Gui, Qi Zhang, Xuanjing Huang

Abstract

Adversarial training (AT) is the gold standard for defending pre-trained language models (PLMs) against adversarial attacks, but its computational overhead—often 7 to 10 times that of standard fine-tuning—is a major barrier. This paper introduces EarlyRobust, a method that identifies "robust early-bird tickets" (sparse, resilient subnetworks) within the first 3% of training. By pruning the model early and finishing with standard fine-tuning, EarlyRobust achieves up to a 13.7x speedup while maintaining or exceeding the robustness of state-of-the-art defensive methods.

Introduction

Pre-trained language models like BERT are powerful yet fragile; small, calculated perturbations to input text can easily trick them into making incorrect predictions. Adversarial Training (AT), where models are trained on these difficult examples, is the most effective defense. However, generating adversarial examples requires multiple gradient descent steps for every training sample, making the process prohibitively slow. EarlyRobust addresses this by asking: can we find a "shortcut" to a robust model without performing expensive adversarial generation for the entire training process?

Overview of the EarlyRobust framework compared to traditional Adversarial Training methods, illustrating the significant reduction in adversarial training time.

Methodology: The EarlyRobust Framework

EarlyRobust builds on the Lottery Ticket Hypothesis, suggesting that dense networks contain sparse subnetworks that perform as well as the full model. The framework consists of two stages:

1. The Searching Stage

The authors discovered that "robust connectivity patterns"—the specific architecture of a resilient subnetwork—emerge very early, typically between 0.15 and 0.3 epochs. To find these, they use modified network slimming, attaching learnable importance coefficients to attention heads and neurons. The model is trained using a combination of adversarial loss and an $L_1$ sparsity regularizer. A "ticket convergence metric" based on Hamming distance detects when the subnetwork structure has stabilized, allowing the expensive searching phase to stop as early as possible.

2. The Drawing and Fine-tuning Stage

Once the "robust ticket" is identified, unimportant heads and neurons are pruned. Crucially, the remaining weights are reset, and training is completed using traditional, low-cost fine-tuning. Because the subnetwork structure itself possesses "inborn robustness," expensive adversarial examples are no longer needed for the remainder of training.

Experimental Results

EarlyRobust was evaluated across standard NLP benchmarks (IMDB, SST-2, AG NEWS, QNLI, QQP) against popular attacks like TextFooler and BERT-Attack.

  • Massive Speedups: EarlyRobust achieved training speedups of 7.0x to 13.7x compared to standard Projected Gradient Descent (PGD) adversarial training. This is largely due to bypassing the expensive adversarial example generation phase for the majority of training.
  • Superior Robustness: On the IMDB dataset under a TextFooler attack, EarlyRobust maintained 63.8% accuracy, vastly outperforming standard PGD (30.2%) and beating the previous state-of-the-art method, RobusT (58.6%).
  • Hardware Efficiency: By using structured pruning (entire heads and neurons) rather than unstructured weight pruning, the method reduces parameters (from 85M to ~60M) and provides actual hardware speedups suitable for edge devices.
A comparison of training time components: Adversarial Training vs. standard Fine-tuning.

Key Insights

  • Early Emergence: The "skeleton" of a robust model is formed almost immediately; convergence of parameters is not required to find the right architecture.
  • Global Pruning: Pruning the least important components across the entire model is more effective for robustness than layer-wise pruning.
  • Inborn Robustness: Robustness is partially a property of the network's topology. Once the right subnetwork is carved out, standard training is sufficient to reach high performance.

Conclusion

EarlyRobust demonstrates that the high cost of adversarial training can be largely bypassed by identifying robust subnetworks early in the training process. This approach makes robust language models more accessible for researchers and engineers with limited hardware resources.

Summary updated

BibTeX
@inproceedings{xi2022efficient,
  author = {Zhiheng Xi and Rui Zheng and Tao Gui and Qi Zhang and Xuanjing Huang},
  title = {{Efficient Adversarial Training with Robust Early-Bird Tickets}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.569},
}
Figure