Trace residual paths, calculate LayerNorm, and compare pre-norm with post-norm.
Preparation: Averages and variance; chain rule for college.
Plan 20–35 minutes with the activities; this is a study estimate, not a timed requirement. Both paths have complete narration. Your notes and progress are kept separately for each level.
FULL LOCAL NARRATION
Follow the complete explanation.
Narration includes worked solutions. Pause at each practice prompt before continuing. Formula notation has a spoken explanation; all teaching text remains readable.
High-school path. Trace residual paths, calculate LayerNorm, and compare pre-norm with post-norm.
Preparation: Averages and variance; chain rule for college. Work through one section at a time. Predict the experiment result before changing its controls, then explain what the example leaves out.
A residual block keeps its input and adds a learned correction. Think of revising a sketch rather than erasing it before every new line. The correction can be positive or negative; it does not always make numbers larger. Keeping a direct route can make information and learning signals easier to pass through many stages. The dimensions must match at the addition point, even if the branch uses a wider hidden representation internally.
Worked step 1. Let x=[1,3] and the branch correction be [0.2,−0.4].
Worked step 2. Add componentwise to get [1.2,2.6].
Worked step 3. The branch changed the representation without replacing its direct input route.
y=x+F(x); J_y=I+J_F
The output is the input plus its branch. Its derivative contains an identity path plus the branch derivative.
Try it yourself. If the branch outputs zero, what does a bare residual addition return?
Pause the recording and write your reasoning before continuing. The worked solution follows.
Reveal worked solution
Worked solution. It returns x exactly. A later normalization can still transform that result.
Section 02 / 07
Normalize features within one position
For the two features one and three, the average is two. Subtract it to obtain minus one and plus one. Their average squared deviation is one, so dividing by its square root leaves minus one and plus one. Layer normalization does this kind of calculation across features at each position. It then uses learned scale and shift values. Those final values need not have average zero or spread one.
Worked step 1. For [1,3], mean=2 and population variance=1.
Worked step 2. Ignoring epsilon only for hand arithmetic, normalized features are [−1,1].
Worked step 3. With gain two and bias one, the output becomes [−1,3].
LN(x)=γ⊙(x−μ)/√(v+ε)+β
Subtract the feature mean, divide by the square root of variance plus epsilon, then apply learned gain and bias.
Try it yourself. Must the final LayerNorm output always have mean zero?
Pause the recording and write your reasoning before continuing. The worked solution follows.
Reveal worked solution
Worked solution. No. Learned gain and bias change the normalized features; the zero-mean statement applies before the affine transformation.
Section 03 / 07
Placement changes the route
Pre-norm applies normalization before the learned branch, then adds the result to the unnormalized residual input. Post-norm adds the branch first and normalizes the sum. The names describe order. They are not interchangeable recipes. Draw both paths with arrows and mark the addition point. Even a zero branch behaves differently: pre-norm leaves the input unchanged at that sublayer, while post-norm still normalizes it.
Worked step 1. Set the branch to zero.
Worked step 2. Pre-norm sublayer returns x.
Worked step 3. Post-norm sublayer returns LN(x), which generally differs from x.
pre: y=x+F(LN(x)); post: y=LN(x+F(x))
Pre-norm normalizes before the branch. Post-norm normalizes after adding the branch.
Try it yourself. Which layout preserves an exact identity route at this sublayer when the branch is zero?
Pause the recording and write your reasoning before continuing. The worked solution follows.
Reveal worked solution
Worked solution. Pre-norm. This statement concerns the sublayer; a complete network may include additional normalization later.
Section 04 / 07
Differentiate the shared mean and variance
Changing one feature changes more than its own normalized value. It also changes the average and spread used by the other features. That is why normalization cannot be differentiated by treating its denominator as a fixed number. Try adding the same amount to every input feature: after subtracting the new average, that shift disappears. A correct sensitivity calculation should respect this cancellation.
Worked step 1. Take input [1,2,4] and add five to every feature.
Worked step 2. Both inputs have identical centered deviations.
Worked step 3. With identical gain, bias and epsilon, their LayerNorm outputs match.
G_x=[u−mean(u)−x̂ mean(u⊙x̂)]/√(v+ε)
Subtract the upstream mean and the normalized-input weighted mean term, then divide by the normalization scale.
Try it yourself. Why is dividing each upstream gradient by standard deviation incomplete?
Pause the recording and write your reasoning before continuing. The worked solution follows.
Reveal worked solution
Worked solution. It ignores the input dependence of the mean and variance. All features participate in those statistics.
Section 05 / 07
Expand features, gate them, return to width
A feed-forward branch can temporarily use more features to build a richer correction. It applies the same learned transformation separately at each position. A gated version makes two descriptions: one carries candidate information, and the other controls it coordinate by coordinate. Multiplying those descriptions is not the same as applying one activation to one projection. The branch then returns to the width required by residual addition.
Worked step 1. Start with a 24-feature position.
Worked step 2. Two projections each produce 64 hidden features.
Worked step 3. Multiply their matching coordinates, then project 64 features back to 24.
FFN(x)=[SiLU(xW_gate)⊙xW_up]W_down
A nonlinear gate multiplies a separate up-projection, then a down-projection restores model width.
Try it yourself. Why can a 64-feature branch not be directly added to a 24-feature residual?
Pause the recording and write your reasoning before continuing. The worked solution follows.
Reveal worked solution
Worked solution. The feature shapes differ. The branch needs a projection back to the residual width.
Section 06 / 07
Compare complete block paths
Use Workbench to change the residual gain and normalization placement. Before running, predict which output will change if you add a common offset to the input. Follow the displayed intermediate values, not just the final bars. A block combines routing, normalization and feature transformation; one knob cannot represent an entire trained transformer. Finish with a diagram labeling what is preserved, what is normalized and what is learned.
Worked step 1. At gain zero, pre-norm gives the original input.
Worked step 2. At gain zero, post-norm gives normalized input.
Worked step 3. Changing gain exposes how normalization placement changes the computation.
Try it yourself. Does a cleaner-looking bar chart establish that one layout trains better?
Pause the recording and write your reasoning before continuing. The worked solution follows.
Reveal worked solution
Worked solution. No. The fixture explains algebra. Training quality requires controlled experiments with a complete model, data and optimization settings.
Section 07 / 07
Mastery and transfer
Bring the pieces together. First answer the checkpoint without the worked solutions. Then explain the mechanism in your own words, using one numerical example from this lesson.
With a zero branch, a bare residual addition returns… Option 1: Zero. Option 2: The input. Option 3: A probability distribution.
Pause here and choose an answer before continuing. The checkpoint explanation follows.
Reveal worked solution
The correct choice is option 2: The input. Adding zero preserves the input.
Transfer task. Change one assumption in the worked example. State your prediction, calculate or test it in Workbench, then explain whether the result supports your prediction.
Reveal worked solution
Self-check rubric. Name the changed assumption, keep the other inputs fixed, show at least one intermediate calculation, and distinguish what the toy example guarantees from what would require a trained model or a real measurement.
WORKBENCH / PREDICT → TEST → EXPLAIN
Inspect exact numerical data
These are computed teaching fixtures. No remote AI model or GPU is called by the experiment.
CHECK YOUR UNDERSTANDING
Commit to an explanation.
Keep your learning record.
Sources and scope
Original worked examples and teaching text, grounded in these primary references. Numerical fixtures explain mechanisms; model quality and hardware performance require separate measurements. Both levels share key examples, with different explanations and checkpoints.
What a model learns: from numbers to a useful answer
Follow a sentence through learned weights, temporary activations, and the next-token decision.
Additional reading · original lesson audio remains unchanged.
Read the full explanation · 586 words
What changes when you ask a question?
23input x
×
0.6−0.2learned weights
+
0.1bias
=
0.7output y
The weights stay fixed during ordinary inference. Activations change with your input.
Text → tokens
Tokens → vectors
Learned transformations
Next-token scores
Text → tokens
A model is a computation with learned settings
A language model does not contain a little librarian choosing a finished answer from a shelf. It contains a structured computation whose numerical settings were learned during training. Those settings are called parameters. Many are weights arranged in matrices; other parameters can include offsets or normalization scales. The architecture determines which operations happen and how information travels. The weights determine the particular transformations performed by those operations. Two models can share an architecture and behave differently because they learned different parameter values.
Consider a tiny operation: y = 0.6x₁ − 0.2x₂ + 0.1. With inputs x₁ = 2 and x₂ = 3, the output is 0.7. Changing the first weight from 0.6 to 0.5 changes the output to 0.5. This is a teaching example, not a miniature intelligent system. Its purpose is to make one idea visible: numerical settings influence the result. In a language model, many such transformations act together across large vectors, nonlinear functions, and layers.
Follow the sentence
First, a tokenizer turns text into a sequence of token identifiers. A token may represent a word, part of a word, punctuation, or another unit. An embedding table supplies a learned vector for each identifier. These vectors are starting representations, not complete dictionary definitions. As they pass through the network, surrounding tokens influence how the current sequence is represented.
In attention, learned projections produce queries, keys, and values. The model compares queries with keys to calculate input-dependent attention scores, then combines value representations. This distinction matters: the projection weights normally remain fixed during a conversation, while the attention scores change with the input. Feed-forward transformations further process the representations, and residual connections carry information around sublayers. Finally, an output transformation supplies scores for possible next tokens. A selection procedure chooses a continuation, which becomes part of the next input step.
Training changes the settings; a conversation changes the state
During training, a loss measures how the predictions compare with the training objective. Gradients estimate how parameter changes would affect that loss. An optimizer uses those gradients to update trainable parameters. A single example does not usually teach an isolated fact to one identifiable weight. Useful patterns emerge through many updates, and knowledge and behavior are distributed across the computation.
During ordinary inference, the parameters stay fixed. Your prompt changes the activations: the temporary numbers produced while the model runs. A cache can retain intermediate information so the system need not repeat earlier work. That cache is not a new permanent education for the model. A product may separately save conversation history or conduct later training, but those are additional mechanisms. Saying that a chatbot remembers your previous sentence does not establish that its weights changed.
Why more parameters is not a complete explanation
A parameter count describes scale, not a guarantee of reliability. Data quality, architecture, training, numerical precision, and the way a model is evaluated all matter. A large model can produce a convincing error; a smaller specialized model can perform a narrow task well. To compare systems, ask what task was tested and under what conditions, rather than treating one number as a universal intelligence score.
Return to the animation and identify three different objects: a stored weight, an activation that changes with the sentence, and an output score. If the diagram uses moving dots, those dots represent information flow; they are not literal particles inside a model. Using the small equation above on paper, change an input while keeping a weight fixed, then change the weight while keeping the input fixed. Explain why these are different experiments. That distinction will help you understand fine-tuning, quantization, caches, and model releases throughout the course.
Sources and further investigation
Source review: October 28, 2026. Model-release claims are attributed to their publishers.