ChatPaper.aiChatPaper

Inferência Especulativa Distribuída de Modelos de Linguagem de Grande Escala

Distributed Speculative Inference of Large Language Models

May 23, 2024
Autores: Nadav Timor, Jonathan Mamou, Daniel Korat, Moshe Berchansky, Oren Pereg, Moshe Wasserblat, Tomer Galanti, Michal Gordon, David Harel
cs.AI

Resumo

Acelerar a inferência de grandes modelos de linguagem (LLMs) é um desafio importante na inteligência artificial. Este artigo introduz a inferência especulativa distribuída (DSI), um novo algoritmo de inferência distribuída que é comprovadamente mais rápido do que a inferência especulativa (SI) [leviathan2023fast, chen2023accelerating, miao2023specinfer] e a inferência autoregressiva tradicional (não-SI). Como outros algoritmos de SI, a DSI funciona em LLMs congelados, não requerendo treinamento ou modificações arquitetônicas, e preserva a distribuição alvo. Estudos anteriores sobre SI demonstraram acelerações empíricas (em comparação com a não-SI), mas exigem um LLM rascunhador rápido e preciso. Na prática, LLMs prontos para uso muitas vezes não possuem rascunhadores correspondentes que sejam suficientemente rápidos e precisos. Mostramos uma lacuna: a SI fica mais lenta do que a não-SI ao usar rascunhadores mais lentos ou menos precisos. Fechamos essa lacuna ao provar que a DSI é mais rápida do que tanto a SI quanto a não-SI, independentemente dos rascunhadores utilizados. Ao orquestrar múltiplas instâncias do modelo alvo e dos rascunhadores, a DSI não só é mais rápida do que a SI, mas também suporta LLMs que não podem ser acelerados com a SI. Nossas simulações mostram acelerações de LLMs prontos para uso em cenários realistas: a DSI é 1,29-1,92x mais rápida do que a SI.
English
Accelerating the inference of large language models (LLMs) is an important challenge in artificial intelligence. This paper introduces distributed speculative inference (DSI), a novel distributed inference algorithm that is provably faster than speculative inference (SI) [leviathan2023fast, chen2023accelerating, miao2023specinfer] and traditional autoregressive inference (non-SI). Like other SI algorithms, DSI works on frozen LLMs, requiring no training or architectural modifications, and it preserves the target distribution. Prior studies on SI have demonstrated empirical speedups (compared to non-SI) but require a fast and accurate drafter LLM. In practice, off-the-shelf LLMs often do not have matching drafters that are sufficiently fast and accurate. We show a gap: SI gets slower than non-SI when using slower or less accurate drafters. We close this gap by proving that DSI is faster than both SI and non-SI given any drafters. By orchestrating multiple instances of the target and drafters, DSI is not only faster than SI but also supports LLMs that cannot be accelerated with SI. Our simulations show speedups of off-the-shelf LLMs in realistic settings: DSI is 1.29-1.92x faster than SI.
PDF180December 15, 2024