LM-Infinite: Simple On-the-Fly Length Generalization for Large Language Models

要約

近年、さまざまなドメインにわたって、Transformer ベースの大規模言語モデル (LLM) のパフォーマンスが目覚ましい進歩を遂げています。
これらの LLM はますます複雑なタスクに導入されるため、より長い推論プロセスを実行したり、より大きなコンテキストを理解したりする必要に直面することがよくあります。
このような状況では、長いシーケンスにおける LLM の長さ汎化の失敗がより顕著になります。
ほとんどの事前トレーニング スキームは、トレーニング シーケンスを固定長に切り詰めます。
LLM は、この問題に対処するために設計された相対位置エンコーディングを使用しても、長いコンテキストの後に下流タスクを実行することはおろか、流暢で一貫したテキストを生成するのに苦労することがよくあります。
長いコーパスの微調整などの一般的なソリューションには、多くの場合、膨大なハードウェアと時間のコストがかかり、慎重なトレーニング プロセス設計が必要です。
既存の LLM の発電能力をより効率的に活用するために、この問題に寄与する主な配電外 (OOD) 要因を理論的および経験的に調査します。
この診断に触発されて、私たちは、オンザフライ長さの一般化のためのシンプルかつ効果的なソリューションである LM-Infinite を提案します。
これには、$\Lambda$ 型のアテンション マスク (過剰な出席トークンを避けるため) と距離制限 (目に見えない距離を避けるため) のみが含まれ、パラメーターの更新や学習は必要ありません。
相対位置エンコード方式を使用するさまざまな LLM に適用できることがわかりました。
LM-Infinite は $O(n)$ の時間とスペースで計算効率が高く、ArXiv および OpenWebText2 データセット上の 32,000 トークンまで一貫したテキスト生成の流暢性と品質を示し、デコード速度が 2.72 倍向上します。
パスキーの取得などの下流タスクでは、バニラ モデルがすぐに失敗するトレーニング期間よりもはるかに長い時間入力を処理し続けます。

要約(オリジナル)

In recent years, there have been remarkable advancements in the performance of Transformer-based Large Language Models (LLMs) across various domains. As these LLMs are deployed for increasingly complex tasks, they often face the need to conduct longer reasoning processes or understand larger contexts. In these situations, the length generalization failure of LLMs on long sequences becomes more prominent. Most pre-training schemes truncate training sequences to a fixed length. LLMs often struggle to generate fluent and coherent texts, let alone carry out downstream tasks, after longer contexts, even with relative positional encoding designed to cope with this problem. Common solutions such as finetuning on longer corpora often involve daunting hardware and time costs and require careful training process design. To more efficiently leverage the generation capacity of existing LLMs, we theoretically and empirically investigate the main out-of-distribution (OOD) factors contributing to this problem. Inspired by this diagnosis, we propose a simple yet effective solution for on-the-fly length generalization, LM-Infinite. It involves only a $\Lambda$-shaped attention mask (to avoid excessive attended tokens) and a distance limit (to avoid unseen distances) while requiring no parameter updates or learning. We find it applicable to a variety of LLMs using relative-position encoding methods. LM-Infinite is computationally efficient with $O(n)$ time and space, and demonstrates consistent text generation fluency and quality to as long as 32k tokens on ArXiv and OpenWebText2 datasets, with 2.72x decoding speedup. On downstream tasks such as passkey retrieval, it continues to work on inputs much longer than training lengths where vanilla models fail immediately.

arxiv情報

著者 Chi Han,Qifan Wang,Wenhan Xiong,Yu Chen,Heng Ji,Sinong Wang
発行日 2023-09-05 15:09:11+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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