SparQ Attention: Bandbreedte-efficiënte LLM-inferentie
SparQ Attention: Bandwidth-Efficient LLM Inference
December 8, 2023
Auteurs: Luka Ribar, Ivan Chelombiev, Luke Hudlass-Galley, Charlie Blake, Carlo Luschi, Douglas Orr
cs.AI
Samenvatting
Generatieve grote taalmodellen (LLMs) hebben tal van nieuwe mogelijkheden geopend, maar vanwege hun aanzienlijke rekenkundige eisen blijft hun alomtegenwoordige gebruik een uitdaging. Sommige van de meest nuttige toepassingen vereisen het verwerken van grote aantallen samples tegelijkertijd en het gebruik van lange contexten, wat beide de geheugencommunicatielast van de modellen aanzienlijk verhoogt. Wij introduceren SparQ Attention, een techniek om de inferentie-doorvoer van LLMs te verhogen door de geheugenbandbreedtevereisten binnen de aandachtblokken te verminderen via selectief ophalen van de gecachete geschiedenis. Onze voorgestelde techniek kan direct worden toegepast op kant-en-klare LLMs tijdens inferentie, zonder dat aanpassingen aan de pre-trainingsopzet of aanvullende fine-tuning nodig zijn. We laten zien hoe SparQ Attention de geheugenbandbreedtevereisten voor aandacht tot acht keer kan verminderen zonder verlies van nauwkeurigheid, door Llama 2- en Pythia-modellen te evalueren op een breed scala aan downstream-taken.
English
Generative large language models (LLMs) have opened up numerous novel
possibilities, but due to their significant computational requirements their
ubiquitous use remains challenging. Some of the most useful applications
require processing large numbers of samples at a time and using long contexts,
both significantly increasing the memory communication load of the models. We
introduce SparQ Attention, a technique for increasing the inference throughput
of LLMs by reducing the memory bandwidth requirements within the attention
blocks through selective fetching of the cached history. Our proposed technique
can be applied directly to off-the-shelf LLMs during inference, without
requiring any modification to the pre-training setup or additional fine-tuning.
We show how SparQ Attention can decrease the attention memory bandwidth
requirements up to eight times without any loss in accuracy by evaluating Llama
2 and Pythia models on a wide range of downstream tasks.