旋转位置嵌入(RoPE)已被证明在基于transformer的语言模型中能够有效编码位置信息。然而,这些模型无法泛化到它们训练时的序列长度之外。我们提出了YaRN(Yet another RoPE扩展方法),一种计算高效的扩展此类模型上下文窗口的方法,仅需比先前方法少10倍的token和2.5倍的训练步骤。使用YaRN,我们展示了LLaMA模型可以有效地利用并扩展到远超其原始预训练允许的上下文长度,同时在上下文窗口扩展方面超越了先前的最先进水平。此外,我们还证明YaRN具备超越微调数据集有限上下文的能力。代码可在https://github.com/jquesnelle/yarn上获取。
英文摘要:
Rotary Position Embeddings (RoPE) have been shown to effectively encode positional information in transformer-based language models. However, these models fail to generalize past the sequence length they were trained on. We present YaRN (Yet another RoPE extensioN method), a compute-efficient method to extend the context window of such models, requiring 10x less tokens and 2.5x less training steps than previous methods. Using YaRN, we show that LLaMA models can effectively utilize and extrapolate to context lengths much longer than their original pre-training would allow, while also surpassing previous the state-of-the-art at context window extension. In addition, we demonstrate that YaRN exhibits the capability to extrapolate beyond the limited context of a fine-tuning dataset. Code is available at https://github.com/jquesnelle/yarn
Exploring Context Window of Large Language Models via Decomposed Positional Vectors
Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学高瓴人工智能学院);Baichuan Inc.(百川公司);School of Information, Renmin University of China(中国人民大学信息学院);Department of Computer Science, National University of Singapore(新加坡国立大学计算机科学系)
PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise Training
Microsoft Corporation(微软公司);School of Computer Science, Peking University(北京大学计算机学院);National Key Laboratory for Multimedia Information Processing, Peking University(北京大学多媒体信息处理国家重点实验室)
Stacked from One: Multi-Scale Self-Injection for Context Window Extension
Singapore University of Technology and Design (SUTD)(新加坡科技设计大学);Singapore Management University (SMU)(新加坡管理大学);Nanyang Technological University (NTU)(南洋理工大学);National University of Singapore (NUS)(新加坡国立大学)
E^2-LLM: Efficient and Extreme Length Extension of Large Language Models
Alibaba Group(阿里巴巴集团);University of Waterloo(滑铁卢大学);The Chinese University of Hong Kong(香港中文大学);The Hong Kong University of Science and Technology(香港科技大学)
Scaling External Knowledge Input Beyond Context Windows of LLMs via Multi-Agent Collaboration
Dept. of Comp. Sci. & Tech., Institute for AI, Tsinghua University, Beijing, China(计算机科学与技术系,人工智能研究院,清华大学,北京,中国);Institute for AI Industry Research (AIR), Tsinghua University, Beijing, China(人工智能产业研究院(AIR),清华大学,北京,中国);Institute of Intelligent Computing, Alibaba Group(智能计算研究院,阿里巴巴集团)