ICML 2025 · PMLR 267

星注意力:在长序列上使用Transformer大语言模型的高效推理

Star Attention: Efficient LLM Inference over Long Sequences

Shantanu Acharya, Fei Jia, Boris Ginsburg

中文摘要

CCF-A 辅助译文,引用以英文原文为准。

使用Transformer的大语言模型(LLMs)在长序列上的推理既昂贵又慢,因为自注意力机制的平方复杂性导致。 我们引入了星注意力,这是一种两阶段的块稀疏近似方法,通过在多个主机上分散注意力,提高了计算效率,同时最小化通信开销。 在第一个阶段,使用块级局部注意力在主机之间并行处理上下文。 在第二个阶段,查询和响应词元通过序列全局注意力与所有前缀缓存词元进行交互。 星注意力与大多数使用全局注意力训练的Transformer型LLMs无缝集成,减少了内存需求和推理时间,最多可减少11x,同时保留了97-100%的精度。

官方英文摘要

Inference with Transformer-based Large Language Models (LLMs) on long sequences is both costly and slow due to the quadratic complexity of the self-attention mechanism. We introduce Star Attention, a two-phase block-sparse approximation that improves computational efficiency by sharding attention across multiple hosts while minimizing communication overhead. In the first phase, the context is processed using blockwise-local attention across hosts, in parallel. In the second phase, query and response tokens attend to all prior cached tokens through sequence-global attention. Star Attention integrates seamlessly with most Transformer-based LLMs trained with global attention, reducing memory requirements and inference time by up to 11x while preserving 97-100% of accuracy.

收录来源 PMLR 267 · Star Attention: Efficient LLM Inference over Long Sequences · CC BY 4.0

返回 ICML 2025 论文列表