Normalizes queries and keys right before attention so their dot products can’t blow up.
Introduced inOct 2020Query-Key Normalization for Transformers
QK-Norm applies RMSNorm to the query and key vectors just before they are compared. Without it, query-key dot products can grow so large during training that attention saturates onto a single token and destabilizes the loss. It became standard in recent models (Qwen3+, Gemma) because it lets them train at higher learning rates with almost no extra compute.
Share of new models that have included QK-Norm ops over time.
Open any of these on hfviewer to find this block in the interactive architecture graph.
Browse all 1050 models with this in the catalog →
hfviewer renders the full architecture of 3,500+ Hugging Face models as interactive graphs. Hover any block to see what it does, with this model’s real numbers.
Browse all model graphs →