b2KIT

Gradient Descent Visualizer

Visualize gradient descent on 2D loss surfaces. Compare SGD, momentum, Adam optimizers. Watch convergence paths and learning rate effects.

Tested tool guide Tested browser tools Checked August 16, 2026

What Gradient Descent Visualizer does and how it behaves

Gradient Descent Visualizer turns successive optimization steps into paths across a loss surface with two adjustable dimensions. It compares how SGD, momentum, and Adam move from a starting point as the learning rate affects progress, oscillation, and stability. The main trap is treating the visually shortest path as proof that an optimizer is generally superior. A trajectory describes one surface, starting point, parameter configuration, and iteration budget; changing any of them can reverse the apparent result.

How the result is produced

1

Optimizer paths

Each plotted path is an ordered sequence of parameter positions on the selected loss surface. In the SGD comparison, a step moves against the gradient used at that iteration, with its size influenced by the learning rate. Momentum also carries forward accumulated direction. Adam maintains gradient-based moving estimates that adjust the update separately along the two displayed parameter dimensions.

2

Reading convergence

Closely spaced points can indicate that updates are becoming small, while repeated crossings of a valley suggest oscillation. Large jumps or movement away from a low region can indicate an excessive learning rate. For a meaningful visual comparison, keep the surface, starting point, and iteration count fixed. Equal learning rates still do not imply equal effective steps across SGD, momentum, and Adam.

Good uses

  • Compare SGD, momentum, and Adam from the same starting location to see how optimizer state changes the route toward a low-loss region.
  • Vary the learning rate to distinguish slow progress from overshooting, oscillation, or outright movement away from a minimum.
  • Study behavior on flat, steep, or differently curved parts of a two-dimensional surface before interpreting similar patterns in a training run.

Limits and checks

  • A two-dimensional surface is an instructional model. Its visible valleys and directions cannot represent all interactions in a model with thousands or millions of parameters.
  • A path labeled SGD does not by itself reveal how much sampling noise is represented. Real stochastic updates depend on the sampled examples or batches.
  • Reaching a dark, low, or central-looking region is not necessarily mathematical convergence. Plot scale and a finite iteration limit can hide continued movement or a nonzero gradient.

Common questions

Why does momentum pass the bottom of a valley?

Momentum retains part of the preceding update direction, so the optimizer can continue moving after the current gradient begins pointing back toward the valley floor. It may then cross the valley repeatedly while the motion decays. A smaller learning rate or different momentum setting can reduce this behavior, but overshooting is not automatically evidence that momentum has failed.

Does Adam always reach the minimum faster than SGD?

No. Adam adapts updates using running estimates of gradient behavior, which can produce a direct-looking path on some surfaces. The result still depends on the surface, starting point, learning rate, optimizer settings, and number of iterations. This visualization can compare those particular trajectories, but it cannot establish that Adam will train every real model faster or reach a better solution.

References and verification

The behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools