Replace a stack of linear layers with their matrix product, and every prediction stays the same. Take one gradient step, though, and the two models can disagree.
The difference comes from what we train: one matrix, or the factors that multiply into it. Working through two layers is enough to see how that choice changes the update—and why the learning rate alone cannot describe it.
Combining two layers into one matrix
In the previous article, each column of a weight matrix gave the destination of one input basis vector. Now send those destinations through another layer:
Here , the hidden vector , and the output . The matrices have shapes and . We use no biases or activations.
The first layer sends the basis vector to . The second sends it to . These final destinations are the columns of a single effective matrix,
The hidden width still matters. Every output is a combination of the columns of , so the output can span at most independent directions:
A network that goes from coordinates to and back to still produces outputs in a subspace of dimension at most . Widening the last layer cannot recover directions that the first layer removed.
So two layers always reduce to one matrix, but a narrow hidden layer restricts which matrices they can represent. Even when width is sufficient to represent any matrix, training the two factors introduces another difference.
Different weights, identical predictions
Double and halve :
The hidden vector doubles. The output does not change, for any input.
Scaling is one instance of a larger freedom. For any invertible matrix ,
The first layer changes the hidden coordinates; the second compensates. We can therefore know the network’s entire input-output function without knowing its individual weight matrices.
The product determines the predictions. The factors also determine how those predictions respond to training. To see the second part, we need their gradients.
How each layer gets its gradient
Start with one example, a target , and the squared loss
Write the output error as . A small output change changes the loss to first order by .
For the second layer, changing gives . In coordinates,
Each weight’s gradient is the error at its output multiplied by the input that passed through it.
For the first layer, a hidden change reaches the output as . Its effect on the loss is
That is where the transpose comes from. gives the loss sensitivity at each hidden coordinate. Since ,
If we trained the effective matrix directly, its gradient would be . For a loss averaged over examples, let . Summing the same calculations gives
These identities also hold for other differentiable losses that depend on the factors through . A separate penalty on or would contribute its own gradient.
The first layer’s update depends on the second layer’s weights. The second layer’s update depends on the hidden inputs produced by the first. Backpropagation keeps track of both dependencies.
What one training step does to the product
Update both factors with learning rate , using gradients evaluated before either update:
Their new product is
This is an exact expression for the simultaneous step. Directly training would instead give .
For small , the leading change in the factored model is
The term comes from changing the first layer and passing that change through the second. The term comes from changing the second layer, whose inputs were formed by the first.
These matrix multiplications can scale different directions differently, changing the direction of the overall update as well as its size. Factoring changes the step taken in -space. As the factors learn, that effect changes with them.
We can see the difference without any matrices at all. Take a scalar input , target , and prediction . The loss is . Start at and use :
| Trainable parameters | Initial values | Values after one step | New prediction |
|---|---|---|---|
All three models start with the same prediction and loss. The last two even have the same architecture. Their different factor scales are enough to produce different predictions after one step.
In the scalar case, writing , equation (12) becomes
The leading step depends on , which the product does not determine. In the two factorizations above, that quantity is and .
Why rescaling changes training
Return to the matrix network and rescale the factors by a positive number :
The effective matrix and its gradient stay the same. But the leading product update becomes
One layer’s contribution shrinks while the other grows. In general, a single adjustment to cannot restore the original update: the two contributions need not point in the same matrix direction.
This is the connection to effective learning rate. Equal predictions do not imply equal training steps. Here the symmetry rescales two adjacent layers together, and the product update exposes a directional effect that a single scalar step size need not capture.
How a weight change travels through a deeper network
For linear layers, the effective matrix is
Focus on layer . Call the product after it and the product before it . At the endpoints, an empty product is the identity.
If only this layer changes, the effective matrix changes exactly by
The same calculation used for two layers gives
Updating every layer simultaneously and keeping the first-order terms therefore gives
Each layer contributes a change shaped by all the layers around it. Depth adds more such contributions and longer products on either side.
A diagonal example makes their effect visible. Suppose every layer currently has the matrix
Then . Change the bottom-right weight of any one layer by . The bottom-right entry of the product changes by
For this diagonal setup, the corresponding gradient entry is . The surrounding layers attenuate both the effect of that weight and the gradient reaching it. Replacing with a number above reverses the effect and amplifies that direction. For general matrices, the directions can also rotate between layers, so individual entries no longer tell the whole story.
The network remains linear in its input throughout. Its weights enter through a product, and training moves those factors separately. Combining them preserves today’s predictions; it does not preserve the next training step.