Gradient Descent as an Error-Minimization Mental Model
Learning, machine or human, is just taking steps that reduce your error.
- Difficulty
- Moderate
- Time to result
- ~weeks to results
- Steps
- 6
- Confidence
- 85%
Lowin explains gradient descent — the core training mechanism behind most neural networks — as a marble rolling down a mountain, where the mountain's height represents error and the model takes iterative steps in the direction that most reduces that error, eventually settling at a low point. He extends this beyond a technical training algorithm into a general mental model: measure your error, find the direction that reduces it fastest, take a step, add momentum to avoid getting stuck in shallow local minima, and repeat. The framework closes with a critical caveat — efficiently descending a mountain means nothing if you're standing on the wrong mountain, i.e., minimizing error on the wrong problem entirely.
Origin
Gradient descent is a long-established mathematical optimization idea that found renewed prominence as the primary way most neural networks are trained.
Core principles
- 01Error minimization requires first defining an explicit error metric.
- 02At each point, measure how a change in any direction affects your error, and move in the direction of steepest improvement.
- 03Adding momentum helps you avoid getting stuck in shallow local minima and speeds convergence.
- 04Efficiently minimizing error is worthless if you're solving the wrong problem ('the wrong mountain').
How to run it
- 1
Define your error metric
Establish a clear, measurable definition of error — the 'height of the mountain' — that you want to minimize, such as misclassification rate.
- 2
Measure the gradient at your current position
Determine how tweaking your parameters in any direction would affect the error, effectively measuring the local slope.
- 3
Take a step in the steepest error-reducing direction
Move your parameters in whichever direction reduces error the most, just as a marble follows the steepest slope down a mountain.
- 4
Add momentum
Incorporate the direction you've already been moving so you don't overreact to every small local variation, helping avoid getting trapped in shallow dips.
Pro tip Gradient descent with momentum was one of the earliest major enhancements to basic training algorithms.
- 5
Repeat until convergence
Continue taking steps until the error stops meaningfully decreasing, arriving at a minimum.
Watch out You may land in a 'local minimum' — a valley that isn't the lowest possible point — rather than the true global minimum.
- 6
Confirm you're on the right mountain
Before optimizing further, step back and verify the problem itself is the right one to be solving — otherwise you're just perfecting the wrong answer.
In the wild
Lowin describes dropping a marble on a mountain: it naturally follows the slope downhill, taking the steepest path at each point, until it settles at a low point — a physical illustration of how gradient descent trains a neural network.
→ Makes an abstract optimization algorithm intuitive and visual.
Common mistakes
Getting stuck in a local minimum
A model (or person) can settle into a valley that feels like an optimum but is far from the true best answer, especially without mechanisms like momentum to carry through shallow dips.
Optimizing the wrong problem entirely
Efficient error minimization is meaningless if the underlying problem or question being solved was the wrong one from the start.
Is it for you?
Not ideal for
Models not trained via iterative optimization (e.g., simple linear regression solved analytically, or many tree-based models).
From the transcript
“gradient descent is an idea, it's actually a very old idea, that's sort of found new life in the machine learning world of minimizing the…”
“whichever direction would reduce our error the most, let's go that way.”
“if you look around and realize you were on the wrong mountain in the first place, you've got a problem.”
From the episode
Jeremiah Lowin – Machine Learning in Investing – [Invest Like the Best, EP.105]