Neural Network Backpropagation
- 54Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
Describe the forward path through a neural network from an input example to a loss value.
54 questions
- 1
Describe the forward path through a neural network from an input example to a loss value.
Model answer
The input passes through layers that combine activations with weights and biases, producing pre-activations and then activations. The final model output is used to calculate the loss.
Explanation
The forward path applies the network modules in order, then evaluates the loss using the model output.
- 2
In what order are quantities typically computed during backpropagation?
Model answer
Computation starts with the loss derivative with respect to the model output, then proceeds backward through the network to derivatives for later and earlier activations.
Explanation
Backpropagation follows dependencies in reverse relative to the forward data flow.
- 3
What does a backpropagation rule for a module allow you to calculate?
Model answer
Given the derivative of the loss with respect to the module’s output, it lets you calculate the derivative with respect to the module’s input.
Explanation
The chain rule passes a loss gradient backward through each module.
- 4
Why is the loss derivative with respect to the model output often straightforward to compute?
Model answer
It comes directly from the chosen loss function, which often has a simple derivative with respect to the output.
Explanation
For example, the lecture describes a squared-error loss whose output derivative follows directly from its formula.
- 5
How are gradients with respect to layer weights and biases obtained during backpropagation?
Model answer
Once the relevant activation gradients are known, they can be used to compute gradients for that layer’s weights and biases.
Explanation
Parameter-gradient calculations depend on the activation gradients produced during the backward pass.
- 6
Why must activation gradients be computed sequentially, while some parameter gradients can be calculated as soon as their needed activation gradient is available?
Model answer
Each activation gradient depends on the gradient from a later part of the network, so these gradients must follow the backward order. A layer’s parameter gradients can be computed once the activation gradient needed for that layer is available.
Explanation
The dependencies between activation gradients determine their order; parameter gradients can be calculated from the corresponding layer quantities when those become available.
- 7
What does training loss measure, and what other terms may be used for it?
Model answer
Training loss measures the model’s loss on the examples used for training. It may also be called training error, training cost, or tuning loss in this context.
Explanation
The lecture uses these terms for the quantity optimized on the training examples.
- 8
Give examples of loss functions that can be used as training losses.
Model answer
Examples include squared loss and cross-entropy loss. A negative log-likelihood can also serve as a training loss.
Explanation
The negative log-likelihood arises by deriving a maximum-likelihood estimator for the data.
- 9
What are two broad approaches to minimizing a training loss, and what methods illustrate them?
Model answer
An analytical approach computes a minimizer using a formula, while a numerical approach iteratively optimizes the loss. Examples include analytical maximum-likelihood solutions and numerical methods such as stochastic gradient descent or Newton’s method.
Explanation
Both approaches seek to minimize a loss defined on the training examples.
- 10
How is test loss defined in terms of a test distribution?
Model answer
Test loss is the expected loss of the model on a fresh example drawn from the test distribution.
Explanation
The expectation accounts for the randomness of the new example and its label.
- 11
Why can the average loss on a test set estimate the expected test loss?
Model answer
A test set consists of fresh examples drawn from the test distribution, so their empirical average estimates the expected loss under that distribution.
Explanation
A sample average is a standard way to estimate the expectation of a random quantity.
- 12
What must be true of test examples for them to provide an unbiased check of generalization?
Model answer
They must be fresh examples that were not used during training or model tuning.
Explanation
If test examples influence the training process, the evaluation no longer reflects performance on unseen examples.
- 13
What is the generalization gap?
Model answer
It is the difference between test loss and training loss.
Explanation
The gap measures how much the model’s loss changes when evaluation moves from training examples to unseen test examples.
- 14
How do training loss and test loss typically compare, and what does a large gap indicate?
Model answer
Training loss is often no greater than test loss, though the two can be similar or differ substantially. A large positive gap indicates that performance is worse on unseen examples than on the training data.
Explanation
The lecture emphasizes that test performance is often worse than training performance, but the size of the difference varies.
- 15
What two quantities should be kept small to obtain a small test loss?
Model answer
Both the training loss and the generalization gap should be small.
Explanation
Test loss combines how well the model fits the training data with how much its performance changes on unseen data.
- 16
Why can’t the test loss usually be optimized directly during model training?
Model answer
Directly choosing parameters to minimize test loss would require using the test examples, which must be kept unseen during training and tuning.
Explanation
The proper sequence is to choose the model first and then evaluate it on the test data.
- 17
What is the characteristic pattern of overfitting?
Model answer
An overfit model has low training loss but high test loss, producing a large generalization gap.
Explanation
It fits the training examples well but does not perform well on unseen examples.
- 18
What is underfitting?
Model answer
Underfitting occurs when a model performs poorly even on the training data, so its training loss is high.
Explanation
The model has not captured the patterns in the examples it was trained on.
- 19
Suppose data follow a noisy quadratic relationship between input and output. Why might a linear model underfit?
Model answer
A linear model cannot represent a quadratic relationship, so it may have high training loss even with plenty of data.
Explanation
The failure comes from insufficient model expressivity, not necessarily from too few examples.
- 20
Why is a model’s inability to represent the true relationship not necessarily fixed by collecting more data or reducing noise?
Model answer
More data or less noise cannot make a restricted model family represent a relationship outside that family, such as a quadratic function with a linear model.
Explanation
The limitation is imposed by the model class itself.
- 21
Why can a high-degree polynomial overfit a small dataset?
Model answer
It is flexible enough to follow the individual patterns, including noise, in the limited training examples.
Explanation
A highly flexible model can explain accidental fluctuations instead of capturing the underlying relationship.
- 22
How can a fifth-degree polynomial behave on four training points?
Model answer
It can pass through all four points, potentially reducing training error to zero.
Explanation
The polynomial has enough flexibility to interpolate a small set of points.
- 23
Why might a polynomial that interpolates training data perform poorly on new examples?
Model answer
It may have fitted noise or incidental patterns in the training points rather than the underlying trend, so its predictions can be inaccurate on fresh data.
Explanation
Exact fit to a small sample does not guarantee that the learned curve captures the true relationship.
- 24
How can retraining a flexible model on a newly sampled dataset reveal sensitivity to the data?
Model answer
If the newly trained model changes substantially when the sample changes, the model is sensitive to the particular examples and noise it received.
Explanation
Different samples from the same distribution contain different incidental patterns.
- 25
What can happen when a flexible polynomial is trained on many examples from a noisy quadratic relationship?
Model answer
It can fit a curve close to the underlying quadratic trend, with the higher-degree coefficients becoming small, even though the model family allows more complex curves.
Explanation
With many examples, fitting all the fluctuations is less effective than fitting the overall relationship.
- 26
How is test error conceptually decomposed in the bias–variance framework?
Model answer
It is decomposed into a bias contribution and a variance contribution.
Explanation
For squared loss, the lecture describes a formal decomposition into squared bias plus variance.
- 27
How does bias generally change as model complexity increases?
Model answer
Bias generally decreases as model complexity increases.
Explanation
More expressive models can represent a wider range of relationships, reducing errors caused by an overly restrictive model family.
- 28
How does variance generally change as model complexity increases?
Model answer
Variance generally increases as model complexity increases.
Explanation
More flexible models can respond more strongly to differences between training samples.
- 29
Why does the classical bias–variance picture predict a U-shaped test-error curve as model complexity changes?
Model answer
Increasing complexity reduces bias but increases variance, so their combined contribution can be smallest at an intermediate complexity.
Explanation
Neither extreme is ideal: a simple model may underfit, while a very complex model may be unstable across samples.
- 30
What does bias represent in terms of the best performance achievable by a model family?
Model answer
Bias reflects the error that remains because of the limitations of the model family, even with effectively unlimited data.
Explanation
A family that cannot express the underlying relationship has a persistent approximation error.
- 31
Why is bias considered a property of a model family rather than simply a measure of how many examples are available?
Model answer
Bias reflects restrictions built into the family of models, such as assuming a linear relationship when the true relationship is quadratic.
Explanation
The restriction remains even if the family is trained on more examples.
- 32
How is variance characterized by comparing models learned from different datasets?
Model answer
Variance is large when the learned models differ substantially across datasets sampled from the same distribution.
Explanation
The comparison shows how sensitive the learning result is to the particular training sample.
- 33
What two factors can contribute to high variance?
Model answer
High variance can result from too little data, an overly complex model, or both.
Explanation
A complex model has more opportunity to respond to sample-specific patterns, especially when data are scarce.
- 34
How can high variance be reduced?
Model answer
It can often be reduced by collecting more examples from the same distribution or by using a simpler model.
Explanation
More data stabilizes what the model learns, while a simpler model is less able to fit incidental patterns.
- 35
Why might the best model complexity depend on the amount of training data?
Model answer
A complex model may have excessive variance with few examples, while more data can make it possible to use that model without the same instability.
Explanation
The trade-off between model flexibility and sample size affects how reliably a model can be learned.
- 36
Why is the best model complexity also dependent on the underlying relationship being modeled?
Model answer
A model must be expressive enough to represent the relationship, but additional complexity beyond what is needed can increase variance.
Explanation
For example, a quadratic relationship may be well represented by a quadratic model, while a different relationship may require a different model family.
- 37
Can bias and variance usually be measured directly in a practical learning problem?
Model answer
Usually not, because their definitions rely on knowledge such as the true relationship or repeated sampling that is not fully available in practice.
Explanation
They are primarily useful for understanding learning behavior; practical model selection typically relies on validation performance.
- 38
How can a validation set help choose model complexity when bias and variance are not directly known?
Model answer
Train and compare candidate models, then choose among them based on their performance on a separate validation set.
Explanation
Validation performance provides a practical estimate of how well different choices generalize.
- 39
Why might the classical bias–variance decomposition be harder to formalize for cross-entropy loss than for squared loss?
Model answer
The standard formal decomposition is established for squared loss, while a corresponding formal decomposition for cross-entropy is more challenging.
Explanation
The qualitative intuitions may still be useful even when the same mathematical decomposition is unavailable.
- 40
What is double descent in the relationship between model size and test error?
Model answer
Double descent occurs when test error first decreases, then rises to a peak, and later decreases again as model size continues to increase.
Explanation
The later decrease is a second descent beyond the peak associated with the classical U-shaped picture.
- 41
What is the overparameterized regime in the model-wise double-descent picture?
Model answer
It is the regime in which the number of model parameters exceeds the number of training examples.
Explanation
The surprising observation is that test error can improve again in this regime rather than remaining uniformly poor.
- 42
What is data-wise double descent?
Model answer
It is a pattern in which test error changes non-monotonically as the number of training examples increases: it can decrease, rise to a peak, and then decrease again.
Explanation
This differs from the simple expectation that adding data will always steadily reduce test error.
- 43
In simple settings, around what relationship between sample size and parameter count can a double-descent peak occur?
Model answer
The peak can occur when the number of examples is close to the number of parameters or features.
Explanation
For linear models this relationship is especially clear; for nonlinear models the precise relationship may be less direct.
- 44
Why can the peak in a double-descent curve depend on the learning algorithm rather than only on the model class?
Model answer
The algorithm used to fit the model can perform poorly near the point where sample size and parameter count are similar, producing a peak that another algorithm might reduce.
Explanation
The observed curve reflects both the model and the procedure used to learn its parameters.
- 45
What behavior of learned parameter norms has been associated with the peak near equal sample size and parameter count?
Model answer
The norm of the learned parameters can become very large near that point.
Explanation
A large norm is one possible indication that the learned solution is complex, even if parameter count alone does not fully describe its complexity.
- 46
Why may parameter count alone be an incomplete measure of model complexity?
Model answer
A model with many parameters can still behave simply if most parameters are near zero, while a model with fewer parameters can have a large norm and behave more complexly.
Explanation
Complexity can depend on how parameters are used, not just how many there are.
- 47
How can explicit regularization of parameter norms affect a peak in test error?
Model answer
It can reduce the peak by encouraging solutions with smaller parameter norms, even if this requires accepting somewhat higher training loss.
Explanation
Regularization balances fitting the training data against preferring a less complex solution.
- 48
What is implicit regularization, and how might it help explain good performance with many parameters?
Model answer
Implicit regularization is a preference for certain solutions created by the optimization algorithm, even though that preference is not explicitly written as a penalty in the loss. It may lead to small-norm solutions in highly parameterized settings.
Explanation
The algorithm can favor simpler solutions without an explicit norm-regularization term.
- 49
Why can a model with far more parameters than examples still generalize well in some cases?
Model answer
The optimization process may implicitly favor a relatively simple solution, such as one with a small parameter norm, rather than fitting every sample-specific detail.
Explanation
Having many available parameters does not guarantee that the learned solution uses them in a complex way.
- 50
Is there one universally correct measure of model complexity?
Model answer
No. The appropriate measure depends on the setting; parameter count and parameter norms can each capture different aspects of complexity.
Explanation
The lecture notes that no single complexity measure applies universally.
- 51
What is the basic purpose of regularization in model fitting?
Model answer
Regularization adds a preference for simpler or smaller-norm models alongside the goal of reducing training loss.
Explanation
It creates a balance between fitting the observed examples and controlling model complexity.
- 52
When does the classical bias–variance discussion provide a well-established formal decomposition?
Model answer
It provides a classic formal decomposition for squared loss, but not the same straightforward decomposition for every loss function.
Explanation
For other losses, such as cross-entropy, the intuitions may remain useful even when the formal analysis is more difficult.
- 53
How can model complexity be varied while remaining within linear models?
Model answer
One can change the number of features used, thereby changing the number of parameters while keeping the model linear in those parameters.
Explanation
Adding or removing features changes the model’s capacity without changing the linear-model framework.
- 54
Why should optimization failure be distinguished from a model’s inability to represent a good solution?
Model answer
A good model may exist in the chosen family but remain undiscovered because the optimization procedure fails; that is different from the family being too restricted to represent the relationship.
Explanation
The bias–variance discussion often assumes optimization succeeds, while optimization difficulty is a separate issue.

Ask anything
We've read this whole study set, so questions about it get the best answers.