Manuscript Offprint

arXiv:2609.38109

How Local Mixing Encodes Relative Position in Global NoPE Attention

Cutter Dawes, Nick Alonso, Tom Figliolia, Beren Millidge

Cutter Dawes 1,∗^{1,*}, Nick Alonso 1,∗^{1,*}, Tom Figliolia 1^{1}, Beren Millidge 1^{1}

1^{1} Zyphra Research ∗^{*} Equal contribution

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.

I. INTRODUCTION

Distinguishing tokens by their position is a vital component of language modeling (Dufter et al., 2022). Since self-attention by itself is permutation invariant, attention layers in large language models (LLMs) typically utilize position encodings (PEs), which explicitly represent either the absolute or relative position of queries and keys. However, commonly used PEs such as rotary positional encoding (RoPE; Su et al., 2024) incur computational overhead and make length extension and extrapolation difficult. Removing explicit PE (a method called NoPE) has met with mixed success: NoPE does not match the in-domain performance of the same architecture with explicit PE, although it can provide some improvements in length extrapolation whereas the performance of RoPE and other explicit position embeddings tend to collapse quickly beyond their training sequence length (Haviv et al., 2022; Kazemnejad et al., 2023).

Separately, to mitigate the computational and memory costs of attention across long sequences, so-called hybrid architectures that interleave either sliding window attention (SWA) or gated linear layers with global attention layers are increasingly used at scale. Interestingly, as hybrid models have become more widespread, there has been a shift in the global attention layers from using RoPE (Gemma Team, 2024) to p-RoPE (Qwen Team, 2025) to, most recently, NoPE. Notably, Kimi K3 interleaved global NoPE with a gated linear variant called KDA (Kimi Team et al., 2026).

However, there are remaining questions concerning how such models utilize and represent position in their NoPE attention layers, an issue that is critical to their long context performance. To our knowledge, only one prior paper has studied how hybrid models represent position in NoPE layers, and their main finding is that they do not represent absolute position (Puvvada et al., 2025) at all. However, this result leaves open the question of whether such models may learn to encode relative position in their NoPE layers.

In this paper, we present novel theoretical and empirical evidence that hybrid architectures can and do develop relative PEs at their NoPE layers. Unlike other explicit relative PEs such as RoPE, hybrid architectures implicitly encode relative position via the interactions between local or linear layers and subsequent NoPE layers. Specifically, the SWA or gated linear layers introduce a recency bias in the residual stream that propagates to, and is selected by, the global NoPE attention logits and then accentuated through depth. We support this account in two complementary ways:

(i) Theoretically, we show mathematically how SWA approximates a moving-average convolution in expectation, inducing a recency bias in its output that transfers into the residual stream, propagates through intervening layers, and is selected by the global NoPE attention logits.

(ii) Empirically, we demonstrate the existence of the predicted recency bias in the residual stream and NoPE attention logits across depth. We show this bias is present at initialization and strengthens throughout training. We validate this in hybrid models interleaving global NoPE attention with SWA (with RoPE and NoPE) and KDA (Appendix E)

An overview of our hypothesized mechanism is provided in Figure 1. In the following sections, we first note that existing relative PEs generally induce a recency bias (Section II), then we introduce our core argument in three steps (Section III). First, SWA produces a residual stream recency bias (Section IV); second, this recency bias propagates through the intervening modules such as normalization and multi-layer perceptrons (MLPs; Section V); and third, this recency bias propagates to and is selected by the global NoPE attention logits (Section VI).

(a) Embeddings, no positional encoding states are exchangeable

Figure

(b) Local layer mixes neighbours SWA or gated linear layer

Figure

(c) NoPE attention inherits the band qi⋅kjq_{i} \cdot k_{j} picks up a b(i−j)b(i-j) term

Figure

Figure

Similarity

Figure

Similarity

Figure

NoPE logits

Figure 1: Proposed mechanism for implicit relative position encoding. (a) Tokens begin as initially uncorrelated. (b) Local mixing correlates nearby residual states. (c) Learned query and key projections can read out this lag-dependent structure as recency-biased global NoPE logits. The shading intensity denotes correlation or logit strength, while line width denotes mixing or attention weight.

References (42)