feat: near_zero/near_one init for trainable params (breaks bf16 dead-grad symmetry)

Trainable params that were init'd at exact 0 or 1 now use near_zero (N(0,1e-4))
or near_one (1 + N(0,1e-4)) to break bf16 symmetry without meaningfully
breaking identity-at-t=0. Exact-zero init is kept where zero IS the identity
constraint (DeLoRA lora_B, EVA lora_B -- both scaled by other params so any
nonzero B would blow up the output).

AntiPaSTO: delta_s and rot_T now near_zero. The old exact-zero could leave
rotation learning dead in bf16 where step sizes round back to zero.

IA3: lora_g now near_one instead of exact ones. Avoids the bf16 spacing issue
around 1.0 where eps_bf16 ~ 7.8e-3 and lr=1e-3 updates were rounding away.

PiSSA: lora_A and lora_B now near_zero (both overwritten by SVD in init(),
so the init value is moot -- but ParamSpec now documents intent correctly).

HRA: lora_U now near_zero (overwritten by symmetric init in init()).

ParamSpec: added 'near_zero' and 'near_one' init modes. Default changed from
'zeros' to 'near_zero'. Tests relaxed identity tolerances accordingly.
This commit is contained in:
wassname
2026-04-27 15:55:05 +08:00
parent 0bd091fe5b
commit e624cd244f
15 changed files with 69 additions and 46 deletions
+16 -12
View File
@@ -47,21 +47,25 @@ just qwen-probe # Qwen/Qwen3-0.6B train/save-load probe
## Variants
| Variant | 4bit/8bit | GSM8K % |
| --------------------------------------------- | --------- | ------- |
| [LoRA](https://arxiv.org/abs/2106.09685) | yes | 63.2% |
| [PiSSA](https://arxiv.org/abs/2404.02948) | no | |
| [DeLoRA](https://arxiv.org/abs/2503.18225) | yes | — |
| [IA3](https://arxiv.org/pdf/2205.05638) | yes | — |
| [DoRA](https://arxiv.org/abs/2402.09353) | no | |
| [HRA](https://arxiv.org/abs/2409.01434) | yes | |
| [EVA](https://arxiv.org/abs/2409.07871) | no | |
| [AntiPaSTO](https://arxiv.org/abs/2503.08696) | no | — |
| Variant | 4bit/8bit | GSM8K % | Params | Peak GPU (GB) |
| --------------------------------------------- | --------- | ------- | ---------- | ------------- |
| [LoRA](https://arxiv.org/abs/2106.09685) | yes | 63.2% | 4.59M | — |
| [PiSSA](https://arxiv.org/abs/2404.02948) | no | 63.2% | 4.59M | — |
| [DoRA](https://arxiv.org/abs/2402.09353) | no | 62.4% | 4.67M | — |
| [DeLoRA](https://arxiv.org/abs/2503.18225) | yes | 61.5% | 4.59M | — |
| [EVA](https://arxiv.org/abs/2409.07871) | no | 60.3% | 4.59M | 11.3 |
| [IA3](https://arxiv.org/pdf/2205.05638) | yes | 60.0% | 57K | 11.4 |
| [IA3-FF](https://arxiv.org/pdf/2205.05638) | yes | 61.4% | 86K | 11.4 |
| [HRA](https://arxiv.org/abs/2409.01434) | yes | — | — | — |
| [AntiPaSTO](https://arxiv.org/abs/2503.08696) | no | 30.6% | 4.5K | 11.3 |
Our test setup: We take Qwen3-0.6B-Base and train one MetaMathQA for 5000 steps. We use a rank of 32, and itnervene on all linear layer then test on GSM8K.
Params = trainable adapter params. Peak GPU = peak CUDA memory during train+eval (logged from this run onward; older runs predate the column).
Setup: Qwen3-0.6B-Base, MetaMathQA train (5k steps, batch 4 = 20k samples), r=32, all q/v targets, GSM8K test (1319 examples).
Is this a good accuracy? TODO we need a like-for-like comparison against PEFT LoRA in the same setup before drawing conclusions. But the [PEFT library](https://github.com/huggingface/peft#results) reports LoRA at 49.0% on Llama-3.2-3B (different model and sample count).
Reference: PEFT reports LoRA at 49.0% on Llama-3.2-3B (different model, different sample count). Our numbers are not directly comparable but suggest the adapters work.
AntiPaSTO at 30.6% is expected: it has only 4.5K trainable params (singular-value deltas + rotation) and needs more steps or a different lr schedule to converge from a cold start.
## Developer docs