Parameter-Efficient Transfer Learning for NLP
- Publication
- ICML 2019Conference
- First submitted to arXiv
- arXiv:1902.00751
Cite this paper · BibTeX
The citation identifies the linked source version. It cites the original paper and its authors.
@misc{modeltuningadapter2019,
title = {{Parameter-Efficient Transfer Learning for NLP}},
author = {Neil Houlsby and Andrei Giurgiu and Stanislaw Jastrzebski and Bruna Morrone and Quentin de Laroussilhe and Andrea Gesmundo and Mona Attariyan and Sylvain Gelly},
year = {2019},
eprint = {1902.00751},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1902.00751}
}
After BERT was introduced, it set the standard for the learning paradigm in NLP:
- We must first train a "large" model with "massive" data, and then fine-tune it.
This paradigm achieved strong results on many contemporary NLP benchmarks.
Defining the Problem
The authors of this paper identify an obvious issue with this approach:
Wastefulness
Think about a target task: do we really need to fine-tune the entire pretrained model?
-
Even if only a small part of it needs adjustment.
-
So, if we want to solve ten different tasks, we must train ten different models?
-
Even if these tasks share many commonalities.
With so many shared aspects, why do we waste so many resources?
Solving the Problem
Here, we don't need much—just a small "Adapter" for each task.
The authors insert small adapter modules into a Transformer, aiming to approach full fine-tuning performance with few task-specific parameters.
Refer to the image above. Specifically, the authors add two Adapter modules to each layer of the Transformer:
- The first follows the attention output projection, before the main residual addition and LayerNorm.
- The second follows the feed-forward output projection, before the main residual addition and LayerNorm.
Each Adapter module functions like a small neural network. It first compresses the original high-dimensional features into lower dimensions, applies a non-linear transformation, and then projects them back to the original high dimensions.
This design, similar to the "bottleneck" architecture seen in lightweight models like MobileNet or SqueezeNet, has two main benefits:
- Parameter Efficiency: This design only requires about 0.5% to 8% of the parameters of the original model.
- Task Adaptation: The bottleneck limits added parameters, while its nonlinear mapping adapts task features.
Each adapter also has its own skip connection. With a near-zero initialization, an inserted module initially approximates the identity function rather than drastically changing the pretrained network. The paper tests initialization scale empirically; stability is not guaranteed for every setting.
Training updates the adapters, task-specific LayerNorm parameters and the output classification layer. The remaining pretrained weights are frozen and can be shared across tasks.
Discussion
GLUE Evaluation
Validation data is used for model selection; the table reports test-set scores from the GLUE evaluation server.
The adapter setup approaches full fine-tuning performance with far fewer trainable parameters per task.
The table above shows two types of experimental designs:
- First Set of Experiments (8-256): This design uses different Adapter modules for different tasks, with the feature dimensions (number of units in the bottleneck) being one of "8, 64, 256."
- Second Set of Experiments (64): Every task uses a bottleneck width of 64, but each still learns its own adapter weights.
Due to training instability, the authors re-ran each setting 5 times with different random seeds and selected the best model on the validation set.
Table 1 uses 24-layer BERT-Large with roughly 330M parameters. Task-selected adapter widths of 8, 64 or 256 yield a GLUE total score of 80.0, versus 80.4 for full fine-tuning; the adapters train parameters amounting to 3.6% of the backbone per task. Retaining all nine table settings requires roughly 1.3× one backbone in total, versus 9× with full fine-tuning. Fixed width 64 uses 2.1% task-specific parameters and scores 79.6. This is a parameter–score trade-off, not a single set of adapter weights shared by all tasks.
Ablation Study
To test the effectiveness of the Adapter modules, the authors conducted a series of ablation experiments.
The imported image contains only the left and center panels of the paper's Figure 6. With BERT-Base and adapter width 64, the authors remove trained adapters from consecutive layers without retraining and measure the relative drop in MNLI and CoLA validation accuracy. The paper's right-hand initialization-scale plot is not in this crop.
The experimental results reveal several findings:
-
Impact of Removing Layers:
- Removing a single Adapter layer has little impact on overall performance, with a relative validation-accuracy drop of at most about 2%.
- Removing all adapters reduces classification accuracy to 37% on MNLI and 69% on CoLA, near majority-class baselines. This CoLA accuracy is not the Matthews correlation reported in the main GLUE table.
-
Impact of High and Low Layers:
- On MNLI, removing lower-layer adapters (for example, layers 0–4) has little effect. Higher-layer adapters matter more in these tests. The authors interpret this as greater task specialization in higher layers.
-
Initialization Scale:
- Adapter performance remains robust with initialization standard deviations below 0.01.
- Performance degrades with higher standard deviations, especially on the CoLA dataset.
-
Bottleneck Feature Size: Widths of 8, 64 and 256 give mean validation accuracies of 86.2%, 85.8% and 85.7% across the tested classification tasks, respectively, showing relatively stable performance.
-
Architecture Variations: Adding BatchNorm or LayerNorm, increasing Adapter layers, changing activation functions (e.g., tanh), or inserting Adapters only in the attention layer did not significantly improve performance.
The authors therefore recommend the original, simple Adapter design: the more complex variants they tested gave no consistent advantage. No need to overthink it.
Conclusion
Adapter modules are like small, efficient plugins added to a model. They let multiple tasks share a large pretrained backbone while training only about 0.5%–8% as many task-specific parameters. Applied as a parameter-count illustration to a 30B model, those ratios would be 0.15–2.4B trainable parameters.
For people with limited computing resources, reducing the work of task adaptation is welcome news! Whether a particular GPU can fit the backbone and training activations still depends on the model, sequence length and hardware.