The Missing Positional Story in LLMs: A Case Study of Shift-Invariant Attention

Benjamin Huh, Hak Hyun Kim, Yuting Tian, Jason Peng, Christopher Kang, Soroush VosoughiNeurIPS 2026

TL;DR

Modern LLMs use mechanisms like Rotary Positional Embeddings (RoPE) that theoretically allow them to care purely about the distance between words rather than their exact coordinates on the page. By surgically measuring and removing these distance-based "shift-invariant" patterns inside attention heads, researchers show that LLMs actively rely on them to make predictions and recall patterns. Surprisingly, how much models lean on this capability varies wildly—up to 140-fold across architectures—suggesting that a powerful computational channel inside our best models might be massively underutilized.

What Problem Does This Paper Address?

If you read the pattern A B A B A, you instinctively expect B next, whether that sequence appears in the first sentence of a book or on page three hundred. Shifting the whole sequence forward changes every token's absolute position, yet the distances between the tokens stay identical.

In modern transformers, RoPE is the dominant way to encode position, and by mathematical design, it gives attention heads a clean channel for shift-invariant (SI) attention—scoring relationships based purely on relative token offset ($\Delta = i - j$). While we know transformers can represent relative distances, having a highway doesn't tell us how much traffic actually drives on it. Do trained LLMs genuinely rely on pure distance patterns to make predictions, or is content doing almost all the heavy lifting?

Methods

Instead of turning off entire attention heads (which wipes out both positional and content-based computation), the authors isolate the pure distance component of pre-softmax attention scores (logits). They split their pipeline into two distinct paths:

Figure 2: Two paths from attention logits. Ranking uses a preprocessed, Fourier-restricted fit; intervention uses raw means. Each averages 50 sequences of 512 tokens. The self-offset is included only in the intervention path.
  1. Measuring SI Strength (Ranking): Across 50 text sequences, they average a head’s attention logits at each token distance, apply a Fourier restriction to capture the strongest repeating distance waves, and calculate an $R^2$ score. A high $R^2$ means token distance alone explains a huge chunk of what that head is doing—not just that its scores are large.
  2. Kernel Subtraction (Intervention): For every head, they build a lookup table—an offset kernel—of its raw average logit at every token distance (0 to 511). During evaluation on new text, they subtract this lookup table directly from the head's live logits before the softmax step.
Figure 1: A numerical illustration of raw-kernel subtraction, not model measurements. A query at position 3 scores keys at positions 1–3. Looking up the raw kernel at their offsets gives (−1, 1, 0); subtracting it changes logits (0, 1, 0) to (1, 0, 0) and redistributes softmax attention. Subtracting a negative kernel entry increases that logit. The SI score uses a separate, smoothed fit (Section 3.2).

Crucially, they use frozen-source transfer: they rank heads and fit kernels on one corpus (e.g., Wikipedia), freeze them, and test the subtraction damage on a completely different domain (e.g., code), alongside strict controls like shuffling the distance order (offset-permutation) or testing non-SI heads of equal overall importance.

Datasets

The authors evaluate pretrained models rather than training from scratch, using:

  • Wikipedia and Code corpora: Document-disjoint partitions of 512-token sequences (50 for fitting kernels/rankings, 100 for evaluating next-token prediction loss).
  • Synthetic Retrieval Probes: Newly constructed repetition tasks (like K V K V K V K V K -> V) paired with length-matched random controls, shuffled labels, and seven task families varying filler spacing and length.
  • Natural-Text Passkey Contexts: 256–512 token Wikipedia and code passages injected with passkeys to test target-probability sensitivity.

Key Insights and Ideas

  • Distance patterns are genuinely "load-bearing": Subtracting a head's average distance lookup table degrades next-token prediction in lockstep with its measured SI score—even when transferring frozen kernels from Wikipedia to code (or vice versa). Scrambling which value gets subtracted at which distance causes noticeably less damage, proving the exact ordering of distances matters.
  • You don't need RoPE to get shift invariance: When evaluating a broader panel of 11 models, SI-like patterns clearly show up in GPT-2 models trained with old-school absolute positional encodings. Relative distance tracking is something models learn to do, not merely an artifact of RoPE.
  • Wild heterogeneity hints at underutilization: Across the three primary 7B–8B models (Llama-3.1, Mistral, OLMo-2), mean SI scores vary by 6.5x; across 11 models spanning 7 architecture families, they vary roughly 140-fold. Moreover, SI structure mostly shines in narrow surface/repetition tasks rather than broader formats, sparking a fascinating hypothesis: models may be leaving rich, position-invariant semantic reasoning on the table unless pretraining explicitly pressures them to use it.

Key Results

  • Cross-Corpus Loss Sensitivity: Across all six frozen-source transfer tests (Wikipedia $\leftrightarrow$ Code on Llama-3.1-8B, Mistral-7B-v0.1, and OLMo-2-7B), higher-SI head groups suffer systematically worse next-token negative log-likelihood (NLL) increases when their kernels are subtracted, with Spearman rank correlations ranging from $\rho = 0.764$ to $0.986$. Source kernel subtraction beat offset-permuted controls in 102 out of 120 bin comparisons.
  • Repetition Retrieval Collapse: Completely removing the outputs of the top 256 SI heads tanks accuracy on basic repetition probes: Llama drops from 93.5% to 2.5%, Mistral from 85.5% to 14.0%, and OLMo from 77.0% to 42.5%. Under a strict selectivity battery (requiring high-SI damage to beat equally sized non-SI head removal), Llama cleanly passes, while Mistral and OLMo show slightly larger disruptions from non-SI heads.
  • Broader & Natural-Text Limits: Under finer-grained kernel subtraction across seven spaced/varied synthetic families, none of the models met the authors' strict 6-of-7 family breadth criterion (Llama and Mistral passed 4/7; OLMo passed 2/7). In natural-text passkey contexts, baseline accuracy was near zero (0–2.8%), though Llama and Mistral still showed selective log-probability drops (+3.64 and +3.12 nats over importance-matched non-SI heads).

Limitations and Future Work

The authors are admirably transparent about what their setup cannot claim:

  • Descriptive cross-model gaps: Because archived logit preprocessing differed across models (Llama and Mistral logits were double-centered for scoring, while OLMo remained uncentered) and training data/architectures vary, the 6.5x and 140x cross-model spreads are descriptive observations—not isolated causal proof of how specific architectures shape SI.
  • Group-level effects & perturbation scale: Interventions alter groups of heads (e.g., 51–52 or 256 heads at once), meaning head-to-head interactions are included. Additionally, equal-norm random kernels actually cause more raw loss damage than true offset kernels—meaning raw loss increase alone doesn't diagnose an SI mechanism without paired permutation and ranking controls.
  • Future Work: The team proposes a testable "representational-commitment hypothesis": continuing pretraining with explicit pressure for semantic consistency across shifted positions to see if LLMs can be nudged into using their shift-invariant channels for deeper, more generalizable computation.

Summary updated

Abstract

Rotary positional embeddings (RoPE) are now the dominant positional mechanism in modern large language models. By construction, RoPE provides a channel for shift-invariant (SI) attention: head logits can depend purely on token offset rather than absolute position. We show that trained models exploit this SI structure in ways that matter for their predictions. This exploitation is load-bearing under intervention: kernel ablations produce systematic degradation that tracks group-average SI strength under converging controls, including when kernels and rankings are frozen before evaluation on another corpus. SI structure also appears in models trained with absolute positional encodings, establishing that it is not exclusive to RoPE without identifying its causal origins. SI-related structure is also functionally meaningful: removing high-SI head outputs strongly disrupts offset-structured retrieval, while kernel subtraction produces model-dependent target-probability changes in natural-text contexts, most consistently in Llama and Mistral. These natural-text results measure probability sensitivity rather than successful long-context retrieval. At the same time, our results motivate a deeper question: is the SI channel currently underutilized? Many computations are position-invariant by nature—recognizing that a pattern holds regardless of where it appears in context—yet our evidence primarily characterizes narrow positional and surface tasks, leaving richer semantic invariances open. Strikingly, mean SI scores vary 6.5-fold across the three primary models and approximately 140-fold across eleven models spanning seven architecture families under the stated scoring conventions. These descriptive differences motivate testing how training shapes SI use, while architecture, data, and preprocessing remain confounded. This suggests a practical hypothesis for future work: pretraining pressure toward semantic invariance tasks may encourage models to exploit SI channels for richer computation.
BibTeX
@inproceedings{huh2026missing,
  author = {Benjamin Huh and Hak Hyun Kim and Yuting Tian and Jason Peng and Christopher Kang and Soroush Vosoughi},
  title = {{The Missing Positional Story in LLMs: A Case Study of Shift-Invariant Attention}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=HbJH1naglA},
}
Figure