Information Entropy Invariance: Enhancing Length Extrapolation in Attention Mechanisms
Not on the map. Why?
Abstract (arXiv)
Since the emergence of research on improving the length extrapolation capabilities of large language models in 2021, some studies have made modifications to the scaling factor in the scaled dot-product attention mechanism as part of their proposed methods without rigorous theoretical justifications. To fill this gap, we propose two new scaled temperatures based on information entropy invariance to enhance length extrapolation. First, a training-free method InfoScale is designed for dotproduct attention, and preserves focus on original tokens during length extrapolation by ensuring consistent entropy. Second, we theoretically analyze the impact of scaling (CosScale) on cosine attention. Experimental data demonstrates that combining InfoScale and CosScale achieves state-ofthe-art performance on the GAU-α model with a context window extended to 64 times the training length, and outperforms seven existing methods. Our analysis reveals that significantly increasing CosScale approximates the Windowed Attention, and highlights the significance of attention score dilution as a key challenge in long-range context handling. The code and data are available at https://github.com/HT-NEKO/ Information-Entropy-Invariance.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 13 of its 23 references that are in the map. First posted on arXiv 15 Jan 2025.
Builds on
13 of 23 references.
References · 13
- 2017Attention Is All You Needcited by 59,932
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
- 2018CosFace: Large Margin Cosine Loss for Deep Face Recognitioncited by 968
- 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 721
- 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
- 2018Additive Margin Softmax for Face Verificationcited by 275
- 2022DeepNet: Scaling Transformers to 1,000 Layerscited by 176
- 2023LM-Infinite: Zero-Shot Extreme Length Generalization for Large Language Modelscited by 120
- 2022Overcoming a Theoretical Limitation of Self-Attentioncited by 110
- 2023PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise Trainingcited by 109
1 more
Built on by
Citing papers per year: 2025: 3; 2026: 1.
4 papers.
- 2025Long-Context Generalization with Sparse Attentioncited by 18
- 2025Scale-invariant Attentioncited by 5
- 2025InfoScale: Unleashing Training-free Variable-scaled Image Generation via Effective Utilization of Informationcited by 1
- 2026When does training on downscaled images yield the same gradients?cited by 0
- 2026When does training on downscaled images yield the same gradients?5 Aug 2026
- 2025InfoScale: Unleashing Training-free Variable-scaled Image Generation via Effective Utilization of Information1 Sep 2025
- 2025Long-Context Generalization with Sparse Attention19 Jun 2025
- 2025Scale-invariant Attention20 May 2025