Skip to content

HHR: Hierarchical Hash Retrieval for Efficient LLM Generation

Oct 2026 · 0 citations · 54 references
Computer Science

TL;DR

H Hierarchical Hash Retrieval (HHR) is proposed, a coarse-to-fine framework that progressively improves retrieval accuracy through Geometry-Aware Key Routing and Learned Hash Projection, substantially improving the fidelity of hash-based sparse attention.

Abstract

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.

View source

Similar papers

Open access Sep 2026

Attention-enhanced vision transformer hashing for hybrid image retrieval

Large-scale image retrieval requires compact representations without substantially sacrificing retrieval accuracy. However, Vision Transformer Hashing (VTS) concatenates all output tokens before hash projection, resulting in a high-dimensional hashing head with considerable model and memory overhead. We replace this to...

U. Nguyen, Hoai Ba, Quynh Dao Thi Thuy · 0 citations
#natural language process... Preprint Oct 2026

Joint Subspace Sparse Attention for Efficient Long-Context Decoding

Sparse attention reduces the KV-cache traffic that dominates long-context LLM decoding, but practical methods largely operate at coarse granularity. Token-level selection offers finer control, yet presents two challenges: low-dimensional scoring may lose query--key structure needed for accurate ranking, while gathering...

Jiwon Song, Yoon Kim, Jae-Joon Kim · 0 citations
#artificial intelligence Preprint Oct 2026

More Value per Key: Asymmetric Sparse Attention for Faster LLM Decoding

Autoregressive generation in Large Language Models (LLMs) is constrained by the memory and computational demands of attention mechanisms. Sparse attention methods mitigate this cost by selecting only high-probability entries of the attention matrix. We observe that in many such methods, this renders the probability-val...

Noam Elata, Itay Lamprecht, Mikey Shechter et al. · 0 citations
Book Open access Nov 2026

LSH-KV: Efficient KV Cache Retrieval for Long-Context LLM Inference via Locality-Sensitive Hashing

As large language models increasingly support long-context inference, the computation and memory access overhead of attention and KV caches have become critical bottlenecks for inference latency and system scalability. Existing approaches mitigate these costs through KV cache dropping, approximate attention, or system-...

Hao-Huan Feng, Shi-Yu Yang, Yuxuan Lu et al. · 0 citations
Open access Oct 2026

Contextual Hashing with Decoupled Localization for Efficient Video Corpus Moment Retrieval.

The aim of Video Corpus Moment Retrieval (VCMR) is to locate temporal moments within a large video corpus on the basis of textual queries; however, it faces challenges in balancing retrieval efficiency and localization accuracy. Existing approaches typically rely on high-dimensional continuous embeddings for retrieval...

Ming-Jin Kuai, Jin-Zhuo Peng, Zhe-Qi Lv et al. · 0 citations

Related blog posts

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.