Position Without Positional Embeddings: A Directional Mechanism in NoPE Transformers
Abstract
Autoregressive Transformers without positional embeddings (NoPE) can recover absolute position. A common explanation is that the causal attention can create a position-dependent variance signal, but this ignores LayerNorm which removes per-token scale. We identify a two-block mechanism that encodes position in the attention weight on a shared beginning-of-sequence (BOS) token. Because BOS participates in every prefix, the first attention layer writes the BOS direction into every position. The first block’s MLP with its succeeding LayerNorm then makes the BOS share nearly constant across later tokens while keeping it distinct at BOS. In the second block, each additional token contributes roughly the same amount to the attention denominator, so the share of attention paid to BOS decreases monotonically and predictably with position. This weight follows k/(k + i) at position i, for a fixed k. The attention output mixes the BOS value with the values of later tokens. Projecting this mixture onto the BOS direction makes the weight readable by downstream layers. We verify the mechanism is not only theoretical but also emerges in trained NoPE transformer decoders, both when trained with a position-prediction loss and with a next-token-prediction language modeling loss. This is demonstrated by measurement and intervention-based experiments on three trained models.