The Half of the Transformer That Does Not Move Information
Last timeNormalizing Over Features
Attention moves information between positions but computes almost nothing nonlinear. The feed-forward block does the opposite, and holds most of the parameters.
Seven lessons have been spent on attention, which is reasonable given the name
of the architecture. But attention is roughly a third of the parameters of a
transformer, and the block sitting next to it does something attention
structurally cannot.
What attention does not do
Consider what happens once the attention weights are fixed. The output is
which is a weighted sum of value vectors. Linear. The nonlinearity in attention
lives entirely in how was computed, not in what is done with the values
once it has been.
So attention routes. It decides which vectors to mix and in what proportion.
Given that decision, no vector is transformed in any way a matrix could not do.
A stack of attention layers with nothing between them would therefore be close
to a linear map with input-dependent coefficients, which is a real but narrow
class of functions. Something has to supply the per-token computation.
The lesson stops here
8 more paragraphs to go
You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.
The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.
See the planThe contentsThis is the reading half
Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.
The contents