October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

How to Choose Between SGD and Adam for a Machine Learning Model

Adam adapts update scales using gradient history; SGD remains worth testing for held-out performance. Compare both with fair tuning and validation metrics.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

There is no optimizer that is best for every model. Adam is a strong candidate when gradients are noisy or sparse and can make early training progress quickly; SGD, often with momentum, deserves a fair comparison when held-out performance matters. Choose by comparing validation results under a controlled training setup—not by training loss alone.

SGD vs. Adam: what changes in the update?

Ordinary stochastic gradient descent (SGD) updates parameters using the current gradient scaled by a learning rate. It does not adapt each parameter’s update scale using gradient-moment estimates. SGD with momentum also accumulates update direction over time, but it is still distinct from Adam’s per-parameter adaptive scaling.

As an Amazon Associate I earn from qualifying purchases.

Adam keeps exponential moving averages of gradients and squared gradients. It corrects those estimates for initialization bias, then uses the corrected first moment divided by the square root of the corrected second moment plus a small epsilon. The result is an update scale that adapts parameter by parameter based on gradient history. See the algorithm in Kingma and Ba’s original Adam paper.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When should you use Adam instead of SGD?

Adam is a reasonable first candidate when your optimization problem has very noisy or sparse gradients, or changes over time. Those are contexts identified by Adam’s authors, based on the problems they studied; they are not guarantees that Adam will be faster or more accurate on every current model.

The original paper reported tested settings of α = 0.001, β1 = 0.9, β2 = 0.999, and ε = 10−8 for its machine-learning problems. Treat these as historical paper settings, not as current defaults for a particular software framework or as an automatically suitable configuration for your task.

Which optimizer generalizes better?

Training progress and held-out performance are different outcomes. An optimizer can reduce training loss quickly without producing the best development or test result. In a 2017 comparative study, Wilson and colleagues reported that, with the same amount of hyperparameter tuning, SGD and SGD with momentum outperformed adaptive methods on the development/test sets across the models and tasks they evaluated. Their result is a reason to test SGD, not evidence that SGD always wins for every architecture, dataset, or modern optimizer variant. Read the study’s scope in The Marginal Value of Adaptive Gradient Methods in Machine Learning.

Rank #2
Sale
Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems
  • Use scikit-learn to track an example ML project end to end
  • Explore several models, including support vector machines, decision trees, random forests, and ensemble methods
  • Exploit unsupervised learning techniques such as dimensionality reduction, clustering, and anomaly detection
  • Dive into neural net architectures, including convolutional nets, recurrent nets, generative adversarial networks, autoencoders, diffusion models, and transformers
  • Use TensorFlow and Keras to build and train neural nets for computer vision, natural language processing, generative models, and deep reinforcement learning
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to make a fair comparison

  1. Choose the deployment-relevant metric. Decide whether you will select by held-out accuracy, loss, or another metric that reflects the model’s intended use. Establish a baseline before comparing optimizers.
  2. Train both candidates. Compare Adam with SGD; include SGD with momentum when appropriate for the task.
  3. Tune each method comparably. Give both optimizers a comparable search over learning rates and schedules, and a comparable training budget. Avoid comparing a tuned configuration with another method’s untuned defaults.
  4. Track training and validation separately. Follow both through training. Note whether validation performance plateaus even as training loss continues to improve.
  5. Select on reliable validation results. Keep data splits, architecture, compute budget, and evaluation metric fixed. If run-to-run variability could change which configuration appears best, repeat runs before deciding.

This comparison protocol is practical guidance for making a task-specific decision; it is not a checklist prescribed verbatim by either cited study.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the evidence does—and does not—establish

  • The cited results do not establish a universal winner across all models, datasets, or optimizer variants.
  • Adam’s ability to adapt update scales does not guarantee faster wall-clock training, better final accuracy, or less tuning on your problem.
  • Although Adam is often presented as requiring little tuning, Wilson and colleagues found that all methods required tuning in the tasks they studied.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.