AdapterDrop: On the Efficiency of Adapters in Transformers

Andreas Rücklé, Gregor Geigle, Max Glockner, Tilman Beck, Jonas Pfeiffer, Nils Reimers, Iryna Gurevych

Introduction

Transformer models like BERT and RoBERTa have revolutionized NLP but remain computationally expensive to fine-tune and deploy. While Adapters—small, trainable modules inserted into frozen Transformer layers—offer a parameter-efficient alternative for storage, they often introduce a slight computational overhead during inference. This paper introduces AdapterDrop, a technique that removes adapters from lower Transformer layers to significantly increase training and inference speeds with minimal impact on accuracy.

Methods

The authors propose two primary strategies to reclaim computational efficiency:

1. AdapterDrop

This method involves removing adapters from the first $n$ layers of the Transformer. The intuition is that lower layers often capture more general linguistic features, making task-specific adapters there less critical. Two variants are explored:

  • Specialized AdapterDrop: Training a specific model for a fixed number of dropped layers.
  • Robust AdapterDrop: Training a single model where the number of dropped layers is randomized during training, allowing for dynamic scaling at run-time based on available hardware resources.
Adapter architecture and the backpropagation shortcut.

One significant advantage of adapters is the "Backprop Shortcut." Because the base model is frozen, gradients only need to be backpropagated to the first layer containing a trainable adapter, potentially speeding up training by up to 60%.

2. AdapterFusion Pruning

AdapterFusion combines knowledge from multiple task adapters but is computationally expensive because it passes data through every adapter sequentially. The authors propose pruning the "least important" adapters—those with the lowest activation scores—to streamline the process.

Key Results and Insights

The researchers evaluated AdapterDrop using the GLUE benchmark. A key finding is that not all layers are equally sensitive; dropping adapters from the first few layers has a negligible effect on most tasks, whereas dropping them from final layers causes performance to drop significantly.

Performance retention across GLUE tasks as adapters are dropped from lower layers.
  • Training Speed: Adapters can be trained 60% faster than full fine-tuning with common hyperparameter settings.
  • Inference Speedup: In multi-task settings (e.g., 8 tasks), AdapterDrop with five layers removed is 39% faster than standard adapter inference.
  • Performance Retention: Specialized AdapterDrop (dropping 5 layers) maintains 97.1% of original performance across GLUE tasks. Robust AdapterDrop maintains 95.4% performance under similar conditions.
  • Pruning Efficiency: Pruning "dead weight" adapters in AdapterFusion can lead to a 68% inference speedup while maintaining performance.

Conclusion and Limitations

While AdapterDrop offers significant efficiency gains, task sensitivity varies. For instance, the CoLA task (linguistic acceptability) is more sensitive to dropping early-layer adapters than MNLI. This suggests that optimal dropping strategies may vary by task. Future research directions include exploring weight sharing across layers and dynamic pruning during the training phase itself.

Summary updated

BibTeX
@inproceedings{ruckle2021adapterdrop,
  author = {Andreas Rücklé and Gregor Geigle and Max Glockner and Tilman Beck and Jonas Pfeiffer and Nils Reimers and Iryna Gurevych},
  title = {{AdapterDrop: On the Efficiency of Adapters in Transformers}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-main.626},
}
Figure