Where Position Matters: Profiling-Guided Layer-Wise RoPE Allocation in Transformers
Abstract
Rotary Position Embedding (RoPE) typically uses uniform coverage across Transformer layers despite heterogeneous positional requirements. Phase-off interventions reveal non-uniform, model-specific rotary-phase dependence, while coverage interventions relate it to coverage-upgrade benefits. We propose profiling-guided layer-wise RoPE allocation, assigning high/low coverage under a fixed budget using early coverage-benefit profiles. The framework supports fixed-width query/key representations and physical rotary-dimension allocation in Multi-head Latent Attention (MLA). Normalized-depth mapping transfers profiles within model families, enabling small-model measurements to guide larger-model allocations before pretraining. A brief analysis relates selection and transfer to score calibration and inter-layer interactions. From-scratch experiments demonstrate validation-loss improvements over available budget-matched baselines, while analytical resource accounting identifies favorable quality--storage--compute trade-offs for physical MLA. These results connect positional demand to transferable, efficient architecture design.
Figures & tables
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Setting | 130M | 350M | 1B |
| Sequence length | 4,096 | 4,096 | 4,096 |
| GPUs per job | 2 | 4 | 4 or 8 |
| Micro-batch size per GPU | 4 | 2 | 1 |
| Global batch size | 64 | 128 | 256 |
| Tokens per step | 262,144 | 524,288 | 1,048,576 |
| Training steps | 9,919 | 13,352 | 19,074 |
| Model / allocation | Layers |
| 130M Dense, Profile50 | |
| 130M MLA, Profile50 | |
| 130M MLA, Profile75 | |
| 130M MLA, Reverse50 | |
| 130M MLA, Last10 | |
| 350M Dense, Transfer50 |
Rotary Positional Embeddings
Rotary positional embeddings (RoPE) encode token positions by rotating attention features, supporting relative-position reasoning in language and multimodal models.
See all 100 papers