Backpropagation and LLM Training
- 84Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
How can a simple house-price model combine house size, bedroom count, location, and age to make a prediction?
84 questions
- 1
How can a simple house-price model combine house size, bedroom count, location, and age to make a prediction?
Model answer
It multiplies each input by an adjustable weight and combines the results into a predicted price.
Explanation
Each weight controls how strongly its corresponding input contributes to the output.
- 2
What does a weight represent in a neural network, and how does the knob analogy explain it?
Model answer
A weight is an adjustable parameter that affects the model's behavior. Like a knob, changing it changes how much a particular input influences the output.
Explanation
Neural networks may contain millions or billions of such adjustable parameters.
- 3
Why is it difficult to train a model with many parameters?
Model answer
When the model makes an error, training must determine which parameters contributed to it, in what direction they should change, and by how much.
Explanation
This becomes especially challenging when the model has millions or billions of weights.
- 4
In the tea-making analogy, what do the recipe choices, making the tea, the rating, tracing the error, and changing the recipe represent?
Model answer
The recipe choices are weights, making the tea is forward propagation, and the rating represents loss. Tracing the error back is backpropagation, while changing the recipe is optimization.
Explanation
Repeating these steps is analogous to training.
- 5
Why is it not enough to know only that a model's result was bad?
Model answer
Training also needs to identify which decisions contributed to the error, how strongly they contributed, and which direction they should change.
Explanation
This information helps determine useful parameter updates rather than making arbitrary changes.
- 6
What is forward propagation?
Model answer
Forward propagation sends input through the network's layers to produce a prediction.
Explanation
It is the prediction-making part of the training loop.
- 7
If a cat-image classifier predicts dog instead of cat, what has happened during the forward pass, and what has not happened yet?
Model answer
The network has produced a prediction, but it has not learned from the mistake yet.
Explanation
A forward pass alone does not change the model's weights.
- 8
What does a loss measure, and how does it relate to prediction quality?
Model answer
Loss is a number that measures how wrong a prediction is. A good prediction has low loss, while a bad prediction has high loss.
Explanation
The loss gives training a quantity to use when improving the model.
- 9
What is the purpose of converting prediction error into a single loss value?
Model answer
It gives the training process a single measure of how wrong the model was, which can guide parameter updates.
Explanation
The loss makes prediction error usable by optimization methods.
- 10
What does a language model do during a forward pass on a prompt such as “Paris is the capital of”?
Model answer
It produces possible next-token predictions with associated probabilities, such as predicting “France.”
Explanation
Producing these predictions is a forward computation, not learning by itself.
- 11
In what sense are weights what a neural network learns?
Model answer
Training changes the weights to improve the network's predictions.
Explanation
Backpropagation helps determine how the weights should change, and an optimizer applies updates.
- 12
What is the central problem that backpropagation addresses in a large neural network?
Model answer
It determines how changing each parameter would affect the final loss.
Explanation
This lets training identify useful changes across a very large set of weights.
- 13
What information does a gradient provide about a parameter?
Model answer
A gradient indicates how the loss changes when the parameter changes, including the direction and strength of that response.
Explanation
It describes sensitivity; it does not itself change the parameter.
- 14
If increasing a weight makes the loss worse, what does that indicate about the direction in which training should move the weight?
Model answer
Increasing the weight is the wrong direction, so training should move it downward.
Explanation
The gradient provides information about how the loss responds to parameter movement.
- 15
Does a gradient update a parameter by itself?
Model answer
No. A gradient provides information, and an optimizer uses that information to decide how to update the parameter.
Explanation
Backpropagation calculates gradients; the optimizer applies weight updates.
- 16
Using the hill analogy, what do loss, gradient, and optimizer correspond to?
Model answer
Loss is height on the hill, the gradient indicates the slope and downhill direction, and the optimizer takes the step.
Explanation
Knowing the slope does not move you; an update rule must use it.
- 17
How do backpropagation and an optimizer divide the work of learning?
Model answer
Backpropagation calculates gradients, while the optimizer uses those gradients to update the weights.
Explanation
They are related but perform distinct jobs in training.
- 18
How does stochastic gradient descent generally use gradients?
Model answer
Stochastic gradient descent takes a step in the downhill direction indicated by the gradient.
Explanation
It is one of several optimizers that can use backpropagated gradients.
- 19
How does Adam adapt its updates over time?
Model answer
Adam keeps a running estimate of the slope and adapts its step over time.
Explanation
Its update behavior differs from a simple downhill step.
- 20
What distinction does AdamW introduce compared with Adam?
Model answer
AdamW is a refinement of Adam that handles weight decay differently.
Explanation
The key distinction here is its approach to weight decay.
- 21
What does the learning rate control?
Model answer
The learning rate controls the scale or size of each weight update.
Explanation
It is a hyperparameter chosen by engineers rather than learned from the data.
- 22
What can happen if the learning rate is too small or too large?
Model answer
A rate that is too small makes progress very slow; one that is too large can overshoot, causing loss to jump around or fail to settle.
Explanation
An appropriate rate helps updates move smoothly toward lower loss.
- 23
What are the main steps in a basic neural-network training loop?
Model answer
The model makes a prediction, the loss measures its error, backpropagation calculates gradients, and the optimizer updates the weights; the process repeats across examples.
Explanation
The repeated cycle of prediction, evaluation, and adjustment produces learning.
- 24
In a one-weight model where the output is the input multiplied by the weight, the input is five, the target is ten, and the weight starts at one. Why should the weight increase?
Model answer
The initial output is five, below the target of ten. Increasing the weight increases the output, moving it toward the target.
Explanation
A weight of two would produce an output of ten in this example.
- 25
Why is the tap, water-flow, and tank-level example an illustration of the chain rule?
Model answer
The tap affects the tank level through its effect on water flow. Multiplying the effects along these dependent links gives the tap's effect on the tank level.
Explanation
The chain rule connects the influence of linked calculations.
- 26
How does the chain rule apply to a neural network?
Model answer
The loss depends on the output, which depends on successive layers and ultimately on the weights. The chain rule connects these dependencies to determine how a weight affects the loss.
Explanation
Backpropagation applies the chain rule across the network's computational graph.
- 27
What does notation asking for the loss with respect to a weight mean in practical terms?
Model answer
It asks how the loss changes when that weight changes slightly.
Explanation
This is the sensitivity of the loss to the weight, expressed by a gradient.
- 28
How does backpropagation make gradient computation efficient across a network?
Model answer
It applies the chain rule backward through the computational graph and reuses shared intermediate results instead of recomputing them.
Explanation
This efficiency allows gradients to be calculated for many parameters in one backward pass.
- 29
What mathematical idea underlies backpropagation?
Model answer
Backpropagation relies on calculus, especially the chain rule, to accumulate derivatives backward through linked computations.
Explanation
The underlying mathematics predates modern neural networks.
- 30
What kinds of fields used related reverse derivative-accumulation ideas before they became widely associated with neural networks?
Model answer
Researchers in control theory and optimization were using these ideas in the 1960s and 1970s.
Explanation
Backpropagation developed from a longer history of mathematical and computational work.
- 31
What contribution did Paul Werbos make in 1974?
Model answer
In his doctoral thesis, Werbos described using backpropagation-style ideas for neural networks.
Explanation
His work received little attention for about a decade.
- 32
What did the 1986 paper by David Rumelhart, Geoffrey Hinton, and Ronald Williams contribute?
Model answer
It showed how to train multilayer neural networks using backpropagation, helping make the method practical and popular.
Explanation
The work was an important step in popularizing, rather than suddenly inventing, the underlying ideas.
- 33
Why is backpropagation better than changing each of a billion weights individually and rerunning the model to test its effect?
Model answer
Testing each weight separately would require about a billion full model evaluations for one update, which does not scale.
Explanation
Backpropagation computes gradients for all weights together using a forward calculation and a backward pass.
- 34
How does backpropagation reduce the cost of finding gradients for many parameters?
Model answer
It builds on one forward calculation and computes gradients in a backward pass, reusing intermediate results across the network.
Explanation
Its cost stays close to that of the forward pass rather than multiplying by the number of parameters.
- 35
Why did backpropagation help make deep neural networks practical?
Model answer
It made gradient computation efficient enough to train networks with many parameters and layers.
Explanation
The method avoids separately testing every parameter's effect.
- 36
Does all artificial intelligence require backpropagation? Give examples of AI approaches that do not.
Model answer
No. Rule-based systems, search algorithms, expert systems, decision trees, random forests, evolutionary algorithms, and many reinforcement-learning approaches do not require it.
Explanation
AI is broader than neural networks and gradient-based training.
- 37
Can a neural network exist and perform forward calculations without being trained by backpropagation?
Model answer
Yes. A neural network is a computational structure, and its weights could be set by hand, searched randomly, or evolved.
Explanation
Backpropagation is a method for training differentiable networks, not a requirement for the network structure itself.
- 38
What problem does backpropagation solve for a neural network that can already perform forward calculations?
Model answer
It provides an efficient way to find useful values for the network's many weights.
Explanation
The challenge is efficiently training millions or billions of parameters.
- 39
How do evolutionary strategies or genetic algorithms improve a population of networks?
Model answer
They score networks with different weights, keep stronger performers, mutate their weights to create a new generation, and repeat.
Explanation
This can optimize systems without traditional backpropagation.
- 40
How do zeroth-order optimization and numerical gradient estimation differ from standard backpropagation?
Model answer
They estimate gradient information by probing or directly perturbing parameters rather than computing it through the network's standard backward pass.
Explanation
These are alternative ways to explore how parameter changes affect performance.
- 41
What are local learning rules and Hebbian-style methods as alternatives to traditional backpropagation?
Model answer
They are learning approaches that use local rules rather than relying on traditional backpropagation through the whole network.
Explanation
They are among several alternatives to gradient-based training.
- 42
How does feedback alignment differ from standard backpropagation?
Model answer
Feedback alignment uses fixed random feedback connections.
Explanation
It is an alternative approach to sending learning signals through a network.
- 43
How does target propagation differ from backpropagation?
Model answer
Target propagation sends target activations instead of gradients.
Explanation
It offers a different way to convey learning information through a network.
- 44
When can forward-mode differentiation be useful?
Model answer
It can be useful when there are many outputs and few inputs.
Explanation
Its usefulness depends on the relationship between the number of inputs and outputs.
- 45
Why is backpropagation still dominant for huge differentiable networks despite the existence of alternatives?
Model answer
It efficiently exploits known mathematical relationships to compute gradients rather than blindly testing parameter changes.
Explanation
Modern deep learning relies heavily on gradient-based training.
- 46
Could a large language model conceptually be built without backpropagation, and how are modern large transformers generally trained?
Model answer
Conceptually, yes, but modern large transformers are overwhelmingly trained with gradient-based optimization, with gradients computed through automatic differentiation using backpropagation.
Explanation
The conceptual possibility differs from the common practical approach.
- 47
How does next-token prediction illustrate one training step for a language model?
Model answer
The model predicts possible next tokens, the loss compares those predictions with the correct token, backpropagation computes gradients, and an optimizer updates the parameters.
Explanation
The cycle repeats over many tokens during pretraining.
- 48
In the example where the correct next token is “blue,” what is the role of the loss and backward pass?
Model answer
The loss measures the error in the model's token prediction, and gradient information flows backward through the transformer so the optimizer can update its parameters.
Explanation
Repeating this process can make the model more confident in the correct token.
- 49
Why should next-token prediction be treated as a conceptual model of pretraining rather than a complete description of every training objective?
Model answer
Next-token prediction is an excellent conceptual model, but the exact numbers and training objective can vary in practice.
Explanation
The example illustrates the general training loop without claiming that every detail is universal.
- 50
What sequence of components processes information in a transformer, from input tokens to token probabilities?
Model answer
Tokens become embeddings, pass through self-attention and feed-forward layers in stacked transformer blocks, then an output projection produces logits that become token probabilities.
Explanation
The resulting probabilities can be compared with the correct token to calculate loss.
- 51
What are the roles of self-attention and a feed-forward network within a transformer block?
Model answer
Self-attention mixes information between positions, while the feed-forward network transforms each position.
Explanation
These components form the transformer blocks that can be stacked to create depth.
- 52
How does gradient information travel through a transformer during backpropagation?
Model answer
It flows from the loss backward through the output projection, transformer blocks, attention and feed-forward layers, and finally the embeddings.
Explanation
Backpropagation follows the operations that produced the prediction.
- 53
How do training and inference differ in whether the model's weights change?
Model answer
Training uses the loss, backpropagation, and an optimizer to update weights. Inference performs forward computations to produce outputs without weight updates.
Explanation
Answering a prompt is not the same process as training the model.
- 54
What does an LLM typically do during inference after receiving a prompt?
Model answer
It performs a forward computation to produce a next token, then continues producing subsequent tokens without a loss calculation or backward pass.
Explanation
The model's weights are not updated during ordinary inference.
- 55
Why does training generally require more memory and computation per token than inference?
Model answer
Training requires the forward computation plus the loss, stored intermediate activations, backward computation, stored gradients, and optimizer state.
Explanation
Inference mainly needs the forward computation and model weights, though it also has costs such as the key-value cache.
- 56
Why can Adam add to a model's training memory requirements?
Model answer
Adam keeps additional values for every parameter as optimizer state.
Explanation
Optimizer state is stored in addition to weights, activations, and gradients.
- 57
Why are GPUs well suited to neural-network training?
Model answer
Neural networks require large amounts of matrix multiplication, and GPUs can perform thousands of small numerical operations in parallel.
Explanation
Both forward propagation and backpropagation use this kind of computation.
- 58
What factors contribute to the large compute requirements of training a modern model?
Model answer
The requirements grow with the number of parameters and training tokens, and include forward and backward computation as well as optimizer state.
Explanation
Training combines these costs rather than requiring only a forward pass.
- 59
What is the vanishing gradient problem, and what effect can it have on early layers?
Model answer
It occurs when gradient signals become extremely small as they pass through a deep computation graph, causing early layers to learn very slowly.
Explanation
Their weights may barely change even when those layers matter.
- 60
What is the exploding gradient problem, and how can it affect training?
Model answer
It occurs when gradient values grow excessively, making updates unstable and causing the loss to jump wildly or become not a number.
Explanation
Exploding gradients are the opposite of gradients that become vanishingly small.
- 61
Name practical techniques used to address unstable gradients or difficult deep-network training.
Model answer
Techniques include careful initialization, normalization layers, residual connections, and gradient clipping.
Explanation
Gradient clipping caps the size of an update to help stabilize training.
- 62
Why would stacking only linear layers fail to give a network the ability to learn complex relationships?
Model answer
A linear function composed with another linear function is still linear, regardless of how many layers are stacked.
Explanation
Without nonlinear activations, adding layers does not create genuinely complex shapes.
- 63
What do nonlinear activation functions enable a neural network to represent?
Model answer
They allow the network to represent curved and complicated relationships.
Explanation
Nonlinearity prevents stacked layers from collapsing into a single linear function.
- 64
Which activation functions are described as historically common, useful for deep networks, and common in modern transformers?
Model answer
Sigmoid and tanh were historically common; ReLU made deep networks easier to train; and modern transformers commonly use smoother variants such as GELU and SwiGLU-style feed-forward blocks.
Explanation
These choices illustrate the development of activation functions used in neural networks.
- 65
Why does neural-network training benefit from nonlinear and differentiable structure?
Model answer
Nonlinearity enables complex representations, while differentiability allows gradients to guide learning.
Explanation
Both properties support gradient-based training.
- 66
What does fine-tuning do to a pretrained model, and why might it be used?
Model answer
Fine-tuning is additional training that adapts a pretrained model to examples from a particular domain, such as domain-specific documents or terminology.
Explanation
It uses a training loop involving predictions, loss, backpropagation, and optimizer updates.
- 67
How does the fine-tuning loop relate to the training of a model from scratch?
Model answer
It uses the same basic sequence: forward pass, loss calculation, backpropagation, and optimizer updates.
Explanation
Fine-tuning is additional training, although it may update only selected parameters.
- 68
What does LoRA stand for, and how does it reduce the amount of trainable state?
Model answer
LoRA stands for low rank adaptation. It freezes most pretrained parameters and trains much smaller attached adapters instead.
Explanation
This dramatically reduces the amount of trainable state while retaining the basic training loop.
- 69
Does LoRA eliminate backpropagation from fine-tuning?
Model answer
No. The adapters are still trained through a forward pass, loss calculation, backpropagation, and optimizer updates.
Explanation
LoRA reduces which parameters are trained, not the basic learning process.
- 70
What backpropagation concepts should an AI application developer understand, even without deriving the mathematics?
Model answer
They should understand forward passes, weights, loss, backpropagation, gradients, optimizers, and the difference between training and inference.
Explanation
The content does not require heavy calculus for this level of practical understanding.
- 71
What training topics should an AI or machine-learning engineer understand beyond the basic concepts?
Model answer
They should understand gradient computation, optimizer behavior, learning rates, training stability, fine-tuning, memory implications, batch size, gradient accumulation, and gradient clipping.
Explanation
These topics support practical work on model training.
- 72
Which deeper topics are associated with model or research engineering?
Model answer
They include derivatives, the chain rule, Jacobians, automatic differentiation, optimization theory, numerical stability, and distributed training.
Explanation
The required mathematical depth depends on a person's responsibilities.
- 73
How does fine-tuning differ from retrieval in what it changes?
Model answer
Fine-tuning changes model parameters, whereas retrieval changes the context supplied to the model without retraining the base weights.
Explanation
This distinction helps determine whether knowledge should be incorporated into weights or provided as input context.
- 74
Why is full fine-tuning of a model with billions of parameters expensive, and how can parameter-efficient fine-tuning help?
Model answer
Updating billions of parameters requires substantial training resources. Parameter-efficient methods such as LoRA train a much smaller set of adapter parameters instead.
Explanation
Most of the pretrained model's parameters can remain frozen.
- 75
How can understanding backpropagation help engineers distinguish training infrastructure from inference infrastructure?
Model answer
It clarifies that training requires backward computation, gradients, activations, and optimizer state, while inference primarily performs forward computation.
Explanation
These different workloads have different compute and memory needs.
- 76
How can understanding gradients help explain slow learning or divergence during training?
Model answer
The learning rate controls update size: a rate that is too small can make learning slow, while one that is too large can cause overshooting and unstable loss.
Explanation
Gradient clipping can also stabilize updates when gradients are large.
- 77
Why might a training process accumulate gradients across microbatches or use gradient clipping?
Model answer
Gradient accumulation combines gradients across microbatches, while gradient clipping stabilizes training by capping large updates.
Explanation
Both are practical considerations in managing training behavior and resources.
- 78
How can understanding training and backpropagation inform a decision among a hosted API, retrieval, prompt engineering, fine-tuning, and training a model?
Model answer
It helps compare whether a task calls for supplying context, changing model weights, using an existing service, or training a model, while accounting for the costs and infrastructure involved.
Explanation
Choosing an approach depends on the problem and the resources required to solve it.
- 79
Does backpropagation mean an AI is thinking backward when it answers a question?
Model answer
No. Answering a question uses a forward computation during inference; backpropagation is a training mechanism for computing gradients.
Explanation
Ordinary inference has no backward pass through the weights.
- 80
How does backpropagation differ from reasoning, reflection, self-correction, or an agent retrying a task?
Model answer
Backpropagation computes gradients for training, whereas reasoning, reflection, self-correction, and retries are not themselves backpropagation.
Explanation
An agent can go back and retry without updating weights through a backward pass.
- 81
What sequence describes the learning of a cat classifier that initially predicts dog but improves after many training examples?
Model answer
The classifier makes a forward prediction, the loss measures its error, backpropagation computes gradients, and the optimizer updates weights; repeating this can improve its predictions.
Explanation
The example illustrates the same basic training loop used across neural networks.
- 82
What is structurally similar about training a cat classifier and pretraining a language model?
Model answer
Both use a forward prediction, a loss, backpropagated gradients, optimizer updates, and repetition; they differ in task and scale.
Explanation
A classifier predicts a label, while a language model can predict a next token.
- 83
Match “guess,” “score,” “trace,” “adjust,” and “repeat” to their roles in training.
Model answer
Guess is forward propagation, score is the loss, trace is backpropagation, adjust is the optimizer updating weights, and repeat is training.
Explanation
The sequence summarizes how predictions become improved parameters through repeated updates.
- 84
How do prediction, loss, backpropagation, and the optimizer connect to produce learning?
Model answer
The model predicts, loss measures the mistake, backpropagation calculates how parameter changes affect that mistake, and the optimizer updates the parameters; repetition creates learning.
Explanation
The steps connect the model's error to changes in its weights.

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