What does the learning rate do in training?
The learning rate sets how far each training step moves the weights. In the gradient descent update, it multiplies the gradient: new weights equal old weights minus the learning rate times the gradient of the loss. A large rate moves far per step, a small one moves little. The learning rate decides how fast you travel, not where you end up, but a bad one means you never arrive.
| Symptom in the loss curve | Likely cause | First fix |
|---|---|---|
| Loss spikes, oscillates or becomes NaN | Rate too high | Divide the rate by 3 to 10 |
| Loss falls very slowly | Rate too low | Raise it, or use a schedule |
| Loss falls, then plateaus above the target | Rate too large for fine movement | Decay the rate later in training |
| Training loss falls, validation loss rises | Not a rate problem | See overfitting |
What is a good learning rate?
There is no universal value. PyTorch’s Adam optimizer defaults to lr=1e-3, which is why 0.001 is a common first try (PyTorch Adam docs, read 23 November 2026). Fine-tuning a large pretrained model usually calls for a much smaller rate, because big steps overwrite what the model already knows (see fine-tuning). Find the rate by sweeping: train briefly at rates spaced on a log scale, for example 1e-5, 1e-4, 1e-3 and 1e-2, and keep the largest that trains stably. The best rate also moves with the batch size, so re-check it when you change one.
What are learning rate schedules?
A schedule changes the rate during training, usually large early and small late. PyTorch lists many in torch.optim.lr_scheduler, including StepLR, ExponentialLR, LinearLR, OneCycleLR and ReduceLROnPlateau, which lowers the rate when a validation measurement stops improving (PyTorch optimizer docs, read 23 November 2026).
| Schedule | Behavior | Example |
|---|---|---|
| Step decay | Cut by a factor every N epochs | 0.1, then 0.01 after 30 epochs, then 0.001 after 60 |
| Exponential decay | Multiply by a factor each epoch | Gamma of 0.9 per epoch |
| Warmup then decay | Ramp up, then fall | Common for transformers |
| Reduce on plateau | Cut when validation stalls | Adapts to the run |
The StepLR example in PyTorch’s documentation starts at 0.05 and multiplies by 0.1 every 30 epochs, giving 0.005 from epoch 30 and 0.0005 from epoch 60 (StepLR docs, read 23 November 2026). The docs also say to call scheduler.step() after optimizer.step(), or the first value of the schedule is skipped (read 23 November 2026).
How do you know the learning rate is right?
Read the loss curve, then confirm on held-out data. A good rate gives a loss that falls smoothly and then flattens, and a validation score that improves with it. A lower training loss is not proof of a better model, so check the result on an eval dataset the training never touched.