Lune

ICLR2025Top-tier venue

HShare: Fast LLM Decoding by Hierarchical Key-Value Sharing

Huaijin Wu, Lianqiang Li, Hantao Huang, Tu Yi, Jihang Zhang, Minghui Yu, Junchi Yan

Abstract

The frequent retrieval of Key-Value (KV) cache data has emerged as a significant factor contributing to the inefficiency of the inference process in large language models. Previous research has demonstrated that a small subset of critical KV cache tokens largely influences attention outcomes, leading to methods that either employ fixed sparsity patterns or dynamically select critical tokens based on the query. While dynamic sparse patterns have proven to be more effective, they introduce significant computational overhead, as critical tokens must be reselected for each self-attention computation. In this paper, we reveal substantial similarities in KV cache token criticality across neighboring queries, layers, and heads. Motivated by this insight, we propose HShare, a hierarchical KV sharing framework. HShare facilitates the sharing of critical KV cache token indices across layers, heads, and queries, which significantly reduces the computational overhead associated with query-aware dynamic token sparsity. In addition, we introduce a greedy algorithm that dynamically determines the optimal layer-level and head-level sharing configuration for the decoding phase. We evaluate the effectiveness and efficiency of HShare across various tasks using three models: LLaMA2-7b, LLaMA3-70b, and Mistral-7b. Experimental results demonstrate that HShare achieves competitive accuracy with different sharing ratios, while delivering up to an 8.6× speedup in self-attention operations and a 2.7× improvement in end-to-end throughput compared with FlashAttention2 and GPT-fast respectively. The source code is publicly available at https://github.com/wuhuaijin/HShare.

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.

5 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 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 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • Efficient Streaming Language Models with Attention Sinks cites Reformer: The Efficient Transformer
  • SALS: Sparse Attention in Latent Space for KV Cache Compression cites Efficient Streaming Language Models with Attention Sinks
  • SALS: Sparse Attention in Latent Space for KV Cache Compression cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • SALS: Sparse Attention in Latent Space for KV Cache Compression cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • SALS: Sparse Attention in Latent Space for KV Cache Compression cites Reformer: The Efficient Transformer
  • Achieving low-bit Muon through subspace preservation and grid quantization cites Generation as Search Operator for Test-Time Scaling of Diffusion-based Combinatorial Optimization
  • 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 H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • 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 Twilight: Adaptive Attention Sparsity with Hierarchical Top-p Pruning
  • H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models cites Reformer: The Efficient Transformer
  • FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning cites Reformer: The Efficient Transformer
  • Twilight: Adaptive Attention Sparsity with Hierarchical Top-p Pruning cites Efficient Streaming Language Models with Attention Sinks
  • Twilight: Adaptive Attention Sparsity with Hierarchical Top-p Pruning cites H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models
  • Twilight: Adaptive Attention Sparsity with Hierarchical Top-p Pruning cites FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers5

  1. Twilight: Adaptive Attention Sparsity with Hierarchical Top-pp PruningChaofan Lin, Jiaming Tang, Shuo Yang, Hanshuo Wang et al.NeurIPS 2025 · 53 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. Generation as Search Operator for Test-Time Scaling of Diffusion-based Combinatorial OptimizationYang Li, Lvda Chen, Haonan Wang, Runzhong Wang et al.NeurIPS 2025 · 13 citations
  4. SALS: Sparse Attention in Latent Space for KV Cache CompressionJunlin Mu, Hantao Huang, Jihang Zhang, Minghui Yu et al.NeurIPS 2025 · 7 citations
  5. Achieving low-bit Muon through subspace preservation and grid quantizationHuaijin Wu, Bingrui Li, Yebin Yang, Yi Tu et al.ICLR 2026

Builds on21

  1. Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 citations
  2. FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 citations
  3. Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han et al.ICLR 2024 · 1,714 citations
  4. Fast Inference from Transformers via Speculative DecodingYaniv Leviathan, Matan Kalman, Yossi MatiasICML 2023 · 1,472 citations
  5. 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

Related papers

  1. ZipVL: Accelerating Vision-Language Models Through Dynamic Token SparsityYefei He, Feng Chen, Jing Liu, Wenqi Shao et al.ICCV 2025 · 1 citation
  2. Q Cache: Visual Attention Is Valuable in Less than Half of Decode Layers for Multimodal Large Language ModelJiedong Zhuang, Lu Lu, Ming Dai, Rui Hu et al.AAAI 2026
  3. Not All Heads Matter: A Head-Level KV Cache Compression Method with Integrated Retrieval and ReasoningYu Fu, Zefan Cai, Abedelkadir Asi, Wayne Xiong et al.ICLR 2025
  4. HATA: Trainable and Hardware-Efficient Hash-Aware Top-k Attention for Scalable Large Model InferencePing Gong, Jiawei Yi, Shengnan Wang, Juncheng Zhang et al.ACL Findings 2025 · 4 citations
  5. SlimInfer: Accelerating Long-Context LLM Inference via Dynamic Token PruningLingkun Long, Rubing Yang, Yushi Huang, Desheng Hui et al.AAAI 2026 · 8 citations
Dusk over the sea between two cliffs drawn in fine vertical lines