HashEvict: A Pre-Attention KV Cache Eviction Strategy using Locality-Sensitive Hashing
On the map: Efficient LLM inference and serving → KV cache optimization
Abstract (arXiv)
Transformer-based large language models (LLMs) use the key-value (KV) cache to significantly accelerate inference by storing the key and value embeddings of past tokens. However, this cache consumes significant GPU memory. In this work, we introduce HashEvict, an algorithm that uses locality-sensitive hashing (LSH) to compress the KV cache. HashEvict quickly locates tokens in the cache that are cosine dissimilar to the current query token. This is achieved by computing the Hamming distance between binarized Gaussian projections of the current token query and cached token keys, with a projection length much smaller than the embedding dimension. We maintain a lightweight binary structure in GPU memory to facilitate these calculations. Unlike existing compression strategies that compute attention to determine token retention, HashEvict makes these decisions pre-attention, thereby reducing computational costs. Additionally, HashEvict is dynamic - at every decoding step, the key and value of the current token replace the embeddings of a token expected to produce the lowest attention score. We demonstrate that HashEvict can compress the KV cache by 30%-70% while maintaining high performance across reasoning, multiple-choice, long-context retrieval and summarization tasks.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Placed in KV cache optimization, one of 12 directions in Efficient LLM inference and serving. Builds on 36 of its 40 references that are in the map. First posted on arXiv 13 Dec 2024.
Builds on
36 of 40 references.
Closest ancestors · 9
Same direction, newest first
- 2024Model Tells You Where to Merge: Adaptive KV Cache Merging for LLMs on Long-Context Tasks11 Jul
- 2024Attention Score is not All You Need for Token Importance Indicator in KV Cache Reduction: Value Also Matters18 Jun
- 2024A Simple and Effective L2 Norm-Based Strategy for KV Cache Compression17 Jun
- 2024MiniCache: KV Cache Compression in Depth Dimension for Large Language Models23 May
- 2024D'ej`aVu: KV-cache Streaming for Fast, Fault-tolerant Generative LLM Serving4 Mar
- 2024SubGen: Token Generation in Sublinear Time and Memory8 Feb
- 2023Model Tells You What to Discard: Adaptive KV Cache Compression for LLMs3 Oct
- 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models24 Jun
- 2023Scissorhands: Exploiting the Persistence of Importance Hypothesis for LLM KV Cache Compression at Test Time26 May
Other references · 27
- 2017Attention Is All You Needcited by 60,361
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2021Training Verifiers to Solve Math Word Problemscited by 10,109
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
- 2020Longformer: The Long-Document Transformercited by 3,413
- 2023A Survey of Large Language Modelscited by 2,576
- 2022Emergent Abilities of Large Language Modelscited by 2,512
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
- 2020Reformer: The Efficient Transformercited by 1,668
- 2019Generating Long Sequences with Sparse Transformerscited by 1,546
- 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
15 more
- 2020What Disease does this Patient Have? A Large-scale Open Domain Question Answering Dataset from Medical Examscited by 1,356
- 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,346
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
- 2015Effective Approaches to Attention-based Neural Machine Translationcited by 1,026
- 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 717
- 2024KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantizationcited by 591
- 2023FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPUcited by 575
- 2023HyperAttention: Long-context Attention in Near-Linear Timecited by 85
- 2022Formal Algorithms for Transformerscited by 72
- 2021Memory-efficient Transformers via Top-k Attentioncited by 60
- 2023KDEformer: Accelerating Transformers via Kernel Density Estimationcited by 58
- 2024QJL: 1-Bit Quantized JL Transform for KV Cache Quantization with Zero Overheadcited by 52
- 2018Approximate Nearest Neighbor Search in High Dimensionscited by 47
- 2022Beyond Attentive Tokens: Incorporating Token Importance and Diversity for Efficient Vision Transformerscited by 47
- 2024Challenges in Deploying Long-Context Transformers: A Theoretical Peak Performance Analysiscited by 44
Built on by
Citing papers per year: 2025: 3; 2026: 3.
6 papers.
- 2025Hold Onto That Thought: Assessing KV Cache Compression On Reasoningcited by 6
- 2025Efficient Low Rank Attention for Long-Context Inference in Large Language Modelscited by 4
- 2026KV Cache Optimization Strategies for Scalable and Efficient LLM Inferencecited by 3
- 2026Sublinear Time Quantum Algorithm for Attention Approximationcited by 1
- 2025PatternKV: Flattening KV Representation Expands Quantization Headroomcited by 0
- 2026Near-Oracle KV Selection via Pre-hoc Sparsity for Long-Context Inferencecited by 0
- 2026KV Cache Optimization Strategies for Scalable and Efficient LLM Inference20 Mar 2026
- 2026Near-Oracle KV Selection via Pre-hoc Sparsity for Long-Context Inference9 Feb 2026
- 2026Sublinear Time Quantum Algorithm for Attention Approximation31 Jan 2026
- 2025Hold Onto That Thought: Assessing KV Cache Compression On Reasoning12 Dec 2025
- 2025Efficient Low Rank Attention for Long-Context Inference in Large Language Models25 Oct 2025
- 2025PatternKV: Flattening KV Representation Expands Quantization Headroom5 Oct 2025
Similar, not cited
Close in wording, no citation either way
- 2025Spotlight Attention: Towards Efficient LLM Generation via Non-linear Hashing-based KV Cache Retrieval
- 2026Back from the Future: Key-Value Cache Management by Counter-Causal Surprise
- 2026Multi-Segment Attention: Enabling Efficient KV-Cache Management for Faster Large Language Model Serving
- 2025HCAttention: Extreme KV Cache Compression via Heterogeneous Attention Computing for LLMs
- 2025SpeCache: Speculative Key-Value Caching for Efficient Generation of LLMs
- 2026Behavior-Preserving KV Cache Compression
- 2024CORM: Cache Optimization with Recent Message for Large Language Model Inference
- 2026Where Matters More Than What: Decoding-aligned KV Cache Compression via Position-aware Pseudo Queries