Static Gradient Attribution Underperforms a Density-Matched Random Mask on Loss-Based Forgetting Within LoRA B-Matrix
Organizations: University of Pennsylvania · Matter Innovation Inc. · University of California, Davis · Johns Hopkins University ·
Abstract
Parameter-efficient continual learning updates a restricted subset of adapter parameters to incorporate sequential tasks while limiting catastrophic forgetting. Gradient attribution is a common rule for selecting that subset, but it requires an additional backward pass over calibration data. We identify a parameter-pool confound in comparisons between initialization-time gradient masks and unrestricted random masks under standard zero-initialized LoRA (): the gradient with respect to is identically zero (), so gradient masks select strictly from the matrix whereas unrestricted random masks draw from both and . Such a comparison changes both the selection rule and the candidate parameter pool. Isolating the selection criterion by restricting both approaches to the same parameter pool, we find a negative result: a uniform random mask consistently achieves lower loss-based backward transfer than gradient attribution across seven seeds on Qwen2.5-3B. The effect is concentrated on the medical task, which contributes 80% of the aggregate; code and math move in the same direction, and legal shows no reliable difference. This advantage is consistent with a stability--plasticity trade-off under the tested task sequence, in which random masking slightly reduces single-task fitting. On the two discrete-option tasks (Medical and Legal), the mean accuracy-BWT difference is not statistically distinguishable from zero.
Figures & tables
| Symbol | Meaning |
|---|---|
| , | base model and its frozen pretrained weight matrix |
| , | low-rank LoRA factors, , |
| , | LoRA rank ( ) and scaling ( ) |
| adapted weight, | |
| , | task index and number of tasks ( ) |
| training split of task |
| Seed | Random-B BWT | Gradient-B BWT | (matched) | (unmatched) |
|---|---|---|---|---|
| 42 | 0.453 | |||
| 123 | 0.453 | |||
| 456 | 0.406 | |||
| 789 | 0.387 | |||
| 1024 | 0.474 | |||
| 2048 | 0.491 |
Appendix figures & tables25 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | Peak GPU (GB) | Time (s) | Backward? |
|---|---|---|---|
| Gradient mask | 584.9 | Yes | |
| Wanda proxy | 7.4 | 12.1 | No |
| Shared random / RRM | 0 ‡ | 0 | No |
| No mask | 0 ‡ | 0 | No |
| Seed | Gradient BWT | Random BWT | No Mask BWT |
|---|---|---|---|
| 42 | 0.491 | 0.435 | 0.507 |
| 123 | 0.463 | 0.417 | |
| 456 | 0.414 | 0.539 | |
| 789 | 0.417 | 0.484 | |
| 1024 | 0.486 | 0.458 | 0.479 |
| Mean | 0.437 | 0.484 |
| Method | BWT | Loss | Calibration pass? |
|---|---|---|---|
| Shared random | No | ||
| Gradient mask | Yes | ||
| No mask | No |
| Seed | random_B_only BWT | full_alora BWT | |
|---|---|---|---|
| 42 | 0.491 | ||
| 123 | 0.413 | ||
| 456 | 0.356 | ||
| 789 | 0.364 | ||
| 1024 | 0.442 | ||
| 2048 | 0.402 |
| Level | What varies | Magnitude | What it measures |
|---|---|---|---|
| (a) protocol-equivalence check | execution path only | numerical agreement between two code paths; not an inferential error term | |
| (b) across-seed paired contrast | independent seed | SD | variability used by the paired significance test |
| (c) position (ordering) sensitivity | position of the two arms | (seed 42, gradient_B ) | method-position interaction in a three-seed check |
| (d) cross-session variation | session, hardware, and method | up to ( full_alora , seed 42) | method-specific offset of unknown origin |
| Seed | rB / main | gB / main | ||
|---|---|---|---|---|
| 42 | 0.01 | 0.41 | ||
| 789 | 0.00 | 0.04 | ||
| 2048 | 0.00 | 0.08 |
| Method | Run A | Run B | Run C | Run D / spread |
|---|---|---|---|---|
| Gradient mask ( full_alora ) | 0.491 | 0.378 | 0.498 | — (0.120) |
| Gradient-B@10% ( gradient_B ) | — | — | 0.453 | 0.423 (0.030) |
| Random mask ( random_A+B ) | 0.435 | 0.349 | — | — |
| Random B-only ( random_B_only ) | 0.326 | 0.324 | 0.278 | 0.278 (0.048) |
| Condition | RRM BWT | Random BWT | Direction | |
|---|---|---|---|---|
| Rank 4 | 0.464 | 0.423 | 0.041 | Random better |
| Rank 8 | 0.427 | 0.373 | 0.055 | Random better |
| Rank 16 (ref.) | 0.401 | 0.435 | 0.034 | RRM better |
| Rank 32 | 0.414 | 0.390 | 0.024 | Random better |
| Reverse order | 0.115 | 0.109 | 0.006 | Random better |
| Sparsity | Random BWT | Gradient BWT |
|---|---|---|
| 5% | 0.327 | 0.422 |
| 10% | 0.435 | 0.491 |
| 20% | 0.444 | 0.474 |
| 30% | 0.361 | 0.467 |
| Module | Gradient density | Random density | Ratio |
|---|---|---|---|
| o_proj | 29.0% | 10.0% | 2.9 |
| up_proj | 12.8% | 10.0% | 1.3 |
| v_proj | 10.3% | 10.0% | 1.0 |
| q_proj | 8.1% | 10.0% | 0.8 |
| k_proj | 8.0% | 10.0% | 0.8 |
| gate_proj | 8.0% | 10.0% | 0.8 |
| Scale | Random BWT | Gradient BWT | No Mask BWT |
|---|---|---|---|
| 0.5B | 0.343 | — | 0.431 |
| 1.5B | 0.309 | — | 0.356 |
| 7B | 0.447 | 0.441 | 0.514 |
| Architecture | Comparison | Grad. BWT | Rand. BWT | |
|---|---|---|---|---|
| Qwen2.5-3B ( ) | Confounded | |||
| Phi-2 ( ) | Confounded | |||
| Qwen2.5-3B ( ) | Within-B | |||
| Phi-2 ( ) | Within-B |
| Method | Unrestricted BWT | B-only BWT | Gap |
|---|---|---|---|
| Gradient | 0.378 | 0.378 | |
| Random | 0.349 | 0.324 |
| Seed | Accuracy-BWT [Grad Rand], pp | Loss BWT [Grad Rand] |
|---|---|---|
| 42 | ||
| 123 | ||
| 456 | ||
| 789 | ||
| 1024 | ||
| 2048 |
| Method | B=0 pool | Within-pool grad-vs-random |
|---|---|---|
| EWC / SI / MAS | No | No |
| PiSSA ( ) | N/A by init | No |
| Attribution-Guided CL (post-training attribution) | N/A by design | No |
| Ours (within- lora_B ) | Yes | Yes |
| Rule | What it scores, and what for | Run |
|---|---|---|
| EWC [ Kirkpatrick et al., 2017 ] ; MAS [ Aljundi et al., 2018 ] | Fisher information, output sensitivity; a penalty, not a mask | no |
| SNIP [ Lee et al., 2019 ] ; GraSP [ Wang et al., 2020 ] | gradient at initialisation; one-shot pruning mask | no |
| Wanda [ Sun et al., 2024 ] | weight activation magnitude; one-shot pruning mask | no |
| LoRA-FA [ Zhang et al., 2023 ] | none, structural; freezes lora_A , trains lora_B | no |
| Grad-Full, Grad-B (§ 3.3 ) | calibration gradient magnitude; static CL mask, full pool (Grad-Full) or lora_B at 10% (Grad-B) | yes |
| Random-B; Random A+B [ Xu and Zhang, 2024 ] | none, uniform; static CL mask, lora_B at 10% (Random-B) or full pool (A+B) | yes |
| Seed | Code | Medical | Legal | Math | Aggregate |
|---|---|---|---|---|---|
| 42 | |||||
| 123 | |||||
| 456 | |||||
| 789 | |||||
| 1024 | |||||
| 2048 |
| Task | random_B_only | gradient_B | full_alora |
|---|---|---|---|
| code | |||
| medical | |||
| legal | |||
| math | |||
| creative |
| Seed | rB start | rB end | gB start | gB end (diff) |
|---|---|---|---|---|
| 42 | 1.543 | 1.821 | 1.478 | 1.931 ( ) |
| 123 | 1.632 | 1.896 | 1.553 | 2.006 ( ) |
| 456 | 1.575 | 1.858 | 1.494 | 1.900 ( ) |
| 789 | 1.548 | 1.900 | 1.475 | 1.862 ( ) |
| 1024 | 1.566 | 1.918 | 1.489 | 1.962 ( ) |
| 2048 | 1.665 | 1.896 | 1.587 | 2.078 ( ) |
| Seed | Random-B BWT | Grad-B BWT | |
| 42 | 0.1661 | ||
| 123 | 0.1273 | ||
| 456 | 0.1749 | ||
| 1024 | 0.1624 | ||
| Mean | — | — | (SD ) |
| Architecture | Mean | SD | |||
|---|---|---|---|---|---|
| Qwen2.5-3B | 7 | 0.0707 | 0.0011 | ||
| Phi-2 | 4 | 0.0173 | 0.0009 |