Eigen Attention: Attention in Low-Rank Space for KV Cache Compression

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Saxena, Utkarsh, Saha, Gobinda, Choudhary, Sakshi, Roy, Kaushik
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866916472606949376
author Saxena, Utkarsh
Saha, Gobinda
Choudhary, Sakshi
Roy, Kaushik
author_facet Saxena, Utkarsh
Saha, Gobinda
Choudhary, Sakshi
Roy, Kaushik
contents Large language models (LLMs) represent a groundbreaking advancement in the domain of natural language processing due to their impressive reasoning abilities. Recently, there has been considerable interest in increasing the context lengths for these models to enhance their applicability to complex tasks. However, at long context lengths and large batch sizes, the key-value (KV) cache, which stores the attention keys and values, emerges as the new bottleneck in memory usage during inference. To address this, we propose Eigen Attention, which performs the attention operation in a low-rank space, thereby reducing the KV cache memory overhead. Our proposed approach is orthogonal to existing KV cache compression techniques and can be used synergistically with them. Through extensive experiments over OPT, MPT, and Llama model families, we demonstrate that Eigen Attention results in up to 40% reduction in KV cache sizes and up to 60% reduction in attention operation latency with minimal drop in performance. Code is available at https://github.com/UtkarshSaxena1/EigenAttn.
format Preprint
id arxiv_https___arxiv_org_abs_2408_05646
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Eigen Attention: Attention in Low-Rank Space for KV Cache Compression
Saxena, Utkarsh
Saha, Gobinda
Choudhary, Sakshi
Roy, Kaushik
Machine Learning
Artificial Intelligence
Computation and Language
Large language models (LLMs) represent a groundbreaking advancement in the domain of natural language processing due to their impressive reasoning abilities. Recently, there has been considerable interest in increasing the context lengths for these models to enhance their applicability to complex tasks. However, at long context lengths and large batch sizes, the key-value (KV) cache, which stores the attention keys and values, emerges as the new bottleneck in memory usage during inference. To address this, we propose Eigen Attention, which performs the attention operation in a low-rank space, thereby reducing the KV cache memory overhead. Our proposed approach is orthogonal to existing KV cache compression techniques and can be used synergistically with them. Through extensive experiments over OPT, MPT, and Llama model families, we demonstrate that Eigen Attention results in up to 40% reduction in KV cache sizes and up to 60% reduction in attention operation latency with minimal drop in performance. Code is available at https://github.com/UtkarshSaxena1/EigenAttn.
title Eigen Attention: Attention in Low-Rank Space for KV Cache Compression
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2408.05646