Tactic: Adaptive Sparse Attention with Clustering and Distribution Fitting for Long-Context LLMs

Kan Zhu, Tian Tang, Qinyu Xu, Zhan Jin, Yile Gu, Zhichen Zeng, Rohan Kadekodi, Liangyu Zhao, Ang Li, Arvind Krishnamurthy, Baris Kasikci

As Large Language Models (LLMs) scale toward "infinite" context windows exceeding a million tokens, they encounter a massive hardware bottleneck: the Key-Value (KV) cache. During the decoding phase, the model must load the KV cache from memory for every single token it generates. For long documents, this memory bandwidth bottleneck is so severe that it can account for over 50% of total inference latency.

To address this, researchers have developed Tactic, a new sparse attention mechanism that optimizes long-context LLM inference. By replacing rigid, fixed token budgets with a dynamic "cumulative score" target, Tactic achieves up to a 7.29x speedup in attention decoding while maintaining significantly higher accuracy than existing state-of-the-art methods.

The Flaw in Fixed Token Budgets

Current solutions to the KV cache problem rely on "sparse attention," which involves selecting a small subset of tokens to load rather than the entire cache. However, most existing methods enforce a fixed token budget (e.g., "always pick the top 1024 tokens").

Comparison of Fixed Token Budget vs. Tactic's Dynamic Target

The fundamental flaw in this approach is that attention sparsity is not uniform. Some layers or specific queries require many tokens to maintain accuracy, while others need very few. A fixed budget is inherently inflexible: it is either wasteful by loading too much for simple queries, or destructive by loading too little for complex ones, leading to significant accuracy drops.

How Tactic Works

Tactic introduces a "calibration-free" approach that adapts to the specific needs of every query by targeting a percentage of the "attention mass" rather than a raw token count. Its workflow consists of three main stages:

  1. Prefill Stage (Clustering): Instead of grouping tokens by their sequential position in a sentence, Tactic applies K-means clustering on Key vectors. This ensures that semantically similar tokens are grouped together in vector space, regardless of their physical distance in the text.
  2. Decoding Stage A (Querying): When generating a new token, Tactic calculates the dot product between the current Query and the cluster centroids. This allows the model to rapidly rank which groups of tokens are likely to be the most important.
  3. Decoding Stage B (Distribution Fitting): This is Tactic's core innovation. The authors observed that once tokens are sorted by importance, their attention scores follow a predictable "long-tail" power-law distribution ($y = a/x + b$). Tactic samples a tiny fraction of tokens (~2.5%), fits this curve, and mathematically estimates exactly how many tokens are needed to reach a target cumulative attention score (e.g., 90% of the total weight).

By targeting a percentage of the attention mass, Tactic naturally scales its effort based on the complexity of the query.

Key Insights: Sparsity is a Moving Target

The researchers proved mathematically that the error in sparse attention is directly bounded by the "missing" attention weight. Because Value vector norms are remarkably consistent across a model, capturing a set percentage (like 90%) of the attention weight effectively guarantees a high-fidelity approximation of the full output.

Cumulative attention score vs. number of tokens across different attention heads

Furthermore, the paper demonstrates that attention heads behave differently. Some act as "retrieval heads" that need to look at many tokens, while others are "streaming heads" that focus on very few. Tactic is the first method to handle this extreme variance dynamically without requiring expensive pre-training or manual calibration. It also proves that clustering in vector space is vastly superior to proximity-based grouping for identifying these crucial tokens, significantly reducing the Within-Cluster Sum of Squares (WCSS).

Performance and Results

Tactic was rigorously evaluated across diverse models (Llama 3.1 8B/70B, Qwen2-7B, MegaBeam-Mistral-7B) using benchmarks like LongBench, PG19, and RULER.

  • Speed: Tactic achieved up to a 7.29x speedup in the attention decoding step and a 1.58x end-to-end inference speedup.
  • Accuracy: On the RULER "stress test" benchmark (up to 96K tokens), Tactic maintained near-perfect accuracy. For example, it scored 84.6% on Llama 3.1 8B compared to full attention's 86.8%. In contrast, fixed-budget competitors like Quest and PyramidKV saw their performance plummet to 63-69% under similar constraints.
  • Speculative Decoding: When used as a draft model, Tactic demonstrated a >95% acceptance rate, proving it is a highly viable candidate for accelerating high-quality text generation.

Limitations and Future Work

While highly effective, Tactic does have areas for future optimization. To keep clusters accurate as new tokens are generated, Tactic currently re-runs K-means every 2048 steps. While this overhead is low (<7% of prefill time), developing incremental cluster updates could further boost efficiency. Additionally, the current implementation is optimized for high-end NVIDIA GPUs (H100/A6000); adapting these dynamic kernels for memory-constrained edge devices remains an open challenge. Finally, combining Tactic's token selection with KV cache quantization could unlock even more dramatic memory savings in the future.

Summary updated

BibTeX
@inproceedings{zhu2026tactic,
  author = {Kan Zhu and Tian Tang and Qinyu Xu and Zhan Jin and Yile Gu and Zhichen Zeng and Rohan Kadekodi and Liangyu Zhao and Ang Li and Arvind Krishnamurthy and Baris Kasikci},
  title = {{Tactic: Adaptive Sparse Attention with Clustering and Distribution Fitting for Long-Context LLMs}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=tJod11fK1A},
}
Figure