Dot-product attention vs QKNorm: normalize Q and K, then multiply by a learnable g.
Illustrative log-scale position of corpus sizes; English-French is described as tens of millions of pairs.
The paper's example: softmax(760, 752, 750) = softmax(12, 4, 2).
Illustrative cosines 0.9, 0.3, 0.1, −0.2 pushed through softmax(g·cos). Drag g.
g₀ = log₂(L² − L). Curve: weight on a best match (cos 1) against L−1 entries at cos 0 (computed from the formula; the paper's rough claim is >99.9% near L≈75).
Attention = softmax(g · Q̂ K̂ᵀ) V, with Q̂, K̂ L2-normalized along the head dimension. V is left alone.
Illustrative hand-made 6-token vectors (dim 4), not from the paper. Hover cells.
Dropping g costs about 8.7 BLEU: scores in [−1,1] without a temperature leave softmax nearly flat. It shows a scale is needed, not that cosine beats a learnable-temperature dot product.
≈2.2 BLEU of the 4.64 total (5 × 0.928), ~47%. Other four average ~0.6.
Reported approximate drops: percentile 97.5→99 ≈ 0.6; heads 8→16 ≈ 0.8.