Paper commentary
Parameter-Efficient Transfer Learning for NLP
- Problem Fine-tuning a pre-trained Transformer gives strong text classification results, but each downstream task then needs its own full set of weights, which becomes costly when many tasks arrive over time.
- Method Inserts small bottleneck adapter modules into each Transformer sub-layer, freezes the pre-trained BERT weights, and trains only the adapters, the layer normalization parameters and the classifier for each task.
- Results Reached a mean GLUE test score of 80.0 with BERTLARGE, against 80.4 for full fine-tuning, using 1.3× total parameters against 9×.
Why one full model per task is costly
Fine-tuning copies the weights of a pre-trained network and tunes them on the downstream task, so every task ends up with its own complete set of weights. Serving N tasks this way requires N times the parameters of the pre-trained model. The setting that motivates the work is an online one, where tasks arrive as a stream and the aim is one system that performs well on all of them without training a new model for each.
Cloud services are the example given, where customers send tasks in sequence and a high degree of sharing between tasks is useful. Feature-based transfer avoids copying the whole network by computing fixed embeddings and feeding them to a custom downstream model. The cited work reports that fine-tuning often performs better than feature-based transfer, which leaves fine-tuning as the strong baseline that a parameter-efficient method has to approach.
Bottleneck adapters inside each Transformer layer
Adapter modules are small trainable blocks added to a pre-trained network while the weights of that network stay untouched. Because the original weights are shared, one base model can be reused, and each task adds only the adapter parameters and a classifier.
Each Transformer layer has an attention sub-layer and a feedforward sub-layer, each followed by a projection back to the input size, a skip-connection and layer normalization. Two serial adapters are placed in each layer, applied to the output of each sub-layer after the projection and before the skip-connection is added back.
The bottleneck projects the d-dimensional features down to a dimension m, applies a nonlinearity, and projects back to d. The module has an internal skip-connection, so when the projection parameters start near zero the adapter begins as an approximate identity function.
The near-identity start means the original network behaves as before at the beginning of training, and the authors report that the model may fail to train when the initialization moves too far from the identity. Alongside the adapters, a new pair of layer normalization parameters is trained per layer, which is 2d parameters per layer. During adapter tuning, the adapters, the layer normalization parameters and the final classification layer are trained, and the rest of the network stays frozen.
Training and selection protocol
Classification follows the BERT recipe: the first token of each sequence is a special classification token, and a linear layer on its embedding predicts the class label. Training uses Adam with a learning rate that rises linearly over the first 10% of steps and then decays linearly to zero, with a batch size of 32 on 4 Google Cloud TPUs. For each dataset and algorithm, a hyperparameter sweep is run and the model with the best validation accuracy is selected.
GLUE results are the test metrics returned by the submission website, while the other classification tasks report test-set accuracy.
GLUE results against full fine-tuning
The GLUE experiments transfer from BERTLARGE, which has 24 layers and 330M parameters. Because training was unstable, each configuration was rerun five times with different random seeds and the best model on the validation set was kept.
Adapter tuning reached a mean GLUE score of 80.0, and full fine-tuning reached 80.4. The chosen adapter size varies by task: 256 for MNLI and 8 for the smallest dataset, RTE, and fixing the size to 64 lowers the mean to 79.6.
Solving all GLUE tasks with full fine-tuning requires 9× the total number of BERT parameters, while adapters require 1.3× in total. Adapter tuning trains 3.6% of the parameters per task on GLUE, and the fixed size-64 variant trains 2.1% with a total of 1.2×.
Seventeen additional classification tasks
Variable fine-tuning freezes all but the top n layers, with n swept over 1, 2, 3, 5, 7, 9, 11 and 12, and it reduces to full fine-tuning when n equals 12. A single-task AutoML search over feedforward and convolutional networks on TensorFlow Hub embeddings served as a baseline without BERT, run for one week per task on 30 machines and exploring over 10k models per task on average.
Adapter tuning sits about 0.4% behind full fine-tuning, while fine-tuning requires 17× the parameters of BERTBASE for all tasks.
Accuracy at matched trained-parameter counts
Figure 1 plots accuracy against the number of trained task-specific parameters, with the y-axis normalized by full fine-tuning on nine GLUE tasks, and the curves show the 20th, 50th and 80th percentiles. Adapter-based tuning reaches similar performance to full fine-tuning with two orders of magnitude fewer trained parameters. On GLUE, performance drops sharply when fewer layers are fine-tuned, whereas on the additional tasks some tasks benefit from training fewer layers, so the decline is much smaller there.
Adapters of size 64, with about 2M trainable parameters, reach 83.7% ± 0.1%, and full fine-tuning reaches 84.4% ± 0.02%. The adapter result is measured on the same validation set and conditions as the top-layer result, so the comparison is at matched parameter budgets.
SQuAD v1.1 question answering
Figure 5 plots validation accuracy against the number of trained parameters for SQuAD v1.1, with error bars showing the s.e.m. across three seeds. On SQuAD v1.1 a model selects the answer span to a question from a Wikipedia paragraph, and fine-tuning sweeps the number of trained layers, learning rate and epochs, while adapters sweep the size, learning rate and epochs with their own ranges.
Adapters of size 64, which is 2% of the parameters, reach an F1 of 90.4%, while fine-tuning reaches 90.7. Even adapters of size 2, at 0.1% of the parameters, reach an F1 of 89.9.
Which adapter layers matter and how sensitive initialization is
Removing the adapters of any single layer reduces performance by at most 2%. Removing all adapters drops MNLI to 37% and CoLA to 69%, which are scores obtained by predicting the majority class, and the authors read this as each adapter having a small influence whose combined effect is large.
Removing the adapters of layers 0 to 4 on MNLI barely changes performance, which the authors interpret as adapters acting mainly on higher layers. They connect this to the view that lower layers extract features shared across tasks while higher layers build task-specific features.
The mean validation accuracy across the eight classification tasks is 86.2% for adapter size 8, 85.8% for size 64 and 85.7% for size 256. Several extensions were tried, including batch or layer normalization inside the adapter, more layers per adapter, other activation functions, adapters only inside attention, and parallel adapters, and none gave a substantial gain over the bottleneck design.
Relation to multi-task and continual learning
Multi-task learning also yields a compact model, but it requires simultaneous access to all tasks during training, which adapter-based tuning does not require. Continual learning faces catastrophic forgetting after retraining, and the authors argue that adapters avoid this because the tasks do not interact and the shared parameters stay frozen.
Progressive Networks avoid forgetting by adding a new column per task, so their parameter count grows linearly with the number of tasks. In vision, convolutional adapters use 1×1 convolutions and the cited work reports an 11% increase in model size per task, while the bottleneck adapters here are described as much smaller.
Limitations
The reported experiments cover text classification and SQuAD v1.1, and the GLUE comparison uses BERTLARGE while the additional tasks and ablations use BERTBASE. Some numbers are therefore not from one shared backbone, and cross-table comparisons should be read with that in mind. The GLUE comparison omits WNLI, following Devlin et al. because no current algorithm beats the majority-class baseline on it.
Training was unstable enough that GLUE runs were repeated five times, so single-run results are not reported.
Paper info
- Authors
- Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, Mona Attariyan, Sylvain Gelly
- Venue
- arXiv · Preprint
- First published
- 2019-2-2
- Added
- 2026-10-20
- Updated
- 2019-6-13
- Version
- v2
- arXiv
- 1902.00751
- Category
- cs.LG · cs.CL · stat.ML
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, Mona Attariyan, Sylvain Gelly (2019). Parameter-Efficient Transfer Learning for NLP. arXiv:1902.00751v2. https://arxiv.org/abs/1902.00751v2
BibTeX
@misc{houlsby2019parameter,
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.00751v2}
}