arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2312.04985cs.LG
收藏

SparQ Attention:带宽高效的大语言模型推理

SparQ Attention: Bandwidth-Efficient LLM Inference

Graphcore Research(Graphcore研究院);Synthesia(Synthesia公司)

Luka Ribar, Ivan Chelombiev, Luke Hudlass-Galley, Charlie Blake, Carlo Luschi, Douglas Orr

AI总结:

本文提出 SparQ Attention,通过选择性获取缓存历史来高效利用注意力层内存带宽,无需修改预训练或微调即可在 Llama 2/3、Mistral、Gemma 和 Pythia 上实现最高 8 倍注意力数据传输节省且准确率基本不降。

摘要:

大语言模型(LLM)推理的计算困难仍然是其广泛部署的重大障碍。许多应用需要支持长输入序列并以大批量方式处理,这通常导致 token 生成受到数据传输的瓶颈限制。为此,我们提出 SparQ Attention,一种通过在注意力层内更高效地利用内存带宽、选择性地获取缓存历史来提高 LLM 推理吞吐量的技术。我们提出的技术可以在推理过程中直接应用于现成的 LLM,无需对预训练设置进行任何修改,也无需额外的微调。我们通过在广泛的下游任务上评估 Llama 2 和 Llama 3、Mistral、Gemma 以及 Pythia 模型,表明 SparQ Attention 在注意力数据传输上实现了最高 8 倍的节省,且准确率没有显著下降。

英文摘要:

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 and 3, Mistral, Gemma and Pythia models on a wide range of downstream tasks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑