LLMCad: Fast and Scalable On-device Large Language Model Inference

要約

テキスト生成や質問応答などの生成タスクは、モバイル アプリケーションの領域で重要な位置を占めています。
プライバシーの問題に敏感であるため、モバイル デバイス上で直接実行する需要が高まっています。
現在、これらの生成タスクの実行は大規模言語モデル (LLM) に大きく依存しています。
それにもかかわらず、これらのデバイスのメモリ容量は限られているため、このようなモデルのスケーラビリティには大きな課題が生じます。
私たちの研究では、効率的な生成自然言語処理 (NLP) タスクのために特別に設計された革新的なオンデバイス推論エンジンである LLMCad を紹介します。
LLMCad の背後にある中心的なアイデアは、モデルのコラボレーションを中心に展開しています。メモリ内に常駐するコンパクトな LLM が最も単純なトークンの生成を担当し、高精度 LLM がこれらのトークンを検証し、特定されたエラーを修正します。
LLMCad には、次の 3 つの新しい技術が組み込まれています。 (1) 候補トークンを順次生成する代わりに、LLMCad はより小さい LLM を使用して、より広範囲の妥当なトークン パスウェイを網羅するトークン ツリーを構築します。
その後、より大きな LLM がこれらすべての経路を同時に効率的に検証できます。
(2) 自己調整フォールバック戦略を採用しており、小規模な LLM が誤ったトークンを生成するたびに検証プロセスを迅速に開始します。
(3) トークン生成の継続的なフローを確保するために、LLMCad は、コンピューティング IO パイプラインを実装することにより、検証プロセス中に投機的にトークンを生成します。
広範な一連の実験を通じて、LLMCad は驚異的なトークン生成速度を示し、既存の推論エンジンよりも最大 9.3 倍の速度を達成しました。

要約(オリジナル)

Generative tasks, such as text generation and question answering, hold a crucial position in the realm of mobile applications. Due to their sensitivity to privacy concerns, there is a growing demand for their execution directly on mobile devices. Currently, the execution of these generative tasks heavily depends on Large Language Models (LLMs). Nevertheless, the limited memory capacity of these devices presents a formidable challenge to the scalability of such models. In our research, we introduce LLMCad, an innovative on-device inference engine specifically designed for efficient generative Natural Language Processing (NLP) tasks. The core idea behind LLMCad revolves around model collaboration: a compact LLM, residing in memory, takes charge of generating the most straightforward tokens, while a high-precision LLM steps in to validate these tokens and rectify any identified errors. LLMCad incorporates three novel techniques: (1) Instead of generating candidate tokens in a sequential manner, LLMCad employs the smaller LLM to construct a token tree, encompassing a wider range of plausible token pathways. Subsequently, the larger LLM can efficiently validate all of these pathways simultaneously. (2) It employs a self-adjusting fallback strategy, swiftly initiating the verification process whenever the smaller LLM generates an erroneous token. (3) To ensure a continuous flow of token generation, LLMCad speculatively generates tokens during the verification process by implementing a compute-IO pipeline. Through an extensive series of experiments, LLMCad showcases an impressive token generation speed, achieving rates up to 9.3x faster than existing inference engines.

arxiv情報

著者 Daliang Xu,Wangsong Yin,Xin Jin,Ying Zhang,Shiyun Wei,Mengwei Xu,Xuanzhe Liu
発行日 2023-09-08 10:44:19+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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