TL;DR
A cyclical learning rate changes the step size of training on a repeating triangle: it climbs from a low value to a high value, falls back, and repeats, instead of only shrinking over time. Leslie Smith proposed it in 2015 as a simple way to pick and move the learning rate, and in his experiments networks often reached good accuracy in fewer steps than with a fixed rate.
Builds on: Stochastic Gradient Descent, Learning Rate · Leads to: SGD with warm restarts, SGDR
Where it's used
Image classifiers. Smith's experiments trained standard convolutional networks to label photos in CIFAR-10, a common benchmark of small labelled images, with a triangle wave between two bounds. He reported that the cyclical schedule reached accuracy comparable to a carefully tuned fixed rate, in fewer training iterations.
Fast training budgets. When a team can afford only a few epochs, a short cycle lets it see the high-rate and low-rate phases several times in one run, without a separate search for a decay schedule.
Warm restarts. Later work by Loshchilov and Hutter, in SGDR, used the same idea with a smooth cosine curve, restarting the rate at its high value on purpose so the model can settle into a new region after each restart.
How it works
Take a tiny training run with 9 steps. Set the lowest rate to 0.001 and the highest to 0.01. Let one half-cycle last 2 steps, so the full cycle is 4 steps long.
- Start at the floor. At step 0 the rate is the lowest value, 0.001. Check: it equals the lower bound.
- Climb halfway. Each step moves a fixed fraction of the way from the lower bound to the upper bound. Over the first half-cycle of 2 steps, the rate covers the full gap of 0.009 in 2 steps, so each step adds 0.0045. At step 1 the rate is 0.001 + 0.0045 = 0.0055. Check: it sits halfway between the bounds.
- Reach the peak. At step 2 the rate is 0.001 + 0.009 = 0.01. Check: it equals the upper bound.
- Fall back. Over the next 2 steps the rate comes down by 0.0045 each step. At step 3 it is 0.0055, and at step 4 it is back to 0.001. Check: the cycle has returned to the floor.
- Repeat. Steps 5 to 8 repeat steps 1 to 4. The rate at step 5 is 0.0055, at step 6 it is 0.01, at step 7 it is 0.0055, and at step 8 it is 0.001.
The rate never stays put. It keeps cycling between the same two values while the loss goes down overall, because each mini-batch update uses the current rate.
- cyclical rate
The math
Let be the lower bound, the upper bound, and the half-cycle length in steps. The rate at step is
Here rounds down, so the rate is a triangle wave in with period .
Step 2 in symbols: the linear climb
Within the first half-cycle, , the floor is 1, so . For that gives , and
The rate rises in a straight line from at to at . With , , , at this gives , matching step 2 above.
Step 4 in symbols: the fall
In the second half-cycle, , the floor is still 1, so , which is non-negative here. Then
At this is . At the rate reaches the floor, , and the next climb begins.
Step 5 in symbols: periodicity
The function has period , so . For the example, , , and so on.
- one full period
Worked examples
- Lower bound 0.001, upper bound 0.01, half-cycle .
- At : , so .
- At : , so , and .
- At : , so , and .
- Interpretation: the rate returns to the floor at every multiple of the period 4 and peaks halfway between.
Try it: find from the formula. Answer: , so and .
Set the bounds to 0.01 and 0.1 and the half-cycle to steps, so the full cycle is 100 steps.
- At the rate is the floor, 0.01.
- At (halfway up the climb) the rate is .
- At the rate is the peak, 0.1.
- At the rate has come halfway back down, .
- At it is back to 0.01, and the next cycle begins.
- Interpretation: over one 100-step block the rate spends equal time in the lower and upper half of its range, so the average rate over a full cycle is 0.055.
Try it: what is the rate at ? Answer: is 30 steps into the second cycle, so it is on the climb at .
Train an image classifier on 50000 training images with a batch size of 128, meaning each update uses 128 images. One epoch is a full pass over all 50000 images, which takes steps. Pick a half-cycle of 2 epochs, so steps.
- The full cycle is steps, which is 4 epochs.
- Over a 10-epoch run there are steps.
- Number of full cycles: . The run ends two full cycles plus steps into the third, which is exactly half a cycle, so the rate is at its peak.
- Suppose the bounds come from a short sweep: raise the rate over one cycle and note the rates where the loss falls fastest and where it starts to rise. Use those as the lower and upper bounds.
- Interpretation: the run ends at a learning rate near its peak, which is a poor place to stop. Choosing a total length that is a whole number of cycles makes the last rate return to the floor.
Try it: with the same settings, how many epochs should the run last to end exactly at a floor? Answer: the run must cover a whole number of 4-epoch cycles, so 4, 8 or 12 epochs. The shortest, 4 epochs, ends at a floor.
Common mistakes and tradeoffs
It is tempting to think a learning rate should only go down, because lowering it helps the final fit. In fact a high rate helps the search escape flat regions and poor spots, which is why Smith's schedule goes back up. The decay happens within each cycle, and the peaks are the exploration.
It is tempting to think a cyclical schedule needs no tuning. In fact the two bounds still matter. Smith suggested a short sweep that raises the rate slowly and watches the loss, then uses the rates where the loss falls fastest and where it starts to rise. This is a cheap search, but it is still a search.
It is tempting to think the cycle must always be long. In fact a short cycle gives more chances to pass through good rates, but it can also keep the rate high at the end of training. Stop the run at a floor, or add a final decay.
Use a cyclical rate when you want a fast run with little tuning, or when you suspect a fixed rate is stuck. Do not use it when a single well-chosen decay, such as Cosine Annealing alone, already works, or when training must end at a precise final value without a final decay. Warmup is often combined with a cyclical rate to start gently before the first peak. Adaptive methods such as Adam scale each parameter's step themselves, but they still take a base rate, and that base rate can follow a cycle too.
History
For most of the early deep learning era, practitioners picked one fixed learning rate and lowered it by hand when the loss stopped improving. Smith's 2015 arXiv preprint argued that this was a poor use of time, and that a simple triangle wave between two bounds was just as good and far cheaper to set up. The idea spread quickly among practitioners, partly because it needed no extra parameters beyond the bounds and the cycle length. Loshchilov and Hutter's SGDR, published in 2016, took the same spirit and used smooth cosine curves with warm restarts, which became a common alternative.
Recap
- Stochastic Gradient Descent, a version of gradient descent, takes steps whose size is the Learning Rate.
- A cyclical learning rate sets that size on a triangle wave between a lower and an upper bound.
- The wave has a half-cycle length , so its period is . The formula is linear on each half.
- The high rates act as exploration and the low rates as settling, and the cycle repeats.
- Choose the bounds with a short sweep, and end the run at a floor or add a final decay.
What to read next: SGD with warm restarts, which replaces the triangle with a smooth cosine, and SGDR for its original statement.
Check yourself
QuestionRecall: what shape does the learning rate follow under a triangular cyclical schedule?Show answer
A triangle wave. It rises linearly from the lower bound to the upper bound over one half-cycle, falls linearly back to the lower bound over the next half-cycle, and then repeats.
QuestionCompute: the lower bound is 0.002, the upper bound is 0.02, and the half-cycle is 3 steps. What is the rate at step 1?Show answer
The rate climbs linearly over the first half-cycle, so at step 1 it is .
QuestionWhy: why would a schedule that raises the rate again help, when lowering it steadily seems more natural?Show answer
A higher rate lets the parameters take larger steps, which helps them move out of flat regions and poor spots that a small rate would stay in. The lower phases then let the parameters settle. Repeating the cycle combines the two, where a steady decay commits to a region early.
QuestionApplied: a team trains for 10 epochs with a cycle of 4 epochs. Their run ends at the peak of the third cycle. What should they change?Show answer
They should end at a floor, so the final rate is low. They could train for 8 epochs, which ends exactly at a floor after two full cycles, or add a short final decay so the last steps use a low rate.