Learning Rate Decay › Exponential Decay

Michael BrenndoerferJanuary 24, 20265 min read
Language AI HandbookAll chapters
Part 32 of 67Training Optimization
Chapter 232Learning Rate Decay › Exponential Decay
Reading section 4 of 15 · Exponential Decay · 5 minSection 4 of 15 · 5 min

Book contents

Section 4 of 15 · 5 min read

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 tt, the learning rate is:

ηt=η0⋅e−λt\eta_t = \eta_0 \cdot e^{-\lambda t}

where:

  • η0\eta_0: the initial learning rate
  • λ\lambda: the decay rate, a positive constant controlling how quickly the rate falls
  • tt: the current training step (or epoch)

An equivalent formulation uses a decay factor γ\gamma per step:

ηt=η0⋅γt\eta_t = \eta_0 \cdot \gamma^t

where γ=e−λ\gamma = e^{-\lambda}. The two are mathematically identical; the second is often more convenient because you can set γ\gamma directly (e.g., γ=0.999\gamma = 0.999 for slow decay or γ=0.99\gamma = 0.99 for faster decay). The relationship γ=e−λ\gamma = e^{-\lambda} means λ=−ln⁡(γ)\lambda = -\ln(\gamma), so a decay factor of 0.99 corresponds to a rate of approximately 0.01.

Choosing the Decay Rate

The relationship between γ\gamma and training duration matters enormously. After TT steps with per-step factor γ\gamma, the learning rate is η0⋅γT\eta_0 \cdot \gamma^T. If you want the learning rate to end at, say, 1% of its initial value after 100 epochs, you need γ100=0.01\gamma^{100} = 0.01, which gives γ=0.011/100≈0.955\gamma = 0.01^{1/100} \approx 0.955. You can work backward from your desired endpoint to choose γ\gamma.

This backward calculation is a useful habit. Before setting γ\gamma, decide what fraction of the initial learning rate you want at the end of training, and how many steps training will run. The required γ\gamma follows directly:

γ=(ηfinalη0)1/T\gamma = \left(\frac{\eta_{\text{final}}}{\eta_0}\right)^{1/T}

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 λ\lambda. After tt steps, the learning rate has shrunk by a factor of e−λte^{-\lambda t}, 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 γ=0.9\gamma = 0.9 per epoch would reach 0.9100≈2.6×10−50.9^{100} \approx 2.6 \times 10^{-5} after 100 epochs starting from η0=0.1\eta_0 = 0.1, which is effectively zero. With a floor of 10−510^{-5}, 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.

In[5]:
Code
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]
)
Out[6]:
Visualization
Line plot comparing four learning rate schedules over 100 epochs on a log scale.
Four common learning rate schedules over 100 training epochs, plotted on a logarithmic scale. Step decay creates a staircase pattern with abrupt drops at epochs 30 and 60. Exponential decay falls smoothly at a constant multiplicative rate. Inverse square root decay drops quickly early and then flattens, staying higher at late epochs than exponential decay. Cosine annealing follows a smooth curve from maximum to near-zero.

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.