Skip to content

Training, adaptation, compression, and systems techniques · Training, fine-tuning, adaptation, compression, and systems techniques · TRN023 · Training method

IA3 activation rescaling

Adapts a frozen transformer by learning small vectors that rescale selected internal activations.

Explained here Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

Documented in the Academy only. There's no Set up button.

Availability
Explained here
Code example
Component demo, not a trained model
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Adapts a frozen transformer by learning small vectors that rescale selected internal activations.

Question / hypotheses

Does this intervention improve the intended quality, adaptation, resource, or reliability objective under a controlled comparison? It defines a method, not an intrinsic null-hypothesis test.

Architecture / computational structure

Learned scales modify attention keys/values and feed-forward activations in the published design; most backbone weights remain frozen.

Assumptions

Scaling vectors must align with the intended channels and preserve initial behavior. The restricted update may be insufficient for a large task shift.

Formula / computational definition

K′=K⊙lk,V′=V⊙lv,hff′=hff⊙lff.K^\prime=K\odot l_k,\quad V^\prime=V\odot l_v,\quad h_{ff}^\prime=h_{ff}\odot l_{ff}.

Parameters and notation

Learned: l_k,l_v,l_ff and optional task head. Hyperparameters: target modules, learning rate, regularization, initialization, training data and stopping rule.

Fitting, fine-tuning, and adaptation

Initialize scales to one, freeze backbone weights, and optimize a suitable task objective. Verify that gradients flow only to intended scales and that adapter serialization preserves module mapping.

How to use and calibrate

Compare quality and training memory with prompt tuning, LoRA, and full adaptation. Example: few-shot language task adaptation.

Example application

few-shot language task adaptation.

Interpretation / pitfalls

Watch out

IA3 is a learned rescaling mechanism, not input prompting. Different module choices are variants and should not be silently equated with the published recipe.

Python and R code examples

Scope: numerical mechanism demonstration. Validation: Python executed successfully on the supplied synthetic inputs; R reviewed but not executed (Rscript unavailable).

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — numerical mechanism demonstration. · needs numpy

import numpy as np
H=np.array([[1.,2.,3.],[2.,1.,0.]]); scale=np.array([1.,.8,1.2])
print(H*scale)
R

Component demo, not a trained model — numerical mechanism demonstration.

H <- rbind(c(1,2,3),c(2,1,0)); scale <- c(1,.8,1.2)
print(sweep(H,2,scale,"*"))

Sources

From the CodeSplash reference, entry TRN023.