Turn a derivative into an update
Use a transparent quadratic to understand gradient descent before reading richer engines.
Course lessons · 1 of 5
Calculate a gradient step and check whether its objective decreases.
Useful background: Follow an update pipeline
The derivative measures local sensitivity
For the teaching objective f(x) = ½(x − a)², the derivative is x − a. Its sign tells which local direction increases the objective. Gradient descent subtracts a positive step-size multiple of that derivative.
If x lies above a, the derivative is positive and subtraction moves left. If x lies below a, the derivative is negative and subtraction moves right. The derivative becomes zero at the target. This example is chosen for transparent arithmetic, not as a reproduction of the Rhiannon engine.
Check the objective after the step
A direction that is locally downhill can still produce an overshoot when the step is too large. Record the starting value, derivative, proposed new value, and objective at both points. A displayed arrow alone cannot establish improvement.
The recovered Rhiannon component uses sigmoid outputs, target comparisons, and a squared-error derivative. Epona’s poster also includes a separate value-gradient term. These are source-specific extensions; understanding the simple loss step helps identify exactly what each extra term changes.
Take one step toward a = 3
1Evaluate the gradient
Start at x = 7. The derivative is seven minus three, giving four.
2Apply a step size of one half
Subtract half the gradient from the current value.
3Check both losses
The old loss is eight, and the new loss is two. This particular step reduced the objective.
Make the idea respond
To reproduce the worked update, set starting x to 7, minimum a to 3, and learning rate η to 0.5. Step once: the state becomes 5 and the objective decreases from 8 to 2. Reset the run before comparing a different starting configuration. These are the quadratic teaching dynamics, not the sigmoid Rhiannon source engine.
Change one input at a time. Predict what should happen, then compare the computed result with your prediction.
Teaching model · computed in your browser
Follow the gradient
Choose a starting point and learning rate, then inspect every update toward a quadratic minimum.
a is the location of the minimum; x is the current parameter; η is the learning rate. The derivative is x − a. For this unit-curvature quadratic, an initial error contracts precisely when 0 < η < 2. This condition does not automatically apply to a different loss function.
Try this: keep the same starting point and compare η = 0.5, 1, 2, and 2.5. Watch the distance from the minimum rather than the learning rate alone.
Playback starts only when you choose Play. It pauses when this tab is hidden or the lab leaves view. Reduced-motion preferences slow the updates; Step always gives you direct control. Runs stop after 40 updates or at the display limit.
The default worked example is shown below.
Convergent: each update moves toward the minimum without crossing it. Press Step to compute x₁ = x₀ − η(x₀ − a).
| Update | x | Gradient x − a | Loss ½(x − a)² |
|---|---|---|---|
| 0 | -2 | -5 | 12.5 |
Your turn.
Try an answer before opening a hint. Feedback will explain the result, and you can practice again.
Interactive practice is loading. The lesson, worked example, and printable questions remain available below.
View printable practice and solutions
Use these questions when studying without interactive controls. Opening a written solution does not earn progress.
For f(x) = ½(x − 3)², what is the derivative at x = 5?
Read the solution
At x = 5, the derivative is 5 − 3 = 2.
Starting at x = 5 with target 3 and step size 0.5, what is the next gradient-descent state?
Read the solution
The next state is 5 − 1 = 4.
At x = 1 with target 3, which direction does a small positive gradient-descent step move?
- Left, toward smaller x.
- It cannot move because the derivative is negative.
- It necessarily jumps to infinity.
- Right, toward larger x.
Read the solution
A positive step size moves the state right toward the target.
What establishes that a particular proposed update improved the chosen objective?
- The presence of the word learning in its name.
- The animation moving faster.
- A larger state value alone.
- Evaluating the objective before and after the update.
Read the solution
For minimization, a lower objective after the update is the relevant local evidence.
Follow the original record
Use the definitions you just practiced to read the project’s own notation, assumptions, and evidence.
The ideas to keep
- Compute the derivative at the current state.
- Subtract it for loss descent.
- Verify improvement by measuring the objective.
Reading completion is separate from your practice evidence.
Progress is kept in this browser. How learning works