SparQ Attention: Bandwidth-Efficient LLM Inference

Published: 05 Mar 2024, Last Modified: 12 May 2024PML4LRS PosterEveryoneRevisionsBibTeXCC BY 4.0
Keywords: language models, sparse attention, sparsity, efficient inference, transformer
TL;DR: An attention sparsity technique for improving the throughput of pre-trained LLM inference.
Abstract: The computational difficulties of large language model (LLM) inference remains a significant obstacle to their widespread deployment, with long input sequences and large batches causing token-generation to be bottlenecked by data-transfer. For this reason, we introduce **SparQ Attention**, a technique for increasing LLM inference throughput by utilising memory bandwidth more efficiently within attention layers, 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. By evaluating Llama $2$, Mistral and Pythia models on a wide range of downstream tasks, we show that SparQ Attention brings up to $8\times$ savings in attention data-transfer without substantial drops in accuracy.
Submission Number: 64
Loading