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

为什么大语言模型的有效上下文长度不足?

Why Does the Effective Context Length of LLMs Fall Short?

The University of Hong Kong(香港大学);ByteDance Inc.(字节跳动公司);University of Illinois Urbana-Champaign(伊利诺伊大学厄巴纳-香槟分校)

Chenxin An, Jun Zhang, Ming Zhong, Lei Li, Shansan Gong, Yao Luo, Jingjing Xu, Lingpeng Kong

AI总结:

本研究发现开源 LLM 有效上下文长度受相对位置频率左偏限制,提出推理时移动位置的 STRING,无需训练即显著提升长上下文性能。

摘要:

分布式训练和高效注意力机制的进展显著扩大了大语言模型(LLM)的上下文窗口大小。然而,近期研究表明,开源 LLM 的有效上下文长度往往不足,通常不超过其训练长度的一半。在本研究中,我们将这一局限归因于 LLM 预训练和后训练阶段形成的相对位置频率分布左偏,这会阻碍其有效收集远距离信息的能力。为应对这一挑战,我们提出 ShifTed Rotray position embeddING(STRING)。STRING 在推理期间移动训练良好的位置,以覆盖原本无效的位置,从而提升其在现有训练长度内的性能。实验结果表明,无需额外训练,STRING 即可使最新的大规模模型(如 Llama3.1 70B 和 Qwen2 72B)在流行的长上下文基准 RULER 和 InfiniteBench 上性能大幅提升超过 10 分,为开源 LLM 建立了新的最先进结果。与商业模型相比,采用 STRING 的 Llama 3.1 70B 甚至取得了优于 GPT-4-128K 的性能,并明显超越 Claude 2 和 Kimi-chat。

英文摘要:

Advancements in distributed training and efficient attention mechanisms have significantly expanded the context window sizes of large language models (LLMs). However, recent work reveals that the effective context lengths of open-source LLMs often fall short, typically not exceeding half of their training lengths. In this work, we attribute this limitation to the left-skewed frequency distribution of relative positions formed in LLMs pretraining and post-training stages, which impedes their ability to effectively gather distant information. To address this challenge, we introduce ShifTed Rotray position embeddING (STRING). STRING shifts well-trained positions to overwrite the original ineffective positions during inference, enhancing performance within their existing training lengths. Experimental results show that without additional training, STRING dramatically improves the performance of the latest large-scale models, such as Llama3.1 70B and Qwen2 72B, by over 10 points on popular long-context benchmarks RULER and InfiniteBench, establishing new state-of-the-art results for open-source LLMs. Compared to commercial models, Llama 3.1 70B with \method even achieves better performance than GPT-4-128K and clearly surpasses Claude 2 and Kimi-chat.

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

↑