Quantifying Hyperparameter Transfer and the Importance of Embedding Layer Learning Rate

Summary (Overview)

  • Develops a quantitative framework for evaluating hyperparameter transfer quality using three complementary metrics: loss predictability error ( E\mathcal{E} ), transfer robustness exponent ( κ\kappa ), and asymptotic loss degradation ( R()\mathcal{R}(\infty) )
  • Isolates the embedding layer learning rate as the primary driver of μ\muP's advantage over SP when training GPT-style Transformers with AdamW, contradicting the notion that the full set of μ\muP conditions is necessary
  • Demonstrates that SP with a corrected embedding learning rate (SP+Embd) matches μ\muP across all three transfer metrics, providing practitioners a simple fix for reliable transfer
  • Reveals that insufficient embedding layer learning rate causes training instabilities, not just slower convergence—a counterintuitive finding since one would expect later layers to compensate
  • Shows weight decay improves loss predictability but degrades asymptotic performance in fixed-step settings and hurts transfer robustness in compute-optimal (fixed token-per-parameter) settings

Introduction and Theoretical Foundation

Background and Motivation

Training large neural networks requires careful hyperparameter tuning, which becomes prohibitively expensive as models scale to trillions of parameters. Hyperparameter transfer addresses this by finding optimal hyperparameters at small scales and extrapolating them to larger scales via scaling laws or structural parameterization choices.

Two main approaches exist:

  1. Fitted scaling laws: Fit functional forms to predict how optimal learning rate η\eta^* scales with model/data size
  2. Structural parameterization: Design the model so that training dynamics remain invariant across scales (e.g., Maximal Update Parameterization, μ\muP)

Theoretical Foundation: Neural Network Parameterizations

Following Yang and Hu [48], networks are parameterized using four scalar exponents {al,bl,cl,dl}\{a_l, b_l, c_l, d_l\} per layer ll:

  • ala_l controls forward pass scaling: h(l+1)=nalW(l+1)ϕ(h(l))\mathbf{h}^{(l+1)} = n^{-a_l} W^{(l+1)} \phi(\mathbf{h}^{(l)})
  • blb_l scales initialization variance: W(l)N(0,n2bl)W^{(l)} \sim \mathcal{N}(0, n^{-2b_l})
  • clc_l scales layer-wise learning rate: η(l)=ηncl\eta^{(l)} = \eta \cdot n^{-c_l}
  • dld_l scales weight decay: λ(l)=λndl\lambda^{(l)} = \lambda \cdot n^{-d_l}

Standard Parameterization (SP) requires activations at initialization to not blow up or vanish, imposing one constraint per layer. Maximal Update Parameterization (μ\muP) imposes a stronger condition: both activations and their updates must be width-independent.

Key Differences Between SP and μ\muP

The two parameterizations differ in four key ways (Table 1):

ParameterizationLayerMultiplier (n⁻ᵃ)Variance (n⁻²ᵇ)LR (n⁻ᶜ)WD (n⁻ᵈ)
SPEmbedding111/nn
Hidden11/n1/nn
Last11/n1/nn
LayerNorm--1/n-
Attention scale1/√d---
μ\muPEmbedding1111
Hidden11/n1/nn
Last11/n²1/nn
LayerNorm--1-
Attention scale1/d---

Theoretical Gaps

The theoretical derivation of μ\muP makes assumptions that don't hold in practice:

  1. Finite training steps in the infinite width limit (practice is the opposite)
  2. Full alignment between weight updates and activations (rarely achieved)
  3. Fixed dataset size (practice scales data with parameters)

Despite these violations, μ\muP still exhibits high-quality transfer—motivating this investigation.

Methodology

Experimental Setup

  • Architecture: GPT-style decoder-only Transformers
  • Dataset: FineWeb-Edu [36]
  • Optimizer: AdamW with Warmup-Stable-Decay (WSD) schedule (20% warmup, 60% stable, 20% decay)
  • Training: Fixed 10,000 steps, batch size 1024 (1M tokens/step)
  • Width scaling: n[128,2048]n \in [128, 2048], head dimension fixed at d=64d = 64

Three Transfer Metrics

1. Loss Predictability Error (E\mathcal{E})

Models the loss landscape as a joint scaling law:

L(ν;n)=L()+Anα+12Cnγ(νν()Bnβ)2L(\nu; n) = L^*(\infty) + An^{-\alpha} + \frac{1}{2}Cn^{\gamma} \cdot \left(\nu - \nu^*(\infty) - Bn^{-\beta}\right)^2

where ν=log2η\nu = \log_2 \eta. The error is computed as:

E=1NνNni,j[L(νi;nj)L^(νi;nj)]2\mathcal{E} = \frac{1}{N_{\nu} N_n} \sum_{i,j} \left[ L(\nu_i; n_j) - \hat{L}(\nu_i; n_j) \right]^2

2. Transfer Robustness Exponent (κ\kappa)

Defined as κ=α2β+γ\kappa = \alpha - 2\beta + \gamma. The parameterization exhibits robust transfer if:

κ=α2β+γ0\kappa = \alpha - 2\beta + \gamma \leq 0

Negative κ\kappa means the loss landscape flattens with width, so prediction errors diminish at scale. Positive κ\kappa amplifies errors, degrading transfer reliability.

3. Asymptotic Loss Degradation (R()\mathcal{R}(\infty))

R()=L()Lbest()0\mathcal{R}(\infty) = L^*(\infty) - L^*_{\text{best}}(\infty) \geq 0

Measures the performance gap at scale relative to the best possible parameterization.

Ablation Strategy

To isolate which of the four differences between SP and μ\muP matters most, the authors performed all 16 ablations, systematically modifying one component at a time:

  • SP+Embd: SP with Θ(1)\Theta(1) embedding learning rate
  • μ\muP-Embd: μ\muP with Θ(1/n)\Theta(1/n) embedding learning rate
  • Similar modifications for attention scale, LayerNorm LR, and last-layer initialization

Empirical Validation / Results

SP vs. μ\muP: Surprising Similarity

Despite SP exhibiting noisier loss curves (training instabilities), both parameterizations show:

  • Comparable asymptotic loss gap R()\mathcal{R}(\infty)
  • Converging optimal learning rates ν(n)\nu^*(n) to finite asymptotic values
  • Negative robustness exponents (robust transfer)

Key difference: SP's predictability error E\mathcal{E} is ~3× larger than μ\muP's, making SP transfer unreliable in practice despite working in principle.

The Embedding Layer Learning Rate is Critical

Figure 2 demonstrates the key finding:

  • SP+Embd (Θ(1)\Theta(1) embedding LR): Eliminates training instabilities, yields smooth μ\muP-like curves
  • μ\muP-Embd (Θ(1/n)\Theta(1/n) embedding LR): Reintroduces SP-like instabilities

Figure 3 shows SP+Embd matches μ\muP across all three metrics, while other modifications (attention scaling, LayerNorm LR, last-layer initialization) contribute little or even hurt transfer.

When Does the Embedding Layer Matter Most?

Switching experiments reveal early training is most critical:

  • μ\muP → slow embedding at step tswitcht_{\text{switch}}: Causes persistent loss gap (0.1-0.2) that grows for earlier switches
  • SP → fast embedding at step tswitcht_{\text{switch}}: Eliminates instabilities and improves performance

Freezing the embedding at initialization hurts both parameterizations, but μ\muP much more than SP, showing later layers do not compensate for an untrained embedding.

Effect of Weight Decay

Fixed-step setting (Figure 5a-c):

  • R()\mathcal{R}(\infty) monotonically increases with λ\lambda (from ~0.01 to ~1 at large λ\lambda)
  • Small weight decay improves E\mathcal{E} for stable parameterizations
  • At large λ\lambda, E\mathcal{E} converges to ~0.01 across all parameterizations

Compute-optimal setting (fixed TPP = 20):

  • Most parameterizations achieve near-zero R()\mathcal{R}(\infty)
  • κ\kappa degrades sharply with increasing weight decay, converging to κ0\kappa \approx 0
  • The ηλ=Θ(1)\eta \cdot \lambda = \Theta(1) convention appears inadequate when training steps scale as Θ(n2)\Theta(n^2)

Theoretical and Practical Implications

Why Does Embedding LR Matter So Much?

The authors argue the embedding layer sits at the network boundary with no upstream processing to compensate for poor training. The Θ(1)\Theta(1) embedding learning rate is required for activation updates to be Θ(1)\Theta(1)—this first-layer update has only a single term contributing, so its scaling must be correct.

By contrast, the last-layer initialization constraint is weaker:

  • It contributes to only one of three terms in the function update Δf1\Delta f_1
  • Its importance depends on alignment assumptions that may not hold in practice
  • Learning rate warmup compensates for the higher sharpness from larger initialization

Practical Recommendations

  1. Practitioners using SP can recover μ\muP-comparable transfer by simply setting the embedding layer learning rate to Θ(1)\Theta(1) instead of Θ(1/n)\Theta(1/n)
  2. Slow embedding training may be an overlooked source of training instabilities in practice
  3. Weight decay scaling conventions need reconsideration in compute-optimal regimes

Generalization Beyond Transformers

In Section D, the authors show CNNs trained on CIFAR-100 exhibit the same pattern: SP with Θ(1)\Theta(1) input-layer learning rate matches μ\muP's transfer quality. This suggests the first/last layer special role is architecture-agnostic, arising from their boundary position in the network.

Conclusion

This work provides both a quantitative framework for evaluating hyperparameter transfer and a surprising mechanistic insight: the primary practical benefit of μ\muP over SP for AdamW-trained Transformers comes from training the embedding layer fast enough.

Key takeaways:

  1. The three metrics (E\mathcal{E}, κ\kappa, R()\mathcal{R}(\infty)) provide complementary diagnostic lenses for transfer quality
  2. The full μ\muP prescription is excessive—SP+Embd suffices
  3. Embedding layer learning rate is critical for both stability and transfer quality

Future directions:

  • Extending analysis to other optimizers (SGD, Muon) whose update geometries differ
  • Weight-tied embedding cases require careful treatment (naive SP needs 1/n1/n output multiplier)
  • Finding correct weight decay scaling in compute-optimal regimes where training horizon scales as Θ(n2)\Theta(n^2)

Limitations: Experiments limited to decoder-only Transformers with fixed depth, scaled to 1B parameters, trained with AdamW on a single dataset (FineWeb-Edu), with single random seed per configuration.

Related papers