Case & CodeA FIELD GUIDE TO AI
Start learning
Advanced

Gradient

Also: gradients, gradient descent, optimizer, optimiser

In plain words

The direction to nudge the model's numbers so its mistakes get smaller. Training takes many small steps in that direction.

The fuller definition

A gradient describes how a quantity such as loss changes with respect to parameters. Gradient-based optimization uses that information to update parameters.

The training loop, simplified
  1. ExamplesInputs paired with the expected output.
  2. PredictionThe model produces an output.
  3. LossHow far off it was, as a number.
  4. UpdateParameters nudged to reduce the loss; repeat.

Training ends at the knowledge cutoff. Whatever the examples contained, including their gaps and biases, is what the model learned.

A concrete example

Training changes a weight in a direction expected to reduce loss for a small step.

The distinction that matters

A gradient is a numerical calculation, not an explanation in ordinary language.

Related terms

Where it is taught

How models learn from examples

Source and further reading

Hugging Face · LLM course

The definition and example are written for this library. The link gives background, official documentation or legal authority as labelled. Legal scope depends on the jurisdiction and current text; product features depend on release and settings.

Lessons, terms, practical guides and sources ESC