Learn AI Math

SGD

What is SGD?

In one sentence: SGD, or Stochastic Gradient Descent, updates a model's weights using gradients from small random batches instead of the whole dataset.

"Stochastic" means random. Rather than calculating the error over every example before each step, SGD takes a quick step after each small batch. The steps are a bit noisy, but there are many more of them, so learning is much faster overall.

What does SGD look like?

Training an image classifier by updating after each batch of 64 random photos uses SGD.

Why does SGD matter?

SGD is the classic training method that many other optimizers are built on.

Last updated · Fact-checked by The AI Math

Linking to this page from a lesson or article?

Like this explanation? Get one every week.

The AI Math newsletter turns confusing AI news into plain English. No hype, no jargon walls.