Extending Context Window of Large Language Models via Positional Interpolation

要約

我々は、LLaMA モデルなどの RoPE ベースの事前トレーニング済み LLM のコンテキスト ウィンドウ サイズを最小限の微調整 (1000 ステップ以内) で最大 32768 まで拡張する位置補間 (PI) を紹介し、長いコンテキストを必要とするさまざまなタスクで強力な経験的結果を示します。
これには、パスキーの取得、言語モデリング、LLaMA 7B から 65B までの長い文書の要約が含まれます。
一方、位置補間による拡張モデルは、元のコンテキスト ウィンドウ内のタスクの品質を比較的よく維持します。
この目標を達成するために、Position Interpolation は、自己注意メカニズムを完全に台無しにする壊滅的に高い注意スコアにつながる可能性があるトレーニングされたコンテキスト長を超えて外挿するのではなく、元のコンテキスト ウィンドウのサイズに一致するように入力位置インデックスを線形にダウンスケールします。
私たちの理論的研究により、内挿の上限は外挿の上限より少なくとも $\sim 600 \times$ 小さいことが示され、その安定性がさらに実証されました。
位置補間によって拡張されたモデルは、元のアーキテクチャを保持し、既存の最適化とインフラストラクチャのほとんどを再利用できます。

要約(オリジナル)

We present Position Interpolation (PI) that extends the context window sizes of RoPE-based pretrained LLMs such as LLaMA models to up to 32768 with minimal fine-tuning (within 1000 steps), while demonstrating strong empirical results on various tasks that require long context, including passkey retrieval, language modeling, and long document summarization from LLaMA 7B to 65B. Meanwhile, the extended model by Position Interpolation preserve quality relatively well on tasks within its original context window. To achieve this goal, Position Interpolation linearly down-scales the input position indices to match the original context window size, rather than extrapolating beyond the trained context length which may lead to catastrophically high attention scores that completely ruin the self-attention mechanism. Our theoretical study shows that the upper bound of interpolation is at least $\sim 600 \times$ smaller than that of extrapolation, further demonstrating its stability. Models extended via Position Interpolation retain its original architecture and can reuse most pre-existing optimization and infrastructure.

arxiv情報

著者 Shouyuan Chen,Sherman Wong,Liangjian Chen,Yuandong Tian
発行日 2023-06-28 04:26:05+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.CL, cs.LG パーマリンク