Skip to content

Adapters, prefixes, rescaling and biases: other small ways to adapt

Four more ways to adapt a frozen network - bottleneck adapters, learned prefixes, IA3 rescaling vectors and bias-only BitFit - compared by what they train, what they cost at prediction time, and whether they can be merged away.

Advanced ~14 min9 steps

What runs in CodeSplash

You will be able to

  • Describe where a bottleneck adapter, a prefix, an IA3 vector and BitFit act inside a layer
  • Compare their trainable-parameter counts with LoRA's
  • Say which ones add cost at prediction time and which can be folded into the weights
  • Name the one that runs in CodeSplash today

Read first

01

Four places to add a few weights

Read

Every method in this lesson freezes the pretrained network and trains something small. They differ in where the trainable numbers sit:

MethodWhat trainsWhere it acts
AdaptersA small bottleneck layerAfter a sublayer's output
Prefix tuningVirtual key and value vectorsInside every attention layer
IA3One multiplier per channelOn keys, values and feed-forward activations
BitFitThe existing bias terms onlyEverywhere a layer has a bias
02

Bottleneck adapters

Read

Adapter layersAdapter layersSmall trainable bottleneck layers (down-project, nonlinearity, up-project, add back) inserted into a frozen network. project a hidden vector hh down to a small width mm, apply a nonlinearity, project back up and add the result:

h′=h+Wup σ(Wdown h).h' = h + W_{\text{up}}\, \sigma(W_{\text{down}}\, h).

WupW_{\text{up}} starts near zero, so the network starts unchanged. Each adapter trains about 2dm2dm numbers for width dd. In the reference's example, a two-number hidden state becomes 0.428 and −0.214: a small learned nudge.

Adapters add layers, so every prediction does a little more work, and the nonlinearity means they can't be folded into the frozen weights.

03

Prefix tuning

Read

Prefix tuningPrefix tuningLearn a few virtual key and value vectors that every attention layer attends to, while every model weight stays frozen. learns a few key and value vectors that every attention layer sees in front of the real tokens. No weight changes; the prefix changes what attention retrieves.

In the reference's example, a query attends over two prefix keys and two token keys; the prefix positions take 0.226 and 0.196 of the attention. Those shares come out of the context: the prefix occupies positions and compute at every step, and it can't be merged away.

04

IA3: one multiplier per channel

Read

IA3IA3 activation rescalingAdapt a frozen network by learning one multiplier per channel for its keys, values and feed-forward activations. learns three vectors per layer that rescale the keys, the values and the feed-forward activations channel by channel. They start at one, so the base model is the starting point.

In the reference's example, a row (1,2,3)(1, 2, 3) times scales (1,0.8,1.2)(1, 0.8, 1.2) becomes 1.0, 1.6 and 3.6. IA3 trains even fewer numbers than LoRA, and a rescaling of a linear layer's output can be folded into that layer's weights.

05

BitFit: only the biases

Read

BitFitBitFitFine-tuning only a network's bias terms and keeping every weight matrix frozen. trains nothing but the bias terms that already exist. In the reference's example, one gradient step on the bias alone moves the layer's output to 2.597, with the weights WW untouched.

BitFit runs in CodeSplash: on a trained neural-network model, Make a model from this → Adapt to new data, adapter BitFit. The adapted model needs nothing extra at prediction time. It can only shift each unit's input, so it suits small shifts in the data, not new behavior.

06

Which costs what?

Predict

Predict first

After training, which two methods still add work to every prediction, however small their parameter count?

Adapters and prefixesLoRA and IA3BitFit and LoRA
Reveal

Adapters and prefixes. An adapter is an extra nonlinear layer; a prefix takes attention positions. LoRA's BA and IA3's rescaling can be folded into the weights, and BitFit only changes existing biases.

07

What runs here

Read
08

Check: small adaptations

Checkpoint

Check yourself

Why is a bottleneck adapter's up-projection started near zero?

Show the answer

Answer: a

With W_up ≈ 0 the adapter adds almost nothing at first; training grows it only as far as the task needs.

Check yourself

Can a trained bottleneck adapter be folded into the frozen layer's weights like LoRA?

Show the answer

Answer: b

LoRA's update BA is linear, so W0 + BA is one matrix. An adapter computes h + W_up σ(W_down h), which no single matrix reproduces.

Check yourself

What does prefix tuning train?

Show the answer

Answer: a

The weights stay frozen; the learned prefix changes what each attention layer attends to.

Check yourself

A model allows 2,048 tokens of context. You add a prefix of 100 virtual tokens. What changes at prediction time?

Show the answer

Answer: a

Prefixes are cheap to store but not free to run, and they share the attention budget with your real tokens.

Check yourself

What does IA3 learn in each adapted layer?

Show the answer

Answer: a

Elementwise rescaling is the smallest change of all: one number per channel.

Check yourself

For a layer of width d, which trains fewer numbers than LoRA at rank 8?

Show the answer

Answer: a

IA3 trains one multiplier per channel and BitFit one bias per unit; LoRA trains r(d + k) = 16d for d = k and r = 8.

Check yourself

How do you adapt a trained CodeSplash network by its biases only?

Show the answer

Answer: a

BitFit is one of the adapter strategies for neural-network learners. The result is an ordinary run that remembers which model it came from.

Check yourself

When is BitFit least likely to be enough?

Show the answer

Answer: b

Biases only shift each unit's input; they can't change how the weights mix the inputs.

09

Recap

Recap
  • Adapters add bottleneck layers; prefixes add attention positions; IA3 rescales channels; BitFit trains biases.
  • Adapters and prefixes cost something at every prediction; IA3, LoRA and BitFit can disappear into the weights.
  • BitFit runs in CodeSplash as an Adapt strategy; adapters, prefixes and IA3 are explained here.

Concepts in this lesson