backprop -- the backward pass (how a model learns)
Most demonstrations show a model using what it already knows. This one shows it learning. The model makes a guess, the page measures how far off it was, and then works backwards through each step asking one question of every number in it: if this number were slightly larger, would the error get better or worse, and by how much? That answer is the number's slope, and shifting each one a little way down its own slope makes the next guess better. Switch on descent and watch the error fall toward zero; run that same loop over billions of numbers instead of the handful here and you have training, because there is nothing else to it.
Interactive page: backpropagation / autograd -- the backward pass, the training counterpart to the forward-pass capstone (and the only page about how a model learns, not just runs). Anchor: H (end to end / training). Family H.
What it shows
A tiny computation graph -- one neuron with a squared loss:
m1 = w1·x1 m2 = w2·x2 z = m1 + m2 + b a = tanh(z) L = (a − y)²
runs forward (values flow →) to a loss L, then gradients flow back (←) by the chain rule: each node takes the gradient arriving from above and multiplies by its own local derivative, handing the result to its inputs:
dL/da = 2(a − y) dL/dz = dL/da · (1 − a²) dL/dw1 = dL/dz · x1...
Every node shows its value and its gradient (g=, in red); the red arrows are the backward flow. The gradient on each weight, dL/dw, is exactly the slope of the loss in that weight's direction.
Flip on descend and the page repeatedly applies w ← w − lr·dL/dw and you watch L fall toward 0 on the loss curve while the output a converges to the target y -- that loop, over billions of parameters, is training.
Step the reveal (0–4) to watch gradients propagate layer by layer; drag any leaf node (inputs x, weights w, bias b, target y) to change it and see every value and gradient update; toggle descend and tune the learning rate.
Render tier
T1 (Canvas2D: the computation-graph nodes with value + gradient, the backward-flow arrows, and the loss-vs-step curve).
Wiring
layout.mount + a 5-step transport (the backward reveal) + controls (lr, train, seed) + animate (the descent loop + loss curve) + onPointer drag-a-leaf-node + hover. ?lr / ?train / ?seed / ?step hooks. Source: page.js.