AI State of the Art
SOTA/Efficient Fine-tuning (PEFT)/27 min
Section 108

IA3 (Infused Adapter by Inhibiting and Amplifying Inner Activations)

Listen as a podcast →

The Lightest Fine-Tuning Method in the Module

The name first, since it is entirely descriptive. IA³, or (IA)³, stands for Infused Adapter by Inhibiting and Amplifying Inner Activations. The cube counts the three words starting with I or A. Put plainly: nothing is added to the model, you simply turn the volume up or down on what flows through it.

The flaw it fixes: LoRA adds two matrices per targeted matrix, hence tens of millions of parameters to learn. When you have only a dozen training examples, that is far too many: the model has room to memorize them instead of extracting a rule. IA³ comes down to a few hundred thousand parameters.

No new layer, no matrix. Just vectors whose every component multiplies one dimension. Rather than rewiring the circuit, you turn volume knobs.

Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learning (Liu et al., 2022)
The Principle in One Sentence

IA³ learns three vectors per layer: one for attention's keys (lkl_k), one for its values (lvl_v), and one for the small neural network that follows, the feed-forward network, abbreviated FFN (lffl_{ff}).

Each of these vectors performs an element-wise multiplication: its first component multiplies the first dimension, its second the second, and so on. Nothing more.

The Idea: Intelligently Multiplying Activations

Attention Scaling

In each attention layer, two interventions only:

K′=lk⊙KV′=lv⊙VK' = l_k \odot K \qquad V' = l_v \odot V

The ⊙\odot symbol means element-wise multiplication: no matrix product here, just each number multiplied by its counterpart. KK and VV are the keys and values computed on the text, lkl_k and lvl_v the two learned vectors, as wide as the model.

It is a colour filter held in front of an image: some dimensions amplified, others dimmed.

Why keys and values and not queries? Because the three enter attention asymmetrically: queries and keys are paired against each other, so scaling one or the other has much the same effect on the score. Tuning both would be redundant.

Scaling the activation or scaling the weight matrix: same thing

Here is a point that makes the whole page clearer, and it applies to LoRA too.

The keys are computed as K=WKxK = W_K x, where WKW_K is a learned and frozen weight matrix and xx the layer's input. IA³ then computes lk⊙Kl_k \odot K.

But multiplying the result element-wise by lkl_k, or pre-multiplying each row of the weight matrix WKW_K by the matching component of lkl_k, gives the exact same number. The two formulations are equivalent.

The practical consequence: once training is done, the vectors can be absorbed into the weight matrices and you serve an ordinary model, with no extra multiplication. IA³ therefore costs nothing at inference, for the same reason LoRA does not.

The FFN's lffl_{ff} vector, on the other hand, applies after a non-linear function: that one cannot be absorbed so simply, exactly as the non-linearity inside adapters forbids merging them.

Diagram of a Transformer block. At the bottom, an orange attention sub-block contains three squares labelled Q, K and V; two vertical pink bars connect to element-wise product symbols placed right after K and after V, and the three streams then flow up into a grey output bar. Above, a blue feed-forward sub-block shows two black trapezoids, an up-projection then a down-projection, with a third pink bar between them connected to an element-wise product symbol. Two light normalization bars and residual connections frame the two sub-blocks.
The three pink bars are the only parameters IA3 trains. Two sit inside attention, right after the keys and the values (never on the queries), the third sits in the middle of the feed-forward. Everything else in the block, in black, stays frozen.Source : Eva Koroleva, PEFT Method Overview

Modulating the FFN

The feed-forward network does three things: a projection out to a wider dimension, a non-linear function, then a projection back. IA³ slots in between the second and the third:

FFN(x)=(lff⊙activation(W1x))×W2\text{FFN}(x) = (l_{ff} \odot \text{activation}(W_1 x)) \times W_2

Symbol by symbol: xx is the network's input; W1W_1 and W2W_2 are its two weight matrices, learned during pre-training then frozen; "activation" is the non-linear function; lffl_{ff} is the only learned parameter here, one coefficient per neuron of the wide layer; ⊙\odot is still element-wise multiplication.

In words: lffl_{ff} decides which neurons of the network count for your task, and how much.

Two-part figure. On the left, under the title (IA)3: the V, K and Q blocks at the bottom; the vector l_k multiplies K before the softmax, and the vector l_v multiplies V after it; next to it, a second diagram shows a Dense layer, a nonlinearity, then the vector l_ff multiplying the activations before the following Dense layer. On the right, under the title Losses used in T-Few: a passage of text asking for a possible continuation of a story enters a T0 model, which produces a correct answer in green tied to the losses L_LM and L_LN, and an incorrect answer in red tied to the loss L_UL.
The original figure from the paper. On the left, the only three insertion points: l_k on the keys before the softmax, l_v on the values after it, and l_ff between the nonlinearity and the second feed-forward projection. The right side shows the other ingredient of the T-Few recipe, the three losses combined during training.Source : T-Few / IA3 paper by Liu et al. (2022), figure 1, via ar5iv

Initialization: Starting from Identity

All the vectors are initialized to 1, i.e. they contain nothing but ones. Multiplying by 1 changes nothing: at the outset, the model behaves exactly as before. Training then lets those values drift.

It is the same principle as LoRA's B matrix initialized to zero, or the adapters' residual connection: start from the identity, so nothing breaks before anything is learned. Note the difference: for an addition the neutral element is 0; for a multiplication it is 1.

The Numbers: Ridiculously Compact

Work it out on LLaMA-2 7B: 32 layers, width d=4096d = 4096, FFN inner width dff=11,008d_{ff} = 11{,}008.

Per layer, three vectors, each as long as whatever it multiplies:

4096⏟lk+4096⏟lv+11,008⏟lff=19,200\underbrace{4096}_{l_k} + \underbrace{4096}_{l_v} + \underbrace{11{,}008}_{l_{ff}} = 19{,}200

Across the 32 layers: 32×19,200=614,40032 \times 19{,}200 = 614{,}400 parameters. Against the model's 6.74 billion: 614,400/6.74×109=0.009%614{,}400 / 6.74 \times 10^9 = 0.009\%, one parameter in eleven thousand.

Two comparisons to place it:

  • Against rank-8 LoRA on the four attention matrices, which counts 8×8192×4×32=8.48 \times 8192 \times 4 \times 32 = 8.4 million parameters: fourteen times fewer.
  • As a file, at 2 bytes per parameter: 614,400×2=1.2614{,}400 \times 2 = 1.2 megabytes. Against 34 MB for a rank-16 LoRA.

Note that IA³'s formula contains no setting at all: no rank to pick, no prefix length. The parameter count is dictated entirely by the model's architecture. It is the only method in the module with that property.

What the Paper Actually Claims

The paper's setting is few-shot learning: only five to thirty-two training examples are available. Two ways of using them compete:

  • in-context learning: just put the examples in the instruction and train nothing;
  • efficient fine-tuning: actually train, but very few parameters.

The paper's title settles it: the second is "better and cheaper" than the first. What is checkable in its abstract: the full recipe, named T-Few and built on the T0 model, beats the state of the art by 6 points absolute on the RAFT benchmark and reaches super-human level there for the first time.

The abstract does not claim to beat full fine-tuning. That is what figure 2 of the paper (reproduced below) shows, in this specific very-few-examples setting, and the reason is simple: with half a million free parameters and ten examples, the model has no room to memorize them. It is forced to generalize.

Why Scaling Works: Inhibition and Amplification

The name says it all: inhibit and amplify. Each learned component falls into one of three regimes.

  • A value near 0 switches the dimension off. The model has learned it carried nothing but noise for this task.
  • A value above 1 amplifies it. The model puts the spotlight on it.
  • A value near 1 leaves it alone, preserving the original behaviour.

This is learned feature selection. Where LoRA transforms the representations (rotates them, recombines them) IA³ merely picks which ones to keep. An audio mixer: you do not change the instruments, you set the volume on each track.

How This Differs from Attention

Attention answers the question "which words in the text matter?". IA³ answers a different one: "which dimensions of the representation matter for my task?"

The distinction is the same one that runs through this whole module. Attention is recomputed for every text; it depends on what is being read. IA³'s vectors are learned once and depend on no text at all.

Comparison: Who Weighs How Much?

All the figures below are for a 7-billion-parameter model, and follow from the formulas given on each page.

MethodLearned parametersShare of the modelWhat is modifiedAdded latency
Prompt tuning, 20 fake words81,9200.0012%the inputnegligible
IA³614,4000.009%one coefficient per dimensionnone, absorbed into the weights
Prefix tuning, prefix of 205.2 million0.08%the input of every layerslight
LoRA rank 8 on attention8.4 million0.12%the targeted matricesnone, merged
Adapterstens of millionsabout 0.3%inserted layerssignificant
Full fine-tuning6.74 billion100%everythingnone
Scatter plot. The horizontal axis shows the percentage of parameters updated on a logarithmic scale from 0.001% to about 0.3%; the vertical axis shows accuracy from 50 to 65. A dashed horizontal line at about 63 is labelled All parameters. The yellow star for (IA)3 is the only point above that line, at about 0.02% of parameters. LoRA, a purple triangle, reaches a close score but at about 0.2% of parameters. Prompt Tuning, green squares, is the lowest. BitFit, Layer Norm, Compacter, Prefix Tuning, Adapter, FISH Mask and Intrinsic SAID fall in between.
The same ranking as the table, seen as a picture: the further left, the fewer parameters the method costs, and the higher up, the better the accuracy. The IA3 star is the only point that is both far left and above the full fine-tuning line. One caveat: this is measured few-shot on the T0 task suite, not on heavy domain adaptation.Source : T-Few / IA3 paper by Liu et al. (2022), figure 2, via ar5iv
When to Use IA³?

In the extreme cases: very few training examples, very constrained storage, or thousands of micro-tasks each with a handful of examples.

The storage arithmetic, for ten thousand clients each with their own preferences:

  • ten thousand sets of IA³ vectors, at 1.2 MB: 12 GB;
  • ten thousand rank-16 LoRA adapters, at 34 MB: 340 GB;
  • ten thousand soft prompts, at 164 KB: 1.6 GB, less still, but prompt tuning only works well on very large models.

So the choice is not only about size: it is a trade-off between storage, the size of the model you have, and how much training data you hold.

Honest Limitations

An Expressiveness Bounded by the Maths

This is not an impression, it is a constraint of form. IA³ can only rescale dimensions one at a time; it can never mix dimension 7 with dimension 342. LoRA can, since its product B×AB \times A recombines dimensions with each other.

The consequence: for a deep adaptation (moving from medical to legal, learning a new language) IA³ lacks the means. It can steer the model, not turn it around.

Tasks That Require Learning Something New

As soon as new associations have to be learned rather than existing ones amplified, LoRA takes the lead. We put no number on that gap: it depends entirely on the task and we have no reference measurement to cite. The direction, though, follows from the constraint above.

Do Not Confuse with Layer Normalization

IA³ multiplies activations by learned coefficients. Layer normalization does something that looks similar: it too has a learned multiplicative coefficient per dimension, conventionally written γ\gamma, plus an additive shift β\beta.

The difference lies in what comes before. Layer normalization first pulls the activations to mean zero and standard deviation one (that is its job, keeping magnitudes in check) and its γ\gamma and β\beta only give the network back the freedom just taken from it. IA³ normalizes nothing: it modulates directly.

Implementation: A Few Lines Are Enough

from peft import IA3Config, get_peft_model

config = IA3Config(
    target_modules=["k_proj", "v_proj", "down_proj"],
    feedforward_modules=["down_proj"],
)

model = get_peft_model(base_model, config)
model.print_trainable_parameters()
# On LLaMA-2 7B: 614,400 trainable parameters
# out of 6,738,415,616 total, i.e. 0.009%

Note the three targets named in the code: k_proj and v_proj are the weight matrices for keys and values, down_proj the FFN's return projection. That is exactly the list of three vectors described above, and the absence of q_proj confirms that queries are left alone.

A 1.2 MB file to save. Hugging Face's PEFT library ships IA3Config directly.

Place in the Ecosystem

LoRA remains the majority choice, because it strikes a better balance between expressiveness and cost in the common case: plenty of training data. IA³ keeps a domain of its own, the very-few-examples regime, where the advantage flips.

The lesson outlives the method: tiny, well-placed modifications to internal activations suffice to reorient a giant model. That says something about how these models store information, apparently, much of what a new task needs is already there, and only has to be brought forward.

The full comparison of the module's methods is in PEFT: comparing the methods.


In short. IA³ shows that adapting a 7-billion-parameter model does not necessarily take millions of new parameters. Knowing which dimensions to amplify and which to switch off is sometimes enough, 614,400 numbers, a 1.2 MB file, no setting to choose, and nothing to pay at inference.

Check your understanding0 / 5

1. Why does IA³ cost nothing at inference, even though it adds multiplications in every layer?

2. Why does IA³ scale the attention's keys and values, but never the queries?

3. IA³'s vectors are initialized to 1, whereas LoRA initializes its B matrix to 0. A contradiction?

4. What is IA³'s fundamental expressiveness limit?

5. Layer normalization also has a learned multiplicative coefficient per dimension. What sets it apart from IA³?