Representing information / 4 of 7

Derivatives and gradients

8 minOpening your notebook…

What you’ll learn

  • Explain the main idea of “Derivatives and gradients” in your own words.
  • Trace a concrete example and identify the assumptions behind it.
  • Apply the principle in a practice problem and recognize a common failure.

The idea, intuitively

A gradient extends a derivative to a function with several inputs. Each component describes change along one coordinate while holding the others fixed. It points toward the steepest local increase under the usual Euclidean geometry.

Use small numbers first and work one operation at a time. Track the shape and units of every quantity before doing algebra. The equations here describe idealized objects; implementing them on a computer introduces finite precision and resource constraints. You can understand the mechanism before learning every proof.

Under the hood

For L(x,y)=x²+3y², the gradient is (2x,6y). Negating the gradient gives a local descent direction; the step size still controls whether the actual loss decreases.

∇L=(∂L/∂w1,…,∂L/∂wn)\nabla L=(\partial L/\partial w_1,\ldots,\partial L/\partial w_n)
Each entry is the rate of change of L when one parameter wᵢ varies and the others are held fixed.
A useful caution

A zero gradient can indicate a minimum, maximum, or saddle point.

A worked example

At (1,1), the gradient is (2,6). A step size of 0.1 produces (0.8,0.4).

How to use this way of thinking

Check a symbolic result with a numeric example, then consider an edge case such as zero, a very large value, or an incompatible shape. Explain what each symbol means rather than memorizing the equation. If a result surprises you, inspect the assumptions and the units first.

See the mechanism

Educational simulationRuns in your browser with simplified rules and example settings.
Try this

Start at −3. Take a step at 0.5, then take several steps at 1.1. Compare the loss in the two runs and use the step history to explain the difference.

Opening the experiment…

Try it yourself

For L(w)=w² at w=4, take a gradient step with rate 0.1.

Key takeaways

  • The negative gradient with a sufficiently small step
  • A zero gradient can indicate a minimum, maximum, or saddle point.
  • Check the assumptions with a small example before applying this idea to a larger system.

Check your understanding

0/2 checked

Use feedback to learn. Quiz scores and lesson completion are tracked separately.

1Which direction locally reduces a differentiable loss?
2True or false: Every point with a zero gradient is a minimum.
Go to lesson completion

Further reading

Original papers and reference material for this school. External resources may be in English and require internet access.

Mathematics for Machine Learning (open textbook) (opens a new tab)

Finish this lesson

Mark this lesson complete when you’re ready to continue.

Start with a question

Introduction to AIAI FoundationsA brief history of AIAI FoundationsTypes of AIAI FoundationsAI, ML, and deep learningAI FoundationsUnderstanding generative AIAI FoundationsEthics, limitations, and responsibilityAI FoundationsLinear algebra for learning systemsMathematics for AIVectors, matrices, and similarityMathematics for AICalculus: measuring changeMathematics for AIDerivatives and gradientsMathematics for AIProbability and statisticsMathematics for AIOptimization and objectivesMathematics for AI
K to open · Escape to close