Soaring from 4K to 400K: Extending LLM’s Context with Activation Beacon

要約

長いコンテキストの利用は、コンテキストウィンドウのサイズが限られているため、LLMにとって大きな課題となる。コンテキストウィンドウは微調整により拡張可能であるが、学習時と推論時の両方でかなりのコストがかかり、LLMの本来の能力に好ましくない影響を与える。本研究では、LLMが限られた文脈ウィンドウでより長い文脈を認識できるように、LLMの生の活性化をコンパクトな形に凝縮する、活性化ビーコンと呼ばれる新しい手法を提案する。アクティベーションビーコンはプラグインモジュールとして導入され、短い文脈におけるLLMの本来の能力を完全に保持する。スライディングウィンドウと連携して長い文脈をストリーミング処理することで、学習と推論の両方においてメモリ効率と時間効率を向上させる。Activation Beaconは、様々な凝縮比の短列データを用いて学習される。このような処理のおかげで、少ない学習コストで、異なる文脈の長さを効果的に学習することができる。我々の実験により、Activation Beaconの文脈拡張の有効性が検証された:Llama-2-7Bの文脈を$times100$倍(4Kから400Kへ)高品質に拡張することができる。ソースコードとモデルのチェックポイントは♪url{https://github.com/FlagOpen/FlagEmbedding}にあります。

要約(オリジナル)

The utilization of long contexts poses a big challenge for LLMs due to their limited context window size. Although the context window can be extended through fine-tuning, it will result in a considerable cost at both training and inference time, and exert an unfavorable impact to the LLM’s original capabilities. In this work, we propose a new method called Activation Beacon, which condenses LLM’s raw activations into compact forms such that the LLM can perceive a longer context with a limited context window. Activation Beacon is introduced as a plug-in module, which fully preserves the LLM’s original capability in short contexts. It works with the sliding window to streamingly process the long context, which leads to a competitive memory and time efficiency in both training and inference. Activation Beacon is trained with short-sequence data of diversified condensing ratios. Thanks to such a treatment, it can be effectively learned to support different context lengths with a small training cost. Our experiment verifies Activation Beacon’s effectiveness of context extension: it can remarkably accomplish high-quality extension of Llama-2-7B’s context by $\times100$ times (from 4K to 400K); meanwhile, it can also achieve superior performances across a variety of long-context language modeling and understanding tasks. The source code and model checkpoint are available at \url{https://github.com/FlagOpen/FlagEmbedding}.

arxiv情報

著者 Peitian Zhang,Zheng Liu,Shitao Xiao,Ninglu Shao,Qiwei Ye,Zhicheng Dou
発行日 2024-02-02 12:34:25+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, DeepL

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