SGDR: Stochastic Gradient Descent with Warm Restarts
Decay the learning rate along a cosine curve and periodically reset it to its peak for faster training and free model ensembles.
Standard step-decay schedules hold the learning rate flat for dozens of epochs and drop it only at hand-picked milestones. SGDR replaces those flat plateaus with smooth cosine cycles that restart back to the peak rate on a doubling period, giving strong checkpoints early and diverse models at every cycle bottom.
Explaining the paperSGDR: Stochastic Gradient Descent with Warm RestartsA 2016 paper that introduced the cosine learning-rate formula now standard across deep learning, cut the epochs needed to reach top CIFAR-10 and CIFAR-100 accuracy by 2 to 4 times, and enabled snapshot ensembles that reached 3.51% and 17.75% test error from a single run (and 3.14% and 16.21% across 16 runs).
Why the learning-rate schedule decides training
Training a neural network with parameters means finding a weight vector that minimizes a loss function measuring prediction error across a dataset. Evaluating the exact gradient over all training images on every step is too slow, so stochastic gradient descent (SGD) computes the gradient on a small random minibatch of examples (128 images in this paper) and steps downhill:
Here is the learning rate, the scalar step size multiplying the noisy minibatch gradient at step . Second-order methods such as Newton's method rescale that gradient by the inverse Hessian matrix (the matrix of second derivatives, encoding local curvature along every direction):
For the Wide Residual Networks tested in this paper, is 36.5 million (WRN-28-10) or 145.8 million (WRN-28-20). Storing would take roughly numbers, so full second-order updates are impossible. Adaptive optimizers such as Adam approximate only the diagonal of the curvature matrix with per-parameter running averages, yet in 2016 the top image-classification results on CIFAR-10, CIFAR-100, and ImageNet with ResNets were still trained with plain SGD plus momentum:
The vector is a running velocity initialized to zero, and (fixed to 0.9 throughout the paper) decides how much past gradient motion carries forward. On a steady slope , velocity builds up to , multiplying progress along consistent directions while averaging out noisy minibatch fluctuations that flip sign from batch to batch. (Zagoruyko and Komodakis used Nesterov's look-ahead momentum; Loshchilov and Hutter used the classical Polyak momentum in (3–4), verified in SGDR_WRNs.py line 259.)
With fixed and a single scalar shared across all 36.5 million weights, the schedule of over time controls the entire run. A single constant fails at one of two competing jobs. Early in training, weights start far from good solutions and need a large to cross wide regions and escape shallow saddles quickly. Late in training, minibatch gradients remain noisy even right at the bottom of a valley: if stays large, each step overshoots the floor by an amount proportional to times the gradient noise, keeping validation error high. If instead you start with a tiny , training crawls and stalls before reaching a good region.
The standard remedy in 2016 was step decay: hold constant and divide it by a fixed factor at hand-picked epoch milestones. To train WRN-28-10 on CIFAR-10 and CIFAR-100 for 200 epochs, Zagoruyko and Komodakis started at and multiplied by 0.2 at epochs 60, 120, and 160 (giving 0.1, 0.02, 0.004, and 0.0008). Picture driving across a city at 60 mph, then slamming the brakes to 12 mph only at milepost 60, then 2.4 mph at milepost 120. That schedule has two practical drawbacks. First, you must commit to the total budget of 200 epochs before training starts; stopping at epoch 50 leaves the model stuck at the noisy initial rate with poor test error. Second, the sharp drops happen at arbitrary epochs that have to be retuned whenever the dataset, batch size, or architecture changes.
How SGDR cosine annealing works
Ilya Loshchilov and Frank Hutter replaced flat plateaus and sharp drops with a smooth curve inside each training cycle (or run) of length epochs. Instead of guessing three drop epochs and a drop factor, you pick a peak rate , a floor , and the cycle length . At every minibatch step , the learning rate follows half a cosine wave from peak to floor:
The variable counts how many epochs have elapsed since the start of cycle , so the ratio runs smoothly from 0 to 1. Multiplying by sweeps the angle from to , where and . Adding 1 and dividing by 2 rescales that cosine onto , so starts at when , crosses the midpoint at , and lands at when . In all experiments in the paper, the bounds stay fixed across cycles at (or other tested initial rates) and , leaving zero extra decay-factor hyperparameters.
Work through concrete numbers for the paper's main first cycle: , , and epochs. At , . A quarter of the way in (), , so : after 25% of the cycle, the learning rate is still at 85% of its peak. At the halfway mark (), and . At three quarters (), (15% of peak), and at it reaches .
Why cosine rather than a straight linear decay from to 0? Look at the derivative of the cosine multiplier with respect to normalized progress :
Because , the cosine curve is flat at both ends and steepest in the middle (, where the slope is ). Solving gives , or . By symmetry, the curve crosses 0.25 at . Cosine annealing therefore spends exactly one third of each cycle above (making rapid global progress), one third dropping through the middle band, and one third below (settling quietly into the valley floor against minibatch noise). Linear decay spends half its budget in the middle band and only 25% at each end.
In Section 3, is updated at every minibatch, not once per epoch, taking fractional values such as 0.0013, 0.0026, and so on (with 781 minibatches of 128 images per 100,000-image epoch in the authors' code, explained in the experiments section below). If you only updated at integer epochs, a one-epoch cycle () would evaluate for all 781 batches and never anneal. In Figure 1, switch between batch-level and epoch-level updates and drag down to 1 to see the epoch-level schedule collapse to a flat line at 1.0, while the lower bar compares the 33% / 33% / 33% band split of cosine against the 25% / 50% / 25% split of linear decay.
Even at epochs, epoch-level updates keep the learning rate frozen at 1.0 for the entire first quarter of the cycle and never reach zero during the final epoch (stopping at ). Updating per minibatch makes every cycle length from upward trace the exact same smooth curve down to .
Warm restarts and doubling periods
Cosine annealing by itself still leaves the budget problem unsolved: if you set , the learning rate stays above until epoch 67 and does not reach low fine-tuning rates until after epoch 133. If you stop early or want to evaluate an architecture quickly, a single long cosine is slower to produce a usable model than even step decay.
To get good solutions early and keep improving as more compute becomes available, Loshchilov and Hutter drew on two older optimization lineages. In gradient-free evolutionary search such as CMA-ES (Covariance Matrix Adaptation Evolution Strategy), Hansen (2009) and Loshchilov et al. (2012) achieved strong anytime performance (good answers no matter when you stop the run) by starting with a small population size and doubling it after each restart. In smooth convex gradient optimization, O'Donoghue and Candès (2015) showed that accelerated gradient methods with momentum overshoot and oscillate with a period proportional to , the square root of the local condition number (the ratio of steepest curvature to shallowest curvature , distinct from the momentum coefficient in Equations 3–4), and that periodically resetting momentum recovers the optimal linear convergence rate. (Separately, Leslie Smith introduced Cyclical Learning Rates in 2015, ramping the rate linearly up and down in a triangle between a lower and upper bound rather than annealing to zero and jumping back.)
SGDR adapts the restart idea to deep neural networks in the simplest possible way: once epochs finish and reaches , reset back to 0 so jumps straight back to , while keeping the current weights as the starting point. That is why the restart is warm rather than cold (cold restarts re-initialize the weights randomly from scratch). After each restart, the new cycle length grows by a factor , so . Summing the cycle lengths gives the cumulative epoch at which the -th cycle ends:
Plug in the paper's two doubling schedules to see what (6) produces inside a 200-epoch budget. With and , the cycles last 10, 20, 40, 80, and 160 epochs, so complete descents finish at epochs 10, 30, 70, 150, and 310. By epoch 30, long before step decay has taken its first drop at epoch 60, SGDR has already finished two full cosine decays. With and , the cycles last 1, 2, 4, 8, 16, 32, 64, and 128 epochs, landing at epochs 1, 3, 7, 15, 31, 63, 127, and 255. Setting gives fixed-width periodic restarts (every 50 or 100 epochs), and setting gives a single cosine decay with zero restarts.
What happens to the momentum velocity from (3) when jumps back up? The paper writes that the size of the learning-rate jump controls how much previously acquired momentum carries over, and reading SGDR_WRNs.py (lines 259 and 314–317) settles the exact mechanism: the velocity buffer is never explicitly zeroed. Instead, during the tail of the finished cycle, has been near zero for hundreds of minibatches, so the update shrinks by a factor of 0.9 on every batch (). When jumps back to 0.05 on the next batch, the leftover velocity is already tiny and the new high-rate gradient term immediately dominates the update.
Figure 2 puts all of these schedules side by side over 200 epochs. Switch between the four paper presets, toggle the log y-axis (the paper notes in Section 3 that plotting its own Figure 1 on a log scale hides the symmetric cosine arch), and hover across epochs to read the active cycle and learning rate.
Notice the consequence of geometric doubling when a budget does not align with a cycle boundary. Under , the fourth cycle ends at epoch 150 and the fifth runs until epoch 310, so a 200-epoch run stops only 31% through cycle five while is still at 0.039. Under , the last completed cycle inside 200 epochs ends at epoch 127. That mismatch between the wall-clock epoch and the cycle bottom is why SGDR needs a rule for which checkpoint to return.
Post-restart spikes and the incumbent rule
Jumping from 0 back to 0.05 abruptly increases the step size by orders of magnitude. On the very next minibatches, the weights bounce off the quiet basin floor they just settled into, and both training loss and test error spike upward. Returning the latest weights right after a restart would hand back a temporarily degraded model.
SGDR avoids that degradation with a two-part incumbent solution rule (Section 3):
- During the first cycle (before the first restart), recommend the current weights .
- After the first cycle, recommend the checkpoint saved at the end of the most recently completed cycle, where .
This rule needs no held-out validation split to pick a checkpoint: you know in advance which epochs reach , so you simply save the model there and keep serving it during the noisy early half of the next cycle until the next cycle finishes. It also explains how to read the curves in the paper's Figure 2: for SGDR, the authors plot only the recommended incumbent error, which stays flat between restarts and steps downward at epochs 10, 30, 70, and 150 (for ).
Figure 3 runs a 2D toy simulation (not a measurement from the paper) of SGD with momentum (3–4) and deterministic minibatch noise on a three-basin surface. Watch the right panel in SGDR mode: live loss (teal) jumps after steps 10, 30, and 70, while the incumbent loss (amber) stays flat across every spike and updates only at the cycle bottoms. Switch to Single cosine and Step decay to compare when each schedule settles into low loss, and drag Gradient noise down to 0 to see how much of the late-stage benefit depends on stochastic minibatch noise.
Loshchilov and Hutter explicitly refuse to claim that warm restarts improve single-model accuracy by kicking SGD out of sharp local minima into wider basins: in Section 5 they write that while restarts can help on multimodal functions, they "do not claim that we observe any effect related to multi-modality." On a single training run, aggressive cosine annealing and scanning through the full learning-rate range from down to 0 already account for much of the speedup. Multi-basin diversity shows up clearly only when we combine checkpoints from separate cycles into an ensemble two sections down.
Anytime speed vs. single-cycle cosine
The paper's main benchmarks train Wide Residual Networks (WRNs) from Zagoruyko and Komodakis (2016) on CIFAR-10 and CIFAR-100: 50,000 training images and 10,000 test images of size across 10 or 100 object classes. The metric throughout is test classification error (%), the percentage of the 10,000 test images misclassified (lower is better). A WRN-- is a residual network with convolutional layers and times as many channels per layer as a standard CIFAR ResNet, using batch normalization and no dropout in the authors' runs. WRN-28-10 has 36.5 million parameters; doubling the width gives WRN-28-20 with 145.8 million parameters and roughly 3 to 4 times more compute per epoch.
Every run uses minibatch size 128, classical momentum 0.9, L2 weight penalty 0.0005, per-pixel mean subtraction (no ZCA whitening, which decorrelates image pixels before training), random 4-pixel padded crops, and a 200-epoch budget. In SGDR_WRNs.py (lines 83–88, 290) and Section 8.1 (Supplementary Material), horizontal flips are concatenated onto the 50,000 training images (inherited from the Lasagne ResNet recipe), so each reported epoch passes over 100,000 images (781 batches of 128) rather than 50,000. Both the default step-decay baselines and every SGDR run share the exact same 100,000-image epoch definition, and a control experiment in Section 8.1 on WRN-28-1 with 50,000-image epochs confirmed the same anytime advantage.
Two distinct findings stand out in Table 1 (medians of 5 runs for WRN-28-10 and 2 runs for WRN-28-20; the Table 1 caption cautions that these sample sizes are too small for formal statistical tests). First, cosine annealing alone (, zero restarts) already beat step decay on single-model CIFAR-10 accuracy: 3.86% vs. 4.13% (default ) and 4.24% (default ) on WRN-28-10, and 3.66% vs. 3.96% on WRN-28-20. That single-cycle schedule needs only two hyperparameters ( and total epochs), yet it has the worst intermediate test error of any method until right before epoch 200.
Second, doubling warm restarts ( and ) hit ~4% test error on CIFAR-10 and ~20% on CIFAR-100 roughly 2 to 4 times faster than step decay, and beat single-cycle cosine outright on the harder 100-class CIFAR-100 task:19.58% vs. 19.98% (single cosine) and 20.21% (step decay) on WRN-28-10, and 18.70% vs. 19.69% (single cosine) and 19.67% (step decay) on WRN-28-20. Remember from (6) that reached those numbers at its epoch-150 checkpoint, and reached 4.09% / 19.74% (WRN-28-10) and 3.91% / 18.90% (WRN-28-20) at epoch 127. Even more practically, training the 3–4× heavier WRN-28-20 for only 50 epochs with pushed CIFAR-100 error below 19%, beating every 200-epoch WRN-28-10 run in the same wall-clock time. The supplementary loss-and-error curves (Figure 7 of the paper) also show that after epoch 120 the step-decay baseline began overfitting (test error rose while training loss fell), whereas SGDR showed only mild overfitting.
Figure 4 plots every verified number from Tables 1 and 2. Toggle between CIFAR-10 and CIFAR-100, switch between WRN-28-10, WRN-28-20, and Ensembles, and click any row to compare its gap against the baseline and see which epoch produced its final checkpoint.
To verify that these gains were not specific to CIFAR, the authors ran two additional domains. On an electroencephalographic (EEG) brain-signal dataset classifying real left-hand, right-hand, and foot movements across 14 subjects (~1,000 trials per subject) with convolutional networks, the baseline schedule required fixing total epochs in advance (30 to 480 epochs) and achieved a median reference error around 9%. SGDR matched the long-run accuracy while giving better anytime error without committing to a budget upfront, and averaging saved end-of-cycle snapshots (snapshot ensembling, detailed next) cut error by 1 to 2 percentage points from a single run and 2 to 3 percentage points across two learning-rate settings ( and ). On a harder 32×32 downsampled ImageNet dataset containing all 1,000 ImageNet classes (two orders of magnitude fewer pixels per image than full ImageNet), 40 epochs of WRN-28-10 with SGDR () reached 39.24% top-1 error (fraction of images whose top guess is wrong) and 17.17% top-5 error (fraction where the true class is not among the top 5 guesses), matching full-resolution AlexNet's 40.7% / 18.2% despite 50 times fewer pixels per image. Scanning across learning rates from to 0 also made SGDR less sensitive to an imperfect initial learning rate.
Snapshot ensembles without extra training
Shortly after the first arXiv version of SGDR appeared in August 2016, Huang et al. (2017) proposed Snapshot Ensembles: instead of discarding the earlier end-of-cycle checkpoints when a new SGDR cycle finishes, keep the last checkpoints saved right before warm restarts and average their softmax class-probability vectors at test time:
Here is a test image and is the -class softmax probability vector output by checkpoint ( for CIFAR-10, for CIFAR-100). Concrete 3-class example: suppose the true class is class 0, and three checkpoints output (wrong, predicts class 1), (right), and (right). Their uniform average (7) is , flipping the wrong first vote into a confident right prediction. Notice what that rescue required: the checkpoints had to disagree on that image.
Loshchilov and Hutter tested this recipe on WRN-28-10 trained with , taking snapshots at epochs 30, 70, and 150 (right before the restarts where hits 0). Table 2 (and the Ensembles tab of Figure 4) reports the payoff:
- Single model (, epoch 150, median of 16 runs): 4.03% on CIFAR-10 and 19.57% on CIFAR-100.
- Single-run snapshot ensemble (, epochs 30, 70, 150): 3.51% on CIFAR-10 and 17.75% on CIFAR-100, dropping CIFAR-100 error by 1.82 percentage points with zero extra training epochs. Matching that accuracy with independent single-snapshot runs required , so snapshot ensembling delivered a 3× training-compute speedup.
- Three runs × three snapshots (, 9 models): 3.25% on CIFAR-10 and 16.64% on CIFAR-100, beating ensembles of 18 and even 21 independent single-snapshot runs ().
- Sixteen runs × three snapshots (, 48 models): 3.14% on CIFAR-10 and 16.21% on CIFAR-100, new state-of-the-art marks at the time.
Why did snapshots from epochs 30, 70, and 150 work so well when the authors' control experiment (averaging checkpoints from consecutive late epochs 148, 149, and 150) failed to improve on the single epoch-150 model? For predictions each with variance and pairwise error correlation , the variance of their average is:
When (identical models), the fraction equals 1 and adding more snapshots buys nothing. Between epochs 148 and 150, is near zero, so the weights barely move and stays close to 1. Between epochs 30, 70, and 150, two full warm restarts kick the weights across the loss surface into distinct regions, lowering enough for averaging to cancel errors. Figure 5 simulates 200 test examples at an individual error rate near 20% (matching CIFAR-100 WRN-28-10) so you can compare the two regimes directly: click Adjacent epochs (148–150) versus Restart snapshots (30, 70, 150) and watch the amber rescued-example cells appear only when drops away from 1.
Notice the one real cost that snapshot ensembling does not remove: inference cost. Training snapshots inside one run costs 1× training compute, yet running the ensemble in production still requires forward passes and sets of stored weights (109.5 million parameters for three WRN-28-10 checkpoints), unless you distill the ensemble back into one student network.
Implementation, PyTorch, and limits
The complete SGDR training loop adds five lines around standard SGD with momentum: track the fractional epoch counter , compute via (5) before each minibatch update (3–4), and save a checkpoint before resetting and multiplying by at the end of each cycle.
# SGDR loop with classical momentum (Eqs. 3-5) and snapshot saving (Eq. 7)
# x: [P] flattened weights (36.5M for WRN-28-10), v: [P] velocity buffer
v = zeros_like(x) # [P] initialized to 0
T_i = T_0 # current cycle length in epochs (e.g. 10)
T_cur = 0.0 # fractional epochs since last restart
snapshots = [] # checkpoints saved at eta_t = eta_min
for epoch in range(num_epochs):
for xb, yb in loader: # xb: [128, 3, 32, 32], yb: [128]
# Eq. (5): cosine annealing evaluated at every minibatch
eta_t = eta_min + 0.5 * (eta_max - eta_min) * (1.0 + cos(pi * T_cur / T_i))
g = grad_loss(x, xb, yb) # [P] minibatch gradient + L2 term
v = mu * v - eta_t * g # [P] Eq. (3): momentum velocity (mu = 0.9)
x = x + v # [P] Eq. (4): weight update
T_cur += 1.0 / len(loader) # fractional epoch advance (1/781 in code)
if round(T_cur, 6) >= T_i: # completed run i at eta_t ~ eta_min
snapshots.append(x.copy()) # incumbent checkpoint for this cycle
T_cur = 0.0 # reset phase: next batch jumps to eta_max
T_i = T_i * T_mult # double cycle length when T_mult = 2
# v is NOT reset here; it already shrank while eta_t -> 0
# Eq. (7): snapshot ensemble prediction on a test batch x_test: [B, 3, 32, 32]
# probs: [B, K] averaged softmax probabilities (K = 10 or 100 classes)
probs = sum(softmax(forward(w, x_test)) for w in snapshots[-M:]) / MIn SGDR_WRNs.py (lines 306–312), the authors wrote Equation (5) in the algebraically identical sine-shifted form lr * (1 + sin(pi/2 + tt)) / 2 (since ) and stepped tt by pi / (Te * batches_per_epoch) after each batch. PyTorch ships both modes directly in torch.optim.lr_scheduler: CosineAnnealingWarmRestarts for full SGDR with and , and CosineAnnealingLR for the single-cycle (, zero-restart) special case.
import torch
from torch.optim.lr_scheduler import CosineAnnealingLR, CosineAnnealingWarmRestarts
# SGDR with doubling restarts (T_0=10, T_mult=2 -> restarts at 10, 30, 70, 150)
opt = torch.optim.SGD(model.parameters(), lr=0.05, momentum=0.9, weight_decay=5e-4)
sched = CosineAnnealingWarmRestarts(opt, T_0=10, T_mult=2, eta_min=0.0)
for epoch in range(200):
for step, (xb, yb) in enumerate(loader): # xb: [128, 3, 32, 32], yb: [128]
sched.step(epoch + step / len(loader)) # fractional T_cur per Eq. (5)
loss = criterion(model(xb), yb)
opt.zero_grad(); loss.backward(); opt.step()
# Single-cycle cosine (T_0 = total steps, 0 restarts; used in modern LLM training)
single = CosineAnnealingLR(opt, T_max=total_steps, eta_min=0.005)In PyTorch, calling sched.step(epoch + frac) inside the minibatch loop (with frac = step / len(loader), as in the listing above) passes fractional epochs to CosineAnnealingWarmRestarts, matching Section 3 and (5) even when . Calling sched.step() once per epoch instead reproduces the coarse staircase shown in Figure 1.
Two follow-up developments explain how SGDR is used today. First, a year later Loshchilov and Hutter paired cosine warm restarts with decoupled weight decay in AdamW (calling the warm-restart variant AdamWR), showing that decoupling L2 decay from Adam's adaptive denominator was needed before Adam benefited cleanly from cosine schedules. Second, large language model pretraining recipes such as LLaMA and Chinchilla adopted single-cycle cosine annealing from Equation (5) with a short linear warmup and a nonzero floor rather than repeated restarts: when a pretraining run has a fixed token budget and produces one model, single-cycle cosine delivers smooth late convergence without post-restart loss spikes (just as won single-model CIFAR-10 in Table 1).
SGDR also has clear operational limits. You still have to choose , , and , and if is kept fixed across cycles on a sensitive objective, a late restart can jump out of a good region without returning to a better one (the authors note in Section 5 that decaying across cycles or reverting to the incumbent checkpoint on validation regression addresses this). Under doubling schedules, stopping partway through a long late cycle wastes the epochs since the last checkpoint under the incumbent rule, so when a budget is known upfront you can solve (6) backward for doubling cycles as (for example, 4 cycles in 150 epochs gives ). Modern Transformer training also prepends a short linear warmup before cosine decay to stabilize early adaptive updates, whereas the batch-normalized CIFAR networks here start directly at .
Questions you might still have
Why do modern LLM training runs use cosine annealing without warm restarts?
When the total token budget is fixed upfront and you only want one final model, single-cycle cosine annealing (T_0 equal to the full run, T_mult = 1) already gets the smooth decay of Equation (5) without post-restart loss spikes. In SGDR Table 1, that single-cycle special case achieved the lowest single-model CIFAR-10 error (3.86% on WRN-28-10 and 3.66% on WRN-28-20). Warm restarts matter most when the total budget is uncertain (anytime performance), when you want snapshot ensembles at no extra training cost, or on harder multi-class tasks like CIFAR-100 where restarts beat single-cycle cosine.
Does a warm restart reset the momentum velocity buffer to zero?
Not in the authors' official code (SGDR_WRNs.py, lines 259 and 314-317), and not in PyTorch's CosineAnnealingWarmRestarts. Only the learning-rate phase counter T_cur resets to zero. Because eta_t has just annealed down to eta_min = 0 over hundreds of batches at the end of the previous cycle, the velocity buffer v_t = 0.9 * v_{t-1} - eta_t * g_t has already decayed close to zero before the jump, so the new high-LR gradients dominate within a few steps.
If you run T_0 = 10, T_mult = 2 for 200 epochs, are epochs 151 to 200 wasted?
For the single-model incumbent rule, yes: cycles end at epochs 10, 30, 70, 150, and 310, so at epoch 200 the recommended checkpoint is still the one from epoch 150. The extra 50 epochs are the start of a 160-epoch fifth cycle that never finishes. In practice, you pick T_0 and T_mult (or stop at epoch 150 or 310) so the budget lands on a cycle end.
Why did averaging checkpoints from epochs 148, 149, and 150 fail to beat a single model?
At the end of a cosine cycle, eta_t is close to zero, so the weights barely move between epochs 148 and 150. Those three models sit in the same basin and make nearly identical mistakes (pairwise error correlation close to 1). Averaging nearly identical predictions cannot cancel variance. The restart jumps at epochs 30 and 70 push the weights far enough apart that the checkpoints at epochs 30, 70, and 150 disagree on a meaningful share of errors.
Does SGDR work with adaptive optimizers like Adam as well as SGD?
The 2016 SGDR paper tested only SGD with momentum and listed Adam as future work. A year later, the same authors (Loshchilov & Hutter, 2017) paired cosine warm restarts with decoupled weight decay in AdamW, calling the combination AdamWR, and showed that decoupling weight decay from Adam's adaptive denominator made warm restarts work reliably with Adam too. The AdamW explainer covers that pairing.
Do warm restarts prove that SGD is escaping bad local minima into better ones?
The authors explicitly caution against claiming that for single-model training: in Section 5 they write that they "do not claim that we observe any effect related to multi-modality." Faster convergence within a single run can come from scanning a wide range of learning rates and annealing aggressively, while the follow-up Snapshot Ensembles work showed that separate cycles do end in distinct enough regions to form strong ensembles.
Footnotes & further reading
- The paper: Ilya Loshchilov & Frank Hutter, SGDR: Stochastic Gradient Descent with Warm Restarts (ICLR 2017; arXiv:1608.03983), with the official Lasagne implementation at github.com/loshchil/SGDR.
- Wide Residual Networks baseline: Sergey Zagoruyko & Nikos Komodakis, Wide Residual Networks (BMVC 2016; arXiv:1605.07146), building on ResNet (He et al., 2015).
- Adaptive restarts in accelerated convex optimization: Brendan O'Donoghue & Emmanuel Candès, Adaptive Restart for Accelerated Gradient Schemes (Foundations of Computational Mathematics, 2015; arXiv:1204.3982).
- Cyclical schedules: Leslie N. Smith, Cyclical Learning Rates for Training Neural Networks (WACV 2017; arXiv:1506.01186).
- Snapshot ensembling: Gao Huang, Yixuan Li, Geoff Pleiss, Zhuang Liu, John E. Hopcroft & Kilian Q. Weinberger, Snapshot Ensembles: Train 1, Get M for Free (ICLR 2017; arXiv:1704.00109).
- Follow-up pairing cosine warm restarts with decoupled weight decay: Ilya Loshchilov & Frank Hutter, Decoupled Weight Decay Regularization (AdamW) (ICLR 2019; arXiv:1711.05101). See also Adam (Kingma & Ba, 2015) and LLaMA for single-cycle cosine schedules in language model pretraining.
How could this explainer be improved? Found an error, or something unclear? I read every message.