The learning rate \(\eta\) is widely considered the single most important hyperparameter in deep learning โ it controls how large a step every weight takes on every update, and getting it wrong can prevent training from working at all, regardless of architecture or data quality.
Where It Appears
\(\eta\) scales the gradient before it's subtracted โ a larger \(\eta\) means bigger, faster (but riskier) steps; a smaller \(\eta\) means smaller, safer (but slower) steps.
Typical Ranges in Practice
| Optimizer | Typical Starting Learning Rate |
|---|---|
| SGD (with momentum) | 0.01 โ 0.1 |
| Adam / AdamW | 0.0001 โ 0.001 (often written 1e-4 to 1e-3) |
| Fine-tuning a pretrained model | Much smaller โ 1e-5 to 1e-6, to avoid destroying pretrained weights |
These are starting points, not universal answers โ the right value depends on the specific architecture, batch size, and optimizer, which is exactly why hyperparameter tuning (covered in its own category later) exists.
Revisiting the Too-Small / Good / Too-Large Picture
The three-way comparison from Gradient Descent (Intro) is worth restating precisely here: too small wastes training time without necessarily reaching a better solution; too large causes the loss to oscillate or diverge outright, since each step can overshoot the minimum by more than the previous step's progress; a well-chosen learning rate balances fast progress against stable convergence.
Numerical Illustration
import torch
def try_lr(lr, steps=20):
w = torch.tensor(10.0, requires_grad=True) # start far from the minimum at w=0
for _ in range(steps):
loss = w ** 2
loss.backward()
with torch.no_grad():
w -= lr * w.grad
w.grad.zero_()
return w.item()
print("lr=0.01: ", try_lr(0.01)) # converges slowly, still far from 0
print("lr=0.3: ", try_lr(0.3)) # converges nicely toward 0
print("lr=1.1: ", try_lr(1.1)) # diverges -- overshoots and grows without bound
Learning Rate and Batch Size Interact
A larger mini-batch (see Mini-Batch Gradient Descent) produces a less noisy, more "confident" gradient estimate โ a common practical heuristic ("linear scaling rule") is to increase the learning rate roughly proportionally when increasing the batch size, though this isn't a universal law and should be validated empirically for a given setup.
Common Mistakes
- Using the same fixed learning rate across the entire training run by default โ as covered later in this category, scheduling the learning rate (decaying it over time, or warming it up at the start) often meaningfully improves final performance.
- Diagnosing a diverging loss as a data or architecture problem before checking the learning rate first โ an overly aggressive learning rate is one of the most common root causes of a loss that explodes or oscillates wildly.
Interview Relevance
Q: "Your model's training loss is oscillating wildly and occasionally spiking to very large values. What's the first hyperparameter you'd check?" The learning rate โ this exact symptom (oscillation, occasional spikes, sometimes outright divergence) is the classic signature of a learning rate set too high, causing weight updates to overshoot the loss surface's minimum repeatedly rather than converging toward it.
Practice Question
You're fine-tuning a large pretrained model on a small new dataset. Would you expect to use a larger or smaller learning rate than training a similar-sized model from scratch? Why?