Linear Maps, Matrices, Invertibility
What is a neural net layer actually doing to your data?
Vishnu Boddeti
Example 1
The projection itself is linear. Layer normalization, attention softmax, and the MLP activation are separate nonlinear operations.
Example 2
This operation is literally an invertible linear map. A singular W would collapse channel information and break exact reversal and likelihood accounting.
Example 3
The identity branch is linear even though F is generally nonlinear. Separating those two paths avoids incorrectly calling the whole block a linear map.
Example 4
Kernel collisions identify distinctions the router cannot see. Agent evaluations should include collision pairs and low-margin cases, not only average routing accuracy.
Each scenario hides a mathematical structure from this lecture. Identify the structure, justify it, and work through the resulting problem.
A robot squeezes three sensor readings into a two-number embedding. Its designer insists that nothing is lost and that the original readings can always be recovered. Is that possible for this encoder?
$T(x)=Ax$ with $A=\begin{bmatrix}1&0&1\\0&1&1\end{bmatrix}$.
A calibration layer has transformed three logits, and a debugging session captured only the transformed values. To reconstruct what the model originally produced, you must run the layer backward.
$y=Ax$ where $A=\begin{bmatrix}1&1&0\\0&1&1\\1&0&1\end{bmatrix}$ and the observed output is $y=(3,2,4)^\top$.
To save inference time, a compiler tries to fold preprocessing into the model's first matrix multiplication. Scaling seems harmless, but centering and clipping are more suspicious. Which operations can truly disappear into a bias-free linear layer?
Compare $P_1(x)=2x$, $P_2(x)=x-\mu$ for fixed nonzero $\mu$, and coordinate clipping $P_3(x)_i=\max(-1,\min(1,x_i))$.