Cosine Learning Rate Schedule › Summary
Language AI HandbookAll chapters Cosine Learning Rate Schedule › SummaryOne section · Sections in this chapter13 / 14 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
The cosine learning rate schedule applies the cosine function to interpolate the learning rate smoothly from a peak value down to a minimum over a fixed number of training steps. Its key properties are:
- The decay rate is slow at the start and end of training and fastest in the middle, matching the natural phases of gradient descent.
- Cosine decay consistently outperforms step decay (no abrupt drops) and slightly outperforms linear decay in final model quality, because it front-loads exploration and back-loads convergence.
- The derivative of the cosine schedule is a scaled sine function, which is zero at the boundaries and maximal at the midpoint. This gives the schedule its characteristic pacing.
- Warm restarts (SGDR) periodically reset the learning rate, helping the optimizer escape sharp minima and enabling snapshot ensembling. They are most useful in computer vision and fine-tuning scenarios, and are less common in large-scale LLM pretraining.
- The most common production configuration combines a short linear warmup (1-5% of total steps) with a long single-cycle cosine decay.
- Critical hyperparameters are , (typically ), total decay steps , and (when using restarts) cycle length and multiplier .
- The trapezoidal schedule tolerates variable training durations better, at the cost of a concentrated cooldown phase.
The cosine schedule is now the de facto standard for training large language models, not because it is theoretically optimal but because it is smooth, interpretable, and empirically reliable across a broad range of training scenarios. The worked numerical examples above make clear exactly how the formula allocates the learning rate budget across training, and the PyTorch implementations show how to apply these principles directly in practice.