A single attention head gives each query one distribution over readable positions. Its value vector may contain many coordinates, but every coordinate in that vector is combined using the same attention weights.
Multi-head attention creates several attention computations instead. Each head has its own query, key, and value projections, so it can form a different score matrix, a different normalized weight matrix, and a different value reading. The head results are then concatenated and projected back to the model width.
For head ,
The complete operation is
We will keep the batch-major convention from Chapter 1. The main new axis is the head axis:
The chapter begins with the reason for using separate heads rather than one wider value vector. It then defines model width, head count, and per-head widths; calculates two heads independently; and shows how combined projection matrices implement the same operation efficiently. The final lessons cover concatenation, parameter counts, head ablations, empirical evidence about specialization and redundancy, and a complete two-head audit.