Position Without Positional Embeddings: A Directional Mechanism in NoPE Transformers

Matan Avitan, Ido Nachum, Yanai Elazar, Yoav GoldbergNeurIPS 2026

TL;DR

How can a Transformer know whether a word is the 5th or the 500th in a sentence when you strip away all its positional embeddings? Previous theories pointed to shrinking activation variance, forgetting that LayerNorm immediately wipes out scale. This paper uncovers the real culprit: a clever, two-layer geometric circuit that uses the "Beginning of Sequence" (BOS) token as a directional compass, encoding exact token positions in vector angles that effortlessly survive normalization.

What Problem Does This Paper Address?

Traditionally, Transformers are treated as "bags of words" unless we explicitly inject positional embeddings (like sinusoidal waves or RoPE) to tell them word order. Yet, strangely, autoregressive Transformers without positional embeddings—dubbed NoPE models—still manage to figure out absolute token positions.

How? The prevailing theory blamed the causal attention mask (which restricts token $i$ to only looking at preceding tokens $0$ through $i$). Because token $i$ averages $i+1$ vectors, the variance of that average shrinks at a predictable rate of $1/(i+1)$. Case closed? Not quite. Real-world Transformers apply LayerNorm throughout the network, which rescales every token vector to unit variance, effectively erasing this scale signal. What, then, actually survives LayerNorm to tell the network where it is?

Methods

Taking a mechanistic interpretability approach (reverse-engineering weights into human-readable circuits), the authors derive a theoretical five-step, two-layer mechanism and verify it empirically on three trained NoPE decoders: two 2-layer models trained explicitly to predict position (1-head 1H and 12-head 12H), and a standard 6-layer language model (NoPE LM) trained purely on next-token prediction.

Schematic of the two-layer directional mechanism turning a noisy BOS signal into a clean position readout.

The circuit unfolds across two Transformer blocks:

  1. Noisy Anchor Injection (Layer 1 Attention): Because the special BOS token sits at position 0, every token attends to it. Layer 1 writes a BOS vector direction into every token's representation, though it gets noisier further down the sequence due to random cross-terms from other words.
  2. Cleaning the Slate (Layer 1 MLP + LayerNorm): The first MLP acts like a gate. Recognizing the massive BOS signal at position 0, it leaves it alone, while pushing all later positions ($i \ge 1$) toward a uniform, nearly constant (or zero) BOS share. Crucially, the enclosing LayerNorm helps squash residual word noise!
  3. Counting in the Denominator (Layer 2 Attention Weights): With BOS standing out cleanly at position 0 and every subsequent token contributing an identical constant to the attention denominator, the attention weight $\alpha_{i,0}$ paid to BOS decays smoothly as $k / (k + i)$ at position $i$.
  4. Exposing the Weight (Layer 2 Value/Output Map): Attention weights are trapped inside the attention head. To expose $\alpha_{i,0}$ to the residual stream, the value-output matrix ($W_{OV}$) maps BOS and non-BOS tokens to two distinct vector directions—creating an output vector that smoothly interpolates between the two levels based on $\alpha_{i,0}$.
  5. Reading Position: Any downstream layer can now take a simple dot product (projection) along the mapped BOS direction to read out $\alpha_{i,0}$—and thus, the exact position $i$.

To prove this isn't just a neat math trick, the authors run causal interventions—surgically ablating or replacing specific directional shares during forward passes while running random-direction controls.

Datasets

All models were trained and evaluated on OpenWebText using sequences of length $L = 1024$ with a BOS token prepended at position 0. Probes were fitted on 320 held-out sequences, and all measurements and causal interventions were evaluated on a separate set of 1,600 held-out sequences. No new datasets were introduced.

Key Insights and Ideas

  • Directions survive where scales die: LayerNorm destroys vector norms (scales), so NoPE models encode position in direction proportions—mixing a fixed BOS anchor vector with an orthogonal or opposite background vector.
  • LayerNorm is an accomplice, not an obstacle: In Step 2, the MLP outputs a high-magnitude vector for positions $\ge 1$ so that when LayerNorm rescales the sum, the noisy Layer-1 token content is effectively washed out.
  • Opposite poles maximize resolution: Theoretically, the BOS and non-BOS value vectors only need to be orthogonal. Empirically, trained networks push them to point in opposite directions (cosine similarity $\approx -0.996$ in 1H and $-0.771$ in NoPE LM). Stretching the gap between the two interpolated endpoints makes tiny shifts in attention weights much easier to distinguish at late positions.

Key Results

Both explicit position models and the naturally trained language model converge on this exact five-step circuit:

Figure 2: Each step of the mechanism appears in both a position model and a language model. Columns follow Steps 1 to 5 of §4, rows show 1H and NoPE LM, and bands show within-position standard deviations. Step 1 projects the Layer-1 activation after its LayerNorm on ˆwBOS, with three single sequences in gray. Step 2 measures how the first MLP separates BOS from later inputs, and Step 3 compares BOS attention with the mechanism’s formula. Step 4 measures the separation produced by the OV map through value projections on ˆwBOS. Step 5 compares the measured BOS attention, on keys 0 and 1 in 1H, with the readout of zi by Equation (5).
  • Formulaic Precision: The analytical curve $k/(k+i)$ explains the measured Layer-2 BOS attention weights with $R^2 = 0.998$ in 1H and $R^2 = 0.954$ in NoPE LM.
  • Sharp Position Decoding: Adding a second layer drops position Mean Absolute Error (MAE) tenfold compared to a 1-layer model (from 30.3 tokens down to 2.3 tokens in 1H). In NoPE LM—which was never explicitly taught about position—probing the Layer-2 projections across heads recovers token position (out of 1,024) with $R^2 = 0.993$ and an MAE of 15.8 tokens.
  • Causal Knockouts: Wiping out the Layer-1 BOS term craters position $R^2$ from $>0.99$ into negative territory ($-4.64$ in 1H, $-15.77$ in NoPE LM) and spikes NoPE LM's next-token perplexity by 41.6x. Collapsing the two value levels in Step 4 similarly ruins position decoding and increases LM perplexity by 7.8x to 34.8x, whereas random-direction control edits change $R^2$ by nothing and loss by at most $0.0008$.

Limitations and Future Work

  • Reliance on a BOS Anchor: Every step counts the prefix relative to a guaranteed BOS token at index 0. Without a fixed starting token, a model must improvise. Because natural language follows Zipf's law, the authors hypothesize networks might latch onto ultra-frequent words like "the" or "a" as makeshift anchors—an open question for future work.
  • Architectural Specificity: The exact circuit steps were derived and tested on decoder-only pre-norm Transformers using standard LayerNorm. Variations like RMSNorm could still exploit the directional BOS anchor, though the exact downstream mechanics require empirical validation.

Summary updated

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.
BibTeX
@inproceedings{avitan2026position,
  author = {Matan Avitan and Ido Nachum and Yanai Elazar and Yoav Goldberg},
  title = {{Position Without Positional Embeddings: A Directional Mechanism in NoPE Transformers}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Sje2qgTHl2},
}
Figure