ChatPaper.aiChatPaper

Inferencia Especulativa Distribuida de Modelos de Lenguaje a Gran 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

Resumen

Acelerar la inferencia de modelos de lenguaje grandes (LLMs, por sus siglas en inglés) es un desafío importante en la inteligencia artificial. Este artículo introduce la inferencia especulativa distribuida (DSI, por sus siglas en inglés), un novedoso algoritmo de inferencia distribuida que es demostrablemente más rápido que la inferencia especulativa (SI) [leviathan2023fast, chen2023accelerating, miao2023specinfer] y la inferencia autoregresiva tradicional (no SI). Al igual que otros algoritmos de SI, DSI funciona en LLMs congelados, sin requerir entrenamiento ni modificaciones arquitectónicas, y preserva la distribución objetivo. Estudios previos sobre SI han demostrado aceleraciones empíricas (en comparación con no SI) pero requieren un LLM "draft" rápido y preciso. En la práctica, los LLMs disponibles a menudo no tienen "drafts" coincidentes que sean lo suficientemente rápidos y precisos. Mostramos una brecha: SI se vuelve más lento que no SI cuando se utilizan "drafts" más lentos o menos precisos. Cerramos esta brecha demostrando que DSI es más rápido que tanto SI como no SI con cualquier "draft". Al orquestar múltiples instancias del modelo objetivo y los "drafts", DSI no solo es más rápido que SI, sino que también admite LLMs que no pueden acelerarse con SI. Nuestras simulaciones muestran aceleraciones de LLMs disponibles en entornos realistas: DSI es 1.29-1.92 veces más rápido que 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.
PDF190December 15, 2024