How Neural Networks Learn
- 96Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
How does tuning a Plinko board illustrate the process of training a model?
A Plinko board can be tuned by trying inputs, checking where they land, and adjusting the pegs so each input reaches its intended exit.
Or swipe the card
96 cards
How does tuning a Plinko board illustrate the process of training a model?
A Plinko board can be tuned by trying inputs, checking where they land, and adjusting the pegs so each input reaches its intended exit.
How is a trained neural network like a tuned Plinko board?
A trained neural network takes an input and produces an intended output. Its adjustable settings are numerical parameters rather than physical pegs.
What does learning mean in the Plinko analogy?
Learning is the repeated process of trying inputs, checking the outputs against the desired answers, and adjusting the network’s settings.
What does a neuron’s weight do in the sound-activated light example?
A neuron multiplies the input by a weight. The weight controls how strongly the input affects the neuron’s score.
How is sound level represented in the light-switch neuron example?
For the example, sound level is represented by a number from 0 (silence) to 1 (very loud).
How does the example neuron turn its score into an on/off light output?
The example rounds scores below 0.5 to 0 (off) and scores of 0.5 or above to 1 (on). This output step is a choice for that task, not a universal neural-network rule.
What sound-level rule is the light-switch neuron meant to learn?
The desired rule is: turn the light on for sound levels of 0.3 or higher, and off below 0.3.
Why does weight 1 fail for a sound level of 0.4 in the light example?
With weight 1, a sound level of 0.4 produces a score of 0.4, which rounds down to off—even though the desired output is on.
How do errors and correct answers affect weight adjustments during training?
A training example that the neuron gets wrong can prompt a weight adjustment; a correct answer gets no adjustment. For example, the weight is nudged up when 0.4 incorrectly produces off, but nudged down when 0.28 incorrectly produces on.
What weight did the sound example settle on, and what did fresh test sounds show?
The example’s weight settles near 1.67. Fresh test levels—0.15, 0.3, 0.29, and 0.8—then receive the desired outputs, illustrating generalization beyond practice examples.
Why demonstrate iterative training on a simple neuron if its answer could be found directly?
The example uses one weight, but real networks may have millions or billions. A general try-check-adjust process can be applied to all of them, even when no simple formula solves the network at once.
How does a neuron combine several inputs?
For multiple inputs, each input has its own weight; the neuron multiplies each input by its weight and adds the results into one score.
What is a neuron’s activation?
A neuron’s response—the number it outputs—is called its activation.
Why can a neuron without a bias only produce zero when every input is zero?
Without a bias, all-zero inputs force the weighted sum to zero, so the neuron cannot produce a nonzero response to an all-zero input.
What is a bias, and what does it allow a neuron to do?
The bias is a learned starting value added to a neuron’s weighted sum. It can let the neuron respond even when all inputs are zero.
Which neuron settings are adjusted during training?
Training adjusts both the weights and the biases.
How can a bias implement the light’s 0.3 sound threshold without scaling the input?
A bias can shift the decision point. In the sound example, weight 1 with bias −0.3 gives score sound level minus 0.3, so the score is nonnegative at sound levels of 0.3 or above.
What is a neural-network layer?
A layer is a group of neurons operating side by side on the same inputs; each neuron has its own weights and makes its own response.
How does a second layer differ from a group of neurons in the first layer?
A later layer reads the preceding layer’s outputs rather than the original inputs. This lets decisions build on earlier decisions.
Why can stacking linear layers alone not represent complex patterns?
A neuron that only multiplies by weights and adds a bias applies a linear equation. Linear equations can draw lines, and stacking linear equations still produces only a line.
Why do multilayer networks need nonlinear activations?
A nonlinear activation bends the mapping from input to output. Nonlinear layers can build shapes and patterns that linear transformations alone cannot represent.
What does the ReLU activation do?
ReLU outputs the larger of zero and the neuron’s total: ReLU(z)=max(0,z). It sets nonpositive totals to zero and passes positive totals through unchanged.
What shape does ReLU produce when plotted?
ReLU’s graph is flat at zero for nonpositive inputs and rises linearly for positive inputs.
How do nonlinear neurons help a network represent complex patterns?
Combining nonlinear units can create increasingly complex shapes—such as bends, peaks, and waves—and stacking layers can build still more complex patterns.
How can a network respond differently to different inputs?
Different inputs can activate different mixtures of neurons, allowing the network to apply different learned combinations of responses.
How can depth help a network recognize complex patterns such as faces?
Deep layers can reuse features in stages: for example, pixels can form edges, edges a circle, a circle an eye, and eyes a face. Reusing features avoids needing a separate rule for every complete pattern.
How is each handwritten digit image represented as input to the network?
The image contains 28×28=784 pixels. Each pixel is represented by a brightness number between 0 and 1, giving the network 784 input values.
Why is the digit network’s input layer size fixed by the image?
The image determines the input size: one brightness value for each of its 784 pixels.
What does the example digit network’s hidden layer contain?
The example network uses 32 hidden neurons, a design choice rather than a uniquely correct number. Each neuron reads all 784 pixels and has its own 784 weights and a bias.
What does each hidden neuron pass to the next layer in the digit network?
Each hidden neuron applies the weigh-add-bias-activation recipe and outputs a numerical response indicating how strongly it responded, not just an on/off answer.
Why does the digit network have ten output neurons, and what does each read?
There are 10 output neurons, one for each digit from zero through nine. Each reads the 32 hidden-layer responses using its own weights.
What does softmax do at the output of the digit-recognition network?
Softmax converts the ten output scores into probabilities that sum to 1. The digit with the highest probability is the network’s predicted answer.
What was the goal and basic training setup for the first digit network?
Training adjusts weights and biases to raise the correct digit’s probability and lower the others. The example training run used 60,000 images over five passes; after training, the correct seven had a probability of 98.6% in the shown example.
How did the one-hidden-layer digit network perform on the test set?
On 10,000 unseen test images, the one-hidden-layer network achieved 95.58% accuracy, correctly identifying 9,558 images.
How did the two-hidden-layer digit network compare in test accuracy?
The second network had hidden layers of 64 and 32 neurons and reached 96.35% accuracy—77 more correct test predictions than the first network.
What complicates interpreting the larger digit network’s better result?
The larger network had about twice as many parameters, where parameters are all adjustable weights and biases. Because it was both wider and deeper, the experiment cannot attribute its improvement to depth alone.
Does the digit experiment prove that larger networks always give better answers?
A better result in one experiment does not establish that a bigger network will always perform better; architecture choices must be measured.
What is loss, and how should it relate to the probability assigned to the correct answer?
Loss is a number measuring how wrong a network’s output is for an example. A perfect prediction should have loss zero, and a less likely correct answer should have greater loss.
What cross-entropy loss is used in the digit example, and how does it behave?
Cross-entropy for a correct-class probability p is the negative logarithm of that probability, −log(p). It increases sharply as p approaches zero.
What loss corresponds to the example’s 9% probability for the correct digit?
For the example’s correct-digit probability of about 9%, the cross-entropy loss is about 2.37. A smaller cross-entropy means the output is closer to the expected answer.
Is cross-entropy the only possible loss function?
Different tasks can use different loss functions; cross-entropy is a common choice for the demonstrated classification task.
What changes followed the example’s 0.05 increase to one weight?
Changing one weight by 0.05 changed a neuron’s value by 0.04, the seven’s score by 0.016, and the loss downward by 0.0065.
What information does a parameter’s slope provide?
A slope describes both which direction to change a parameter to help and how strongly the loss responds to that change.
What does a derivative tell us?
A derivative measures how much one quantity changes per unit change in another; it is the slope of the first quantity with respect to the second.
For a neuron output y=wx+b, what is the derivative of the output with respect to its weight?
For y=wx+b, the derivative of y with respect to w is the input x.
For a neuron output y=wx+b, what is the derivative of the output with respect to its bias?
For y=wx+b, the derivative of y with respect to the bias b is 1.
For a neuron output y=wx+b, what is the derivative of the output with respect to its input?
For y=wx+b, the derivative of y with respect to the input x is the weight w.
How does the numerical example demonstrate that the weight derivative equals the input?
With input 5, weight 2, and bias 1, the output is 11. Increasing the weight to 3 changes the output to 16, a change of 5—the input value.
What did the untrained miniature digit network predict, and why?
The small demonstration network compresses an image to three inputs, uses two neurons, and produces ten probabilities. Before training its parameters are starting values—often randomly selected—so its answer can be arbitrary; in the example it predicted three and assigned the correct seven about 9% probability.
What simpler loss function is used in the two-neuron backpropagation demonstration?
The example’s loss is half the squared difference between the expected answer and the actual answer.
Why is checking parameters one at a time impractical for a large network?
Changing parameters one at a time would require about 25,450×2,345, or nearly 60 million, network reruns for the stated digit-network training setup.
What problem does backpropagation solve?
Backpropagation calculates the influence of every weight and bias on the loss in one backward pass, rather than requiring a separate full rerun for each parameter.
What is the central calculation repeated during backpropagation?
Use the chain rule: multiply the slope already known for a downstream quantity by the local derivative linking it to the parameter or earlier quantity.
Where does backpropagation begin in a network?
Backpropagation starts with the derivative of the loss with respect to the network’s final output, because that output directly enters the loss.
What initial and weight slopes are obtained in the two-equation backpropagation example?
In the two-equation demonstration, the loss derivative with respect to final output x3 is +2. Combining it with the local derivative gives a loss derivative of 14 with respect to w2.
What intermediate and first-weight slopes are obtained in the two-equation example?
The loss derivative with respect to the intermediate output x2 is 4. Combining that carried slope with the first equation’s local weight derivative gives a loss derivative of 8 with respect to w1.
What information is kept and what information is passed backward at each network layer?
At each equation, backpropagation keeps the slopes for that equation’s weights and bias, then passes the slope for its input backward to the preceding equation.
How does backpropagation handle a neuron that feeds several neurons in the next layer?
When one neuron feeds multiple later neurons, it receives a contribution from each downstream path; those slope contributions are added together.
What is the gradient of a neural network?
The gradient is the collected list of loss slopes for all weights and biases; each slope measures the loss’s sensitivity to one parameter.
What does backpropagation do—and what does it not do?
Backpropagation measures how the loss responds to parameter changes. It does not change parameters and does not tell neurons what outputs they should produce.
What happens after backpropagation has calculated the gradient?
The update step uses the gradient to adjust all weights and biases together in directions intended to reduce the loss.
What is gradient descent?
Gradient descent updates parameters using their loss slopes: stronger slopes produce larger changes, while tiny slopes produce smaller changes.
Why should gradient-descent steps avoid being too large?
A parameter’s slope is measured while other parameters are held fixed. It is most dependable when the other parameters then move only a little.
What are two possible drawbacks of steps that are too small?
Very small steps make learning slow and may leave the network stuck in a shallow dip even when a better solution lies beyond a bump.
What does the learning rate control?
The learning rate is a shared setting that controls the size of parameter updates. The step size is proportional to the slope’s size, scaled by the learning rate.
What does a learning rate of 0.2 mean for an update?
With learning rate 0.2, a parameter moves by one fifth of its slope’s size in the loss-reducing direction.
How is a suitable learning rate found?
There is no universal formula in the example for choosing the learning rate; it is found by trying a value, checking its effect, and adjusting it.
What happened after one gradient-descent step in the small-network example?
In the example, one update with learning rate 0.2 reduced loss from 2.37 to 2.08, although the predicted digit was still three.
What is a batch, and how does it produce a parameter update?
A batch is a group of training examples whose gradients are calculated separately, averaged, and used for one shared parameter update.
What is an epoch?
An epoch is one complete pass through the training data. Training proceeds through batches until every training example has been included once in that pass.
How does batch training handle examples that disagree about how a weight should change?
Averaging gradients lets examples with conflicting suggestions contribute to a shared update instead of following only one example’s direction.
How did three learning rates affect loss in the example, and what does the comparison show?
In the two-example illustration, learning rate 0.05 reduced loss only from 2.00 to 1.97; rate 2 reduced it to 0.92; rate 20 made it explode to 8.99.
What is overfitting?
Overfitting occurs when a network improves on its training examples but becomes worse on unseen examples because it is memorizing rather than learning reusable patterns.
How do training, validation, and test data differ?
Training data is used to adjust the network; validation data is held out from training and used to evaluate progress and select a model; test data is reserved for a final evaluation.
When should the test set be used?
The test set should be evaluated only at the end, so it remains an independent check on performance.
What pattern in training and validation loss signals overfitting?
With only about 1,000 training images, the wide network’s training loss kept falling while its validation loss turned upward, indicating increasing memorization.
What did validation identify in the small-data experiment, and how did that checkpoint perform on the test set?
The validation set identified epoch ten as the best checkpoint. That version achieved 88.83% accuracy when evaluated on the test set once.
What is early stopping?
Early stopping selects the saved checkpoint that performed best on validation data, rather than using a later model that may have overfit.
Why is more training data a strong way to reduce overfitting?
More and more varied examples reduce opportunities for memorization. The related network trained on all 60,000 images reached 95.58% accuracy, compared with the starved experiment’s much smaller training set.
Name several techniques that can help reduce memorization.
Possible tools include choosing a suitable network size, penalizing extreme weights, randomly silencing neurons during training, and augmenting images by stretching, shifting, or tilting them.
Why must model choices be evaluated on unseen data?
A narrow network may memorize less but also learn less. Bigger is not always better, so architecture and training choices must be judged using data the network has not seen.
How are a layer’s weights organized as a matrix?
A matrix is a grid of numbers. In the layer representation described, rows correspond to inputs and columns to neurons, with each connection represented by a weight.
How does matrix multiplication perform a layer’s weighted sums?
For one neuron, multiply each input by its corresponding weight and add the results. Doing this for every neuron at once is a matrix multiplication.
Which parts of the neuron calculation happen after the layer’s matrix multiplication?
The matrix multiplication handles the weighted sums; each neuron’s bias and activation are applied afterward.
How can matrix multiplication process a batch of examples efficiently?
A batch can be organized as rows of examples. One matrix multiplication then calculates the weighted sums for every example and neuron in the batch.
What parts of neural-network computation can be parallelized, and what remains sequential?
Each cell of the result is an independent multiply-and-add calculation, so many cells can be computed in parallel. However, layers must proceed in order because each layer needs the previous layer’s outputs.
Why are GPUs often useful for neural networks?
A CPU is designed for a broad range of tasks, while a GPU is designed to perform many similar calculations at once. GPUs are often effective for large matrix operations.
Why does hardware matter for training modern language models?
Modern language models can contain billions of weights. Their training uses the same try-check-adjust loop at enormous scale, often taking days or weeks on thousands of processors.
What is tokenization in a language model?
A tokenizer splits text into tokens—chunks that may be whole words, word pieces, or punctuation. The exact split depends on the tokenizer.
How does a language model represent tokens numerically?
Each token has a learned list of numbers. These representations are tuned during training alongside weights and biases.
What next-token prediction task does a language model learn?
Given the preceding words—the context—the model estimates what token should come next. Earlier words can all influence that prediction.
How does a language model choose its next token?
The model scores possible tokens, and softmax converts the scores into probabilities. It can choose the highest-probability token or sample a less likely one.
How does a language model generate a sequence of text?
After selecting a token, the model appends it to the text and predicts again using the expanded context.
How is a language model trained to predict the next token?
During next-token training, the real next token is treated as the correct answer. Loss evaluates the probability assigned to it, backpropagation finds slopes, and an optimizer adjusts weights, biases, and token representations.
What other language tasks can networks learn, and what does attention help a language model do?
Networks can also be trained for tasks such as translation, summarization, and answering. Modern language models use additional mechanisms, especially attention, to decide which earlier words matter most.
What common learning framework underlies many different AI applications?
Across applications such as digit recognition, object detection, speech, and language, the shared backbone is a neural network trained by repeated prediction, checking, and adjustment.

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