Skip to content
Query Feedz
  • News
  • Business
    • Digital Marketing
      • Marketing & Sales
      • SEO
      • Content Marketing
      • AEO and GEO
    • Startups
      • Founder Stories
      • Funding & VC
      • Product & Growth
    • Money
      • Investing
      • Markets & Economy
      • Saving & Budgeting
  • AI & Technology
    • Technology
      • Consumer Tech
      • CRM
      • Cyber Security
      • Software Engineering
      • WordPress
      • Hardware
    • Artificial IntelligenceAI Glossary
      • LLMs
      • Machine Learning
      • AI Fundamentals
      • Generative AI
      • Deep Learning
    • AI Use Cases
      • Automation
      • Content
      • Customer Support
      • Finance
      • Marketing
      • View All
  • Tools & Software
  • Account
    • Submit Guest Post
    • Submit a tool
    • My listing
  • Contact
QueryFeedz
  • News
  • Business
    • Digital Marketing
      • Marketing & Sales
      • SEO
      • Content Marketing
      • AEO and GEO
    • Startups
      • Founder Stories
      • Funding & VC
      • Product & Growth
    • Money
      • Investing
      • Markets & Economy
      • Saving & Budgeting
  • AI & Technology
    • Technology
      • Consumer Tech
      • CRM
      • Cyber Security
      • Software Engineering
      • WordPress
      • Hardware
    • Artificial IntelligenceAI Glossary
      • LLMs
      • Machine Learning
      • AI Fundamentals
      • Generative AI
      • Deep Learning
    • AI Use Cases
      • Automation
      • Content
      • Customer Support
      • Finance
      • Marketing
      • View All
  • Tools & Software
  • Account
    • Submit Guest Post
    • Submit a tool
    • My listing
  • Contact
QueryFeedz
  1. Home /
  2. AI Glossaries /
  3. Machine Learning /
  4. What is Stochastic Gradient Descent (SGD)?
Machine Learning

What is Stochastic Gradient Descent (SGD)?

Updated October 2, 2026 Read 3 min

Stochastic gradient descent (SGD) updates a model's weights using one example or a small batch at a time rather than the entire dataset, making training fast enough to scale while adding useful noise.

Contents 12
  1. 01Key takeaways
  2. 02SGD explained in simple terms
  3. 03The three variants
  4. 04A worked example
  5. 05Why noise helps
  6. 06Improvements built on SGD
  7. 07SGD vs Adam in practice
  8. 08Practical settings
  9. 09Limitations
  10. 10Common Use Cases
  11. 11Frequently Asked Questions
  12. 12Related Terms

Stochastic gradient descent (SGD) is a version of gradient descent that updates model weights using one example or a small batch at a time, rather than computing gradients over the entire dataset. “Stochastic” means random: each step uses a random sample, so the direction is noisy but far cheaper to compute. Almost all modern deep learning training is some form of SGD.

Key takeaways

  • Batch gradient descent uses all data per update; SGD uses a sample.
  • In practice, “SGD” almost always means mini-batch SGD.
  • The noise is not purely a drawback: it helps escape saddle points and flat regions.
  • Momentum and adaptive methods such as Adam build directly on SGD.
  • SGD with momentum is still competitive, and sometimes generalises better than Adam.

SGD explained in simple terms

Imagine finding the lowest point in a valley in fog. Batch gradient descent surveys the entire landscape before each careful step: accurate but painfully slow. SGD glances at a small patch of ground and steps immediately. Each step is less reliable, but you take thousands in the time the careful surveyor takes one, and you arrive sooner.

The three variants

VariantData per updateUpdates per epoch (10,000 examples)Character
BatchAll 10,0001Stable, slow, memory-heavy
Stochastic (pure)110,000Very noisy, poor hardware use
Mini-batche.g. 32313The practical standard

Pure single-example SGD is rare today because GPUs are far more efficient on batches. When people say SGD, they nearly always mean mini-batch SGD with a batch size between 16 and several thousand.

A worked example

A model has weight w = 0.80 and a learning rate of 0.1.

StepMini-batch gradientUpdateNew w
10.50.80 − 0.1 × 0.50.75
2−0.20.75 − 0.1 × (−0.2)0.77
30.60.77 − 0.1 × 0.60.71

The gradients disagree between batches because each sees different examples. The path wobbles, but across thousands of steps the average direction is correct and the weight converges towards a good value.

Why noise helps

  • It can knock the model out of saddle points and flat regions where exact gradients stall.
  • It acts as a mild regulariser, discouraging very sharp minima.
  • Research has linked the noise scale, driven by batch size and learning rate, to how well models generalise.

Too much noise, from a tiny batch or a large learning rate, prevents convergence. Too little, from a very large batch, can lead to sharper solutions that generalise less well unless the learning rate is scaled and warmed up.

Improvements built on SGD

MethodIdeaEffect
Momentum (1964)Accumulate a velocity across stepsSmooths zig-zags, speeds up along consistent directions
Nesterov momentumLook ahead before computing the gradientSlightly faster convergence
AdaGradPer-parameter step sizes based on past gradientsHelps sparse features
RMSPropMoving average of squared gradientsStabilises step sizes
Adam (2014)Momentum plus adaptive step sizesThe common default for deep learning
AdamWAdam with decoupled weight decayStandard for training large models

SGD vs Adam in practice

ConsiderationSGD with momentumAdam / AdamW
Tuning effortHigher; sensitive to learning rateLower; works near defaults
MemoryLowerStores two extra values per parameter
Convergence speedSlower earlyFaster early
Final generalisationSometimes better, notably in visionExcellent for transformers and LLMs

Most large language models are trained with AdamW. Many computer vision results still use SGD with momentum, which is why the choice is empirical rather than settled.

Practical settings

  • Shuffle data every epoch so batches are genuinely random.
  • Scale the learning rate with batch size, and use a warmup phase.
  • Use a learning rate scheduler, typically cosine decay.
  • Apply gradient clipping to survive outlier batches.
  • Track training loss over a moving window, since per-batch loss is inherently noisy.

Limitations

  • Noisy loss curves make progress harder to read.
  • Sensitive to learning rate and batch size choices.
  • Convergence is to a good solution, not a provably optimal one.
  • Requires shuffling and careful data ordering to avoid bias.

Common Use Cases

01

Deep learning training

Train neural networks of any size efficiently.

02

Large-scale datasets

Learn from data too large to process in one batch.

03

Online learning

Update models continuously as new data arrives.

04

Fine-tuning

Adapt pre-trained models with small batches.

05

Computer vision

Train CNNs with SGD plus momentum.

06

Resource-constrained training

Keep memory use low with small batches.

Frequently Asked Questions

A version of gradient descent that updates weights using a random sample or mini-batch rather than the whole dataset.

Standard gradient descent uses all data per update. SGD uses a sample, making updates faster and noisier.

In modern usage, yes. SGD almost always refers to mini-batch training.

It can escape saddle points and flat regions and acts as a mild regulariser.

Adam or AdamW is the common default, especially for transformers. SGD with momentum remains competitive in vision and sometimes generalises better.

Related Terms

  • Gradient Descent
  • Batch Size
  • Learning Rate
  • Learning Rate Scheduler
  • Backpropagation
  • Loss Function

Related AI Terms

What is Cross-Validation in Machine Learning?Cross-validation is a technique that repeatedly splits data into training and validation parts, rotating which part is held…What is Early Stopping in Machine Learning?Early stopping is a regularisation technique that halts training when validation performance stops improving, preventing the model from…What is L2 Regularization?L2 regularization adds a penalty equal to the sum of the squared weights, shrinking all weights smoothly towards…What is L1 Regularization?L1 regularization, known as lasso in linear models, adds a penalty equal to the sum of the absolute…What is a Hyperparameter?A hyperparameter is a configuration value set before training that controls how a model learns or how complex…What is the Bias-Variance Tradeoff?The bias-variance tradeoff describes how a model's error splits into bias from overly simple assumptions and variance from…

Contents

  1. 01Key takeaways
  2. 02SGD explained in simple terms
  3. 03The three variants
  4. 04A worked example
  5. 05Why noise helps
  6. 06Improvements built on SGD
  7. 07SGD vs Adam in practice
  8. 08Practical settings
  9. 09Limitations
  10. 10Common Use Cases
  11. 11Frequently Asked Questions
  12. 12Related Terms

AI Topic

  • Machine Learning

Related Terms

  • What is Cross-Validation in Machine Learning?
  • What is Early Stopping in Machine Learning?
  • What is L2 Regularization?
  • What is L1 Regularization?
  • What is a Hyperparameter?
  • What is the Bias-Variance Tradeoff?

Quick Navigation

  • Common Use Cases
  • Frequently Asked Questions
  • Related Terms
  • Back to top

Details

Updated
October 2, 2026
Read
3 min
  • Forum
  • Submit a tool
  • Submit Guest Post
  • List Your Startup
  • Privacy Policy
  • Editorial Policy
  • Account
  • Contact
  • AI Productivity
  • AI Video
  • AI Coding
  • AI Chatbots
  • Sales
  • AI Business
  • View All Tools

Subscribe our Newsletter

Get weekly exclusive content - No spam.

Copyright © 2026 -  Query Feedz

Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}