Adapter Layers

Category: Generative AI / LLM

Small trainable neural network modules inserted between frozen transformer layers that learn task-specific transformations with minimal additional parameters.

Full Explanation

Adapter layers are lightweight neural network modules added inside each transformer layer of a pre-trained model. Each adapter typically consists of a down-projection to a low-dimensional bottleneck, a nonlinearity, and an up-projection back to the original dimension, plus a residual connection. During fine-tuning, only the adapter parameters are trained while the original model weights remain frozen. Adapters were one of the earliest parameter-efficient fine-tuning methods, predating LoRA. They add a small amount of latency during inference since the adapter computation occurs sequentially within each layer (unlike LoRA, which can be merged into the weights). Adapters are particularly useful in multi-task settings, where different adapters can be loaded for different tasks. The AdapterHub library provides a comprehensive ecosystem for training, sharing, and composing adapters across many pre-trained models.

Related Terms

More in Generative AI / LLM

Explore More