LayerRoPE: Dynamic Depth-wise Magnitude & Angular Superposition
cs.LG, cs.AI, cs.CL
Submitted: 2026-10-06
Updated: 2026-10-06
License: http://creativecommons.org/licenses/by/4.0/
The gist: 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
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 γ: with depth, γ 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 γ vectors with a single shared vector and depth-conditioned scalars, at a net reduction in parameters and <0.02% change in FLOPs. Across a model ladder scaled up to 100 B+ tokens, LayerRoPE consistently outperforms Pre-, Post- and Peri-Norm and Layer-Norm Scaling, reaching Pre-Norm's 1.3B loss with 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 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.
Sources
- gpt-oss-120b & gpt-oss-20b Model Card
- DeepSeek LLM: Scaling Open-Source Language Models with Longtermism
- Universal Transformers
- Dissecting Outlier Dynamics in LLM NVFP4 Pretraining
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Tools
- The Llama 3 Herd of Models
- Training Compute-Optimal Large Language Models
- Mistral 7B
- Scaling Laws for Neural Language Models
- Peri-LN: Revisiting Normalization Layer in the Transformer Architecture
- 2 OLMo 2 Furious
- Parcae: Scaling Laws For Stable Looped Language Models
- Massive Activations in Large Language Models
- The Curse of Depth in Large Language Models
- Gemma 2: Improving Open Language Models at a Practical Size
- Attention Residuals
- LLaMA: Open and Efficient Foundation Language Models
- Llama 2: Open Foundation and Fine-Tuned Chat Models
- Negligible in Size, Significant in Effect: On Scale Vectors in Large Language Models
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: The Predictive Cost of ELBO Binding
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks