2025-12-09 · 专家 · 自然语言处理 · 机器学习

Beyond Real: Imaginary Extension of Rotary Position Embeddings for Long-Context LLMs

该论文提出了一种名为RoPE++的旋转位置编码扩展方法,通过重新引入被标准RoPE丢弃的虚部信息,增强了长上下文语言模型的建模能力。

更新于 2025-12-10。作者:Xiaoran Liu、Yuerong Song、Zhigeng Liu、Zengfeng Huang、Qipeng Guo、Zhaoxiang Liu、Shiguo Lian、Ziwei He、Xipeng Qiu。

中文摘要

旋转位置嵌入(RoPE)已成为在大型语言模型(LLMs)中编码序列顺序的标准,通过在复平面上对查询和键向量进行旋转实现。然而,标准的实现仅利用复数值点积的实部来计算注意力分数。这种简化丢弃了包含宝贵相位信息的虚部,可能导致建模长上下文依赖关系时关系细节的潜在损失。在本文中,我们提出了一种扩展,该扩展重新整合了被丢弃的虚部。我们的方法利用完整的复数值表示来创建双成分注意力分数。我们从理论和实证上证明,这种方法通过保留更多位置信息,增强了长上下文依赖关系的建模。此外,在一系列长上下文语言建模基准测试中的评估表明,我们的方法在标准RoPE上始终如一地提高了性能,随着上下文长度的增加,这种好处变得更加显著。代码可在https://github.com/OpenMOSS/rope_pp上获取。

英文摘要

Rotary Position Embeddings (RoPE) have become a standard for encoding sequence order in Large Language Models (LLMs) by applying rotations to query and key vectors in the complex plane. Standard implementations, however, utilize only the real component of the complex-valued dot product for attention score calculation. This simplification discards the imaginary component, which contains valuable phase information, leading to a potential loss of relational details crucial for modeling long-context dependencies. In this paper, we propose an extension that re-incorporates this discarded imaginary component. Our method leverages the full complex-valued representation to create a dual-component attention score. We theoretically and empirically demonstrate that this approach enhances the modeling of long-context dependencies by preserving more positional information. Furthermore, evaluations on a suite of long-context language modeling benchmarks show that our method consistently improves performance over the standard RoPE, with the benefits becoming more significant as context length increases. The code is available at https://github.com/OpenMOSS/rope_pp.

解读

一句话总结

该论文提出了一种名为RoPE++的旋转位置编码扩展方法,通过重新引入被标准RoPE丢弃的虚部信息,增强了长上下文语言模型的建模能力。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源

机器可读索引:llms.txt