Home/Inference & Serving/Star-Attention
Star-Attention logo

Star-Attention

NVIDIA/Star-Attention

Efficient LLM Inference over Long Sequences

GraphCanon updated today · GitHub synced today

392 stars25 forksLast push 1y Python Apache-2.0

Decision brief

Star-Attention specializes in long sequence inference of large language models using star-attention to maintain efficiency.

Good fit when

  • For applications requiring handling very large input sequences
  • When you need to enhance computational efficiency with star-attention mechanism

Avoid when

  • If your use case involves short sequence processing only
  • In scenarios where traditional attention mechanisms yield adequate results without performance loss

Observed Jul 15, 2026 · Source: enrich:decision_facts

Verify the decision

Maintenance and security

Full trust report
Maintenance
Dormant (425d since push)
As of today
Provenance
Not a fork · Organization account
As of today
Security (OSV)
No lockfile
As of 1mo

Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.

Backing

Company context for Nvidia. Display-only - separate from trust and ranking.

Company
NVIDIA Corporation·GitHub org profile·1mo
Employees
11,528·Wikidata (P1128 employees)·1mo
Commercial model
Pure OSS·GitHub org profile (public repos)·1mo

Install

pip install Star-Attention
PyPI

Similar tools

Same-category neighbours. No typed graph edges are catalogued for this tool yet.

Evidence and technical details

Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.

Overview

A Python project for efficient inference of large language models with long sequences using star-attention mechanisms.

Capability facts

Languages
python

Source: github.language · Aug 25, 2026

Categories

Graph entities

Tags

README

Star Attention: Efficient LLM Inference over Long Sequences

This repository contains code for the paper Star Attention: Efficient LLM Inference over Long Sequences. Star Attention is a novel block-sparse attention mechanism designed to enable efficient inference on long sequences in transformer-based LLMs. The method operates in two phases:

  1. Phase 1 - Context Encoding: The context tokens are processed using blockwise-local attention, with the context segmented into blocks where each block is prefixed with an anchor block.
  2. Phase 2 - Query Processing and Token Generation: The query and response tokens attend to all prior cached tokens through sequence-global attention.

Star Attention improves the inference time by up to 11x while preserving 97-100% of accuracy. The method is compatible with most Transformer-based LLMs trained with global attention, operating seamlessly out-of-the-box without additional training/finetuning. Furthermore, Star Attention is orthogonal to other optimization methods, including Flash Attention and KV cache compression techniques, allowing for potential combined enhancements.

This codebase contains the implementation of Star Attention in PyTorch using the HuggingFace Transformers library, along with the code for launching inference with Star Attention on two benchmarks: RULER and BABILong.

ModelSeq. Len.
(K)
Block Size
(K)
Ring-Attn
Acc. (%)
Star-Attn
Δ Acc.Δ Speedup
meta-llama
Llama3.1-8B-Instruct
16492.22-0.94%1.1x
32887.53+1.17%1.2x
641684.79-1.42%1.8x
1283276.31-1.90%2.7x
meta-llama
Llama-3.1-70B-Instruct
16495.09-2.71%1.7x
32894.61-2.55%

For agents

This page has a .md twin and JSON over the API.

Was this helpful?

Anonymous feedback helps us improve pages and translations.