arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.10959cs.LGcs.AIcs.CL
收藏

旋转位置嵌入作为相位调制:长上下文Transformer的RoPE基础理论界限

Rotary Positional Embeddings as Phase Modulation: Theoretical Bounds on the RoPE Base for Long-Context Transformers

Feilong Liu

AI总结:

本文将RoPE重新解释为相位调制,推导出长上下文Transformer中RoPE基础的理论界限,揭示了位置一致性、精度和深度对模型性能的影响。

摘要:

旋转位置嵌入(RoPE)被广泛用于大型语言模型中,通过乘法旋转来编码token的位置,但其在长上下文长度下的行为仍缺乏充分描述。在本工作中,我们将RoPE重新解释为对一组复数振荡器的相位调制,从而能够通过经典信号处理理论进行分析。在此框架下,我们推导出RoPE基础参数的原理性下界,这些下界是保持目标上下文长度内位置一致性所必需的。这些包括一个类似于奈奎斯特极限的根本性混叠限制,以及一个限制低频位置模式中相位漂移的直流分量稳定性限制。我们进一步将此分析扩展到深度Transformer,显示在各层中重复的旋转调制会累积角偏移,随着深度增加,收紧基础要求。补充这些结果,我们推导出一个与精度相关的RoPE基础上限,源于有限的浮点数分辨率。在该限制之上,增量相位更新变得在数值上无法区分,导致即使在没有混叠的情况下位置信息也会丢失。共同,下界和上界定义了一个依赖精度和深度的可行性区域,即一个“Goldilocks区”用于长上下文Transformer。我们通过对当前最先进模型的全面案例研究来验证该框架,包括LLaMA、Mistral和DeepSeek变体,显示观察到的成功、失败和社区回退与预测的界限高度一致。值得注意的是,违反稳定性限制的模型会出现注意力崩溃和长距离退化,而尝试扩展到一百万token以上会遇到一个与架构或训练无关的硬精度限制。

英文摘要:

Rotary positional embeddings (RoPE) are widely used in large language models to encode token positions through multiplicative rotations, yet their behavior at long context lengths remains poorly characterized. In this work, we reinterpret RoPE as phase modulation applied to a bank of complex oscillators, enabling analysis through classical signal processing theory. Under this formulation, we derive principled lower bounds on the RoPE base parameter that are necessary to preserve positional coherence over a target context length. These include a fundamental aliasing bound, analogous to a Nyquist limit, and a DC-component stability bound that constrains phase drift in low-frequency positional modes. We further extend this analysis to deep transformers, showing that repeated rotary modulation across layers compounds angular misalignment, tightening the base requirement as depth increases. Complementing these results, we derive a precision-dependent upper bound on the RoPE base arising from finite floating-point resolution. Beyond this limit, incremental phase updates become numerically indistinguishable, leading to positional erasure even in the absence of aliasing. Together, the lower and upper bounds define a precision- and depth-dependent feasibility region a Goldilocks zone for long-context transformers. We validate the framework through a comprehensive case study of state-of-the-art models, including LLaMA, Mistral, and DeepSeek variants, showing that observed successes, failures, and community retrofits align closely with the predicted bounds. Notably, models that violate the stability bound exhibit attention collapse and long-range degradation, while attempts to scale beyond one million tokens encounter a hard precision wall independent of architecture or training.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑