Skip to content
module

IA3

6 members
lucid.peft.tuners.ia3

lucid.peft.tuners.ia3 — (IA)^3: one learned rescaling vector per layer.

(IA)^3 (Liu et al., 2022, arXiv:2205.05638 — Infused Adapter by Inhibiting and Amplifying Inner Activations) learns a vector ℓ\ell per adapted layer that rescales its output channels, y=ℓ⊙(Wx+b)y = \ell\odot(Wx + b), or, for a block's feed-forward layers, its input, y=W(ℓ⊙x)+by = W(\ell\odot x) + b. It starts at ones, so the adapted model starts as the base, and it folds into the weight. Pick it for an adapter of one vector per layer, when rescaling channels is enough; that carries less than a low-rank update.

Where the reference library keeps them, so isinstance(m, IA3Layer) and from lucid.peft.tuners.ia3 import Linear read as they do there. One layer type per module the method adapts: Linear and the convolutions Conv2d / Conv3d. IA3Config and IA3Model are here and exported from lucid.peft. Importing the package registers the method (its config under PeftType.IA3, its tuner and layers), which is what makes get_peft_model and PeftModel.from_pretrained know it.

Paper

Liu, Haokun, et al. "Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learning." [arXiv:2205.05638](https://arxiv.org/abs/2205.05638), 2022.

Overview

(IA)^3 (Liu et al., 2022, arXiv:2205.05638 — "Infused Adapter by Inhibiting and Amplifying Inner Activations") freezes the model and learns one vector ℓ\ell per targeted layer that rescales its output channels, y=ℓ⊙(Wx+b)y = \ell \odot (W x + b); for the feed-forward layers of a block it rescales the input instead, y=W(ℓ⊙x)+by = W (\ell \odot x) + b. The vector starts at ones, so the adapted model starts as the base, and it folds into the weight (and bias), so a merged model costs what the base does.

Classes