Paper commentary
SGDR: Stochastic Gradient Descent with Warm Restarts
Warm restarts with cosine decay speed up training of deep networks
- Problem Fixed step learning rate schedules need many epochs to reach good test error on deep networks. Training with them is slow, so the rate is hard to tune for speed.
- Method SGDR restarts the learning rate at set points and lets it decay along a cosine curve. Each restart keeps the current weights instead of starting from scratch, so only the rate jumps up.
- Results On CIFAR-10 SGDR reached a median test error of 4.03 with WRN-28-10, versus 4.24 for the default schedule. It reached this with 2 to 4 times fewer epochs.
Why fixed-step learning rate schedules are slow
Residual networks currently post the top reported results on CIFAR and ImageNet, and they are trained with plain SGD with momentum. For such models the scheduling of the learning rate, together with the amount of L2 weight decay, is the main practical difficulty. A common schedule keeps the rate constant and divides it by a fixed constant at roughly regular intervals.
The blue line in Figure 1 shows this default schedule as used by Zagoruyko & Komodakis (2016) with an initial rate of 0.1. The authors' concern is speed: their warm restart schedule reached comparable results with 2 to 4 times fewer epochs.
Warm restarts with a cosine learning rate
The core idea is to raise the learning rate at restart points, keep the current weights, and let the rate decay again along a cosine curve. A restart does not begin from scratch, because the previous parameter vector is still the starting point and only the rate jumps up. The size of that jump sets how much of the earlier momentum carries over into the new run.
Within the i-th run, the rate is set for every batch with the following formula. T_cur counts the epochs since the last restart and advances by one batch at a time, so it can take fractional values such as 0.1. At T_cur = 0 the rate equals eta_max, and once T_cur reaches T_i it falls to eta_min.
The authors keep eta_max and eta_min the same in every run, which limits the number of hyperparameters. The recommended solution is the point at the end of the last completed run, where the rate equals eta_min, so no separate validation set is needed.
Single-model results on CIFAR
The authors trained WRN-28-10 with SGD with momentum on CIFAR-10 and CIFAR-100 under moderate augmentation with flips and translation. Reproducing the default schedule with an initial rate of 0.1 gave a median of 4.24 test error on CIFAR-10 and 20.33 on CIFAR-100 over 5 runs. The initial rate of 0.05 did better, with 4.13 and 20.21, so the authors used 0.05 in their later experiments.
With restarts after T_0 = 10 and doubling periods, the median test error was 4.03 on CIFAR-10 and 19.58 on CIFAR-100. These values compare to 4.24 and 20.33 for the default schedule with an initial rate of 0.1. The authors use the doubling to reach good test error early, and they report about 2 to 4 times faster progress than the default schedule.
A single run with T_0 = 200 and T_mult = 1 gave the lowest CIFAR-10 error in this comparison, at 3.86. Its CIFAR-100 error of 19.98 is higher than several other SGDR settings, so the authors suggest the original WRN schedule may be suboptimal in these settings.
Since SGDR reaches good error sooner, the authors also trained WRN-28-20, which improved by about 0.25% on CIFAR-10 and by about 0.5 to 1.0% on CIFAR-100. The default schedule overfits after about epoch 120, as its test error rises, while SGDR shows only very mild overfitting.
Snapshot ensembles from restart points
Following Huang et al. (2016a), the authors save snapshots right before the last restarts and average their predictions, which gives an ensemble without extra training runs. The baseline is WRN-28-10 trained with SGDR at T_0 = 10 and T_mult = 2, with a median test error of 4.03 on CIFAR-10 and 19.57 on CIFAR-100 over 16 runs. Averaging three snapshots from one run, taken at epochs 30, 70 and 150, lowered these values to 3.51 and 17.75.
Snapshots from independent runs also help, but each extra run costs a full training: three runs with three snapshots each gave 3.25 and 16.64. The authors describe the single-run snapshots as a 3-fold speedup in these settings, because the extra snapshots of one run come at no added training cost. Sixteen runs with three snapshots each gave 3.14 on CIFAR-10 and 16.21 on CIFAR-100, the lowest values in the ensemble experiments.
Averaging the last three epochs, 148, 149 and 150, did not improve on the single snapshot at epoch 150. The authors read this as support for the view of Huang et al. (2016a) that snapshots spaced along the restart trajectory provide useful diversity.
Preliminary runs on downsampled ImageNet and EEG
The downsampled ImageNet keeps the same images from 1000 classes, resized to 32 by 32 pixels. SGDR with T_0 = 10, T_mult = 2 and eta_max = 0.01 reached 39.24% top-1 error and 17.17% top-5 error. These values are close to the 40.7% and 18.2% reported for AlexNet on full-size ImageNet, which has about 50 times more pixels per image. That is a comparison with a different and larger setup, so it is not a controlled comparison.
Snapshots from a single SGDR run lowered this error by 1 to 2%, and snapshots from both hyperparameter settings lowered it by 2 to 3%. The authors call these EEG results preliminary.
Limitations
The authors do not claim that warm restarts exploit multimodality of the objective, and they only note that restarts can help on multimodal functions. The preliminary ImageNet study did not run longer than about 40 epochs, and the authors expect longer runs and tuning to improve the results. Ensemble gains were measured only with WRN-28-10 as the base model, and the authors expect better base models to help.
SVHN, MS COCO, and warm restarts with AdaDelta or Adam were left to future work and were not tested. Restarts often worsen performance for a while, so the last iterate is not always the recommended solution.
Paper info
- Authors
- Ilya Loshchilov, Frank Hutter
- Venue
- arXiv · Preprint
- First published
- 2016-8-13
- Added
- 2026-11-6
- Updated
- 2017-5-3
- Version
- v5
- arXiv
- 1608.03983
- Category
- cs.LG · cs.NE · math.OC
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Ilya Loshchilov, Frank Hutter (2016). SGDR: Stochastic Gradient Descent with Warm Restarts. arXiv:1608.03983v5. https://arxiv.org/abs/1608.03983v5
BibTeX
@misc{loshchilov2016sgdr,
title = {{SGDR: Stochastic Gradient Descent with Warm Restarts}},
author = {Ilya Loshchilov and Frank Hutter},
year = {2016},
eprint = {1608.03983},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1608.03983v5}
}