NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

AdaCal: Adaptive Calibration for Robust Sparse Attention in Long-Context LLMs

Leqin Xiang, Yongbin Liu, Chunping Ouyang, Ying YuNeurIPS 2026

TL;DR

Processing massive prompts in LLMs is agonizingly slow due to the quadratic $O(n^2)$ cost of self-attention, and existing shortcuts either blindly ignore critical information or let in too much distracting noise. AdaCal solves this by treating sparse attention like a smart triage nurse: it categorizes the task upfront, takes a cheap "pulse" of each attention head's behavior, and allocates extra compute strictly when and where a specific head needs it. The result is faster, leaner long-context processing that occasionally even beats standard full attention in accuracy by filtering out distractors.

What Problem Does This Paper Address?

When you feed a 100,000-token book into an LLM, the "prefill" stage—where the model reads and processes the prompt before generating its first word—hits a massive computational wall because standard self-attention compares every token to every other token.

Because most attention weights end up near zero anyway, researchers use sparse attention to compute only a fraction of the attention map. Currently, you have two imperfect choices:

  1. Static Sparse Attention: Uses fixed geometric masks (like looking only at neighboring words and a few global "landmark" tokens). It’s fast and predictable, but easily misses crucial facts buried in the middle of a long document.
  2. Dynamic Sparse Attention: Uses runtime heuristics to guess where to look on the fly. While flexible, the authors uncover a Noise-Recall Dilemma: on structured tasks like Question Answering, dynamic methods often over-expand and pull in semantically similar distractors, performing worse than simple static masks! Conversely, static masks completely collapse on needle-in-a-haystack retrieval tasks past 32K tokens.
Figure 1: The Noise-Recall Dilemma on RULER. (a) QA: Static Vertical-Slash (Blue) outperforms FlexPrefill (Orange), revealing that blind dynamic sparsity injects detrimental noise. (b) CWE: Conversely, Vertical-Slash collapses on long contexts (> 32k), confirming its failure in retrieval. This trade-off necessitates our profile-guided adaptive routing to balance noise rejection and global recall.

Methods

Instead of relying on a single one-size-fits-all sparsity rule, AdaCal introduces a training-free "Constrain-then-Calibrate" framework built on block-sparse Triton kernels (partitioning sequences into 128-token blocks):

  1. Coarse Task Dispatch (Constrain): Before looking at attention weights, an experience-driven dispatcher groups the input task into one of three coarse buckets: structure-dominant, reasoning-intensive, or retrieval-intensive. This acts as a safety guardrail on what the attention heads are allowed to do next.
  2. Lightweight Physical Profiling (Probe): Rather than estimating the full $N \times N$ matrix, AdaCal runs a cheap static Vertical-Slash (VS) pattern (diagonal local window + sparse vertical landmarks) as a universal probe. From this, it calculates three intuitive metrics per attention head:
  3. Normalized Entropy: Is attention scattered/uncertain?
  4. Top-$\kappa$ Concentration: Is attention already sharply focused? (Used as a "veto" against adding noisy blocks).
  5. Mid-Zone Coverage: Is the middle 25%–75% of the prompt being ignored?
  6. Task-Conditional Routing (Calibrate): Based on the task bucket and head profile, each head is routed to one of three mutually exclusive execution policies:
  7. No-Expand: Locks structure-dominant tasks strictly to the base VS mask to block distractors.
  8. Global-TopK: For reasoning tasks, appends high-mass global blocks only if a head has high entropy and low concentration.
  9. Coverage-Sampling: For retrieval tasks, injects extra landmark blocks across the middle of the text using an adaptive stride if mid-zone coverage drops too low.
AdaCal's three task-conditional execution policies augmenting the base Vertical-Slash topology.

Datasets

Because AdaCal requires no retraining, datasets are used strictly for evaluation across Llama-3.1-8B-Instruct, Yi-9B-200K, and Qwen2-7B-Instruct:

  • RULER: A synthetic benchmark testing retrieval, variable tracking, common words extraction (CWE), and QA across context lengths scaling from 4K to 128K tokens.
  • InfiniteBench: A realistic long-context benchmark featuring 10 unstructured tasks, including code debugging, math reasoning, summarization, and key-value retrieval (Retr.KV).

No new datasets were introduced in this paper.

Key Insights and Ideas

  • Less attention can mean better accuracy: Expanding an attention head's视野 (field of view) isn't free accuracy—when a head already has high concentration, forcing more global context onto it injects detrimental noise. Vetoing expansion actually improves reasoning and QA.
  • Attention topologies vary fundamentally by task: Visualizing full attention maps before any sparsification shows that math tasks and QA tasks naturally form distinct geometric patterns, justifying upfront task priors rather than purely reactive statistical estimators.
  • Selectivity scales naturally with length: As prompts stretch from 4K to 128K tokens, AdaCal actually triggers global compensation on fewer heads (dropping from 57.33% to 41.41%), naturally curbing distractor accumulation in ultra-long contexts.

Key Results

  • Outperforming Full Attention: Remarkably, by suppressing distractor noise, AdaCal beats the exact Full Attention oracle on average across all three model families on both RULER (e.g., 90.06 vs. 89.14 on Llama-3.1) and InfiniteBench (48.57 vs. 48.56 on Llama-3.1; 28.35 vs. 27.83 on Qwen2).
  • Crushing Hard Retrieval: On InfiniteBench’s notoriously difficult key-value retrieval (Retr.KV) with Llama-3.1, AdaCal scores 59.20, trouncing dynamic baselines like FlexPrefill (44.60) and MInference (21.00).
  • Minimal Overhead: The profiling and routing logic is super lightweight—in 84.6% of runs, adaptive selection adds $\le 3\%$ overhead to block selection time (with a median of just 0.04%).

Limitations and Future Work

  • Prefill-Only Focus: AdaCal strictly optimizes the $O(n^2)$ prefill bottleneck; it does not currently manage or compress the KV-cache during the subsequent token-by-token decoding stage.
  • Coarse Task Dispatch & Tail Latency: The framework relies on an "experience-driven" coarse task categorization upfront, and while routing overhead is usually tiny, a small tail of inputs incurs up to 19.24% selection overhead.
  • Future Directions: The authors plan to adapt this physical profiling paradigm to decoding-time KV-cache optimizations and extend it to multimodal long-sequence models.

Summary updated

BibTeX
@inproceedings{xiang2026adacal,
  author = {Leqin Xiang and Yongbin Liu and Chunping Ouyang and Ying Yu},
  title = {{AdaCal: Adaptive Calibration for Robust Sparse Attention in Long-Context LLMs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=1VrcmRz58A},
}
Figure