Star Attention: Efficient LLM Inference over Long Sequences

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Acharya, Shantanu, Jia, Fei, Ginsburg, Boris
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915312806395904
author Acharya, Shantanu
Jia, Fei
Ginsburg, Boris
author_facet Acharya, Shantanu
Jia, Fei
Ginsburg, Boris
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2411_17116
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Star Attention: Efficient LLM Inference over Long Sequences
Acharya, Shantanu
Jia, Fei
Ginsburg, Boris
Computation and Language
Artificial Intelligence
Machine Learning
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.
title Star Attention: Efficient LLM Inference over Long Sequences
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2411.17116