The computational difficulties of large language model (LLM) inference remain a significant obstacle to their widespread deployment. The need for many applications to support long input sequences and process them in large batches typically causes token-generation to be bottlenecked by data-transfer. For this reason, we introduce SparQ Attention, a technique for increasing the inference throughput of LLMs by utilising memory bandwidth more efficiently within the 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. We show that SparQ Attention brings up to 8x savings in attention data-transfers without substantial drops in accuracy, by evaluating Llama 2, Mistral and Pythia models on a wide range of downstream tasks.
翻译:大型语言模型(LLM)推理的计算难题仍是其广泛部署的主要障碍。许多应用需要支持长输入序列并以大批量处理,这通常导致令牌生成受数据传输瓶颈制约。为此,我们提出SparQ Attention技术,通过注意力层中更高效地利用内存带宽(选择性获取缓存历史)来提升LLM推理吞吐量。该技术可直接应用于现成LLM的推理过程,无需修改预训练配置或额外微调。通过在Llama 2、Mistral和Pythia模型上对多种下游任务的评估,我们证明SparQ Attention可在不显著降低精度的前提下,实现高达8倍的注意力数据传输节省。