Guided pathThis is part of Understand Transformers & BERTBack to the path

Backpropagation Intuition

P6.dl-architectures.01 · Audience: guest, language-pro, it-ml · Prerequisites: Loss Functions and the Learning Objective

Real LLM grading for this pageLLM grading (this page):

How does a network know which weights to adjust, and by how much — without any calculus notation? Backpropagation traces the prediction error backward through a computation graph, assigning each weight a "blame score". This module builds that intuition step by step on a tiny concrete expression, f = (a + b) × c.

Step 1 / 4What Is Backpropagation?

The fundamental problem. A neural network makes a prediction. The prediction is wrong. We know how wrong (by computing a loss: the difference between prediction and truth). But which of the millions of weights caused the error? And by how much should each weight change?

Backpropagation (short: backprop) is the algorithm that answers both questions. It traces the error backward through the network, assigning a "blame score" to each weight — telling us exactly how much each weight contributed to the mistake.

🗣️ From a linguist's perspective: Backpropagation as tracing the source of errors backward through a pipeline
In error analysis for machine translation, a post-editor traces the cause of each error backward: was it a mistranslation of a source word, a wrong syntactic parse, a failure of coreference resolution, or a terminology error? Each error has a source in the pipeline, and fixing it requires adjusting the right stage. Backpropagation is the automated version of this error-tracing for neural networks: it measures how much each weight in every layer contributed to the final prediction error, and assigns each weight a "gradient" — a direction and magnitude for adjustment. Without this algorithm, training large networks would be computationally impossible.
ⓘ Concept: Backpropagation — the Big Picture

Training a neural network has two passes plus an update:

  • Forward pass — compute the prediction step by step: input → hidden → output.
  • Backward pass — starting from the error (loss), trace backward and compute how much each operation contributed to it. These contributions are called gradients (or informally, "blame scores").
  • Update — adjust each weight in the direction that reduces the loss (gradient descent: new_weight = old_weight − learning_rate × gradient).

Why it matters — Backprop is what makes it possible to train neural networks with millions of parameters. Without it, we would have to try random weight changes — far too slow for any real model. Every modern AI, including the Transformer, is trained using some form of backpropagation.

Reference: Rumelhart, Hinton & Williams 1986 — Learning representations by back-propagating errors

💡 We use the word gradient to mean "how much does the output change when I slightly increase this weight?" A large gradient means a small nudge to this weight has a big effect on the loss. A gradient of zero means the weight is not contributing at all.

Q1 — Direction of error signals: backpropagation sends error signals in which direction through the network — forward or backward?

📚 Go Further

Curated resources to explore backpropagation further.

TypeResource
VideoAndrej Karpathy — The spelled-out intro to neural networks and backpropagation: building micrograd (YouTube, ~2.5 h)
Video3Blue1Brown — Backpropagation calculus (Deep Learning, Chapter 4, YouTube)
CourseCoursera — Deep Learning Specialization, Course 1 Week 4: Backpropagation, Andrew Ng (free audit)
ReferenceCS231n Stanford — Backpropagation, Intuitions (cs231n.github.io/optimization-2)
ExerciseKarpathy — micrograd GitHub repo: implement scalar autograd from scratch, then inspect the computation graph
Ask the mentor about this module

Ask a question about this content. The mentor explains and grounds its answer in what you are studying; asking is recorded as a learning signal, not a grade.

Ctrl/Cmd + Enter to send

🎓 Practice ladder

3 graded rungs · ~20 min

Three graded rungs: verify the chain rule numerically on f(g(x)) = sigmoid(x²), backpropagate through f = (a + b) × c by hand, then finish a minimal tape-based autograd.

Rung 1 — Chain rule, checked numerically

Loading exercise…

Rung 2 — Backprop through f = (a + b) x c

Loading exercise…

Rung 3 — Finish the autograd tape

Loading exercise…

Try it yourself

A scratch console for this page's ideas — ungraded, nothing you run here is recorded.

Scratch console

A scratch console with the scientific stack (pandas, numpy, scikit-learn). Runs on the server — no network, resource-limited and measured.

Output appears here.