5.6.8 · D5Machine Learning (Aerospace Applications)

Question bank — Backpropagation — chain rule, gradient computation

1,337 words6 min readBack to topic

True or false — justify

True or false: Backprop and gradient descent are the same algorithm.
False — backprop only computes the gradients; Gradient Descent is the separate step that uses those gradients to update weights. One supplies, the other consumes.
True or false: Backprop requires the loss to be a scalar.
True — the gradient only makes sense when is a single number; a vector output must first be reduced to a scalar loss before any backward sweep can start.
True or false: A forward pass is optional — you can backprop from just the weights.
False — backprop needs the cached activations and pre-activations from the forward pass, since local derivatives like and the input factor depend on them.
True or false: Doubling the number of layers roughly doubles the cost of one backward sweep.
True — cost scales with the number of operations in the computation graph, so it grows linearly with depth, not with the number of weights individually.
True or false: If a unit's activation slope , no gradient reaches any weight before that unit on that path.
True — the error is multiplied by when crossing the nonlinearity, so that path contributes zero to upstream weight gradients (this is one root of Vanishing Gradients).
True or false: Backprop computes the gradient exactly, not an approximation.
True — it is the chain rule applied symbolically to the graph, so (up to floating-point) it is exact, unlike finite-difference estimates which carry truncation error.
True or false: The bias gradient equals the error signal at that layer.
True — since gives , the bias inherits the raw with no input factor attached.
True or false: Backprop can only be done by hand for tiny nets.
False — automatic differentiation applies exactly these rules to arbitrarily large graphs mechanically; the hand derivation just reveals what the machine does.

Spot the error

Spot the flaw: "The gradient of is just , because ."
It drops the downstream error: , not alone. The bare is only the local derivative ; the rest of the network's blame multiplies it.
Spot the flaw: "To send error backward through , multiply by ."
Backprop uses the transpose , not the inverse. The derivative of the linear map with respect to is ; differentiation transposes, it never inverts (and need not even be square).
Spot the flaw: "Use the layer-2 output rule everywhere: ."
It forgets the factor. Hidden layers pass through a nonlinearity, so their incoming error must be scaled by each unit's activation slope; only the linear output layer skips it.
Spot the flaw: "At a node whose output feeds two layers, backprop the error from just the shorter path."
You must sum the contributions from all outgoing paths (multivariable Chain Rule). Each path is an independent way the node influences the loss, and total sensitivity is their sum.
Spot the flaw: "We seed the backward pass with ."
For MSE the seed is , the error, not . Missing the target makes the whole downstream gradient wrong.
Spot the flaw: "Since backprop reuses forward values, we don't need to store them — just recompute."
Recomputing each local derivative from scratch would destroy the efficiency; the whole -forward-pass advantage comes from caching activations so each backward step is cheap.
Spot the flaw: "The gradient ."
The orientation is wrong — it is the outer product , giving a matrix shaped like (outputs × inputs). Swapping the transpose gives the wrong shape.

Why questions

Why does backprop cost about one forward pass rather than one pass per weight?
Because the chain rule factors the derivative into a product of local slopes, and a single backward sweep reuses each cached intermediate to fill in all weight gradients simultaneously.
Why do we go backward rather than forward when accumulating derivatives?
The loss is a scalar at the far end; sweeping backward from that one scalar reuses each shared sub-derivative, whereas forward accumulation would recompute the same downstream factors once per input weight.
Why does the error get multiplied by and not by when crossing a nonlinearity?
We are differentiating, so we need the slope of the activation (), which says how a small change in changes — the value itself is what the forward pass used, not the sensitivity.
Why does the same "error × input" pattern appear in every layer?
Because each layer's pre-activation has the identical linear form , so always picks out the input — the recursion just repeats this local structure at every depth.
Why can saturated activation functions stall learning even when backprop is perfectly correct?
In their flat regions , so correct math still multiplies the error by near-zero, shrinking gradients across many layers — the mechanism behind Vanishing Gradients.
Why is backprop what makes aerospace deep-learning surrogates practical?
Fitting a CFD surrogate means tuning millions of weights on huge datasets; only the one-sweep gradient of backprop makes each training step affordable enough to converge.

Edge cases

Edge case: What is the gradient through a ReLU unit sitting exactly at ?
The slope is undefined there (a kink), so implementations pick a subgradient — usually (sometimes ); it is a measure-zero case that rarely affects training.
Edge case: If two different weights share the exact same value, do their gradients have to match?
No — the gradient depends on the error arriving and the input at each weight's own location, which generally differ, so equal weights can have very different gradients.
Edge case: What happens to for a "dead" ReLU that outputs 0 for every training example?
Its on all inputs, so it passes zero error backward and receives zero weight gradient forever — it is stuck and cannot recover on its own.
Edge case: Does a bias with input "always 1" still get a gradient?
Yes — its gradient is exactly , the raw error at that unit; the constant input just means there's no extra input factor multiplying it.
Edge case: If the loss is completely flat at the current weights (), what does backprop return?
It returns all-zero gradients — a correct answer meaning descent will not move, which happens at minima, maxima, saddle points, or dead-flat plateaus alike.
Edge case: A weight feeds a unit whose downstream error is exactly zero. What is that weight's gradient?
Zero, regardless of the weight's own value or its input, because and nullifies the product.