The Maths You Actually NeedLesson 23 of 76

Module 3 · Change, slopes and the walk downhill

Backpropagation, and where the memory goes

In this lesson

  • 10 min read
  • 8 reading sections
  • Knowledge check
  • Lesson 5 of 9 in this chapter

This chapter’s goalCompute a partial derivative and a chain-rule derivative by hand, trace a gradient backwards through a two-layer network and say where the memory goes, and diagnose from a loss curve and a gradient-norm plot whether the learning rate, the curvature or a vanishing gradient is the cause.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
One backward sweep over a two-layer networkForward, and cachez1 = 0.5 times 2 =1.0, a1 = relu(1.0) =1.0, z2 = 3 times 1.0= 3.0. Keep x, thesign of z1, and a1.Start at the lossL = (3 minus 1)squared = 4, and thederivative withrespect to z2 is 2times (3 minus 1) = 4.Layer 2Weight gradient 4times a1 = 4, whichneeded the cached a1.Pass down 4 times w2 =12.Layer 1Through the relu: 12times 1 = 12. Weightgradient 12 times x =24, which needed thecached x.Two weight gradients, 4 and 24, from one sweep. Notice which forward values had to survive to make itpossible: a1 for the second layer and x for the first. That cache, held from the forward pass untilthe backward pass reaches it, is where training memory goes.
Two weight gradients, 4 and 24, from one sweep. Notice which forward values had to survive to make it possible: a1 for the second layer and x for the first. That cache, held from the forward pass until the backward pass reaches it, is where training memory goes.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 9Free · no account needed
Lesson steps

The problem it solves

You have a network with 7 billion parameters and you need the derivative of the loss with respect to each one. The naive approach is to nudge each parameter, rerun the network, and see how the loss changed. That is 7 billion forward passes per training step. At a tenth of a second each, one step would take twenty-two years.

Backpropagation gets all 7 billion in roughly the cost of two forward passes. The trick is that most of the arithmetic is shared, and doing it backwards is what lets you share it.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Stuck on something?Ask Funke, your AI tutor

How to cite: Addaly (2026) ‘Backpropagation, and where the memory goes’, in The Maths You Actually Need. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/maths-you-need/backpropagation-as-bookkeeping (Accessed: 29 November 2026).