Information Entropy Invariance: Enhancing Length Extrapolation in Attention Mechanisms
Kewei Li, Yanwen Kong, Yiping Xu, Jianlin Su, Lan Huang, Ruochi Zhang,, Fengfeng Zhou

TL;DR
This paper introduces entropy-based scaling methods to improve length extrapolation in attention mechanisms, enabling models to handle much longer contexts effectively without additional training.
Contribution
It proposes two novel entropy-invariance based scaling techniques, InfoScale and CosScale, with theoretical analysis and state-of-the-art experimental results on extended context lengths.
Findings
InfoScale maintains focus on original tokens during length extension.
Combining InfoScale and CosScale achieves state-of-the-art performance on long-context tasks.
Increasing CosScale approximates windowed attention, addressing long-range context challenges.
Abstract
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-{\alpha} model with a context window extended to 64 times the training length, and…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNeural Networks and Applications
MethodsAttention Is All You Need · Softmax · Focus
