paper-with-me

홈 › Papers

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

2024-12-13 · Minghui Liu, Tahseen Rabbani, Tony O'Halloran, Ananth Sankaralingam, Mary-Anne Hartley, Furong Huang, Cornelia Fermüller, Yiannis Aloimonos

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.

📄 PDF Abstract BibTeX arXiv:2412.16187

Code (0)

등록된 구현이 없습니다.

Tasks

GPUMultiple-choice

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Attention 설명 없음

Similar Papers 제목 키워드 기반

Ada-KV: Optimizing KV Cache Eviction by Adaptive Budget Allocation for Efficient LLM Inference

2024-07-16 · Yuan Feng, Junlin Lv, Yukun Cao, Xike Xie 외

Large Language Models have excelled in various domains but face efficiency challenges due to the growing Key-Value (KV) cache required for long-sequence inference. Recent efforts aim to reduce KV cache size by evicting v…

PagedEviction: Structured Block-wise KV Cache Pruning for Efficient Large Language Model Inference

2025-09-04 · Krishna Teja Chitty-Venkata, Jie Ye, Xian-He Sun, Anthony Kougkas 외 arxiv

KV caching significantly improves the efficiency of Large Language Model (LLM) inference by storing attention states from previously processed tokens, enabling faster generation of subsequent tokens. However, as sequence…

NACL: A General and Effective KV Cache Eviction Framework for LLMs at Inference Time

2024-08-07 · Yilong Chen, Guoxia Wang, Junyuan Shang, Shiyao Cui 외

Large Language Models (LLMs) have ignited an innovative surge of AI applications, marking a new era of exciting possibilities equipped with extended context windows. However, hosting these models is cost-prohibitive main…

Reformulating KV Cache Eviction Problem for Long-Context LLM Inference

2026-05-08 · Tho Mai, Joo-Young Kim arxiv

Large language models (LLMs) support long-context inference but suffer from substantial memory and runtime overhead due to Key-Value (KV) Cache growth. Existing KV Cache eviction methods primarily rely on local attention…

Hierarchical Adaptive Eviction for KV Cache Management in Multimodal Language Models

2026-02-02 · Xindian Ma, Yidi Lu, Peng Zhang, Jing Zhang arxiv

The integration of visual information into Large Language Models (LLMs) has enabled Multimodal LLMs (MLLMs), but the quadratic memory and computational costs of Transformer architectures remain a bottleneck. Existing KV …

Story Generation