Parameter-Efficient Transfer Learning for NLP

Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin de Laroussilhe, Andrea Gesmundo, Mona Attariyan, Sylvain Gelly

TL;DR

Instead of training a massive, separate copy of a model like BERT for every new task, this paper introduces adapter modules: tiny, trainable "plugins" inserted into a frozen pre-trained model. This approach matches the performance of full fine-tuning while training two orders of magnitude fewer parameters, making it possible to scale to hundreds of tasks with minimal storage overhead.

The Problem: Parameter Inefficiency in Fine-Tuning

In the world of Natural Language Processing (NLP), the standard recipe for success is "Pre-train then Fine-tune." You take a massive model like BERT, pre-trained on vast amounts of text, and then "fine-tune" it by updating all its weights for a specific task (like sentiment analysis or question answering).

While effective, this is parameter-inefficient. If you want to support 100 different tasks, you have to store 100 different versions of a 330-million-parameter model. For cloud providers or mobile developers, this is a logistical nightmare. The authors sought a way to achieve "compact" and "extensible" transfer learning: a system that performs as well as full fine-tuning but only requires a tiny number of task-specific parameters.

Methods: Adapter Tuning

The authors propose Adapter Tuning. The core idea is to keep the original pre-trained model's weights completely frozen and insert small, new layers called "adapters" between the existing layers of the Transformer architecture.

The Adapter Architecture

Each adapter uses a simple bottleneck structure to keep the parameter count low.

Adapter architecture showing insertion within a Transformer layer and the internal bottleneck structure

As shown above, the adapter consists of:

  1. Down-projection: It takes the high-dimensional hidden state and projects it into a much lower dimension (the "bottleneck").
  2. Nonlinearity: It applies a simple activation function.
  3. Up-projection: It projects the data back up to the original dimension.
  4. Skip-connection: The original input is added back to the output. If the adapter weights are initialized to near-zero, the module acts as an identity function and doesn't disrupt the pre-trained model initially.

In a standard Transformer, these adapters are inserted twice per layer: once after the multi-headed attention and once after the feed-forward sub-layer. During training, only the adapters and the layer normalization parameters are updated.

Key Insights and Ideas

  • The Power of Freezing: By freezing the main model, learning a new task never "corrupts" the original knowledge or interferes with other tasks. This makes the model perfectly extensible.
  • Near-Identity Initialization: Initializing the adapter's weights so they start out doing almost nothing prevents the randomly initialized adapters from "breaking" the pre-trained model at the start of training.
  • The Efficiency-Performance Trade-off: The bottleneck size allows developers to choose their level of efficiency. You can have a tiny adapter for a 0.5% parameter increase, or a slightly larger one for 8%.
  • Higher Layers Matter More: Ablation studies revealed that adapters in the top layers of the network have a much larger impact on performance than those in the bottom layers.

Key Results

The researchers put their method to the test across a massive battery of NLP challenges, including the GLUE Benchmark, 17 additional classification tasks, and SQuAD v1.1. The results demonstrated a massive leap in parameter efficiency without sacrificing performance.

Accuracy delta compared to full fine-tuning across different parameter budgets
  • Performance Parity: On the GLUE benchmark, adapters achieved a mean score of 80.0, nearly matching the 80.4 of full fine-tuning.
  • Massive Savings: Adapters achieved this while training only 3.6% of the parameters per task.
  • Scaling: When looking at the "Additional Tasks" suite, adapters used two orders of magnitude fewer parameters than fine-tuning the top layers to reach the same accuracy.
  • Robustness: Even with an extremely small bottleneck (adding only 0.1% parameters), the model performed remarkably well on SQuAD, achieving an F1 score of 89.9 (vs. 90.7 for the full model).

Limitations and Future Work

  • Inference Latency: While adapters save disk space and training time, they add extra layers to the model. This slightly increases the time it takes to run a single "forward pass" (inference), which might be a concern for strict real-time applications.
  • Hardware Efficiency: While the number of parameters is low, current hardware (GPUs/TPUs) is often optimized for large, dense matrix multiplications. Small, sparse layers like adapters might not see a 1:1 speedup in training time without specialized software kernels.

Summary updated

BibTeX
@inproceedings{houlsby2019parameter,
  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},
  title = {{Parameter-Efficient Transfer Learning for NLP}},
  booktitle = {International Conference on Machine Learning},
  year = {2019},
  url = {https://openreview.net/forum?id=H1NjknZO-H},
}
Figure