Summary (Overview)
- The paper proposes two novel intervention-based metrics—RoPE Frequency Importance Score (RFIS) and RoPE Positional Dependence (RPD)—to establish a complete head-level taxonomy of retrieval and positional heads in modern RoPE-based Transformers.
- The authors identify a Global Positional Band (GPBand), a salient mid-low-frequency band that separates retrieval from positional functions and follows the training-length positional scale, potentially explaining zero-shot length extrapolation failure.
- Two hybrid architecture design principles are derived: (i) positional modeling should operate only locally, while global access uses position-independent retrieval; (ii) retrieval and positional functions should be assigned at head granularity with layer-specific allocation.
- These principles are instantiated in the Head-wise Hybrid Architecture (HwH) using NoPE Full Attention (FA) for global retrieval and Gated DeltaNet (GDN) linear attention (LA) for local positional modeling, with FA-to-LA ratio less than 1:3.
- From-scratch pretraining at 380M and 1.4B scales shows HwH retains strong language modeling, improves retrieval, and substantially strengthens zero-shot long-context extrapolation over Transformer, pure-LA, and layer-wise hybrid baselines.
Introduction and Theoretical Foundation
Background and Motivation
Hybrid architectures combining Full Attention (FA) and Linear Attention (LA) are increasingly prominent, yet their allocation remains largely heuristic. FA provides exact token-to-token access but incurs quadratic sequence complexity and a growing KV cache, while fixed-state LA offers recurrent efficiency but struggles with exact long-range retrieval. The central design question remains: which roles should be assigned to FA or LA, at what granularity, and with what allocation strategy?
Theoretical Foundation
The functional differentiation learned by modern RoPE-based Transformers offers a natural design reference. Prior work identified retrieval heads supporting long-range access, but these methods begin with pretrained Transformers and do not independently characterize the complementary function.
Full Attention with causal masking:
Linear Attention (Gated DeltaNet) with data-dependent decay and delta-rule update:
Rotary Position Embedding (RoPE) partitions each head into two-dimensional groups with frequencies:
The dot product decomposes into exact frequency contributions:
Methodology
Behavioral Probes
The authors use QRscore to measure retrieval tendency and introduce LDscore to measure local-streaming tendency. However, behavioral evidence alone cannot classify all heads mechanistically, motivating intervention-based metrics.
RoPE Frequency Importance Score (RFIS)
RFIS removes one frequency contribution from a head's logits while holding others fixed, measuring the change in the complete attention distribution via Jensen-Shannon divergence:
where the removal intervention is:
RoPE Positional Dependence (RPD)
RPD replaces the relative rotation of one frequency with the identity while preserving learned Q/K coordinates:
The intervention:
Both metrics are faithful intervention-based metrics bounded in [0, 1].
Head-wise Hybrid Architecture (HwH)
HwH instantiates the two principles as architectural inductive bias:
- NoPE FA heads provide position-independent global retrieval
- LA (GDN) heads provide local positional modeling
The standard configuration (HwH-std) follows the observed layer-specific distribution:
- First and last layers: only GDN
- Middle half: NoPE-FA:GDN = 1:3
- Remaining shallow and deep layers: 1:7
Empirical Validation / Results
Language Modeling
At 380M parameters, HwH-std achieves the best perplexity (27.41 on Wiki, 34.84 on LAMBADA) and highest average commonsense accuracy (42.78%). At 1.4B, HwH-std remains competitive with the best baselines.
Table 1: Language modeling perplexity (↓) and commonsense-reasoning accuracy (%, ↑)
| Model | Wiki ↓ | LAMB. ↓ | HellaS. | PIQA | ARC-E | ARC-C | WinoG. | OBQA | Avg. |
|---|---|---|---|---|---|---|---|---|---|
| 380M parameters | |||||||||
| Transformer | 29.10 | 38.26 | 39.05 | 66.54 | 56.90 | 27.73 | 51.22 | 21.60 | 42.30 |
| GDN | 28.71 | 36.03 | 39.55 | 67.03 | 58.12 | 26.88 | 49.33 | 23.00 | 42.18 |
| Inter | 27.69 | 36.05 | 39.52 | 65.83 | 57.87 | 27.30 | 50.28 | 22.00 | 42.07 |
| HwH-std | 27.41 | 34.84 | 39.93 | 67.57 | 57.87 | 28.16 | 50.75 | 22.40 | 42.78 |
| 1.4B parameters | |||||||||
| Transformer | 17.36 | 13.31 | 55.30 | 72.42 | 69.87 | 38.31 | 56.91 | 29.20 | 52.61 |
| GDN | 17.32 | 13.42 | 55.54 | 72.20 | 71.30 | 36.69 | 58.96 | 27.60 | 52.35 |
| Inter | 16.82 | 11.97 | 55.99 | 72.36 | 71.55 | 38.48 | 58.48 | 26.80 | 53.05 |
| HwH-std | 16.85 | 12.11 | 55.96 | 72.09 | 70.12 | 36.60 | 58.25 | 28.20 | 52.70 |
Retrieval and Length Extrapolation
Table 2: Real-world retrieval and RULER NIAH at the 1.4B scale
| Model | FDA | SWDE | SQuAD | NQ | TriviaQA | DROP | Avg. | NIAH-S1 4K | NIAH-S2 4K | NIAH-S3 4K |
|---|---|---|---|---|---|---|---|---|---|---|
| Transformer | 46.19 | 45.27 | 40.68 | 25.12 | 61.26 | 22.47 | 40.17 | 0.0 | 0.0 | 0.0 |
| GDN | 16.33 | 22.95 | 35.22 | 21.79 | 58.23 | 21.42 | 29.33 | 99.4 | 35.2 | 23.0 |
| Inter | 64.43 | 40.95 | 42.73 | 26.64 | 59.72 | 24.01 | 43.08 | 99.8 | 79.6 | 35.8 |
| HwH-std | 66.15 | 47.25 | 45.84 | 25.28 | 60.13 | 23.19 | 44.64 | 100.0 | 99.6 | 46.2 |
Key findings:
- Transformer scores zero on all NIAH tasks at 4K (no zero-shot length extrapolation)
- HwH-std extrapolates nearly perfectly through 4K (twice the training length) and achieves strongest performance beyond 4K
- HwH-std achieves the best overall retrieval performance
Ablations
Function-specific components:
- GDN is stronger than SWA in commonsense reasoning; SWA slightly improves retrieval and substantially improves extrapolation
- Replacing NoPE FA with RoPE FA sharply degrades retrieval and extrapolation, confirming NoPE FA's advantage for position-independent global retrieval
Layer-specific allocation:
- Removing NoPE FA from first/last layers markedly improves extrapolation through 4K
- Reducing outer-layer ratio from 1:3 to 1:7 further improves extrapolation beyond 4K and strengthens retrieval
Theoretical and Practical Implications
Theoretical Contributions
-
Complete mechanism-level taxonomy: RFIS and RPD establish a complete two-type taxonomy of retrieval and positional heads in RoPE Transformers, moving beyond behavioral probes that cannot fully classify heads.
-
GPBand as functional boundary: The training-length-related salient mid-low-frequency band marks the mechanism-level boundary between retrieval and positional dependence. This global positional fitting is identified as a potential cause of extrapolation failure.
-
RoPE Transformers as implicit functional hybrids: Modern Transformers naturally learn to separate retrieval and positional functions across heads, providing evidence-grounded design principles for hybrid architectures.
Practical Implications
-
Principled hybrid design: The two principles offer a systematic alternative to heuristic FA/LA allocation in hybrid architectures.
-
Improved length extrapolation: HwH achieves zero-shot extrapolation to twice the training length, addressing a critical limitation of standard Transformers.
-
Efficiency: With FA-to-LA ratio less than 1:3, HwH maintains strong performance while reducing the quadratic attention cost.
-
Component role clarity: The work clarifies that LA (GDN) should handle local positional modeling while NoPE FA should handle global retrieval, informing future component selection.
Conclusion
The paper establishes a complete head-level taxonomy of retrieval and positional modeling in modern RoPE-based Transformers, identifying the training-length-related GPBand as its functional boundary. The derived hybrid-design principles—local positional modeling with position-independent global retrieval, and head-granularity with layer-specific allocation—are validated through from-scratch HwH experiments.
Future directions include:
- Extending analyses to function-aligned GQA
- Other modalities and larger scales
- Improved components
- Hybrid designs beyond multi-head Transformers
The work demonstrates that principled hybrid architecture design, grounded in mechanistic understanding of functional differentiation, is a promising route toward future foundation models.
Related papers
- Beneath the Diff: Diagnosing and Mitigating Algorithmic Mode Collapse in Code-Level Autonomous Research Loops
Autonomous research loops can silently collapse into self-confirming echo chambers, a failure mode the paper identifies and characterizes in code-level agents.
- Prompt-Induced Waste in Coding Agents: Reasoning, Effort, Harness Design, and End-to-End Cost
Prompt, effort, and harness interact to determine coding-agent cost per successful task, not token counts; harness design can shift intervention effects by 4–15×.
- Harness Engineering: Anatomy, Architecture, and Evolution of Coding Agents — A Source-Code Study of Eleven Systems
Production harnesses replace agentic frameworks and RAG, relying on hand-rolled loops and deterministic retrieval, marking a platform turn in agent design.