Lune

NeurIPS2025Top-tier venue

Twilight: Adaptive Attention Sparsity with Hierarchical Top-pp Pruning

Chaofan Lin, Jiaming Tang, Shuo Yang, Hanshuo Wang, Tian Tang, Boyu Tian, Ion Stoica, Song Han, Mingyu Gao

Abstract

Leveraging attention sparsity to accelerate long-context large language models (LLMs) has been of great importance recently. However, most existing sparse attention algorithms use a fixed budget of how many tokens to use in their computations. This simple static decision raises critical issues in real-world deployment because it fails to account for the dynamic nature of real-world scenarios, where the optimal balance between accuracy and efficiency can vary greatly. In this paper, we reveal a key insight that leveraging the idea of top-p sampling (a.k.a., nucleus sampling) in sparse attention could enable efficient and adaptive budget decisions. Based on this, we propose Twilight, a framework that enhances any existing sparse attention algorithm with adaptive budget decision capabilities without sacrificing accuracy. Empirical results show that Twilight can adaptively prune up to 98% tokens with nearly no accuracy loss in both long-and medium-context scenarios, leading to a 1.4× speedup over state-of-the-art sparse attention mechanisms.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

16 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Efficient Streaming Language Models with Attention Sinks cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • Sparsity Forcing: Reinforcing Token Sparsity of MLLMs cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • FreeKV: Boosting KV Cache Retrieval for Efficient LLM Inference cites Efficient Streaming Language Models with Attention Sinks
  • FreeKV: Boosting KV Cache Retrieval for Efficient LLM Inference cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • FreeKV: Boosting KV Cache Retrieval for Efficient LLM Inference cites SnapKV: LLM Knows What You are Looking for Before Generation
  • FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • SnapKV: LLM Knows What You are Looking for Before Generation cites Efficient Streaming Language Models with Attention Sinks
  • SnapKV: LLM Knows What You are Looking for Before Generation cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • VecAttention: Vector-wise Sparse Attention for Accelerating Long Context Inference cites Efficient Streaming Language Models with Attention Sinks
  • VecAttention: Vector-wise Sparse Attention for Accelerating Long Context Inference cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • VecAttention: Vector-wise Sparse Attention for Accelerating Long Context Inference cites Sparse VideoGen2: Accelerate Video Generation with Sparse Attention via Semantic-Aware Permutation
  • Sparse VideoGen2: Accelerate Video Generation with Sparse Attention via Semantic-Aware Permutation cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Sparse VideoGen2: Accelerate Video Generation with Sparse Attention via Semantic-Aware Permutation cites Efficient Streaming Language Models with Attention Sinks
  • Sparse Attention Adaptation for Long Reasoning cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Sparse Attention Adaptation for Long Reasoning cites Efficient Streaming Language Models with Attention Sinks
  • Sparse Attention Adaptation for Long Reasoning cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • Sparse Attention Adaptation for Long Reasoning cites SnapKV: LLM Knows What You are Looking for Before Generation
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers16

  1. Sparse VideoGen2: Accelerate Video Generation with Sparse Attention via Semantic-Aware PermutationShuo Yang, Haocheng Xi, Yilong Zhao, Muyang Li et al.NeurIPS 2025 · 114 citations
  2. FreeKV: Boosting KV Cache Retrieval for Efficient LLM InferenceGuangda Liu, Chengwei Li, Zhenyu Ning, Jing Lin et al.ICLR 2026 · 17 citations
  3. Sparse Attention Adaptation for Long ReasoningYizhao Gao, Shuming Guo, Shijie Cao, Yuqing Xia et al.ICLR 2026 · 17 citations
  4. VecAttention: Vector-wise Sparse Attention for Accelerating Long Context InferenceAnmin Liu, Ruixuan Yang, Huiqiang Jiang, Bin Lin et al.CVPR 2026 · 4 citations
  5. Sparsity Forcing: Reinforcing Token Sparsity of MLLMsFeng Chen, Yefei He, Lequan Lin, Jing Liu et al.ICLR 2026 · 3 citations

Builds on33

  1. The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
  2. Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
  3. FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 citations
  4. Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han et al.ICLR 2024 · 1,714 citations
  5. SnapKV: LLM Knows What You are Looking for Before GenerationYuhong Li, Yingbing Huang, Bowen Yang, Bharat Venkitesh et al.NeurIPS 2024 · 1,019 citations

Related papers

  1. Tactic: Adaptive Sparse Attention with Clustering and Distribution Fitting for Long-Context LLMsKan Zhu, Tian Tang, Qinyu Xu, Zhan Jin et al.ICLR 2026 · 25 citations
  2. Token Sparse Attention: Efficient Long-Context Inference with Interleaved Token SelectionDongwon Jo, Beomseok Kang, Jiwon Song, jae-joon kimICML 2026 · 1 citation
  3. The Sparse Frontier: Sparse Attention Trade-offs in Transformer LLMsPiotr Nawrot, Jianing Li, Renjie Huang, Sebastian Ruder et al.ACL Findings 2026 · 3 citations
  4. Elastic Attention: Test-time Adaptive Sparsity Ratios for Efficient TransformersZecheng Tang, Quantong Qiu, Yi Yang, Zhiyi Hong et al.ICML 2026 · 4 citations
  5. ProxyAttn: Guided Sparse Attention via Representative HeadsYixuan Wang, Huang He, Siqi Bao, Hua Wu et al.ICLR 2026 · 9 citations
Dusk over the sea between two cliffs drawn in fine vertical lines