Abstract
Learning rate scheduling is essential in transformer training, where the final annealing plays a crucial role in getting the best performance. However, the mechanisms behind this cooldown phase, with its characteristic drop in loss, remain poorly understood. To address this, we provide a comprehensive analysis focusing solely on the cooldown phase in the Warmup-Stable-Decay (WSD) learning rate scheduler. Our analysis reveals that different cooldown shapes reveal a fundamental bias-variance trade-off in the resulting models, with shapes that balance exploration and exploitation consistently outperforming alternatives. Similarly, we find substantial performance variations — comparable to those from cooldown shape selection — when tuning AdamW hyperparameters. Notably, we observe consistent improvements with higher values of $\beta_2$ during cooldown. From a loss landscape perspective, we provide visualizations of the landscape during cooldown, supporting the river valley loss perspective empirically. These findings offer practical recommendations for configuring the WSD scheduler in transformer training, emphasizing the importance of optimizing the cooldown phase alongside traditional hyperparameter tuning.
Introduction
In Large Language Model (LLM) training, the Warmup-Stable-Decay (WSD) scheduler has emerged as a flexible alternative to traditional cosine decay. Unlike cosine decay, which requires a predefined total step count, WSD maintains a constant "stable" learning rate before initiating a final "cooldown" phase. This cooldown period is critical, often accounting for the most significant drops in validation loss. Despite its importance, the internal dynamics of this phase have remained largely unexplored. This paper investigates how different cooldown shapes and optimizer hyperparameters influence model performance through the lens of a bias-variance framework.
The WSD Scheduler and Cooldown Dynamics
The WSD scheduler consists of three phases: a brief warmup to a peak learning rate, a stable phase at that peak, and a final decay to zero. The shape of this decay—whether linear, square root, or otherwise—significantly impacts the final model quality.
The authors evaluate these dynamics using a 210M parameter Llama-like Transformer trained on datasets like SlimPajama and FineWeb-Edu. By freezing the model at various points and using linear probing, they found that deeper layers undergo the most significant refinement during the cooldown, suggesting that the "drop" in loss is primarily driven by the optimization of high-level representations.
Bias-Variance Trade-off and the Loss Landscape
A central contribution of this work is the application of a bias-variance framework to evaluate cooldown shapes. Bias is measured relative to a long-trained reference model, while variance is measured as the inconsistency between runs with different data shufflings.
The analysis reveals a fundamental trade-off:
- Exploration (High Bias, Low Variance): Shapes that drop the learning rate quickly (e.g.,
linear 0.1) act as exploiters, settling into local basins but potentially missing better global regions. - Exploitation (Low Bias, High Variance): Shapes that maintain a high learning rate longer (e.g.,
square) encourage exploration, finding better regions but resulting in higher variance between runs. - The Sweet Spot: Shapes like
sqrt(square root) andlowered linear 0.7balance these forces, effectively navigating the "river valley" of the loss landscape to find deep, stable basins.
Optimization Insights: AdamW and Batch Size
Beyond the scheduler shape, the authors identify critical interactions with optimizer hyperparameters. Specifically, increasing the AdamW $\beta_2$ parameter during the cooldown phase consistently improves performance. This suggests that as the learning rate decreases, the optimizer benefits from a longer-term memory of gradient variance to maintain stability.
Furthermore, increasing the batch size during cooldown was found to be beneficial. This is attributed to an improved "token half-life" — the effective number of tokens the optimizer considers — which becomes more favorable at larger scales.
Conclusion
The cooldown phase of the WSD scheduler is not merely a final descent but a sophisticated optimization process. By selecting shapes that balance exploration and exploitation, such as square root decay, and tuning optimizer parameters like $\beta_2$ during the final phase, practitioners can achieve performance gains comparable to extensive hyperparameter sweeps. These findings provide a theoretical and empirical foundation for more principled transformer training.
Summary updated