How Local Mixing Encodes Relative Position in Global NoPE Attention
Abstract
The attention operation is naively position invariant. However, positional information is fundamental to natural language, and therefore a variety of explicit position encodings have been developed in transformer-based models, such as rotary position encoding (RoPE). Although explicit position encodings have long been assumed to be required, recent methods that interleave local mixing layers, such as sliding window attention (SWA) and gated linear attention, while not encoding position (NoPE) in global attention layers has recently been shown to be successful at scale. How and why this approach works is not well-understood. In this paper, we develop an explanation of how hybrid models of this sort can implicitly encode position at global NoPE layers. Supported by both theoretical and empirical evidence, our central argument is that SWA and gated linear attention induce a recency bias in the residual stream that propagates to, and is selected by, the global attention logits. Moreover, in contrast to the implicit position encodings found in models with only global NoPE attention, in which positional information arises solely from the causal mask, the recency bias in hybrid models can be maintained across long sequences. In addition to deepening our understanding of how hybrid models encode position, these findings may provide insights for how to encode position in a way that can extrapolate to longer sequence lengths indefinitely.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI, cs.LG
Related papers
Shifting Mechanisms: How Positional Encoding Choice Shapes In-Context Retrieval
Shared title terminologycs.CLEric Enouen, Sainyam Galhotra
JHealthBench-L: Clinician-Reviewed Localization of HealthBench for Rubric-Based Medical LLM Evaluation in Japan
Shared title terminologycs.CLShohei Hisada, Keisuke Orimo, Kenji Igarashi et al.
Fine-Tuning Without Gradients? Closed-Form, LLM-Written Classifiers on a Frozen Encoder
Shared title terminologycs.CLMd Nasir Uddin, Musa Tur Farazi, Soumik Bhattacharjee et al.
DiCALM: Converting Autoregressive Convolution-Attention Language Models into Discrete Diffusion Language Models
Shared title terminologycs.CLPhong Le, Ngoc-Quan Pham, Dat Quoc Nguyen
Is Prosody Encoded in the Neural Audio Codec Mimi?
Shared title terminologycs.CLNicolas Ballier, Artem Saloev, Erin Pacquetet et al.
Localizing Cross-Lingual Generalization in Parameter Space
Shared title terminologycs.CLYeoreum Lee, Jaeseong Lee, Seung-won Hwang