arXiv:2410.01490cs.CL2024-10EMNLP被引 10

从旋转角度分布出发,提升大模型长文本处理能力。

Extending Context Window of Large Language Models from a Distributional Perspective

  • 通过分析旋转位置编码的角度分布,优化长文本扩展策略。
  • 扩展至8k时降低72%分布扰动,16k时降低32%。
  • 在LongBench-E上提升4.33%,性能稳定无明显下降。

扩大基于旋转位置编码(RoPE)的大语言模型上下文窗口已成为常见方法,但现有扩展方式多依赖经验,缺乏对RoPE内部分布的深入理解,导致性能不佳。本文从旋转角度分布视角优化扩展过程:首先估计模型内旋转角度的分布,并分析长度扩展对其扰动程度;提出一种新策略,最小化扩展前后角度分布的差异,保持与预训练阶段的一致性,增强模型对长序列的泛化能力。实验表明,在将LLaMA2上下文窗口扩展至8k时,分布扰动减少72%;扩展至16k时减少32%。在LongBench-E基准上,平均性能提升达4.33%,优于现有最优方法。同时,模型在Hugging Face Open LLM基准上的表现波动仅在-0.12至+0.22之间,保持稳定。

原文摘要 · Abstract (English)

Scaling the rotary position embedding (RoPE) has become a common method for extending the context window of RoPE-based large language models (LLMs). However, existing scaling methods often rely on empirical approaches and lack a profound understanding of the internal distribution within RoPE, resulting in suboptimal performance in extending the context window length. In this paper, we propose to optimize the context window extending task from the view of rotary angle distribution. Specifically, we first estimate the distribution of the rotary angles within the model and analyze the extent to which length extension perturbs this distribution. Then, we present a novel extension strategy that minimizes the disturbance between rotary angle distributions to maintain consistency with the pre-training phase, enhancing the model's capability to generalize to longer sequences. Experimental results compared to the strong baseline methods demonstrate that our approach reduces by up to 72% of the distributional disturbance when extending LLaMA2's context window to 8k, and reduces by up to 32% when extending to 16k. On the LongBench-E benchmark, our method achieves an average improvement of up to 4.33% over existing state-of-the-art methods. Furthermore, Our method maintains the model's performance on the Hugging Face Open LLM benchmark after context window extension, with only an average performance fluctuation ranging from -0.12 to +0.22.

大模型上下文扩展位置编码分布优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。