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

RoPE 的基数约束上下文长度

Base of RoPE Bounds Context Length

Baichuan Inc.(百川智能);ISCAS(中国科学院软件研究所)

Xin Men, Mingyu Xu, Bingning Wang, Qingyu Zhang, Hongyu Lin, Xianpei Han, Weipeng Chen

AI总结:

本文发现基于OOD理论的RoPE长上下文能力可能表面化,提出RoPE的base参数存在绝对下界约束上下文长度,并从理论和实证揭示二者关系,为长上下文训练提供新视角。

摘要:

位置嵌入是当前大型语言模型(LLM)的核心组成部分。旋转位置嵌入(RoPE)是一种利用旋转矩阵编码位置信息的技术,已成为许多 LLM(如 Llama 系列)中位置嵌入的事实标准选择。RoPE 进一步被用于扩展长上下文能力,这大致基于调整 RoPE 的 base 参数以缓解位置嵌入中的分布外(OOD)问题。然而,在本文中,我们发现 LLM 可能基于 OOD 理论获得一种表面的长上下文能力。我们重新审视了 RoPE 在 LLM 中的作用,并提出了一种新的长期衰减性质,推导出 RoPE 的 base 约束上下文长度:对于获得特定上下文长度能力,base 值存在一个绝对下界。我们的工作从理论和实证两方面揭示了上下文长度与 RoPE base 之间的关系,这可能为未来的长上下文训练提供启示。

英文摘要:

Position embedding is a core component of current Large Language Models (LLMs). Rotary position embedding (RoPE), a technique that encodes the position information with a rotation matrix, has been the de facto choice for position embedding in many LLMs, such as the Llama series. RoPE has been further utilized to extend long context capability, which is roughly based on adjusting the \textit{base} parameter of RoPE to mitigate out-of-distribution (OOD) problems in position embedding. However, in this paper, we find that LLMs may obtain a superficial long-context ability based on the OOD theory. We revisit the role of RoPE in LLMs and propose a novel property of long-term decay, we derive that the \textit{base of RoPE bounds context length}: there is an absolute lower bound for the base value to obtain certain context length capability. Our work reveals the relationship between context length and RoPE base both theoretically and empirically, which may shed light on future long context training.

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

↑