LoRC: Low-Rank Compression for LLMs KV Cache with a Progressive Compression Strategy

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Zhang, Rongzhi, Wang, Kuang, Liu, Liyuan, Wang, Shuohang, Cheng, Hao, Zhang, Chao, Shen, Yelong
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866909335720820736
author Zhang, Rongzhi
Wang, Kuang
Liu, Liyuan
Wang, Shuohang
Cheng, Hao
Zhang, Chao
Shen, Yelong
author_facet Zhang, Rongzhi
Wang, Kuang
Liu, Liyuan
Wang, Shuohang
Cheng, Hao
Zhang, Chao
Shen, Yelong
contents The Key-Value (KV) cache is a crucial component in serving transformer-based autoregressive large language models (LLMs), enabling faster inference by storing previously computed KV vectors. However, its memory consumption scales linearly with sequence length and batch size, posing a significant bottleneck in LLM deployment. Existing approaches to mitigate this issue include: (1) efficient attention variants integrated in upcycling stages, which requires extensive parameter tuning thus unsuitable for pre-trained LLMs; (2) KV cache compression at test time, primarily through token eviction policies, which often overlook inter-layer dependencies and can be task-specific. This paper introduces an orthogonal approach to KV cache compression. We propose a low-rank approximation of KV weight matrices, allowing for plug-in integration with existing transformer-based LLMs without model retraining. To effectively compress KV cache at the weight level, we adjust for layerwise sensitivity and introduce a progressive compression strategy, which is supported by our theoretical analysis on how compression errors accumulate in deep networks. Our method is designed to function without model tuning in upcycling stages or task-specific profiling in test stages. Extensive experiments with LLaMA models ranging from 8B to 70B parameters across various tasks show that our approach significantly reduces the GPU memory footprint while maintaining performance.
format Preprint
id arxiv_https___arxiv_org_abs_2410_03111
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle LoRC: Low-Rank Compression for LLMs KV Cache with a Progressive Compression Strategy
Zhang, Rongzhi
Wang, Kuang
Liu, Liyuan
Wang, Shuohang
Cheng, Hao
Zhang, Chao
Shen, Yelong
Machine Learning
Artificial Intelligence
Computation and Language
I.2
The Key-Value (KV) cache is a crucial component in serving transformer-based autoregressive large language models (LLMs), enabling faster inference by storing previously computed KV vectors. However, its memory consumption scales linearly with sequence length and batch size, posing a significant bottleneck in LLM deployment. Existing approaches to mitigate this issue include: (1) efficient attention variants integrated in upcycling stages, which requires extensive parameter tuning thus unsuitable for pre-trained LLMs; (2) KV cache compression at test time, primarily through token eviction policies, which often overlook inter-layer dependencies and can be task-specific. This paper introduces an orthogonal approach to KV cache compression. We propose a low-rank approximation of KV weight matrices, allowing for plug-in integration with existing transformer-based LLMs without model retraining. To effectively compress KV cache at the weight level, we adjust for layerwise sensitivity and introduce a progressive compression strategy, which is supported by our theoretical analysis on how compression errors accumulate in deep networks. Our method is designed to function without model tuning in upcycling stages or task-specific profiling in test stages. Extensive experiments with LLaMA models ranging from 8B to 70B parameters across various tasks show that our approach significantly reduces the GPU memory footprint while maintaining performance.
title LoRC: Low-Rank Compression for LLMs KV Cache with a Progressive Compression Strategy
topic Machine Learning
Artificial Intelligence
Computation and Language
I.2
url https://arxiv.org/abs/2410.03111