PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise Training

要約

大規模言語モデル (LLM) は、事前定義されたコンテキスト長でトレーニングされるため、長い入力を必要とするシナリオでの使用が制限されます。
LLM をより長い長さに適応させるためのこれまでの取り組みでは、通常、この目標長での微調整 (全長微調整) が必要となり、集中的なトレーニング コストが発生します。
効率的なコンテキスト ウィンドウ拡張のためにターゲットの長さからトレインの長さを切り離すために、固定コンテキスト ウィンドウを使用して長い入力をスマートにシミュレートする Positional Skip-wisE (PoSE) トレーニングを提案します。
これは、最初に元のコンテキスト ウィンドウをいくつかのチャンクに分割し、次に個別のスキッピング バイアス項を設計して各チャンクの位置インデックスを操作することによって実現されます。
これらのバイアス項と各チャンクの長さはトレーニング例ごとに変更され、モデルがターゲット長内のすべての位置に適応できるようになります。
実験結果は、PoSE がパフォーマンスへの影響を最小限に抑えながら、全長微調整と比較してメモリと時間のオーバーヘッドを大幅に削減することを示しています。
この利点を活用して、2k トレーニング コンテキスト ウィンドウを使用して LLaMA モデルを 128k トークンまで拡張することに成功しました。
さらに、PoSE がすべての RoPE ベースの LLM および位置補間戦略と互換性があることを経験的に確認しています。
特に、私たちの方法は潜在的に無限の長さをサポートできますが、推論時のメモリ使用量によってのみ制限されます。
効率的な推論の継続的な進歩により、PoSE はコンテキスト ウィンドウを 128k を超えてさらに拡張できると考えています。

要約(オリジナル)

Large Language Models (LLMs) are trained with a pre-defined context length, restricting their use in scenarios requiring long inputs. Previous efforts for adapting LLMs to a longer length usually requires fine-tuning with this target length (Full-length fine-tuning), suffering intensive training cost. To decouple train length from target length for efficient context window extension, we propose Positional Skip-wisE (PoSE) training that smartly simulates long inputs using a fixed context window. This is achieved by first dividing the original context window into several chunks, then designing distinct skipping bias terms to manipulate the position indices of each chunk. These bias terms and the lengths of each chunk are altered for every training example, allowing the model to adapt to all positions within target length. Experimental results show that PoSE greatly reduces memory and time overhead compared with Full-length fine-tuning, with minimal impact on performance. Leveraging this advantage, we have successfully extended the LLaMA model to 128k tokens using a 2k training context window. Furthermore, we empirically confirm that PoSE is compatible with all RoPE-based LLMs and position interpolation strategies. Notably, our method can potentially support infinite length, limited only by memory usage in inference. With ongoing progress for efficient inference, we believe PoSE can further scale the context window beyond 128k.

arxiv情報

著者 Dawei Zhu,Nan Yang,Liang Wang,Yifan Song,Wenhao Wu,Furu Wei,Sujian Li
発行日 2024-02-21 13:37:07+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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