Multi-head attention runs N parallel attention computations on projections of the input. Each head can specialize: one tracks syntax, another semantic similarity, another positional patterns.
The outputs concatenate and project back. GQA (Llama 2/3): query heads outnumber K/V heads to save KV cache memory while preserving multi-head benefits.