Gradient Descent

Last updated October 14, 2026

What is Gradient Descent in simple terms?

In simple terms, gradient descent is how AI learns by taking small steps toward fewer mistakes. Picture finding the bottom of a foggy valley by always stepping downhill — each step lowers the error a little.

Gradient Descent explained

Gradient descent is the optimization method neural networks and many other AI models use to learn — repeatedly nudging their internal settings in the direction that reduces error, in small steps, until the error stops falling meaningfully.

When a model trains from scratch, it starts out useless — its internal settings are essentially random, so its predictions are wrong. Learning means adjusting those settings, called weights, until the predictions get good. Gradient descent is the method that does the adjusting. The model measures how wrong it currently is using a score called the loss (lower is better), and gradient descent works out, for each weight, which direction to nudge it to make the loss a little smaller. Then it takes a small step in that direction for every weight at once. Do this over and over — across enormous amounts of data and millions or billions of weights — and the model gradually descends toward settings that make few mistakes.

The standard way to picture it is a landscape. Imagine the model's error as the height of terrain: high ground is lots of mistakes, low ground is few, and the goal is to reach a valley bottom. You're standing somewhere on this landscape in fog so thick you can only feel the slope right under your feet. Gradient descent is the strategy of always stepping in the steepest downhill direction — the "gradient" is the mathematical word for which way is uphill and how steep, so the method steps the opposite way. The size of each step matters: too big and you overshoot the valley and bounce around; too small and learning crawls. That step size is one of the key dials, called the learning rate, that practitioners tune. In practice models use a fast variant that estimates the slope from small batches of data at a time rather than all of it at once.

Gradient descent is genuinely the engine under the hood of nearly all modern machine learning — deep learning, large language models, image generators, all of it learns essentially this way, paired with backpropagation, which is the technique that efficiently calculates which way is downhill for every weight. It isn't flawless: across the millions of dimensions of a real model, the foggy-valley path can get stuck on flat stretches where no direction feels clearly downhill, or settle into a dip that isn't the deepest one available — and a poorly chosen step size can stall or destabilize training. But it scales astonishingly well to huge models, and decades of refinements have made it reliable enough that this one simple idea — keep stepping toward less error — underpins most of modern machine learning.

Real-world example of Gradient Descent

A data scientist at a city transit agency is training a model to predict how many minutes late each bus will be, using the time of day, the route and the weather. While training runs, her screen prints one number after every step: the model's average error. It starts at around eleven minutes, drops to seven, then five, then creeps down more slowly toward two and a half before it levels off. That falling curve is gradient descent at work. At every step the software works out which direction to nudge each of the model's weights so the error gets smaller, moves them all a little that way, and measures again. When the curve flattens out, she knows further steps are buying almost nothing, and she stops the run.

Frequently asked questions about Gradient Descent

What is the difference between gradient descent and backpropagation?

They're partners in training but do different jobs. Backpropagation is the method that efficiently calculates, for every weight in the network, which direction and how much it should change to reduce the error. Gradient descent is what then uses those calculations to actually update the weights — taking a small step in the downhill direction. In short, backpropagation works out which way is downhill for each weight, and gradient descent takes the step. Together they form the core learning loop repeated millions of times during training.

How does gradient descent work?

The model measures how wrong it is with a loss score, then computes the gradient — the direction in which that loss rises fastest — for each of its weights. It nudges every weight a small amount in its downhill direction, lowering the error slightly, and repeats this across huge amounts of data. Over many iterations it descends toward settings with low error, like feeling your way to the bottom of a foggy valley by always stepping downhill. The step size, called the learning rate, controls how big each move is and has to be tuned carefully.

What is gradient descent used for?

It's the optimization method behind training most modern AI: neural networks, deep learning systems, large language models, and image generators all learn by some form of gradient descent. When a neural network improves by reducing its mistakes over a dataset, gradient descent — usually a fast variant that works on small batches of data at a time — is the process doing the improving. It's one of the most fundamental algorithms in machine learning, the engine that turns raw data and a starting point into a trained model.