Adapter tuning

Also known as: adapter layers · adapters

On this page 7

Adapter tuning is a parameter-efficient fine-tuning method in which small trainable modules, called adapter layers or simply adapters, are inserted into a pretrained neural network while the original weights stay frozen. In artificial intelligence, it is a training technique that lets one large base model serve many tasks, because each task only needs its own adapter, typically 0.5-5% of the base model’s parameters.

The method was popularized for transformer language models around 2019 and became the first widely used alternative to full fine-tuning. Later approaches such as LoRA, prefix tuning and prompt tuning share its goal of adapting a model cheaply without rewriting it, but they differ in where and how the new parameters enter the computation.

How adapter layers work inside a transformer

A classic adapter is a bottleneck feed-forward block with a residual connection. It projects the hidden state of dimension d down to a much smaller dimension r, applies a nonlinearity, and projects back up to d. The output is added to the original hidden state, so the adapter learns a small correction rather than a full replacement.

The adapter’s up-projection is usually initialized near zero. At the start of training the adapter therefore behaves almost like an identity function, and the model begins from exactly the behavior of the pretrained network. This near-identity initialization makes training stable even with relatively high learning rates.

The table below summarizes the main components and design choices of a standard adapter.

ComponentTypical choicePurpose
Down-projectionLinear layer d to r, r often 8-256Compresses the representation
NonlinearityReLU or GELUAllows nonlinear task-specific changes
Up-projectionLinear layer r to d, near-zero startRestores the hidden size
Residual connectionAdds adapter output to inputPreserves pretrained behavior
PlacementAfter attention, after feed-forward, or bothSets capacity and inference cost
Components of a bottleneck adapter

During training, gradients flow through the whole network, but the optimizer updates only the adapter weights, and usually the layer normalization parameters and the task head. Memory for optimizer states shrinks accordingly, which is where most of the training cost savings come from.

Adapter variants and configurations

Several adapter architectures exist, and they differ mainly in placement, size and how adapters combine. The bottleneck size r is the main capacity knob: larger values improve accuracy on hard tasks but increase parameters and latency.

VariantKey ideaWhen it fits
Houlsby adapterTwo adapters per block, after attention and feed-forwardMaximum quality with modest budget
Pfeiffer adapterOne adapter per block after feed-forwardLower cost with similar accuracy
Parallel adapterAdapter runs beside a sublayer, not after itReduced sequential latency
AdapterFusionLearns attention over several task adaptersCombining knowledge from many tasks
Language adaptersSeparate adapters per languageCross-lingual transfer, as in MAD-X
Common adapter variants

Because each adapter is a separate file of a few megabytes, teams can store hundreds of task adapters for one shared base model. Switching tasks means loading a different adapter instead of a different multi-gigabyte checkpoint.

Adapter tuning belongs to the family of parameter-efficient methods, and the main differences lie in inference cost and mergeability. The comparison below shows how adapters relate to the neighboring techniques that practitioners most often weigh against them.

MethodWhat is trainedExtra inference cost
Full fine-tuningAll model weightsNone, but one full copy per task
Adapter tuningInserted bottleneck modulesSmall added latency per layer
LoRALow-rank updates to weight matricesNone after merging into weights
Prefix tuningTrainable key and value vectorsLonger effective attention context
Prompt tuningSoft prompt embeddings at the inputSlightly longer input sequence
Adapter tuning and neighboring methods

The most important practical contrast is with LoRA. A LoRA update can be merged into the base weights after training, leaving zero inference overhead, while a classic adapter adds extra sequential layers that remain at inference time. On large models served at scale, this difference explains why LoRA largely displaced adapters for language model customization, although adapters remain common in research and multilingual and multi-task systems.

Benefits and practical use

Adapter tuning is chosen when many tasks must share one base model or when training hardware is limited. Its modularity also reduces the risk of catastrophic forgetting, because the pretrained weights are never changed.

  • Storage efficiency: each task adds megabytes instead of a full model copy.
  • Modularity: adapters can be swapped, stacked or combined per request.
  • Stable training: near-identity initialization keeps early updates safe.
  • Preserved base skills: the frozen backbone keeps its general knowledge.

Typical settings use a learning rate of about 1e-4 to 1e-3, which is higher than the rates used for full fine-tuning, because only a small number of freshly initialized weights are trained. A bottleneck of r = 16 to 64 is a common starting point for mid-sized models.

Limitations and common mistakes

Adapters are efficient, but they are not a free substitute for full fine-tuning. On tasks that differ sharply from the pretraining data, a small bottleneck may lack the capacity to learn the required behavior.

ProblemCauseFix
Accuracy well below full fine-tuningBottleneck too smallIncrease r or add adapters per sublayer
Higher serving latencySequential adapter layersUse parallel adapters or LoRA
Unstable early trainingRandom up-projection initializationInitialize near zero
Adapter fails on new base versionAdapters tied to exact weightsRetrain for each base checkpoint
Frequent problems with adapter tuning

A frequent misconception is that an adapter trained on one model transfers to any other model. It does not: an adapter is coupled to the hidden dimensions and learned representations of the specific base checkpoint it was trained on.

In simple terms

Picture a large, expensive reference book. You do not rewrite the book for each new job. Instead, you add small sticky notes to certain pages. Each note adjusts how one page is read.

Adapter tuning works the same way for an AI model. The big model stays unchanged. Small add-on parts learn the new job. You can keep one set of notes per job and swap them quickly. This saves memory, time and money.

A practical example

A company that runs customer support in 12 languages needs one text classifier per language to route tickets. Fine-tuning a separate copy of a multilingual transformer for each language would require storing and serving 12 full models of several gigabytes each.

The machine learning team instead freezes one shared base model and trains a Pfeiffer adapter with r = 48 for each language on about 20,000 labeled tickets. Each adapter file is only a few megabytes. Routing accuracy lands within about one percentage point of full fine-tuning, while one server loads the shared backbone once and switches adapters per request.