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

要約

近年、さまざまなドメインにわたって、Transformer ベースの大規模言語モデル (LLM) のパフォーマンスが目覚ましい進歩を遂げています。
これらの LLM は、ますます複雑なタスクに導入されるため、より長い推論プロセスを実行したり、より大きなコンテキストを理解したりする必要に直面することがよくあります。
このような状況では、長いシーケンスにおける LLM の長さ汎化の失敗がより顕著になります。
ほとんどの事前トレーニング スキームは、トレーニング シーケンスを固定長 (LLaMa の 2048 など) に切り詰めます。
LLM は、この問題に対処するように設計された相対位置エンコーディングを使用しても、長いコンテキストの後に下流タスクを実行することはおろか、流暢なテキストを生成するのに苦労することがよくあります。
より長いコーパスの微調整などの一般的なソリューションには、多くの場合、膨大なハードウェアと時間のコストがかかり、慎重なトレーニング プロセス設計が必要です。
既存の LLM の発電能力をより効率的に活用するために、この問題に寄与する主な配電外 (OOD) 要因を理論的および経験的に調査します。
この診断に触発されて、我々は、パラメータの更新や学習を必要とせず、$\Lambda$ 型のアテンション マスクと距離制限のみを必要とする、オンザフライの長さ一般化のためのシンプルかつ効果的なソリューションである LM-Infinite を提案します。
相対位置エンコード方式を使用するさまざまな 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 needs to conduct longer reasoning processes or understanding larger contexts. In these situations, the length generalization failure of LLMs on long sequences become more prominent. Most pre-training schemes truncate training sequences to a fixed length (such as 2048 for LLaMa). LLMs often struggle to generate fluent texts, let alone carry out downstream tasks, after longer contexts, even with relative positional encoding which is designed to cope with this problem. Common solutions such as finetuning on longer corpora often involves daunting hardware and time costs and requires 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, which involves only a $\Lambda$-shaped attention mask and a distance limit while requiring no parameter updates or learning. We find it applicable to a variety of LLMs using relative-position encoding methods. LM-Infinite is computational efficient with $O(n)$ time and space, and demonstrates consistent fluency and generation quality to as long as 32k tokens on ArXiv and OpenWebText2 datasets, with 2.72x decoding speedup. On downstream task 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-08-30 16:47:51+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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