ImageNet classification with deep convolutional neural networks
Alex Krizhevsky, Ilya Sutskever et al.
34
Citations
4
Influential Citations
International Conference on Machine Learning
Venue
2024
Year
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.
Star Attention addresses a critical bottleneck in deploying large language models (LLMs) for long-context tasks: the quadratic cost of self-attention. As models like GPT-4 and Llama 2 are increasingly used for processing entire books, legal documents, or long conversation histories, inference latency and memory become prohibitive. Existing sparse attention methods often require retraining or degrade accuracy, while full attention is impractical for sequences exceeding tens of thousands of tokens. Star Attention provides a drop-in approximation that works with pre-trained models, making it immediately applicable to production systems.
The paper's two-phase design is particularly clever: it exploits the observation that during context processing, tokens can be attended locally without global communication, saving bandwidth. Only during the generation phase do queries need global attention. This asymmetry mirrors the typical usage pattern of LLMs (long context, short generation) and minimizes overhead. The result is a method that scales linearly with the number of hosts, enabling inference on sequences that would otherwise exceed single-device memory.
The paper reports up to 11x reduction in memory and inference time on long sequences (e.g., 128K tokens) compared to full attention baselines. Accuracy is preserved within 97-100% on standard benchmarks such as LongBench and RULER, with the highest degradation observed on tasks requiring exact token recall (e.g., needle-in-a-haystack). The method is evaluated on models from the Llama 2 and Mistral families, showing consistent performance across different architectures and sizes.
Star Attention represents a practical advance for deploying LLMs in long-context applications. By enabling efficient inference without retraining, it lowers the barrier for using large models on tasks like document analysis, codebase understanding, and long-form question answering. The approach is complementary to other efficiency techniques like quantization and speculative decoding, and could be combined for further gains. However, the paper does not explore the impact on tasks requiring fine-grained attention over distant tokens, such as mathematical reasoning or multi-hop QA, where accuracy might degrade more. Future work could investigate adaptive block sizes or hybrid approaches to address these edge cases. Overall, Star Attention is a valuable contribution to the growing toolkit for practical LLM inference.
Alex Krizhevsky, Ilya Sutskever et al.
Ashish Vaswani, Noam Shazeer et al.
Douglas M. Bates, Martin Mächler et al.
Diederik P. Kingma, Jimmy Ba