All papersFoundationsClassic
Tune a huge model by training two tiny matrices
Paper: LoRA: Low-Rank Adaptation of Large Language Models
Edward Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, Weizhu Chen · arXiv · Posted · 22 min read · arXiv 2106.09685
- Fine-tuning retrains every weight.
- Each task then needs a full copy of the model.
- For GPT-3 175B, that copy is huge.
- Adapters and prefixes save space but add delay or lose quality.
10,000xfewer trainable parameters than fine-tuning GPT-3 175B with Adam.
- They froze the model and added small low-rank matrices.
- They tested RoBERTa, DeBERTa, GPT-2 and GPT-3 175B.
- They compared with fine-tuning, adapters and prefix methods.
- They studied why a very low rank works.
- LoRA matches or beats full fine-tuning on quality.
- It needs 3 times less GPU memory.
- It adds no inference delay after merging.
- A rank of 1 or 2 can be enough.
LoRA with 4.7M parameters matches full fine-tuning on WikiSQLFrom Table 4Hover, tap or focus a bar to read its exact value.
| Method | Accuracy (%) |
|---|
| Fine-tune (175B) | 73.8 |
| BitFit (14.2M) | 71.3 |
| PreEmbed (3.2M) | 63.1 |
| PreLayer (20.2M) | 70.1 |
| AdapterH (40.1M) | 73.2 |
| LoRA (4.7M) | 73.4 |
- Merged LoRA cannot batch different tasks in one pass.
- A very low rank may fail on tasks far from pre-training.
- The paper tuned only attention weights, not the MLP.
- Hyperparameters were chosen by heuristics.
Jump to
Every detail from the paper
Cards follow the paper's own order. Dotted words link to Words to know. Numbers match the paper.
The problem
- Large models are pre-trained, then adapted to each task.
- Full fine-tuning retrains all parameters.
- For GPT-3 175B, keeping one full copy per task costs far too much.
The idea
- LoRA freezes the pre-trained weights.
- It adds small trainable low-rank matrices to each Transformer layer.
- This cuts trainable parameters a lot.
The result
- Versus GPT-3 175B fine-tuned with Adam, LoRA cuts trainable parameters by 10,000 times.
- It cuts GPU memory by 3 times.
- Quality is on par or better on RoBERTa, DeBERTa, GPT-2 and GPT-3.
- Unlike adapters, it adds no inference latency.
Extras
- They also study why low rank works.
- They release a PyTorch package, plus code and checkpoints for RoBERTa, DeBERTa and GPT-2.
The cost of fine-tuning
- Many NLP apps adapt one large pre-trained model to many tasks.
- Fine-tuning updates all its parameters.
- The new model is as big as the original.
- For GPT-3 with 175 billion trainable parameters, that is a deployment problem.
Earlier fixes
- Some methods train only some parameters or add outside modules.
- Then each task needs only a few stored parameters.
- But adapters often add inference latency, or shrink the usable sequence length.
- They often fail to match fine-tuning quality.
How LoRA changes one weight matrixFrom Figure 1 and Section 4.1- Input x enters two paths
- W0Frozen weights compute W0 x
- A shrinks x to r values
- B grows back to d values
- Add both outputs to get h
Only A and B train. B starts at zero, so training begins at the original model.
The hunch
- Earlier work says trained models live in a low intrinsic dimension.
- The authors guess the change in weights has a low intrinsic rank.
- So they train two small matrices whose product is the change.
- On GPT-3 175B, r can be one or two.
- The full rank d is 12,288.
Four advantages
- 1. One shared model, many small LoRA modules.
- Swap matrices A and B to switch tasks.
- 2. Training is cheaper. The hardware barrier drops by up to 3 times.
- 3. Merge the matrices into the frozen weights for deployment, so latency is unchanged.
- 4. It mixes with other methods, such as prefix-tuning (Appendix E).
Terms used
- Transformer layers have input and output size d_model.
- W_q, W_k, W_v and W_o are the query, key, value and output matrices of self-attention.
- W0 is a pre-trained matrix. Delta W is its update. r is the LoRA rank.
- The MLP size is 4 times d_model. Training uses Adam.
Setup
- The method suits any training goal, but they focus on language modeling.
- Task data are pairs of context x and target y, both token sequences.
- NL2SQL: x is a question and y is a SQL command.
- Summarization: x is an article and y is its summary.
Full fine-tuning
- Full fine-tuning starts at the pre-trained weights.
- It follows the gradient to raise the likelihood of the target tokens (Equation 1).
- Each task learns a new set of parameters as big as the original.
- GPT-3 has about 175 billion, so many copies are hard to store.
The efficient version
- Instead, encode the update with a much smaller parameter set Theta (Equation 2).
- For GPT-3 175B, Theta can be as small as 0.01% of the original.
The two strategies
- Two main strategies: add adapter layers, or tune input activations.
- Both have limits in large, latency-sensitive production.
Adapters add latency
- Adapters add compute that cannot be skipped.
- Two designs: Houlsby has two adapter layers per block. Lin has one, plus LayerNorm.
- Adapters are small, sometimes under 1% of the model.
- But big networks rely on parallel hardware, and adapters run in order.
- That hurts when batch size is as small as one.
Sharding makes it worse
- Sharding the model needs more sync steps, such as AllReduce and Broadcast.
- Unless adapter weights are stored many times.
Adapters slow inference most when batches are smallFrom Table 1AdapterLAdapterH
Hover, tap or focus a bar to read its exact value.
| Setup | AdapterL (%) | AdapterH (%) |
|---|
| Batch 32, length 512 | 2.2 | 3.0 |
| Batch 16, length 256 | 5.0 | 8.4 |
| Batch 1, length 128 | 20.7 | 30.3 |
| Method | Batch 32, length 512 | Batch 16, length 256 | Batch 1, length 128 |
|---|
| Fine-Tune / LoRA | 1449.4 | 338.0 | 19.8 |
| AdapterL | 1482.0 (+2.2%) | 354.8 (+5.0%) | 23.9 (+20.7%) |
| AdapterH | 1492.2 (+3.0%) | 366.3 (+8.4%) | 25.8 (+30.3%) |
Table 1: GPT-2 medium inference latency (ms)
Trainable parameters in the adapters: 0.5M, 11M, 11M. Averaged over 100 trials on an NVIDIA Quadro RTX8000.
Tuning the prompt is hard
- Prefix tuning is hard to optimize.
- Its performance changes non-monotonically with trainable parameters.
- It reserves part of the sequence length for tuning.
- That leaves less length for the real task.
The hypothesis
- Dense layers multiply by a weight matrix, usually full-rank.
- Earlier work shows models adapt well even in a small random subspace.
- So the authors guess the weight update also has a low intrinsic rank.
The formula in words
- For a pre-trained matrix W0 (d by k), write its update as B times A.
- B is d by r. A is r by k.
- The rank r is far below d and k.
- W0 is frozen. Only A and B train.
- Both paths take the same input and their outputs are summed (Equation 3).
Starting values and scaling
- A starts with random Gaussian values. B starts at zero.
- So the update is zero at the start of training.
- The update is scaled by alpha over r. Alpha is a constant in r.
- Tuning alpha is much like tuning the learning rate.
- They set alpha to the first r they try and do not tune it.
- This avoids re-tuning when r changes.
A generalization of fine-tuning
- Fine-tuning can train a subset of parameters.
- LoRA does not need the update to be full rank.
- Apply LoRA to all matrices and train all biases.
- Set r to the full rank of the weights.
- Then you roughly recover full fine-tuning.
- Adapters converge to an MLP.
- Prefix methods converge to a model that cannot take long input.
Serving many tasks with LoRAFrom Section 4.1- Merge: W = W0 + BA
- Run inference as usual
- Task switch: subtract BA
- Add B'A' for the new task
No added latency by construction. Switching is quick and uses little memory.
Where it goes
- A Transformer has four weight matrices in self-attention: Wq, Wk, Wv, Wo.
- It has two in the MLP module.
- They adapt only the attention weights and freeze the MLP, for simplicity.
- Section 7.1 tests which attention matrices to adapt.
- MLP layers, LayerNorm and biases are left for future work.
Practical benefits
- Memory: up to 2/3 less VRAM when r is far below d_model.
- GPT-3 175B training memory falls from 1.2TB to 350GB.
- With r = 4 on query and value matrices, the checkpoint shrinks about 10,000×.
- It drops from 350GB to 35MB.
- Training is 25% faster on GPT-3 175B.
Storage and speed
- Task switching is cheap: swap only the LoRA weights.
- You can serve many custom models from one stored base model.
- Storing 100 adapted models needs about 354GB, not about 35TB.
- Throughput on GPT-3 175B: 32.5 tokens/s for full fine-tuning, 43.1 for LoRA, per V100.
Limit
- Merged A and B make it hard to batch different tasks in one pass.
- You can skip merging and choose modules per sample, if latency is not critical.
Plan
- They test RoBERTa, DeBERTa and GPT-2, then scale to GPT-3 175B.
- Language understanding: the GLUE benchmark, for RoBERTa and DeBERTa.
- GPT-2 follows Li and Liang for a direct comparison.
- GPT-3 adds WikiSQL (NL to SQL) and SAMSum (chat summaries).
- All runs use NVIDIA Tesla V100.
How they compare
- They reuse reported numbers where possible, so some baselines appear in only some tests.
Fine-tuning variants
- Fine-tuning (FT): all parameters update.
- FT-Top2: only the last two layers update (GPT-2).
- Bias-only (BitFit): only bias vectors train.
Prefix methods
- Prefix-embedding (PreEmbed): trainable tokens inserted in the input.
- Parameters: d_model times the number of tokens.
- Prefix-layer (PreLayer): learn activations after every Transformer layer.
- Parameters: L times d_model times the number of tokens.
Adapters
- AdapterH: two fully connected layers with a nonlinearity, inside each block.
- AdapterL: one adapter after the MLP and a LayerNorm.
- AdapterP: much like Pfeiffer. AdapterD: AdapterDrop, which drops some adapter layers.
- Numbers with an asterisk come from prior work.
LoRA
- LoRA adds pairs of matrices in parallel to existing weights.
- Most tests apply it to Wq and Wv only.
- Trainable parameters: 2 times the number of matrices times d_model times r.
Setup
- RoBERTa improved BERT's pre-training recipe.
- They use RoBERTa base (125M) and large (355M) from HuggingFace.
- They also replicate Houlsby and Pfeiffer setups.
- For fair comparison with adapters: same batch size, sequence length 128.
- For MRPC, RTE and STS-B, start from the pre-trained model, not one adapted to MNLI.
- Those runs are marked with a dagger.
| Model and method | Trainable parameters | GLUE average |
|---|
| RoBbase (FT) | 125.0M | 86.4 |
| RoBbase (BitFit) | 0.1M | 85.2 |
| RoBbase (AdptD) | 0.3M | 84.4 |
| RoBbase (AdptD) | 0.9M | 85.4 |
| RoBbase (LoRA) | 0.3M | 87.2 |
| RoBlarge (FT) | 355.0M | 88.9 |
| RoBlarge (LoRA) | 0.8M | 89.0 |
| RoBlarge (AdptP) | 3.0M | 88.4 |
| RoBlarge (AdptP) | 0.8M | 87.9 |
| RoBlarge (AdptH) | 6.0M | 87.8 |
| RoBlarge (AdptH) | 0.8M | 86.4 |
| RoBlarge (LoRA, dagger setup) | 0.8M | 88.6 |
| DeBXXL (FT) | 1500.0M | 91.1 |
| DeBXXL (LoRA) | 4.7M | 91.3 |
Table 2: GLUE results by method (average of 8 tasks)
Metrics: accuracy for most tasks, Matthew's correlation for CoLA, Pearson for STS-B. Higher is better.
Reading the table
- LoRA on RoBERTa base beats fine-tuning: 87.2 versus 86.4.
- On RoBERTa large, LoRA scores 89.0 against 88.9.
- On DeBERTa XXL, LoRA scores 91.3 against 91.1.
- RTE on RoBERTa base: LoRA 86.6, fine-tuning 78.7.
Setup
- DeBERTa XXL (1.5B) is a recent BERT variant trained at larger scale.
- They test if LoRA matches full fine-tuning on GLUE.
Setup
- They test whether LoRA also works on text generation.
- Setup follows Li and Liang, on the E2E NLG Challenge.
- WebNLG and DART are in Appendix F.1.
| Model and method | Trainable parameters | BLEU | CIDEr |
|---|
| GPT-2 M (FT) | 354.92M | 68.2 | 2.47 |
| GPT-2 M (AdapterL) | 0.37M | 66.3 | 2.40 |
| GPT-2 M (AdapterL) | 11.09M | 68.9 | 2.47 |
| GPT-2 M (AdapterH) | 11.09M | 67.3 | 2.44 |
| GPT-2 M (FTTop2) | 25.19M | 68.1 | 2.41 |
| GPT-2 M (PreLayer) | 0.35M | 69.7 | 2.49 |
| GPT-2 M (LoRA) | 0.35M | 70.4 | 2.53 |
| GPT-2 L (FT) | 774.03M | 68.5 | 2.45 |
| GPT-2 L (AdapterL) | 0.88M | 69.1 | 2.49 |
| GPT-2 L (AdapterL) | 23.00M | 68.9 | 2.45 |
| GPT-2 L (PreLayer) | 0.77M | 70.3 | 2.47 |
| GPT-2 L (LoRA) | 0.77M | 70.4 | 2.47 |
Table 3: E2E NLG Challenge (selected metrics)
Also reported: NIST, METEOR and ROUGE-L. LoRA beats several baselines with similar or fewer parameters.
Result
- This is the final stress test.
- Training is costly.
- They report a typical standard deviation over seeds, not one per entry.
- LoRA matches or beats fine-tuning on all three datasets.
| Method | Trainable parameters | WikiSQL accuracy (%) | MNLI-m accuracy (%) |
|---|
| GPT-3 (FT) | 175,255.8M | 73.8 | 89.5 |
| GPT-3 (BitFit) | 14.2M | 71.3 | 91.0 |
| GPT-3 (PreEmbed) | 3.2M | 63.1 | 88.6 |
| GPT-3 (PreLayer) | 20.2M | 70.1 | 89.5 |
| GPT-3 (AdapterH) | 7.1M | 71.9 | 89.8 |
| GPT-3 (AdapterH) | 40.1M | 73.2 | 91.5 |
| GPT-3 (LoRA) | 4.7M | 73.4 | 91.7 |
| GPT-3 (LoRA) | 37.7M | 74.0 | 91.6 |
Table 4: GPT-3 175B
SAMSum is also in the paper. Fluctuation: WikiSQL about 0.5%, MNLI-m about 0.1%.
LoRA with 4.7M parameters matches full fine-tuning on WikiSQLFrom Table 4Hover, tap or focus a bar to read its exact value.
| Method | WikiSQL (%) | MNLI-m (%) |
|---|
| Fine-tune (175B) | 73.8 | 89.5 |
| BitFit (14.2M) | 71.3 | |
| PreEmbed (3.2M) | 63.1 | 88.6 |
| PreLayer (20.2M) | 70.1 | 89.5 |
| AdapterH (40.1M) | 73.2 | 91.5 |
| LoRA (4.7M) | 73.4 | 91.7 |
Not monotone
- More trainable parameters do not always help (Figure 2).
- Accuracy drops with more than 256 special tokens for prefix-embedding.
- It drops with more than 32 tokens for prefix-layer.
- They suspect the input drifts away from the pre-training data.
- The low-data test is in Section F.3.
Three questions
- They study GPT-3 175B, where the cut is up to 10,000×.
- Question 1: which weight matrices should get LoRA, given a budget?
- Question 2: is the update really low rank, and what rank is good?
- Question 3: how does the update relate to the original weights?
Setup
- Budget: 18M parameters, about 35MB in FP16.
- That is r = 8 for one matrix type, or r = 4 for two.
- It covers all 96 layers.
| Weight type | Rank r | WikiSQL (%) | MultiNLI (%) |
|---|
| Wq | 8 | 70.4 | 91.0 |
| Wk | 8 | 70.0 | 90.8 |
| Wv | 8 | 73.0 | 91.0 |
| Wo | 8 | 73.2 | 91.3 |
| Wq, Wk | 4 | 71.4 | 91.3 |
| Wq, Wv | 4 | 73.7 | 91.3 |
| Wq, Wk, Wv, Wo | 2 | 73.7 | 91.7 |
Table 5: validation accuracy by weight type (18M parameters)
What it means
- Putting everything into Wq or Wk is much worse.
- Adapting Wq and Wv together works best.
- Even rank four holds enough information.
- It is better to adapt more matrices than one matrix with a bigger rank.
| Weights adapted | Rank r | WikiSQL (%) | MultiNLI (%) |
|---|
| Wq | 1 | 68.8 | 90.7 |
| Wq | 2 | 69.6 | 90.9 |
| Wq | 4 | 70.5 | 91.1 |
| Wq | 8 | 70.4 | 90.7 |
| Wq | 64 | 70.0 | 90.7 |
| Wq, Wv | 1 | 73.4 | 91.3 |
| Wq, Wv | 2 | 73.3 | 91.4 |
| Wq, Wv | 4 | 73.7 | 91.3 |
| Wq, Wv | 8 | 73.8 | 91.6 |
| Wq, Wv | 64 | 73.5 | 91.4 |
| Wq, Wk, Wv, Wo | 1 | 74.1 | 91.2 |
| Wq, Wk, Wv, Wo | 2 | 73.7 | 91.7 |
| Wq, Wk, Wv, Wo | 4 | 74.0 | 91.7 |
| Wq, Wk, Wv, Wo | 8 | 74.0 | 91.5 |
| Wq, Wk, Wv, Wo | 64 | 73.9 | 91.4 |
Table 6: validation accuracy by rank
A rank of one suffices for Wq and Wv. Wq alone needs more. Fluctuation: WikiSQL 0.5%, MultiNLI 0.1%.
Meaning and caution
- The update may have a very small intrinsic rank.
- A small r may not work for every task.
- A task in a new language might need full retraining, like r equal to d_model.
Subspace similarity between ranks
- They compare the learned matrices for r = 8 and r = 64.
- They use singular value decomposition and a similarity score from 0 to 1.
- 1 means full overlap. 0 means none.
- They look at the 48th layer of 96. Other layers agree.
Finding
- The top singular direction overlaps a lot between r = 8 and r = 64.
- Other directions do not.
- Wv and Wq share a one-dimensional subspace with similarity above 0.5.
- That explains why r = 1 works on GPT-3.
- The other directions look like noise gathered during training.
Between random seeds
- They compare two runs with different random seeds, both r = 64.
- Wq shows a higher intrinsic rank than Wv.
- That matches Table 6.
- Random Gaussian matrices share no directions.
The test
- They project W onto the directions of Delta W.
- They compare the Frobenius norm of the projection with other choices.
| Directions from | r = 4 | r = 64 |
|---|
| Delta Wq | 0.32 | 1.90 |
| Wq | 21.67 | 37.71 |
| Random | 0.02 | 0.33 |
Table 7: Frobenius norm of the projection (layer 48 of GPT-3)
||Wq|| is 61.95. ||Delta Wq|| is 6.91 for r = 4 and 3.57 for r = 64.
Three conclusions
- First: Delta W links to W more than a random matrix does.
- It boosts features already in W.
- Second: it does not repeat W's top directions.
- It boosts directions W does not stress.
- Third: the boost is large, about 21.5 for r = 4.
- That is 6.91 divided by 0.32.
Meaning
- The update seems to boost features learned in pre-training but not stressed.
- Those features matter for the specific task.
Summary
- Fine-tuning huge models costs too much hardware and storage.
- LoRA adds no latency and keeps the full sequence length.
- It keeps model quality and allows quick task switching.
- The idea applies to any network with dense layers.
Four future directions
- 1. Combine LoRA with other efficient methods.
- 2. Study how pre-trained features turn into task skills.
- 3. Find principled ways to pick matrices, not just heuristics.
- 4. If Delta W is rank-deficient, W may be too.
Why
- Few-shot is good with few examples.
- But products often have thousands of examples.
- Fine-tuning then beats few-shot a lot.
| Method | MNLI-m (%) | RTE (%) |
|---|
| GPT-3 Few-Shot | 40.6 | 69.0 |
| GPT-3 Fine-Tuned | 89.5 | 85.4 |
Table 8: few-shot versus fine-tuning on GPT-3
The few-shot MNLI test uses two examples per class, six in all.
Why
- Adapters are added in sequence. LoRA is added in parallel.
- Large batch size or long sequences hide the latency.
- Online inference with small batches does not.
Test and result
- They test GPT-2 medium on one NVIDIA Quadro RTX8000, averaged over 100 trials.
- They vary batch size, sequence length and bottleneck size r.
- Slow-down can top 30% in short-sequence, small-batch online use.
GLUE, WikiSQL, SAMSum
- GLUE: MNLI, SST-2, MRPC, CoLA, QNLI, QQP, RTE and STS-B.
- WikiSQL: about 56 thousand training and 8 thousand validation examples.
- SAMSum: about 14 thousand training and 819 test examples.
Data-to-text sets
- E2E: about 42 thousand training examples. Restaurant domain.
- E2E: 4 thousand 600 validation and 4 thousand 600 test examples.
- DART: 82K examples. Open-domain triples.
- WebNLG: 22K examples, 14 categories, 9 seen in training, 5 unseen.
- Licenses are listed for each.
RoBERTa and DeBERTa
- RoBERTa and DeBERTa: AdamW, linear decay. Median over 5 seeds.
- RoBERTa LoRA: r_q = r_v = 8.
- Tables 9 and 10 list rates, epochs and batch sizes.
GPT-2
- GPT-2: AdamW, linear schedule, 5 epochs, mean over 3 seeds.
- LoRA there: r = 4, alpha 32, learning rate 0.0002, batch size 8 (Table 11).
GPT-3
- GPT-3: AdamW, 2 epochs, batch size 128, weight decay 0.1.
- Sequence lengths: 384 WikiSQL, 768 MNLI, 2048 SAMSum.
- Best prefix-embedding: l_p = 256, l_i = 8, 3.2M parameters.
- Best prefix-layer: l_p = 8, l_i = 8, 20.2M parameters.
- LoRA budgets: 4.7M and 37.7M parameters. Table 12 lists learning rates.
Findings
- LoRA+PE adds trainable prefix tokens. LoRA+PL replaces them after each block with a fixed vector.
- LoRA+PE beats both LoRA and prefix-embedding on WikiSQL, so they are somewhat orthogonal.
- On MultiNLI it does not beat LoRA, which already matches the human baseline.
- LoRA+PL is slightly worse than LoRA, because prefix-layer is sensitive to the learning rate.
Selected numbers (Table 15)
- LoRA+PE with r = 8: 75.0 on WikiSQL, 91.4 on MNLI-m.
- With r = 64: 76.2 and 91.3.
F.1 GPT-2: DART and WebNLG
- LoRA beats or matches prefix methods at equal parameters on DART and WebNLG.
- DART BLEU, GPT-2 medium: LoRA 47.1 against fine-tune 46.2.
- DART BLEU, GPT-2 large: LoRA 47.5 against fine-tune 47.0.
F.2 GPT-3 sweeps
- Table 15 sweeps methods on GPT-3.
- PrefixEmbed and PrefixLayer get worse with more parameters.
- LoRA stays steady.
LoRA does best with little data; prefix methods collapseFrom Table 16Fine-tunePrefixEmbedPrefixLayerLoRA
Hover, tap or focus a bar to read its exact value.
| Training examples | Fine-tune (%) | PrefixEmbed (%) | PrefixLayer (%) | LoRA (%) |
|---|
| 100 | 60.2 | 37.6 | 48.3 | 63.8 |
| 1k | 85.8 | 75.2 | 82.5 | 85.6 |
| 10k | 88.9 | 79.5 | 85.9 | 89.2 |
| 392K (full) | 89.5 | 88.6 | 89.6 | 91.7 |
F.3 Low-data regime
- They sample 100, 1k and 10k training examples from MNLI.
- PrefixEmbed is barely above chance at 100 examples: 37.6% versus 33.3%.
- The gap shrinks with more data.
- LoRA beats fine-tuning on MNLI-100 and the full set.
- It ties on 1k and 10k, within 0.3.
The measure
- The score is a squared Frobenius norm of a product.
- It is divided by the smaller of i and j.
- It is the reverse of the standard Projection Metric.
- It lies between 0 and 1.
H.1 Other layers
- Figures 6 and 7 show other layers: the 1st, 32nd, 64th and 96th.
- The same pattern holds.
H.2 Rank on GPT-2
- On GPT-2 medium (E2E), the best r is between 4 and 16.
- Validation loss peaks at r = 16, BLEU at r = 4.
- This is similar to GPT-3 175B.
- How rank relates to model size is still open.
H.3 W versus Delta W
- Delta W lacks the top singular directions of W.
- Compare the top 4 directions of Delta W with the top 10% of W.
- Their similarity barely exceeds 0.2.
- So Delta W holds task-specific directions.
H.4 Amplification
- The amplification factor is the norm ratio of the projection.
- At r = 4 it is as large as 20.
- At r = 64 it is only about 2.
- So a task needs few directions, each boosted a lot.
- Different tasks boost different directions.
- This write-up covers the whole paper, including appendices, at section level.
Words to know
- Adapter: A small extra layer inserted into a model and trained alone.
- Fine-tuning: Retraining a pre-trained model on task data.
- GLUE: A set of eight language understanding tests.
- Latency: The time a model needs to answer one request.
- Low-rank: Built from few independent directions, so it is small and simple.
- Prefix tuning: Training extra input tokens while the model stays frozen.
- Rank: How many independent directions a matrix holds.
- Trainable parameter: A number in the model that training changes.
- VRAM: The memory on a GPU.
Ask AI about this paper
Stuck on a word or an idea? Ask in plain words. The answer comes from the write-up on this page.
Jump to