A Self-Attentive Meta-Optimizer with Group-Adaptive Learning Rates and Weight Decay
Abstract
Adaptive optimizers like AdamW apply uniform hyperparameters across all parameter groups, ignoring heterogeneous optimization dynamics across layers and modules. We address this limitation by proposing MetaAdamW - a new optimizer that integrates a self-attention mechanism to dynamically modulate per-group learning rates and weight decay. The modulation factors are produced by a lightweight Transformer encoder that operates on statistical features (gradient norms, momentum norms, correlations) extracted from each parameter group. To train the attention module, we introduce a meta-learning objective that combines gradient alignment, loss decrease, and generalization gap. A key novel contribution is the extension of homoscedastic uncertainty weighting (HUW) with task-specific priorities that directly scale the regularization terms - enabling domain knowledge to guide automatic loss balancing. Extensive experiments on five diverse tasks-time series forecasting (ETT), language modeling (WikiText-2), machine translation (Multi30k), image classification (CIFAR-10), and sentiment analysis (IMDB) - demonstrate that MetaAdamW consistently outperforms the standard AdamW baseline in terms of validation loss, accuracy, or perplexity. Depending on the task, MetaAdamW either reduces overall training time (by up to 17.11%) or improves performance (by up to 11.08%) while introducing only moderate overhead; in some cases, it can also mitigate issues of insufficient convergence caused by premature early stopping. Ablation studies validate the effectiveness of each component, including feature versions, grouping strategies, and the proposed priority-injected uncertainty weighting.
Figures & tables
| Parameter | Value |
|---|---|
| Global learning rate | |
| Weight decay | |
| AdamW betas | |
| range | |
| range | |
| Warmup epochs (before meta) |
| Task | AdamW | MetaAdamW | Improvement | Time Overhead | ||
|---|---|---|---|---|---|---|
| Metric | Value | Metric | Value | |||
| ETTh1 (forecast) | MSE | 0.006147 | MSE | 0.005885 | +4.26% | -7.20% |
| WikiText-2 (LM) | PPL | 120.47 | PPL | 115.51 | +4.12% | -17.11% |
| Multi30k (MT) | PPL | 2.0297 | PPL | 1.9690 | +2.99% | +27.35% |
| CIFAR-10 (classif.) | Acc | 87.02% | Acc | 88.05% | +1.18% | +27.58% |
| IMDB (sentiment) | Acc | 74.53% | Acc | 82.79% | +11.08% | +172.53% |
| Configuration | ETTh1 (Loss) | WikiText-2 (PPL) | Multi30k (PPL) | CIFAR-10 (Acc) | IMDB (Acc) | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| Value | % | Value | % | Value | % | Value | % | Value | % | |
| MetaAdamW (baseline) | 0.005885 | – | 115.51 | – | 1.9690 | – | 0.8805 | – | 0.8279 | – |
| AdamW | 0.006147 | -4.45 | 120.47 | -4.29 | 2.0297 | -3.08 | 0.8702 | -1.17 | 0.7453 | -9.98 |
| Grouping strategy | ||||||||||
| Original | – | – | 116.13 | -0.54 | – | – | – | – | – | – |
| Fine-grained | baseline | – | baseline | – | baseline | – | baseline | – | baseline | – |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Task | (attn layers) | (attn) | Heads | Feature version | Feature dim | Feature gating | HUW priorities | |
|---|---|---|---|---|---|---|---|---|
| ETTh1 | 217 | 8 | 16 | 6 | basic | 6 | True | [1.0, 1.0, 1.0] |
| WikiText-2 | 123 | 8 | 16 | 6 | basic | 6 | False | [1.0, 1.0, 1.0] |
| Multi30k | 454 | 128 | 64 | 6 | basic | 6 | False | [2.0, 5.0, 1.0] |
| CIFAR-10 | 190 | 64 | 64 | 6 | basic | 6 | False | [5.0, 2.0, 1.0] |
| IMDB | 39 | 64 | 64 | 11 | basic_plus | 11 | True | [1.0, 3.0, 5.0] |
| Task | AdamW epoch | MetaAdamW epoch | AdamW total | MetaAdamW total | Overhead |
|---|---|---|---|---|---|
| ETTh1 | 93.39 | 99.04 | 747 | 693 | -7.20% |
| WikiText-2 | 373.58 | 357.32 | 5604 | 4645 | -17.11% |
| Multi30k | 895.25 | 957.67 | 18800 | 23942 | +27.35% |
| CIFAR-10 | 2410.36 | 2635.86 | 28924 | 36902 | +27.58% |
| IMDB | 283.35 | 356.40 | 1700 | 4633 | +172.53% |
Deep Learning Optimization
Deep learning optimization develops algorithms and training strategies that help neural networks converge, generalize, and use compute efficiently.
See all 205 papers