Weight Scale Rebalancing: Transferable Training Recipes for Transformers
Organizations: Department of Mathematics and Mathematical Statistics Umeå University, Sweden
Abstract
Training Transformers requires careful hyperparameter tuning, which becomes increasingly costly for large models. We introduce UDV-Rebalance (UDVR), a reparameterization that inserts an auxiliary diagonal matrix between naturally paired weight matrices appearing throughout Transformer architectures. UDVR periodically rebalances the factors to maintain unit-norm columns in and unit-norm rows in , with absorbing the corresponding scales. With rebalancing, a single hyperparameter setting of UDVR remains effective across model scales, architectures, and data distributions. This yields a tuning-free rule that adapts to each weight matrix using only its dimensions. We fit this rule once on ViT models trained on CIFAR-10 and CIFAR-100, and it remains valid when the activation function or the optimizer is changed. The same rule transfers to new image domains in DomainNet, to ViT, Swin, and MaxViT on ImageNet, and to language-model pretraining with up to 1.3B parameters. UDVR consistently outperforms Weight Normalization and Reparam and matches a vanilla baseline whose hyperparameters are swept on each target model.
Figures & tables
| Domain | Data | Model | Params (M) | |||
| Vision | CIFAR DomainNet | |||||
| ViT | 128 | 1.21 | 1.60 | 2.39 | ||
| ViT | 192 | 2.70 | 3.59 | 5.36 | ||
| ViT | 256 | 4.78 | 6.35 | 9.50 | ||
| ImageNet | ViT-S | 384 | 22.01 | |||
| ViT-B | 768 | 86.48 | ||||
| Method | Learning rate | Weight decay |
|---|---|---|
| Vanilla | (5) | (6) |
| WN | (9) | |
| Reparam | (9) | |
| UDVR |
| CIFAR-10 | CIFAR-100 | ||||||||
| UDVR | Vanilla | WN | Reparam | UDVR | Vanilla | WN | Reparam | ||
| 128 | 6 | 87.96 | 85.15 | 83.05 | 83.55 | 65.39 | 64.55 | 62.14 | 62.62 |
| 8 | 88.54 | 86.05 | 84.33 | 83.32 | 66.62 | 65.17 | 62.32 | 62.77 | |
| 12 | 88.62 | 86.96 | 85.04 | 84.37 | 68.16 | 66.78 | 64.18 | 64.83 | |
| 192 | 6 | 87.72 | 86.63 | 85.16 | 84.20 | 67.19 | 66.47 | 63.38 | 64.03 |
| 8 | 88.43 | 87.11 | 85.54 | 85.12 | 68.17 | 65.92 | 64.28 | 64.66 | |
| Lion | Muon | ||||||||
| UDVR | Vanilla | WN | Reparam | UDVR | Vanilla | WN | Reparam | ||
| 128 | 6 | 67.54 | 65.07 | 64.25 | 63.05 | 69.10 | 68.44 | 65.09 | 65.81 |
| 8 | 67.43 | 66.11 | 63.05 | 64.25 | 70.29 | 70.26 | 65.56 | 67.90 | |
| 12 | 68.55 | 69.32 | 66.23 | 65.17 | 71.43 | 74.08 | 67.52 | 67.32 | |
| 192 | 6 | 68.82 | 67.25 | 65.57 | 65.31 | 70.09 | 69.92 | 67.20 | 67.16 |
| 8 | 69.13 | 67.88 | 65.22 | 65.69 | 71.02 | 70.77 | 67.38 | 66.68 | |
| Lion | Muon | ||||||||
| UDVR | Vanilla | WN | Reparam | UDVR | Vanilla | WN | Reparam | ||
| 128 | 6 | 88.13 | 66.94 | 84.95 | 82.65 | 90.66 | 90.59 | 87.79 | 88.19 |
| 8 | 88.04 | 87.01 | 85.39 | 83.60 | 90.64 | 91.03 | 88.51 | 89.33 | |
| 12 | 88.61 | 87.34 | 85.90 | 84.98 | 91.35 | 91.87 | 88.81 | 88.51 | |
| 192 | 6 | 87.77 | 87.26 | 86.09 | 83.12 | 91.00 | 90.18 | 89.61 | 89.67 |
| 8 | 88.59 | 85.34 | 86.78 | 85.32 | 91.94 | 91.96 | 90.31 | 88.34 | |
| ReLU | SiLU | ||||||||
| UDVR | Vanilla | WN | Reparam | UDVR | Vanilla | WN | Reparam | ||
| 128 | 6 | 65.80 | 63.56 | 62.47 | 62.34 | 65.59 | 62.91 | 58.79 | 59.59 |
| 8 | 66.60 | 64.06 | 60.83 | 63.19 | 66.27 | 63.83 | 60.34 | 60.32 | |
| 12 | 67.90 | 65.27 | 64.64 | 64.42 | 67.83 | 63.27 | 60.55 | 62.62 | |
| 192 | 6 | 66.92 | 64.87 | 64.05 | 63.93 | 67.21 | 63.72 | 61.31 | 62.37 |
| 8 | 67.45 | 65.93 | 64.40 | 64.20 | 67.98 | 63.95 | 61.67 | 62.52 | |
| ReLU | SiLU | ||||||||
| UDVR | Vanilla | WN | Reparam | UDVR | Vanilla | WN | Reparam | ||
| 128 | 6 | 87.45 | 85.20 | 85.10 | 84.44 | 86.88 | 83.43 | 79.64 | 78.13 |
| 8 | 87.60 | 85.81 | 85.22 | 84.93 | 87.76 | 83.19 | 79.82 | 78.64 | |
| 12 | 88.47 | 87.27 | 84.36 | 85.55 | 88.17 | 83.73 | 83.99 | 80.38 | |
| 192 | 6 | 87.78 | 87.12 | 86.17 | 85.65 | 88.34 | 83.62 | 82.70 | 80.22 |
| 8 | 88.20 | 87.10 | 87.29 | 86.13 | 88.21 | 84.88 | 82.91 | 81.38 | |
| Real | Sketch | ||||||||
| UDVR | Vanilla | WN | Reparam | UDVR | Vanilla | WN | Reparam | ||
| 128 | 6 | 55.50 | 54.12 | 49.26 | 50.35 | 34.08 | 27.22 | 21.67 | 20.49 |
| 8 | 56.69 | 54.72 | 49.93 | 50.84 | 35.68 | 29.26 | 20.81 | ||
| 12 | 58.46 | 55.31 | 51.74 | 53.84 | 36.29 | 25.91 | 23.44 | 25.92 | |
| 192 | 6 | 57.90 | 55.63 | 52.34 | 52.48 | 37.00 | 26.77 | 23.80 | 21.76 |
| 8 | 58.87 | 55.98 | 51.82 | 54.30 | 37.65 | 28.97 | 24.23 | 28.14 | |
Appendix figures & tables27 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Depth | Heads | Drop path | Trainable params (M) | |||||
| CIFAR ( , patch 4) / DomainNet ( , patch 8) | CIFAR-10 | CIFAR-100 | DomainNet | ||||||
| ViT | 6 | 2 | 128 | 64 | 512 | 0.0 | 1.20 | 1.21 | 1.26 |
| ViT | 8 | 2 | 128 | 64 | 512 | 0.0 | 1.59 | 1.60 | 1.65 |
| ViT | 12 | 2 | 128 | 64 | 512 | 0.1 | 2.38 | 2.39 | 2.44 |
| ViT | 6 | 3 | 192 | 64 | 768 | 0.0 | 2.68 | 2.70 | 2.77 |
| ViT | 8 | 3 | 192 | 64 | 768 | 0.0 | 3.57 | 3.59 | 3.66 |
| Category | Item | CIFAR-10 / CIFAR-100 | DomainNet (real / sketch) | ImageNet |
|---|---|---|---|---|
| Optimizer | Optimizer | AdamW | ||
| Betas | (0.9, 0.999) | |||
| Eps | 1e-8 | |||
| Gradient clip | None | |||
| LR schedule | Scheduler | linear warmup then cosine decay to 0, stepped per optimizer step | ||
| Warmup ratio | 0.05 | |||
| Hyperparameter | Vanilla | WN | Reparam | UDVR (predefined) |
| , , , , | , , , , , , , , | , , , , , , , , | (CIFAR, DomainNet; batch 512) (ImageNet; batch 2048) | |
| Weight decay | , , , , , | |||
| Runs per cell (CIFAR) | 30 | 9 | 9 | 1 |
| WN | ||||
| Weight form | – | – | – | |
| Reparam | ||||
| Vanilla | WN | Reparam | ||
|---|---|---|---|---|
| Model | Weight decay | |||
| ViT-S | , | , | , , , | , , , |
| ViT-B | , | , | , , , | , , , |
| Swin-T | , | , | , , , , | , , , , |
| Swin-B | , , | , | , , | , , |
| MaxViT-T | , , , | , , | , , | |
| Model | Depth | Heads | Trainable | |||
|---|---|---|---|---|---|---|
| GPT-S | 22 | 8 | 512 | 64 | 2048 | 120.76M |
| GPT-M | 22 | 16 | 1024 | 64 | 4096 | 379.94M |
| GPT-L | 22 | 32 | 2048 | 64 | 8192 | 1313.53M |
| Category | Item | Value |
| Optimizer | Optimizer | AdamW |
| Betas | (0.9, 0.95) | |
| Eps | 1e-8 | |
| Gradient clip | None | |
| LR schedule | Scheduler | linear warmup then cosine decay to 0, stepped per optimizer step |
| Warmup ratio | 0.01 |
| Hyperparameter | Vanilla | WN | Reparam | UDVR |
| , GPT-S | , , , | , , , , , | , , , , , | |
| , GPT-M | , , , | , , , , , | , , , , , | |
| , GPT-L | , , | , , | , , | |
| Weight decay | , (S, M) (L) | |||
| Runs (S / M / L) | 8 / 8 / 3 | 6 / 6 / 3 | 6 / 6 / 3 | 1 / 1 / 1 |
| WN | ||||
| Form | FFN forward | Scale of | Scale of |
|---|---|---|---|
| Single-D | to | to | |
| V-proj | to | discarded | |
| U-proj | discarded | to | |
| U-only | to | discarded † | |
| Two-D | to | to |
| Hyperparameter | Values | Count |
|---|---|---|
| for , , | 11 | |
| for , | 7 | |
| , , | 3 | |
| , , | 3 |
| Model | Size | Main (%) | wd 0 | wd 0.05 | |
|---|---|---|---|---|---|
| ViT | S | 3.5 | 78.63 | 78.57 | |
| B | 1.8 | 79.97 | 80.23 | ||
| Swin | T | 8.4 | 79.37 | 79.67 | |
| B | 4.5 | 82.16 | 81.46 | ||
| MaxViT | T | 30.0 | 82.37 | 82.77 | |
| S | 29.4 | 82.98 | 83.53 |
| Vanilla | UDVR | |||||
|---|---|---|---|---|---|---|
| Model | GELU | SwiGLU | GELU | SwiGLU | ||
| ViT-S | 79.82 | 80.12 | 78.63 | 79.26 | ||
| Swin-T | 80.41 | 80.84 | 79.37 | 80.21 | ||
| No ImageNet search | Grid search | |||
|---|---|---|---|---|
| Model | P | UDVR | Vanilla | P UDVR |
| ViT-S | 79.22 | 78.63 | 79.82 | |
| ViT-B | 79.84 | 79.97 | 80.12 | |
| Swin-T | 79.39 | 79.37 | 80.41 | |
| Swin-B | 79.90 | 82.16 | 82.49 | |
| Model | Depth | Heads | Norm | FFN | Trainable | |||
|---|---|---|---|---|---|---|---|---|
| Llama-S | 22 | 8 | 512 | 64 | RMSNorm | SwiGLU | 1536 | 126.51M |
| OLMoE-S | 22 | 8 | 512 | 64 | RMSNorm | SwiGLU MoE (top-8) | 490.56M (127.23M active) |
| Category | Item | Llama-S | OLMoE-S |
| Optimizer | Optimizer | AdamW | |
| Betas | (0.9, 0.95) | ||
| Eps | 1e-8 | ||
| Gradient clip | None | ||
| LR schedule | Scheduler | linear warmup then cosine decay to 0, stepped per optimizer step | |
| Warmup ratio | 0.01 | ||
| Val. PPL | LAMBADA (%) | |||
|---|---|---|---|---|
| Method | Llama-S | OLMoE-S | Llama-S | OLMoE-S |
| UDVR | 12.432 | 10.897 | 24.98 | 28.57 |
| Vanilla | 12.404 | 10.939 | 25.91 | 29.32 |
| WN | 12.617 | 11.202 | 24.88 | 28.24 |
| Reparam | 12.674 | 11.258 | 24.84 | 29.36 |
Neural Network Optimization
Neural network optimization studies algorithms and training dynamics that help models learn efficiently, reliably, and generalize well.
See all 368 papers