arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.05209cs.CLcs.AI
收藏

基于RoPE的外推缩放定律

Scaling Laws of RoPE-based Extrapolation

Shanghai AI Lab(上海人工智能实验室);School of Computer Science, Fudan University(复旦大学计算机科学技术学院)

Xiaoran Liu, Hang Yan, Shuo Zhang, Chenxin An, Xipeng Qiu, Dahua Lin

AI总结:

本文提出RoPE外推缩放定律,从周期视角统一描述基数值与微调长度对外推性能的影响,并揭示外推临界维度,在LLaMA2上以16K训练长度实现100万上下文外推。

摘要:

基于旋转位置嵌入(RoPE)的大型语言模型(LLM)的外推能力目前是一个备受关注的话题。解决LLM外推问题的主流方法涉及修改RoPE,将原始RoPE中$θ_n={10000}^{-2n/d}$的旋转基数10000替换为更大的值,并提供更长的微调文本。在这项工作中,我们首先观察到,在预训练上下文长度内使用更小或更大的基数对基于RoPE的LLM进行微调,可以显著增强其外推性能。之后,我们提出了\textbf{\textit{基于RoPE的外推缩放定律}},一个从周期视角出发的统一框架,用于描述外推性能与基数值以及微调上下文长度之间的关系。在此过程中,我们还通过\textbf{\textit{外推临界维度}}解释了基于RoPE的外推问题的起源。除了这些观察和分析,我们在LLaMA2 7B和13B上仅用16K训练长度就实现了高达100万上下文长度的外推。

英文摘要:

The extrapolation capability of Large Language Models (LLMs) based on Rotary Position Embedding is currently a topic of considerable interest. The mainstream approach to addressing extrapolation with LLMs involves modifying RoPE by replacing 10000, the rotary base of $θ_n={10000}^{-2n/d}$ in the original RoPE, with a larger value and providing longer fine-tuning text. In this work, we first observe that fine-tuning a RoPE-based LLM with either a smaller or larger base in pre-training context length could significantly enhance its extrapolation performance. After that, we propose \textbf{\textit{Scaling Laws of RoPE-based Extrapolation}}, a unified framework from the periodic perspective, to describe the relationship between the extrapolation performance and base value as well as tuning context length. In this process, we also explain the origin of the RoPE-based extrapolation issue by \textbf{\textit{critical dimension for extrapolation}}. Besides these observations and analyses, we achieve extrapolation up to 1 million context length within only 16K training length on LLaMA2 7B and 13B.

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

↑