Lune

ICML2024Top-tier venue

QUEST: Query-Aware Sparsity for Efficient Long-Context LLM Inference

Jiaming Tang, Yilong Zhao, Kan Zhu, Guangxuan Xiao, Baris Kasikci, Song Han

Abstract

As the demand for long-context large language models (LLMs) increases, models with context windows of up to 128K or 1M tokens are becoming increasingly prevalent. However, longcontext LLM inference is challenging since the inference speed decreases significantly as the sequence length grows. This slowdown is primarily caused by loading a large KV cache during self-attention. Previous works have shown that a small portion of critical tokens will dominate the attention outcomes. However, we observe the criticality of a token highly depends on the query. To this end, we propose Quest, a query-aware KV cache selection algorithm. Quest keeps track of the minimal and maximal Key values in KV cache pages and estimates the criticality of a given page using Query vectors. By only loading the Top-K critical KV cache pages for attention, Quest significantly speeds up self-attention without sacrificing accuracy. We show that Quest can achieve up to 7.03× self-attention speedup, which reduces inference latency by 2.23× while performing well on tasks with long dependencies with negligible accuracy loss. Code is available at https: //github.com/mit-han-lab/Quest .

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.

168 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: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Efficient Streaming Language Models with Attention Sinks cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models cites Efficient Streaming Language Models with Attention Sinks
  • Efficient Streaming Language Models with Attention Sinks cites Compressive Transformers for Long-Range Sequence Modelling
  • MoBA: Mixture of Block Attention for Long-Context LLMs cites Efficient Streaming Language Models with Attention Sinks
  • MoBA: Mixture of Block Attention for Long-Context LLMs cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • MoBA: Mixture of Block Attention for Long-Context LLMs cites Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attention
  • MoBA: Mixture of Block Attention for Long-Context LLMs cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • MoBA: Mixture of Block Attention for Long-Context LLMs cites RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrieval
  • MoBA: Mixture of Block Attention for Long-Context LLMs cites MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Compressive Transformers for Long-Range Sequence Modelling
  • Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attention cites Efficient Streaming Language Models with Attention Sinks
  • Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attention cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attention cites MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention
  • H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models cites Compressive Transformers for Long-Range Sequence Modelling
  • Efficient Memory Management for Large Language Model Serving with PagedAttention cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Neural Attention Search cites Efficient Streaming Language Models with Attention Sinks
  • Neural Attention Search cites MoBA: Mixture of Block Attention for Long-Context LLMs
  • Neural Attention Search cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Neural Attention Search cites Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attention
  • Neural Attention Search cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • Neural Attention Search cites Efficient Memory Management for Large Language Model Serving with PagedAttention
  • Neural Attention Search cites Compressive Transformers for Long-Range Sequence Modelling
  • Neural Attention Search cites MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention
  • RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrieval cites Efficient Streaming Language Models with Attention Sinks
  • RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrieval cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrieval cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrieval cites MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention
  • MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention cites RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrieval
  • MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention cites Efficient Streaming Language Models with Attention Sinks
  • MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attention cites Compressive Transformers for Long-Range Sequence Modelling
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers168

  1. MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse AttentionHuiqiang Jiang, Yucheng Li, Chengruidong Zhang, Qianhui Wu et al.NeurIPS 2024 · 479 citations
  2. Neural Attention SearchDifan Deng, Marius LindauerNeurIPS 2025 · 431 citations
  3. Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse AttentionJingyang Yuan, Huazuo Gao, Damai Dai, Junyu Luo et al.ACL 2025 · 334 citations
  4. MoBA: Mixture of Block Attention for Long-Context LLMsEnzhe Lu, Zhejun Jiang, Jingyuan Liu, Yulun Du et al.NeurIPS 2025 · 219 citations
  5. RetrievalAttention: Accelerating Long-Context LLM Inference via Vector RetrievalDi Liu, Meng Chen, Baotong Lu, Huiqiang Jiang et al.NeurIPS 2025 · 148 citations

Builds on13

  1. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 citations
  2. Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han et al.ICLR 2024 · 1,714 citations
  3. Efficient Memory Management for Large Language Model Serving with PagedAttentionWoosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng et al.SOSP 2023 · 1,016 citations
  4. H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language ModelsZhenyu Zhang, Ying Sheng, Tianyi Zhou, Tianlong Chen et al.NeurIPS 2023 · 1,003 citations
  5. Compressive Transformers for Long-Range Sequence ModellingJack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, Chloe Hillier et al.ICLR 2020 · 833 citations

Related papers

  1. TokenSelect: Efficient Long-Context Inference and Length Extrapolation for LLMs via Dynamic Token-Level KV Cache SelectionWei Wu, Zhuoshi Pan, Kun Fu, Chao Wang et al.EMNLP 2025 · 2 citations
  2. Vegas: Self-Speculative Decoding with Verification-Guided Sparse AttentionYikang Yue, Yuqi Xue, Jian HuangICML 2026 · 2 citations
  3. KVzip: Query-Agnostic KV Cache Compression with Context ReconstructionJang-Hyun Kim, Jinuk Kim, Sangwoo Kwon, Jae W. Lee et al.NeurIPS 2025 · 103 citations
  4. FIER: Fine-Grained and Efficient KV Cache Retrieval for Long-context LLM InferenceDongwei Wang, Zijie Liu, Song Wang, Yuxin Ren et al.EMNLP Findings 2025 · 1 citation
  5. AttentionPredictor: Temporal Patterns Matter for KV Cache CompressionQingyue Yang, Jie Wang, Xing Li, Zhihai Wang et al.NeurIPS 2025 · 8 citations
Dusk over the sea between two cliffs drawn in fine vertical lines