25 November 2026 · 4 min readInteractive 3D
What is a local minimum? Why AI can get stuck
A landscape with two valleys shows why where you start can decide where you end up, and why that matters less than people feared.
Gradient descent only ever walks downhill. On a landscape with one valley, that is fine. On a landscape with two, it can settle in the shallower one and never find the deeper one. The shallow valley is a local minimum; the deepest point anywhere is the global minimum.
Where you start decides where you finish
Turn the start slider and roll again. From one side the ball finds the deep valley; from the other it stops in the shallow one. Nothing is wrong with the rule: each step really is downhill. It simply cannot see over the ridge.
Why it matters less in practice
- Real models have millions of directions, and in high dimensions most valleys turn out to be about equally good.
- Training uses small random batches of data, so the ball jiggles and can bounce out of poor valleys.
- People train several times from different random starts and keep the best result.
The same idea appears in everyday life: improving bit by bit can leave you at the best version of a plan that was never the best plan.
A worked example
The function f(x) = x⁴ − 4x² + x has two valleys. Its slope f′(x) = 4x³ − 8x + 1 is zero at about x = −1.47, x = 0.13 and x = 1.35. The middle one is a hill top; the outer two are valleys. f(−1.47) ≈ −5.44 and f(1.35) ≈ −2.62, so the left valley is the lowest point overall (the global minimum).
- Start at x = 2 and roll downhill
- You reach the valley at x ≈ 1.35, where f ≈ −2.62
- The slope there is zero, so gradient descent stops
- The deeper valley at x ≈ −1.47 is never found
Ways to escape
- Start from several random points and keep the best result.
- Add momentum so the ball can roll over small hills.
- Use noisy steps (small random batches) that can jump out of shallow valleys.
- Start with a large learning rate and shrink it later.
Why big networks worry less
In a landscape with millions of directions, a true valley needs the ground to rise in every direction at once, which is rare. Most flat spots are saddles instead, and most valleys that are found turn out to be almost as good as each other. That is one reason very large models train better than you might expect.
A local minimum is a valley that is lowest only in its own neighbourhood. The global minimum is the lowest point anywhere.
Beyond AI
Local minima appear wherever something is optimised step by step. A delivery company improving its routes by small changes can get stuck with a good but not best plan. Evolution produces animals that are well adapted but not perfect. Engineers use the same escape tricks, random restarts and occasional bold changes, to find better answers.
Simulated annealing
This method borrows from metalwork. Hot metal’s atoms move freely; as it cools slowly they settle into a strong, low-energy arrangement. The algorithm allows uphill moves often at first and rarely later, so it explores widely before settling.
Glossary
- Local minimum: lowest point in its neighbourhood.
- Global minimum: lowest point overall.
- Momentum: keeping part of the previous step.
- Random restart: starting again from a new point.
Try these yourself
- Q1. f(x) = x²: how many minima? One, a global minimum at 0
- Q2. f(x) = x³: is x = 0 a minimum? No: the slope is zero but it keeps rising, an inflection point
- Q3. Starting at x = −2 on x⁴ − 4x² + x, which valley do you reach? The left, global one near −1.47
- Q4. Name one way to escape a shallow valley: momentum, noise or a restart
A hiking picture
Imagine walking downhill in thick fog, only able to feel the ground under your feet. You stop when every direction goes up. You might be at the lowest point in the region, or just in a small hollow on a hillside. Gradient descent has exactly this limited view.
In short
Gradient descent stops wherever the slope is zero, which may be a local rather than global minimum. Restarts, momentum and noise help, and big networks are more forgiving than small ones.
Keep going
Questions people ask
What is the difference between a local and a global minimum?
A local minimum is the lowest point nearby; the global minimum is the lowest point of the whole function.
Why does gradient descent get stuck in local minima?
Because at the bottom of any valley the slope is zero, so the rule “step downhill” has nowhere to go.
How do AI models avoid bad local minima?
Random restarts, momentum, noisy mini-batches and changing the learning rate all help, and in very large networks most valleys are good enough.