Overview

10 ALBERT, adapters, and multitask adaptation strategies

In this chapter, the focus is on making transfer learning for NLP both more efficient and more flexible. The discussion begins by revisiting adaptation strategies for pretrained transformer models and then introduces ALBERT as a smaller, more scalable alternative to BERT. ALBERT achieves this efficiency through embedding factorization, which separates the vocabulary projection from the hidden size, and through cross-layer parameter sharing, which reuses weights across layers to greatly reduce model size while preserving strong performance.

The chapter then turns to multitask fine-tuning and sequential adaptation as ways to improve transfer when labeled data is limited. Using GLUE as the main benchmark collection, it shows how tasks such as sentiment analysis, paraphrase detection, textual similarity, entailment, and question answering can be used to train models that generalize better across language understanding problems. It also demonstrates that adapting first on a data-rich related task and then on a lower-resource target task can improve results, as illustrated by fine-tuning BERT on QQP before STS-B, which yields better correlation than training on STS-B alone.

Finally, the chapter presents adapters as a lightweight alternative to full fine-tuning. Instead of updating all pretrained weights, small task-specific modules are inserted between layers and trained while the base model remains frozen, giving strong performance with only a small parameter increase. The chapter emphasizes the practical advantages of this modular approach: it is efficient in storage and training, easy to share, and straightforward to apply through existing tooling, making it a useful blueprint for adapting transformer models to many new NLP tasks.

The hard-parameter sharing multitask learning scenario we are exploring in this section. The model is first fine-tuned on QQP, which is a data-rich scenario, and then STS-B, which is a low-resource scenario. The sequential nature of this experiment classifies it as sequential adaptation.
10_01
Newly introduced adapter layers in the “vanilla” transformer encoder from figure 7.6
10_02

Summary

  • Applying embedding factorization and parameter sharing across layers yields a more parameter-efficient model.
  • Fine-tuning a model from the BERT family on multiple tasks simultaneously, that is, multitask fine-tuning, yields a more generalizable model.
  • Employing adapters on a model from the BERT family can simplify fine-tuning.

1. Z. Lan et al., “ALBERT: A Lite BERT for Self-Supervised Learning of Language Representations,” ICLR (2020).

2. A. Wang et al., “Glue: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding,” ICLR (2019).

3. N. Houlsby et al., “Parameter-Efficient Transfer Learning for NLP,” ICML (2019).

4. Z. Lan et al., “ALBERT: A Lite BERT for Self-Supervised Learning of Language Representations,” ICLR (2020).

7. X. Liu et al., “Multi-Task Deep Neural Networks for Natural Language Understanding,” ACL Proceedings (2019).

8. A. Wang et al., “GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding,” ICLR (2019).

9. P. Rajpurkar et al., “SQuAD: 100,000+ Questions for Machine Comprehension of Text,” arXiv (2016).

10. A. Wang et al., “Glue: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding,” ICLR (2019).

12. N. Houlsby et al., “Parameter-Efficient Transfer Learning for NLP,” ICML (2019).

FAQ

What is ALBERT and why was it introduced?ALBERT stands for “A Lite BERT.” It was introduced to make transformer-based language models scale more efficiently by reducing the number of parameters while keeping strong performance.
What are the two main ideas behind ALBERT?ALBERT is built on two core ideas: embedding factorization and cross-layer parameter sharing. Together, these reduce model size and improve scalability for larger vocabularies and longer inputs.
How does embedding factorization reduce the size of the model?Instead of directly projecting one-hot token vectors into the hidden layer size, ALBERT splits the embedding into two matrices: one from vocabulary size to a smaller embedding dimension, and another from that smaller dimension to the hidden size. This makes the embedding much smaller and more efficient.
What is cross-layer parameter sharing in ALBERT?Cross-layer parameter sharing means that the same parameters are reused across transformer layers instead of learning separate parameters for each layer. This reduces the number of parameters and acts as a form of regularization.
How much smaller is ALBERT compared to BERT in this chapter?The chapter notes that ALBERT-base has about 11.8 million parameters, compared with BERT’s 178.6 million parameters. That is roughly a 15-fold reduction in size.
What is the purpose of multitask fine-tuning in NLP transfer learning?Multitask fine-tuning trains a model on multiple related tasks, which can improve generalization and transfer performance. It is especially useful when a target task has limited training data.
What is sequential adaptation?Sequential adaptation is a transfer strategy where the model is fine-tuned in stages rather than all at once. A common pattern is to adapt first on a data-rich related task and then on the low-resource target task.
What is the GLUE benchmark used for in this chapter?GLUE is a benchmark suite of natural language understanding tasks. In this chapter, it is used to demonstrate multitask fine-tuning and sequential adaptation on tasks like STS-B and QQP.
What are adapters and why are they useful?Adapters are small additional modules inserted between layers of a pretrained model. Instead of fine-tuning all model weights, only the adapter parameters are trained, which makes adaptation efficient and lightweight.
How are adapters used to classify sentiment in the chapter?The chapter shows loading a pretrained BERT model, attaching an SST-2 adapter from AdapterHub, and then running predictions with that adapter active. The result is a sentiment classifier that can distinguish positive and negative sentences effectively.

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Transfer Learning for Natural Language Processing Transfer Learning for Natural Language Processing ebook for free
Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Transfer Learning for Natural Language Processing Transfer Learning for Natural Language Processing ebook for free
Close
choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • renews monthly, pause or cancel renewal anytime
  • renews annually, pause or cancel renewal anytime
  • Transfer Learning for Natural Language Processing Transfer Learning for Natural Language Processing ebook for free