atlas

Research map / Architectures and efficiency / Attention and transformers

Twilight: Adaptive Attention Sparsity with Hierarchical Top-$p$ Pruning

NeurIPS 2025 · Architectures and efficiency › Attention and transformers · approach: Sparse attention for long-context LLMs · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Twilight adds adaptive, top-p (nucleus-style) budget pruning as a hierarchical second stage on top of existing top-k sparse attention methods, cutting attended tokens by up to 98% with little accuracy loss.

Problem

Top-k sparse attention for long-context LLMs uses a fixed token budget, causing over-selection for focused attention and under-selection for diffuse attention, and optimal budgets vary by layer, head, prompt and algorithm.

Approach

Apply top-p (nucleus) thresholding to the attention weights of tokens pre-selected by a base sparse attention algorithm (select-then-prune), so the budget adapts per head and query; uses 4-bit quantized key cache for estimating weights and binary-search top-p kernels.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Apply Twilight pruning to QuestQuest · Longbench (12-task average), Longchat-7B-v1.5-32kaverage score: 37.33 -> 38.04Helped
Apply Twilight pruning to DSDS · Longbench (12-task average), Longchat-7B-v1.5-32kaverage score: 36.62 -> 38.71Helped
Apply Twilight pruning to full attentionFull attention · Longbench (12-task average), LLaMA-3.1-8B-Instructaverage score: 52.01 -> 51.64Hurt
Apply Twilight pruning to QuestQuest · RULER average, LLaMA-3.1-8B-Instructaverage score: 81.62 -> 86.65Helped
Apply Twilight pruning to DSDS · RULER average, LLaMA-3.1-8B-Instructaverage score: 87.18 -> 87.88Helped
Use Twilight pruning instead of the fixed-budget baselineLLaMA-2-7B-Chat · PG-19perplexity: Full 7.503; Twilight 7.600; Quest 14.15; DS 7.622Mixed
Use Twilight pruning instead of the fixed-budget baselineLLaMA-3.1-8B-Instruct · GSM8K flexibleaccuracy: Full 0.7726; Twilight 0.7771Helped
Use Twilight pruning instead of the fixed-budget baselineLLaMA-3.1-8B-Instruct · COQA exact matchexact match: Full 0.6363; Twilight 0.6325Hurt
Apply Twilight to QuestQuest · Self-attention operatorspeedup: 1.4×Helped
Apply Twilight to QuestQuest · End-to-end decodingspeedup: 1.35×Helped
Use a top-p threshold around 0.85 (ablation)Twilight on Longchat-7B-v1.5-32k · PG-19 and TrivialQAaccuracy and sparse attention latencyMixed
Use 4-bit rather than 2-bit key-cache quantization (ablation)Twilight top-p weight estimation · Attention-weight estimationstability of cumulative attention weightsHelped

Surprising findings

Limitations

Experimental setup

Datasets: Longbench RULER GSM8K COQA PG-19 Qasper GovReport LCC

Benchmarks: Longbench RULER GSM8K COQA PG-19

Metrics: score perplexity exact match flexible/strict accuracy latency speedup TPOT

Baselines: Quest Double Sparsity (DS) MagicPIG FlashAttention2 FlashInfer StreamingLLM SnapKV

Builds on: Quest Double Sparsity FlashInfer nucleus sampling

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy