liveBook · Manning

Gradient

As explained in Transformers in Action

A gradient is a vector of partial derivatives indicating how a function changes with respect to its parameters.

A gradient is a vector of partial derivatives of the loss function with respect to model parameters. It indicates how each weight or bias should change, so gradient descent updates parameters in the opposite direction. section 8.1.1

Gradient-based training connects the update direction to several training controls:

  • The learning rate scales each update; excessive values can overshoot a minimum, while small values slow convergence or stall progress. section 8.1.1
  • Batch size determines how many data points contribute to each gradient calculation, affecting convergence stability and speed. section 8.1.1
  • Epoch count controls how often the dataset is revisited; excessive training can overfit, making early stopping a regularization measure. section 8.1.1
Figure 8.1 Gradient descent with lr = 0.1, demonstrating faster convergence
figure

Compare a larger learning rate with faster convergence in gradient descent. section 8.1.1

Figure 8.2 Gradient descent with lr = 0.01, illustrating stability in convergence
figure

Contrast a smaller learning rate with more stable convergence in gradient descent. section 8.1.1

How Transformers in Action covers it

How deep it goes
Explains loss-relative parameter updates and training controls, without deriving partial derivatives or detailing their implementation.
Examples
Contrasts gradient-descent convergence with learning rates of 0.1 and 0.01.
What you can do after
Apply it via gradient descent to understand parameter updates and choose learning-rate, batch-size, and epoch settings.
How it connects
Connects model parameters, loss functions, gradient descent, learning rate, batch size, epochs, overfitting, and early stopping.

Also explained in

Compare how 20 books explain gradient →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Transformers in Action. The section links point to the parts of the book it draws on.