AI GLOSSARY · AI CONCEPTS

Gradient descent

Markdown version

Definition

Gradient descent iteratively updates parameters in the opposite direction of an objective's gradient, scaled by a learning rate. Step size and stopping rules affect the result; the method does not generally guarantee a global minimum.

Also called: gradient descent algorithm, batch gradient descent.

In plain language

Gradient descent is how many models learn. Picture walking down a foggy hill by feeling which way the ground slopes under your feet and taking a step downhill, again and again. The height is the model's error, and each step nudges the model's settings to reduce it. The size of the step matters: too large and you can overshoot the bottom, too small and training takes a long time. IBM notes the walk can also settle in a dip that is not the lowest point. Training with it uses computing time, which is a cost when models are large. A fixed-weight inference request need not perform gradient descent; an application can separately invoke optimization or training.

Technical definition

Gradient descent minimizes a loss function over model parameters. At each step it computes the gradient, the vector of slopes of the loss with respect to the parameters, and moves the parameters a small step in the negative gradient direction. The step size is the learning rate, which Stanford's CS231n notes call one of the most important hyperparameters to tune. Backpropagation is a common way to compute neural-network gradients. Stochastic gradient descent uses one example, per Google's glossary, and, per CS231n, mini-batch computes the gradient over batches of the training data; CS231n notes that people often say SGD when they mean mini-batch. IBM notes that on non-convex problems it can stop at a local minimum.

Worked examples in this catalogue

Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.

  1. Skill by Skill Almanac · Illustrative, not executed

    math-step-checker 58/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    What you see
    A learner's own worked arithmetic or algebra checked line by line with a script that re-evaluates every step exactly and finds the first step that breaks.
    Why it exercises the concept
    One gradient descent update is arithmetic: a gradient, a learning rate and a subtraction. Working a few steps by hand and checking each line is a way to see the method move.
  2. Skill by Skill Almanac · Illustrative, not executed

    split-leakage-check 53/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    What you see
    A check of train, validation and test files for duplicates, shared groups, time and label leakage, printed as JSON.
    Why it exercises the concept
    Gradient descent proposes objective-reducing updates, but a finite step can raise loss. This linked skill checks evaluation splits rather than the optimizer.
  3. Coding tool · Illustrative, not executed

    Claude Code

    What you see
    Claude Code's overview page describes it as an agentic coding tool that reads your codebase, edits files and runs commands.
    Why it exercises the concept
    An agent can write a short optimization loop so you can inspect how loss responds to the step size. Loss need not fall at every step.

How it shows up when you use agents

Gradient descent can appear when you or an agent write optimization or training code, for example with PyTorch or scikit-learn, and in the settings and logs of that code: the learning rate, the batch size and a loss value printed each step.

Reading those logs is the practical skill. A loss that falls steadily suggests the steps are suitable. A loss that jumps or rises can mean the learning rate is too high, which is a hyperparameter you choose. The loss itself is defined by the loss function, and in a neural network the gradient comes from backpropagation.

What breaks when it is misunderstood: people treat a falling training loss as proof the model is good. Compare it with loss on held-out data, and check the split with split-leakage-check. A next action when a run behaves badly is to change one setting, usually the learning rate, and rerun with the same data so you can see the effect. Large runs cost compute time, so test on a small slice first.

Worked example (illustrative)

For the toy objective f(w)=w², start at w=1, whose gradient is 2. A learning rate of 1.5 gives w_new=1−1.5×2=−2, so the objective rises from 1 to 4. The computed step follows the negative gradient yet overshoots. This is an arithmetic counterexample to guaranteed improvement at any step size, not a training benchmark.

Common confusions

  • Gradient descent versus backpropagation. Backpropagation computes the gradient in a neural network. Gradient descent uses the gradient to update the parameters. See Backpropagation.
  • Batch versus stochastic versus mini-batch. They differ in how many examples are used per update: all, one, or a small group. Many people say SGD for mini-batch, as CS231n notes.
  • Gradient descent versus loss function. The loss function measures error. Gradient descent uses its gradient to propose parameter updates; step size affects whether a finite update lowers it. See Loss function.
  • Myth. Gradient descent finds the best possible model. IBM notes it can stop in a local minimum that is not the lowest point, especially on non-convex problems.
Show all 21 related terms

Terms that mention Gradient descent

16 terms mention this one

More in AI concepts

Next steps

  1. math-step-checker A skill that exercises it.
  2. Backpropagation Related term.
  3. Neural network Related term.
  4. All glossary terms A to Z and by family.

Sources

Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-24. Wikipedia is never the only source.

Review record

Last verified

Drafted by Claude (original draft) and Codex (automated revisions); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-24. Last verified .

Change log (7)
  • : Independent automated factual/example review completed. Cached US query estimate aligned to receipt; no traffic promise. Final technical gate recorded separately; publication disabled.
  • : First version.
  • : Verifier pass: applied verifier corrections to unsourced or overstated claims.
  • : Targeted correction from source-supported early audit; complete exact-version review remains pending.
  • : Learning-method scope and counterexample corrections; independent exact-version review pending.
  • : Aligned related-tool explanations with scoped definitions; no blanket claims about the full catalog.
  • : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.