HHR: Hierarchical Hash Retrieval for Efficient LLM Generation
Not on the map. Why?
Abstract (arXiv)
Efficient long-context inference is essential for large language models (LLMs), yet it poses a severe computational bottleneck. Hash-based retrieval offers an efficient alternative by encoding queries and keys into binary codes and using Hamming distance for key selection. However, this leads to a critical mismatch between Hamming distance and attention relevance. Query-Key logits depend jointly on directional similarity and feature magnitudes, whereas hash binarization discards magnitude information, causing both false-positive retrieval of low-logit keys and false-negative omission of high-logit keys. To address these failures, we propose Hierarchical Hash Retrieval (HHR), a coarse-to-fine framework that progressively improves retrieval accuracy through Geometry-Aware Key Routing (GKR) and Learned Hash Projection (LHP). GKR learns a head-wise orthogonal transformation to redistribute feature magnitudes and derive more discriminative page-level logit bounds, enabling effective pruning of low-logit keys while preserving important candidates. LHP then learns a head-wise projection space that aligns Hamming distance with the true Query-Key relevance ranking for fine-grained retrieval. By combining GKR and LHP, HHR suppresses false positives and recovers false negatives, substantially improving the fidelity of hash-based sparse attention. Extensive experiments across diverse LLMs and benchmarks demonstrate that HHR achieves superior performance over existing methods. For example, on LongBench, HHR improves the average score by 1.10 points and, at a context length of 128K, achieves up to a 3.30x decoding speedup and a 2.83x end-to-end speedup for Llama-3.1-8B-Instruct. The code is publicly available at https://github.com/lianjunl13-sudo/HHR.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 46 of its 53 references that are in the map. First posted on arXiv 1 Oct 2026.
Builds on
46 of 53 references.
References · 46
- 2017Attention Is All You Needcited by 59,932
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2025Qwen3 Technical Reportcited by 8,195
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
- 2019Generating Long Sequences with Sparse Transformerscited by 1,523
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,270
- 2020Constructing A Multi-hop QA Dataset for Comprehensive Evaluation of Reasoning Stepscited by 1,259
- 2024SnapKV: LLM Knows What You are Looking for Before Generationcited by 848
- 2024KIVI: A Tuning-Free Asymmetric 2bit Quantization for KV Cachecited by 604
- 2024KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantizationcited by 571
- 2024Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inferencecited by 487
34 more
- 2025Native Sparse Attention: Hardware-Aligned and Natively Trainable Sparse Attentioncited by 391
- 2024MInference 1.0: Accelerating Pre-filling for Long-Context LLMs via Dynamic Sparse Attentioncited by 375
- 2025From System 1 to System 2: A Survey of Reasoning Large Language Modelscited by 319
- 2024DuoAttention: Efficient Long-Context LLM Inference with Retrieval and Streaming Headscited by 283
- 2025MoBA: Mixture of Block Attention for Long-Context LLMscited by 188
- 2024A Survey on Recent Advances in LLM-Based Multi-turn Dialogue Systemscited by 170
- 2024SeerAttention: Learning Intrinsic Sparse Attention in Your LLMscited by 121
- 2025FlexPrefill: A Context-Aware Sparse Attention Mechanism for Efficient Long-Sequence Inferencecited by 121
- 2025SpargeAttention: Accurate and Training-free Sparse Attention Accelerating Any Model Inferencecited by 113
- 2024MagicPIG: LSH Sampling for Efficient LLM Generationcited by 112
- 2014Asymmetric LSH (ALSH) for Sublinear Time Maximum Inner Product Search (MIPS)cited by 109
- 2024Loki: Low-rank Keys for Efficient Sparse Attentioncited by 87
- 2023HyperAttention: Long-context Attention in Near-Linear Timecited by 85
- 2017Orthogonal Recurrent Neural Networks with Scaled Cayley Transformcited by 82
- 2024Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Modelscited by 71
- 2024Squeezed Attention: Accelerating Long Context Length LLM Inferencecited by 56
- 2025Twilight: Adaptive Attention Sparsity with Hierarchical Top-p Pruningcited by 48
- 2025SeerAttention-R: Sparse Attention Adaptation for Long Reasoningcited by 28
- 2025MMInference: Accelerating Pre-filling for Long-Context VLMs via Modality-Aware Permutation Sparse Attentioncited by 26
- 2024Star Attention: Efficient LLM Inference over Long Sequencescited by 25
- 2025Tactic: Adaptive Sparse Attention with Clustering and Distribution Fitting for Long-Context LLMscited by 24
- 2024HashAttention: Semantic Sparsity for Faster Inferencecited by 23
- 2025Efficient Attention Mechanisms for Large Language Models: A Surveycited by 21
- 2025Long-Context Generalization with Sparse Attentioncited by 18
- 2024A Training-free Sub-quadratic Cost Transformer Model Serving Framework With Hierarchically Pruned Attentioncited by 12
- 2025Efficient Many-Shot In-Context Learning with Dynamic Block-Sparse Attentioncited by 12
- 2024A Little Goes a Long Way: Efficient Long Context Training and Inference with Partial Contextscited by 9
- 2025Mustafar: Promoting Unstructured Sparsity for KV Cache Pruning in LLM Inferencecited by 7
- 2025HATA: Trainable and Hardware-Efficient Hash-Aware Top-k Attention for Scalable Large Model Inferencecited by 6
- 2026FASA: Frequency-aware Sparse Attentioncited by 6
- 2025Overcoming Long-Context Limitations of State-Space Models via Context-Dependent Sparse Attentioncited by 5
- 2025Retrospective Sparse Attention for Efficient Long-Context Generationcited by 4
- 2026Faster Than Flash: Exploiting Attention Sparsity for Efficient Long-Context Decodingcited by 4
- 2025Spotlight Attention: Towards Efficient LLM Generation via Non-linear Hashing-based KV Cache Retrievalcited by 2
Built on by
Not cited yet.