Manuscript Offprint

arXiv:2610.09179

LayerRoPE: Dynamic Depth-wise Magnitude & Angular Superposition

Shikhar Srivastava, Christopher Kanan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

As data propagates through a Transformer, the norm of its hidden states grows by orders of magnitude with depth, a phenomenon framed as ‘curse of depth’ and nearly universally treated as a pathology to be suppressed. We take the opposite view. Across 16 pre-trained LLMs from 9 families, spanning dense, mixture-of-experts and hybrid architectures and Pre-, Peri- and Post-Norm designs, we find that this growth reflects an emergent depth-positional encoding, carried by the only learned per-layer gain on the residual stream, the normalization weight γ\gamma: with depth, γ\gamma grows in magnitude and rotates in direction, jointly encoding the layer index. We make this depth-conditioned encoding explicit with LayerRoPE, an implicit analog of RoPE along the depth axis, which replaces all layerwise γ\gamma vectors with a single shared vector, depth-conditioned scalars, at a net reduction in parameters and <0.02%<0.02\% change in FLOPs. Across a model ladder scaled up to 100B+ tokens, LayerRoPE consistently outperforms Pre-, Post- and Peri-Norm, Layer-Norm Scaling, reaching Pre-Norm’s 1.3B loss with 3.4×3.4\times less compute; LayerRoPE is the only approach that shows strong convergence and improves near monotonically as depth scales to 512 layers. It improves learning-rate sensitivity by 3−10×3-10\times, and transfers naively to and consistently improves looped latent models and Vision Transformers. Inspecting its learned schedule inverts the prevailing premise: LayerRoPE does not shrink the residual stream but widens it, damping what each block reads while amplifying what it writes. Depth stability, our results suggest, calls not for suppressing the residual stream, but for depth-conditioned regulation of the computational blocks it feeds.

Figure

(a) Illustration: LayerRoPE’s regulation of computational block with depth-conditioned I/O, while maximizing residual variance.

(b) Compute-scaling curves on a 4×4 \times Chinchilla model-ladder

Figure 1: LayerRoPE offers a contrary premise: Maximizing residual variance with depth-conditioned regulation of computational blocks, allows better convergence, deeper networks, wider learning basins, efficiently (<0.02% FLOP increase), and across architectures and modalities.

*Correspondence to ssrivas9@ur.rochester.edu.

Project webpage: www.cs.rochester.edu/u/ssrivas9/layer-rope.

1 INTRODUCTION

Transformers underpin modern AI, from large language models (LLMs) to Vision Transformers (ViTs). All such systems share a persistent pathology: as the input propagates through the network, the ℓ2\ell_{2} norms of hidden states grow rapidly with depth, often by several orders of magnitude between the input embeddings and the final layers. Recent studies have characterized various distinct manifestations of this growth. Sun et al. (2024) identify “massive activations” whose magnitudes exceed the mean by more than 3000 times; Darcet et al. (2024) observe high-norm “register” tokens that emerge in ViTs to absorb global context; and Sun et al. (2025) frame the broader phenomenon of activation variance growth in Pre-Norm transformers as a “curse of depth” that degrades gradient flow and layer contributions in deeper LLMs.

The prevailing beliefs treat this growth as something to suppress or re-engineer away, along two lines. One, damps the residual stream directly: Layer-Norm Scaling (Sun et al., 2025), for instance, scales each block's input, the output of its layer normalization, by 1/ℓ+11/\sqrt{\ell+1}, and Peri-Norm (Kim et al., 2025) re-normalizes each sub-layer's output before it re-enters the stream. Second, to rewrite the residual pathway itself: Attention Residuals (Team et al., 2026) show that the unit-weight residual is equivalent to a low-rank linear attention over depth, whose uniform accumulation forces hidden-state norms to grow as O(L)O(L), and replace it with a learned aggregation that holds magnitudes bounded; Hyper-Connections (Zhu et al., 2025) and Manifold-Constrained Hyper-Connections (Xie et al., 2025) instead widen the single stream into several parallel streams, constraining their mixing to preserve signal magnitude. A detailed discussion of related work is provided in Section F. Nonetheless, across both lines, the unifying premise is that activation growth is a defect to be removed.

We take the opposite view: The residual growth is not in itself a failure mode, and the goal must not be to shrink the residual pipe that flows through the network. Rather, to regulate the computational blocks it feeds into, allowing us to further widen the residual pipe flowing through the network. We show through broad experimentation that this view leads to better depth scaling, than residual damping or unconstrained computation. In order to regulate computational blocks to read/write into a wide residual stream, it is first necessary to ask what the growth encodes. We find, interestingly, that the systemic, per-layer growth of activation norms is indicative of an emergent depth-positional encoding that the network learns to express through the only learned per-layer gain directly on the residual stream: the RMSNorm weight γ\gamma. Through analysis of a large breadth of LLMs, we show that the MLP block's γ\gamma vectors grow and rotate conditioned variously on the network depth. Magnitude and rotation, we hypothesize, therefore, are conditioned on the residual stream's depth, and therefore jointly encode a form of layer-index encoding: an implicit analog of RoPE (Su et al., 2024) along the depth axis rather than along sequence position.

We make this layer-index encoding explicit. LayerRoPE replaces the per-layer gains γℓ\gamma_{\ell} with one shared γ\gamma per site, rotated and scaled by a few depth-conditioned scalars. It is a drop-in addition to any computational block, at net fewer parameters and a <0.02%<0.02\% change in FLOPs. Our contributions are:

• An emergent depth code. Across 16 LLMs with varying families and architectures, the norm weights γ\gamma show depth-conditioned magnitude and rotation, with ∼99%\sim99\% of its dimensions following a shared layer-wise trajectory (Section 2).

• Better scaling. On a 58M-1.3B ladder trained at 4× the Chinchilla budget (up to 107B tokens), LayerRoPE attains the lowest loss at every scale, reaches Pre-Norm’s 1.3B loss with 3.4× less compute, and achieves the best average zero-shot accuracy (Section 4.1).

• Deeper, more stable networks. It is the only method whose loss improves monotonically with strong convergence, up to 512 layers (Section 4.2), and it cuts learning-rate sensitivity by 3−10×3-10\times while training stably at rates up to 8×8\times higher than its baseline tolerates (Section 4.3).

• Beyond language models. Without tuning, it improves looped latent models on nearly every metric at every scale, and Vision Transformers by up to 0.9 points of top-1 accuracy (Section 4.4).

• A wider stream, not a narrower one. LayerRoPE’s learned depth-conditioned schedule scales down reads and amplifies writes into the stream, widening the residual stream between 4−100×4-100\times its backbone’s variance at 1.3B (Section 5.1).

Figure

(a) Distribution of MLP block RMSNorm γ\gamma values. Means and upper percentiles grow nearly monotonically with depth.

Figure

(b) MDS projection of the same per-layer γ\gamma vectors. Successive layers trace a near-monotone arc spanning ∼143∘\sim143^{\circ}.

Figure 2: Norm weights encode depth in LLAMA-like LLMs (LLaMA-2 7B shown here). Magnitude (left) and angular position (right) jointly form a depth-positional code along the residual stream.

References (73)