mlsanityData to 14 Oct 2026

HashEvict: A Pre-Attention KV Cache Eviction Strategy using Locality-Sensitive Hashing

arXiv 2412.16187 ↗First posted 13 Dec 2024cs.LG cs.AI cs.CLcited by 6

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

  1. 2024Model Tells You Where to Merge: Adaptive KV Cache Merging for LLMs on Long-Context Tasks11 Jul
  2. 2024Attention Score is not All You Need for Token Importance Indicator in KV Cache Reduction: Value Also Matters18 Jun
  3. 2024A Simple and Effective L2 Norm-Based Strategy for KV Cache Compression17 Jun
  4. 2024MiniCache: KV Cache Compression in Depth Dimension for Large Language Models23 May
  5. 2024D'ej`aVu: KV-cache Streaming for Fast, Fault-tolerant Generative LLM Serving4 Mar
  6. 2024SubGen: Token Generation in Sublinear Time and Memory8 Feb
  7. 2023Model Tells You What to Discard: Adaptive KV Cache Compression for LLMs3 Oct
  8. 2023H2O: Heavy-Hitter Oracle for Efficient Generative Inference of Large Language Models24 Jun
  9. 2023Scissorhands: Exploiting the Persistence of Importance Hypothesis for LLM KV Cache Compression at Test Time26 May

Other references · 27

  1. 2017Attention Is All You Needcited by 60,361
  2. 2024The Llama 3 Herd of Modelscited by 14,715
  3. 2021Training Verifiers to Solve Math Word Problemscited by 10,109
  4. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
  5. 2020Longformer: The Long-Document Transformercited by 3,413
  6. 2023A Survey of Large Language Modelscited by 2,576
  7. 2022Emergent Abilities of Large Language Modelscited by 2,512
  8. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
  9. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
  10. 2020Reformer: The Efficient Transformercited by 1,668
  11. 2019Generating Long Sequences with Sparse Transformerscited by 1,546
  12. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,417
15 more
  1. 2020What Disease does this Patient Have? A Large-scale Open Domain Question Answering Dataset from Medical Examscited by 1,356
  2. 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,346
  3. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
  4. 2015Effective Approaches to Attention-based Neural Machine Translationcited by 1,026
  5. 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 717
  6. 2024KVQuant: Towards 10 Million Context Length LLM Inference with KV Cache Quantizationcited by 591
  7. 2023FlexGen: High-Throughput Generative Inference of Large Language Models with a Single GPUcited by 575
  8. 2023HyperAttention: Long-context Attention in Near-Linear Timecited by 85
  9. 2022Formal Algorithms for Transformerscited by 72
  10. 2021Memory-efficient Transformers via Top-k Attentioncited by 60
  11. 2023KDEformer: Accelerating Transformers via Kernel Density Estimationcited by 58
  12. 2024QJL: 1-Bit Quantized JL Transform for KV Cache Quantization with Zero Overheadcited by 52
  13. 2018Approximate Nearest Neighbor Search in High Dimensionscited by 47
  14. 2022Beyond Attentive Tokens: Incorporating Token Importance and Diversity for Efficient Vision Transformerscited by 47
  15. 2024Challenges in Deploying Long-Context Transformers: A Theoretical Peak Performance Analysiscited by 44

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 3; 2026: 3.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Spotlight Attention: Towards Efficient LLM Generation via Non-linear Hashing-based KV Cache Retrieval
  2. 2026Back from the Future: Key-Value Cache Management by Counter-Causal Surprise
  3. 2026Multi-Segment Attention: Enabling Efficient KV-Cache Management for Faster Large Language Model Serving
  4. 2025HCAttention: Extreme KV Cache Compression via Heterogeneous Attention Computing for LLMs
  5. 2025SpeCache: Speculative Key-Value Caching for Efficient Generation of LLMs
  6. 2026Behavior-Preserving KV Cache Compression
  7. 2024CORM: Cache Optimization with Recent Message for Large Language Model Inference
  8. 2026Where Matters More Than What: Decoding-aligned KV Cache Compression via Position-aware Pseudo Queries