Large Language Models without QK-Normalization
Yongding Tao, Yitong Qiao, Tianqi Shao, Tian Wang, Zhixuan Chu, Xiaoming Wu, Yihong Dong, Ge Li
Key points
From the paper's conclusion- These results demonstrate that query-key scale can be effectively controlled without sacrificing token-specific magnitude information.
Abstract
Query-Key Normalization (QK-Norm) is widely adopted in modern large language models to control the growth of attention logits and improve training stability. However, query and key norms are not merely sources of instability. The query norm controls the sharpness of the attention distribution, while the key norm determines how strongly a token attracts different queries. These norms therefore carry token-specific information about attention selectivity and token importance. By normalizing both, QK-Norm suppresses this information. This raises a natural question: can we control query-key representations without discarding their sensitivity to magnitude? To address this question, we propose QK-MAP, a Magnitude-Aware Projection for constructing queries and keys. Rather than removing magnitude through normalization, QK-MAP transforms the input representation using multiple learnable frequencies, so that changes in magnitude are encoded as bounded phase patterns. This allows magnitude to be represented through phase and direction rather than vector length alone. Its periodic features have a fixed norm while remaining sensitive to magnitude changes, separating magnitude encoding from norm growth. Multiple frequencies further help distinguish magnitudes and reduce periodic ambiguity. Experiments across model scales from 190M to 7B parameters show that QK-MAP achieves lower training and validation loss than both Standard attention and QK-Norm. Further analyses show that QK-MAP preserves sensitivity to input scale, assigns less attention to the first token, and produces stronger attention contrast for relevant evidence in synthetic long-context tests. These results demonstrate that query-key scale can be effectively controlled without sacrificing token-specific magnitude information.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- The Gradient Difference Induced by Detaching the Denominator in QK NormalizationarXiv · 2026
- RefineKV: Query-Adaptive KV Cache Compression via Attention-Error BoundsarXiv · 2026
- Read What Matters: Query-Adaptive Quantization for KV CachesarXiv · 2026
- Attention under Bounded Key-Query Similarity: Space Complexity and Transformer AnisotropyarXiv · 2026
- VAR-Q: Tuning-free KV Cache Quantization for Visual Autoregressive Image and Video GenerationarXiv · 2026
- KVPath: Connecting Key-Value Representations Across Transformer LayersarXiv · 2026