SpecExec: Massively Parallel Speculative Decoding for Interactive LLM Inference on Consumer Devices

要約

大規模な言語モデルが広く採用されるにつれて、それらを効率的に実行することが重要になります。
LLM 推論に関する最近の研究では、投機的デコードを使用して極端な高速化を実現しています。
ただし、これらの作品のほとんどは、ハイエンド データセンター ハードウェア向けのアルゴリズムを暗黙的に設計しています。
この研究では、私たちは逆の質問をします。消費者向けマシンで LLM をどれくらい速く実行できるか?
コンシューマ GPU は、利用可能な最大のモデル (50B 以上のパラメータ) に適合できなくなり、RAM または SSD にオフロードする必要があります。
オフロードされたパラメーターを使用して実行すると、推論エンジンは数百または数千のトークンのバッチを 1 つのトークンと同時に処理できるため、投機的なデコードに自然に適合します。
私たちは、一般的な LLM ファミリに対してターゲット モデルの反復ごとに最大 20 個のトークンを生成できるシンプルな並列デコード手法である SpecExec (投機的実行) を提案します。
これは、最新の LLM のトークン確率分布の急激な変化と、モデル出力確率間の高度な整合性を利用します。
SpecExec は、ドラフト モデルから最も可能性の高い継続トークンを取得して、ターゲット モデルの「キャッシュ」ツリーを構築し、単一パスで検証されます。
SpecExec を使用して、4 ビット量子化で 1 秒あたり 4 ~ 6 トークン、または 16 ビット重みで 1 秒あたり 2 ~ 3 トークンで RAM オフロードを行うコンシューマ GPU 上で 50B 以上のパラメータ LLM の推論を実証します。

要約(オリジナル)

As large language models gain widespread adoption, running them efficiently becomes crucial. Recent works on LLM inference use speculative decoding to achieve extreme speedups. However, most of these works implicitly design their algorithms for high-end datacenter hardware. In this work, we ask the opposite question: how fast can we run LLMs on consumer machines? Consumer GPUs can no longer fit the largest available models (50B+ parameters) and must offload them to RAM or SSD. When running with offloaded parameters, the inference engine can process batches of hundreds or thousands of tokens at the same time as just one token, making it a natural fit for speculative decoding. We propose SpecExec (Speculative Execution), a simple parallel decoding method that can generate up to 20 tokens per target model iteration for popular LLM families. It utilizes the high spikiness of the token probabilities distribution in modern LLMs and a high degree of alignment between model output probabilities. SpecExec takes the most probable tokens continuation from the draft model to build a ‘cache’ tree for the target model, which then gets validated in a single pass. Using SpecExec, we demonstrate inference of 50B+ parameter LLMs on consumer GPUs with RAM offloading at 4-6 tokens per second with 4-bit quantization or 2-3 tokens per second with 16-bit weights.

arxiv情報

著者 Ruslan Svirschevski,Avner May,Zhuoming Chen,Beidi Chen,Zhihao Jia,Max Ryabinin
発行日 2024-06-04 17:53:36+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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