Turning Trash into Treasure: Accelerating Inference of Large Language Models with Token Recycling

要約

大規模言語モデル (LLM) のパラメーターの急速な増加により、推論の遅延が根本的なボトルネックとなり、LLM の広範な適用が制限されています。
投機的デコードは、最新のハードウェアの並列機能を活用し、推測と検証のパラダイムを通じて推論を加速するロスレス アプローチを表します。
一部の投機的デコード手法は、小さなモデルやパラメーター効率の高いアーキテクチャなど、ドラフト トークンを推測するための追加の構造に依存しており、使用前に追加のトレーニングが必要です。
あるいは、検索ベースのトレインフリー技術は、既存のコーパスから、または N グラム生成によってライブラリを構築します。
ただし、大規模なストレージ要件、時間のかかる検索、限られた適応性などの課題に直面しています。
デコードプロセス中に生成された候補トークンが将来のシーケンスで再び発生する可能性が高いことを観察し、トークンのリサイクルを提案します。
このアプローチでは、候補トークンを隣接行列に格納し、その行列に対して幅優先検索 (BFS) のようなアルゴリズムを使用してドラフト ツリーを構築します。
次に、ツリーはツリー アテンションを通じて検証されます。
デコード プロセスからの新しい候補トークンは、マトリックスを更新するために使用されます。
トークン リサイクルには \textless2MB の追加ストレージが必要で、すべてのサイズの LLM で約 2 倍の高速化を実現します。
これは、既存のトレーニングを必要としないメソッドよりも 30\% 優れており、トレーニングメソッドよりも 25\% も優れています。
これは、調整を必要とせずに、既存の LLM およびタスクに直接適用できます。

要約(オリジナル)

The rapid growth in the parameters of large language models (LLMs) has made inference latency a fundamental bottleneck, limiting broader application of LLMs. Speculative decoding represents a lossless approach to accelerate inference through a guess-and-verify paradigm, leveraging the parallel capabilities of modern hardware. Some speculative decoding methods rely on additional structures to guess draft tokens, such as small models or parameter-efficient architectures, which need extra training before use. Alternatively, retrieval-based train-free techniques build libraries from pre-existing corpora or by n-gram generation. However, they face challenges like large storage requirements, time-consuming retrieval, and limited adaptability. Observing that candidate tokens generated during the decoding process are likely to reoccur in future sequences, we propose Token Recycling. This approach stores candidate tokens in an adjacency matrix and employs a breadth-first search (BFS)-like algorithm on the matrix to construct a draft tree. The tree is then validated through tree attention. New candidate tokens from the decoding process are then used to update the matrix. Token Recycling requires \textless2MB of additional storage and achieves approximately 2x speedup across all sizes of LLMs. It significantly outperforms existing train-free methods by 30\% and even a training method by 25\%. It can be directly applied to any existing LLMs and tasks without the need for adaptation.

arxiv情報

著者 Xianzhen Luo,Yixuan Wang,Qingfu Zhu,Zhiming Zhang,Xuanyu Zhang,Qing Yang,Dongliang Xu,Wanxiang Che
発行日 2024-08-16 12:20:56+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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