4/42
Part 1 of 6 · Why headsLearn
Several heads, each with its own softmax
Each head is a whole attention function of its own.
x, one token = C numbers.
So run several attention functions side by side. Each head projects the full input into its own queries, keys and values, each wide. Then it runs its own softmax.
Their outputs sit in separate channels until a final projection mixes them.
The paper writes it like this:
In words:
- is the input, one row of numbers per token.
- , and are head 's own query, key and value projections, each .
- puts the head outputs side by side, and is the output projection, .