ChatPaper.aiChatPaper

Inférence Hogwild! : Génération parallèle de modèles de langage via une attention concurrente

Hogwild! Inference: Parallel LLM Generation via Concurrent Attention

April 8, 2025
Auteurs: Gleb Rodionov, Roman Garipov, Alina Shutova, George Yakushev, Vage Egiazarian, Anton Sinitsin, Denis Kuznedelev, Dan Alistarh
cs.AI

Résumé

Les grands modèles de langage (LLMs) ont démontré leur capacité à traiter des tâches de plus en plus complexes grâce à un raisonnement avancé, la génération de contenus longs et l'utilisation d'outils. La résolution de ces tâches implique souvent des calculs longs au moment de l'inférence. Dans la résolution de problèmes humains, une stratégie courante pour accélérer le travail est la collaboration : en divisant le problème en sous-tâches, en explorant différentes stratégies de manière concurrente, etc. Des recherches récentes ont montré que les LLMs peuvent également fonctionner en parallèle en mettant en œuvre des cadres de coopération explicites, tels que des mécanismes de vote ou la création explicite de sous-tâches indépendantes pouvant être exécutées en parallèle. Cependant, chacun de ces cadres peut ne pas être adapté à tous les types de tâches, ce qui peut limiter leur applicabilité. Dans ce travail, nous proposons une approche de conception différente : nous exécutons des "travailleurs" LLM en parallèle, en leur permettant de se synchroniser via un cache d'attention mis à jour de manière concurrente, et en incitant ces travailleurs à décider de la meilleure manière de collaborer. Notre approche permet aux instances de concevoir leur propre stratégie de collaboration pour le problème en cours, tout en "voyant" les progrès partiels des autres dans le cache concurrent. Nous implémentons cette approche via Hogwild! Inference : un moteur d'inférence parallèle pour LLM où plusieurs instances du même LLM fonctionnent en parallèle avec le même cache d'attention, avec un accès "instantané" aux tokens générés par les autres. Hogwild! Inference tire parti des Rotary Position Embeddings (RoPE) pour éviter les recalculs tout en améliorant l'utilisation du matériel parallèle. Nous constatons que les LLM modernes capables de raisonnement peuvent effectuer une inférence avec un cache Key-Value partagé sans nécessiter de réglage supplémentaire.
English
Large Language Models (LLMs) have demonstrated the ability to tackle increasingly complex tasks through advanced reasoning, long-form content generation, and tool use. Solving these tasks often involves long inference-time computations. In human problem solving, a common strategy to expedite work is collaboration: by dividing the problem into sub-tasks, exploring different strategies concurrently, etc. Recent research has shown that LLMs can also operate in parallel by implementing explicit cooperation frameworks, such as voting mechanisms or the explicit creation of independent sub-tasks that can be executed in parallel. However, each of these frameworks may not be suitable for all types of tasks, which can hinder their applicability. In this work, we propose a different design approach: we run LLM "workers" in parallel , allowing them to synchronize via a concurrently-updated attention cache and prompt these workers to decide how best to collaborate. Our approach allows the instances to come up with their own collaboration strategy for the problem at hand, all the while "seeing" each other's partial progress in the concurrent cache. We implement this approach via Hogwild! Inference: a parallel LLM inference engine where multiple instances of the same LLM run in parallel with the same attention cache, with "instant" access to each other's generated tokens. Hogwild! inference takes advantage of Rotary Position Embeddings (RoPE) to avoid recomputation while improving parallel hardware utilization. We find that modern reasoning-capable LLMs can perform inference with shared Key-Value cache out of the box, without additional fine-tuning.

Summary

AI-Generated Summary

PDF1076April 9, 2025