TRANSMISSION // 2611.29280v1

QASparse adapts attention budgets to each query region

Source published

A preprint proposes a way to speed up long-context LLM prefill by adjusting which tokens each query attends to and how many it keeps.

AI-generated conceptual illustration for QASparse adapts attention budgets to each query region
AI-generated conceptual illustration; not documentary evidence.

Long inputs make the initial processing of a language model’s prompt costly. QASparse tries to cut that cost without giving every query the same token budget: it estimates local needs, then checks candidates near the selection cutoff.

When a large language model reads a long prompt, its prefill stage computes attention between each query and earlier tokens. Dense attention considers all causally available tokens, so the amount of query–key computation grows quadratically with input length. Sparse attention aims to save work by selecting only some tokens. But a shared ranking of important tokens may not suit every attention head or every position in the prompt: one query may need more context than its neighbor, or favor different tokens.

A new preprint introduces QASparse, a method designed to adapt both the size and membership of those selections. The authors evaluate it on four long-context language models and report faster prefill attention and higher benchmark scores than the sparse-attention baselines they tested. The results are promising, but they come from a specific experimental setup and do not establish that the method will help every model or workload.

One shared ranking, with local adjustments

QASparse starts with a shared ranking of context tokens. The researchers average-pool query and key representations across attention heads at matching positions, then use their scores to create an ordering that can guide selection across heads. Sharing this initial estimate reduces the cost of building separate rankings for every head.

The method then adjusts that shared starting point in two ways. Local Budget Regression samples representative queries at intervals along the prompt. For each sampled query and attention head, it estimates how many tokens are needed to reach a target level of attention coverage under the shared ranking. A sliding-window regression uses nearby observations to predict budgets for other query positions. This is intended to capture local variation rather than applying one budget everywhere.

Boundary Voting addresses a different problem: a token favored by a particular head may sit just outside the shared ranking’s cutoff. QASparse examines a limited set of candidate blocks near that boundary. Sampled queries cast votes based on query–key scores, and the method swaps in preferred candidates while keeping the selection size fixed. Regression changes how much is selected; voting can change which candidates make the cut without expanding that budget.

The authors also build separate selection-kernel execution paths for different context lengths. A sparse pattern that saves arithmetic can still be slow if GPU work is poorly distributed or selection adds too much overhead. Their implementation uses custom kernels, including Triton-based computation.

What the tests show

The evaluation uses Llama-3.1-8B-Instruct, Qwen2.5-7B-Instruct-1M, GLM-4-9B-Chat-1M and MegaBeam-Mistral-7B-512k. The authors test on RULER, which includes controlled context lengths and tasks such as retrieval and multi-hop reasoning, and InfiniteBench, a collection of long-context tasks. Experiments were run on a single NVIDIA A100 64GB GPU. The sparse methods perform sparse computation during prefill and switch to dense attention during decoding.

On RULER, QASparse has the highest mean score among the sparse methods compared in the paper for each of the four models. Its reported mean scores are close to the FlashAttention-2 dense-attention baseline in some model settings, but the pattern varies by model and context length. On InfiniteBench, QASparse has the highest mean among the sparse methods for all four models; it does not lead every individual task or exceed the dense baseline in every comparison. These averages do not show a uniform improvement on every kind of long-context work.

For Llama-3.1-8B-Instruct at a 128K-token context, the paper reports a 2.81× speedup over FlashAttention-2 for attention computation. In a separate latency measurement at a 90% attention-coverage threshold, QASparse’s reported attention latency is 211.74 milliseconds, compared with 595.57 milliseconds for FlashAttention at 128K. At 64K, the authors report up to a 1.77× time-to-first-token speedup over FlashAttention-2. These figures describe particular configurations and metrics; they are not a general guarantee of end-to-end serving speed.

What remains uncertain

The experiments suggest that local budgets and boundary-level corrections can work alongside shared rankings, but they do not establish how well QASparse transfers to other hardware, models or workloads. The paper identifies adaptation to other hardware platforms and reducing selection overhead as future work. Its comparisons also depend on choices such as the target attention-coverage threshold and a special rule for the final two query blocks: those blocks attend to all key blocks visible under causal masking. This is not unrestricted attention to future tokens. An ablation reports lower RULER scores when the rule is removed, so comparisons using it should be understood in that context.

QASparse is described in an arXiv preprint, not a peer-reviewed publication in the supplied source. The benchmark results are evidence from the authors’ experiments, not independent confirmation. Further testing would help establish how robust the method is across implementations and practical serving conditions.

Reviewed cross-references

These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.

  • A shared shortlist could make long-context AI faster

    Shared method: Both methods reuse shared candidate information while retaining query-specific selection: QASparse refines a shared token ranking with query/key scores near the cutoff, while ADIndex shares a token bank across neighboring queries and then performs query-specific refinement. This is a design-level parallel, not evidence of identical methods or comparable performance; the papers evaluate different systems and settings.

    Model review: · openai-codex/gpt-6-luna

    Evidence and provenance

    Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.

    • 2611.29280v1 — Original paper

      Excerpt reference: static/papers/2611.29280v1.md:59-103
      Basis: Paper text
      Source SHA-256: db82d59ca649a2addf83a88047f16dee8da68c72aa78e8776d9f05a7b0a0f1ea

    • 2611.12956v1 — Original paper

      Excerpt reference: static/papers/2611.12956v1.md:188-236
      Basis: Paper text
      Source SHA-256: 9796c78dbd8a34d9112871d8b341e01df1ca343e81bb87d1b60845a3631d32c1

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.