LongRoPE2: ほぼロスレスなLLMコンテキストウィンドウの拡張
LongRoPE2: Near-Lossless LLM Context Window Scaling
February 27, 2025
著者: Ning Shang, Li Lyna Zhang, Siyuan Wang, Gaokai Zhang, Gilsinia Lopez, Fan Yang, Weizhu Chen, Mao Yang
cs.AI
要旨
LongRoPE2は、事前学習済み大規模言語モデル(LLM)の有効なコンテキストウィンドウを目標長に拡張しつつ、元の短いコンテキストウィンドウでの性能を維持する新しいアプローチです。これは以下の3つの貢献によって実現されています:(1) 既存手法で観察される持続的な分布外(OOD)問題の原因として、高次元RoPEにおける不十分な訓練が寄与しているという仮説;(2) 不十分な訓練問題に対処するため、「ニードル駆動」パープレキシティに基づく進化的探索を採用した効果的なRoPEリスケーリングアルゴリズム;(3) 長文コンテキストシーケンスに対してリスケーリングされたRoPEを適用しつつ、短文コンテキスト性能を元のRoPEで維持する混合コンテキストウィンドウ訓練手法。LLaMA3-8BおよびPhi3-mini-3.8Bを用いた様々なベンチマークでの広範な実験により、この仮説が検証され、LongRoPE2の有効性が実証されました。特に、LongRoPE2はLLaMA3-8Bの有効コンテキスト長を128Kに拡張し、短文コンテキスト性能の98.5%以上を維持しながら、わずか10Bトークンでこれを達成しています。これはMetaのアプローチの80分の1のトークン数であり、Metaの手法は目標の有効コンテキスト長に到達できませんでした。コードはhttps://github.com/microsoft/LongRoPEで公開予定です。
English
LongRoPE2 is a novel approach that extends the effective context window of
pre-trained large language models (LLMs) to the target length, while preserving
the performance on the original shorter context window. This is achieved by
three contributions: (1) a hypothesis that insufficient training in higher RoPE
dimensions contributes to the persistent out-of-distribution (OOD) issues
observed in existing methods; (2) an effective RoPE rescaling algorithm that
adopts evolutionary search guided by "needle-driven" perplexity to address the
insufficient training problem; (3) a mixed context window training approach
that fine-tunes model weights to adopt rescaled RoPE for long-context sequences
while preserving the short-context performance with the original RoPE.
Extensive experiments on LLaMA3-8B and Phi3-mini-3.8B across various benchmarks
validate the hypothesis and demonstrate the effectiveness of LongRoPE2.
Remarkably, LongRoPE2 extends LLaMA3-8B to achieve a 128K effective context
length while retaining over 98.5% of short-context performance, using only 10B
tokens -- 80x fewer than Meta's approach, which fails to reach the target
effective context length. Code will be available at
https://github.com/microsoft/LongRoPE.Summary
AI-Generated Summary