Learning Rate Decay › Exponential Decay
Language AI HandbookAll chapters Learning Rate Decay › Exponential DecayOne section · Sections in this chapter4 / 15 ↓
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
Exponential decay smooths out the staircase by applying decay at every step rather than at discrete intervals. The learning rate decreases continuously as a smooth exponential curve.
Formulation
At step , the learning rate is:
where:
- : the initial learning rate
- : the decay rate, a positive constant controlling how quickly the rate falls
- : the current training step (or epoch)
An equivalent formulation uses a decay factor per step:
where . The two are mathematically identical; the second is often more convenient because you can set directly (e.g., for slow decay or for faster decay). The relationship means , so a decay factor of 0.99 corresponds to a rate of approximately 0.01.
Choosing the Decay Rate
The relationship between and training duration matters enormously. After steps with per-step factor , the learning rate is . If you want the learning rate to end at, say, 1% of its initial value after 100 epochs, you need , which gives . You can work backward from your desired endpoint to choose .
This backward calculation is a useful habit. Before setting , decide what fraction of the initial learning rate you want at the end of training, and how many steps training will run. The required follows directly:
This ensures the schedule hits your target endpoint rather than decaying too fast or too slow.
Intuition and Limitations
The exponential function has a special property: its rate of change is proportional to its current value. This means exponential decay reduces the learning rate by the same multiplicative factor at every step. Early in training, the absolute reduction is large (because the learning rate is high); later in training, the absolute reduction is small. The relative reduction is constant throughout.
In practice, the effect of this is that exponential decay can shrink the learning rate too quickly, especially with even moderately large . After steps, the learning rate has shrunk by a factor of , which can become extremely small well before training ends. Practitioners often add a floor: a minimum learning rate below which the schedule does not go, preventing the rate from becoming so small that training effectively stops.
Without a floor, exponential decay with per epoch would reach after 100 epochs starting from , which is effectively zero. With a floor of , the schedule plateaus at that value and training continues to make at least some progress.
The continuous nature of exponential decay is both a strength and a weakness. There are no abrupt transitions to cause loss spikes, but the schedule also never provides the sharp signal of a step drop that can sometimes help the model escape a local plateau. Empirically, exponential decay tends to work well when training is well-behaved and the main concern is smooth, gradual refinement rather than dramatic transitions between phases.
import numpy as np
def step_decay(t, eta0, gamma, step_size):
return eta0 * (gamma ** (t // step_size))
def exponential_decay(t, eta0, gamma):
return eta0 * (gamma**t)
def inv_sqrt_decay(t, eta0):
return eta0 / np.sqrt(t + 1)
def cosine_decay(t, eta_max, eta_min, T_max):
return eta_min + 0.5 * (eta_max - eta_min) * (1 + np.cos(np.pi * t / T_max))
epochs = np.arange(0, 100)
eta0 = 0.1
step_lrs = np.array(
[step_decay(t, eta0=eta0, gamma=0.1, step_size=30) for t in epochs]
)
exp_lrs = np.array(
[exponential_decay(t, eta0=eta0, gamma=0.955) for t in epochs]
)
inv_sqrt_lrs = np.array([inv_sqrt_decay(t, eta0=eta0) for t in epochs])
cosine_lrs = np.array(
[cosine_decay(t, eta_max=eta0, eta_min=1e-4, T_max=100) for t in epochs]
)
The plot shows the four schedules on a logarithmic scale. Step decay drops abruptly at epochs 30 and 60. Exponential decay falls smoothly but steeply. Inverse square root decay drops quickly at first and then flattens. Cosine annealing curves smoothly from its maximum to its minimum.