When does a larger learning rate stop helping?
Run on Molab
- Download the notebook.
- Open Molab (opens in a new tab), sign in, and import the downloaded Python notebook.
- Write a prediction, run the reference, then change one condition. These small experiments run on CPU.
Your notebook runs in your Molab workspace. Download its report to keep your evidence.
Read the gradient-descent article and the learning-rate experiments for the background. Here we train a line on a small synthetic dataset and isolate the effect of step size. You need basic algebra and the idea that a gradient gives a local direction of increasing loss.
Inspect the data
Open Explore dataset in a new tab. Each of the 300 records has an input , a target , and a fixed training or validation assignment. Sort the inputs and inspect several targets. Do similar inputs always have similar targets? Would one straight line pass through every record?
We generated inputs uniformly between −2 and 2, then used , with uniform noise between −0.6 and 0.6. Seed 42 fixes both the records and their shuffled split: 240 training records and 60 validation records. Values are stored to six decimal places. No preprocessing is applied. The identifier and split are metadata, not model inputs.
Our model predicts : it learns a slope and an intercept . Each update averages gradients over all 240 training records. Validation records never contribute to updates. For either split, the reported loss is half its mean squared prediction error:
Establish a reference
Keep the starting slope at , the learning rate at , and the budget at 20 updates. The intercept always starts at zero. Predict whether training and validation loss will decrease, and whether either will reach zero. Write your reason in the bench, then select .
Record initial and final losses and at least one intermediate slope and intercept using . This is your reference. Every subsequent run starts afresh with the same records and split; it does not continue training from the preceding run.
Change only the learning rate
Keep the starting slope and 20-update budget fixed. Predict and run learning rates , , , and , one at a time. Compare both loss curves and the parameter values against the reference. Which rates improve slowly, settle quickly, or grow unstable? Does a slope that crosses its eventual value necessarily indicate failure?
Experiment bench
300 synthetic observations: y = 2x + 1 + uniform noise in [−0.6, 0.6), seed 42. Fixed split: 240 training / 60 validation. Model ŷ = wx + b; initial b = 0. Full-batch gradient descent uses training rows only. Loss = ½ mean squared error. Every run starts afresh; no preprocessing or resampling.
Load the reference, write a prediction, and run it first. For each comparison, change only the condition named in the lesson. Each run is calculated here in your browser.
Loading reference settings preserves your evidence. Work is saved in this tab across navigation and reloads. Download your report to keep it after closing the tab.
Build your explanation from the evidence
Write your explanation before opening the comparison. Blue solid shows training loss; orange dashed shows validation loss. The vertical axis is . Each run has its own scale, so compare numerical losses rather than heights across different plots.
Compare the outcomes and explain the pattern
After 20 updates, the reference has slope about , intercept , training loss , and validation loss . Rate 0.01 still has training loss about 6.436; rate 1 is already near the best training fit. Rate 1.5 oscillates while converging, whereas rate 2 grows rapidly, reaching training loss about within this budget.
Both parameters use the same pre-update errors :
The best training line has slope about and intercept . It differs slightly from the generating line because we fitted a finite noisy sample. Its training loss is about , not zero. A larger rate multiplies both gradient components; whether the resulting step helps depends on the inputs and the shape of the loss.
Validation loss measures prediction error on the 60 withheld records. It is not used in the gradients. Once we use those validation results to choose a rate, they are no longer an unbiased final test of our selection. This experiment has no separate test set and does not reproduce the articles’ MNIST measurements.
Design your own investigation
Choose a rate and two available starting slopes. Keep the budget identical. Predict which parts of the trajectory will change, then test your explanation against both losses and the intermediate parameters.
For a separate budget comparison, keep rate 0.05 and starting slope −2 fixed, then compare 10 with 40 updates. Explain why this answers a different question from comparing rates after exactly 20 updates.
Use to select a recorded run that differs in only the condition you are testing. In the editable notebook, you can also rescale every value in both splits inside the calculation. Record the scale, keep those transformed inputs fixed across runs, and investigate whether the same learning rate remains stable.
Report and transfer
Name the runs you compared, cite both losses, and distinguish observations from your explanation. State what remains uncertain after testing only one dataset and split. Download the report to keep the input records, settings, predictions, and every calculated step.
Without running, suppose we multiply the entire loss by a positive constant , and use its matching gradient. How would you adjust the learning rate to reproduce exactly the same parameter trajectory?
Check the transfer argument
The gradient is multiplied by . Dividing the learning rate by leaves each parameter update unchanged. The reported loss values are still multiplied by . A numerical learning rate therefore depends on the loss definition; even replacing half-MSE with MSE changes the matching rate by a factor of two.
Optional one-parameter warm-up
For one input , target , and a fixed zero intercept, . Starting at −2, predict one update at rates 0.25, 1, and 2 before calculating .
The respective results are −1, 2, and 6. If , then , so a nonzero error shrinks for . This boundary belongs to this particular one-parameter loss. It is not the boundary for our two-parameter dataset experiment.
Continue experimenting
Next: What breaks when backpropagation forgets a path? · All machine learning experiments