Learning Rate Schedules: A Deep Mathematical Dive
Beyond cosine annealing — understanding why different learning rate schedules work from an optimization theory perspective.
The Most Important Hyperparameter
The learning rate is arguably the single most impactful hyperparameter in deep learning. Too high and training diverges; too low and it takes forever or gets stuck in suboptimal minima.
Constant Learning Rate: When It Fails
With a constant learning rate \eta, SGD converges to a neighborhood of the minimum with radius proportional to \eta:
The first term decreases with T (more steps), but the second term is a fixed floor set by the learning rate and gradient noise.
Warmup: Building Momentum
Learning rate warmup serves a critical mathematical purpose: in the early stages of training, the model's statistics (batch norm, attention patterns) are far from their converged values. Large gradients on random features can cause irreversible damage to the loss landscape exploration.
Warmup lets the model "find its footing" before taking large steps.
Cosine Annealing
Why cosine? It provides:
The WSD Schedule (Warmup-Stable-Decay)
Recent LLM training has converged on WSD:
This works because large models need sustained high learning rates to explore the vast parameter space before settling.
Practical Wisdom
The optimal schedule depends on your loss landscape. Highly non-convex landscapes (deep networks) benefit from aggressive exploration followed by careful refinement. The mathematics of stochastic optimization gives us the theory; practice requires experimentation within theoretically motivated bounds.