English

Massive Values in Self-Attention Modules are the Key to Contextual Knowledge Understanding

Computation and Language 2025-05-22 v4

Abstract

Large language models (LLMs) have achieved remarkable success in contextual knowledge understanding. In this paper, we show that these concentrated massive values consistently emerge in specific regions of attention queries (Q) and keys (K) while not having such patterns in values (V) in various modern transformer-based LLMs (Q, K, and V mean the representations output by the query, key, and value layers respectively). Through extensive experiments, we further demonstrate that these massive values play a critical role in interpreting contextual knowledge (knowledge obtained from the current context window) rather than in retrieving parametric knowledge stored within the model's parameters. Our further investigation of quantization strategies reveals that ignoring these massive values leads to a pronounced drop in performance on tasks requiring rich contextual understanding, aligning with our analysis. Finally, we trace the emergence of concentrated massive values and find that such concentration is caused by Rotary Positional Encoding (RoPE), which has appeared since the first layers. These findings shed new light on how Q and K operate in LLMs and offer practical insights for model design and optimization. The Code is Available at https://github.com/MingyuJ666/Rope_with_LLM.

Keywords

Cite

@article{arxiv.2502.01563,
  title  = {Massive Values in Self-Attention Modules are the Key to Contextual Knowledge Understanding},
  author = {Mingyu Jin and Kai Mei and Wujiang Xu and Mingjie Sun and Ruixiang Tang and Mengnan Du and Zirui Liu and Yongfeng Zhang},
  journal= {arXiv preprint arXiv:2502.01563},
  year   = {2025}
}

Comments

International Conference on Machine Learning (ICML 2025)

R2 v1 2026-06-28T21:30:55.467Z