TailorKV: A Hybrid Framework for Long-Context Inference via Tailored KV Cache Optimization

The Key-Value (KV) cache in generative large language models (LLMs) introduces substantial memory overhead.Existing works mitigate this burden by offloading or compressing the KV cache.However, loading the entire cache incurs significant latency due to PCIe bandwidth bottlenecks in CPU-GPU communication, while aggressive compression causes notable performance degradation.We identify that certain layers in the LLM need to maintain global information and are unsuitable for selective loading.In contrast, other layers primarily focus on a few tokens with dominant activations that potentially incur substantial quantization error.This observation leads to a key insight that loading dominant tokens and quantizing all tokens can complement each other.Building on this insight, we propose a hybrid compression method, TailorKV, which seamlessly integrates quantization and offloading.TailorKV develops an inference framework along with a hardware-friendly implementation that leverages these complementary characteristics.Extensive long-context evaluations exhibit that TailorKV achieves nearly lossless performance under aggressive compression settings, outperforming the state-of-the-art.Particularly, the Llama-3.1-8B with 128k context can be served within a single RTX 3090 GPU, reaching 82 ms per token during decoding 1 .

Authors

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.findings-acl.1043
Primary Topic
Caching and Content Delivery
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

TailorKV: A Hybrid Framework for Long-Context Inference via Tailored KV Cache Optimization

Zheng Lin, Jian Luan, D.D. Yao, Bin Wang et al.
Caching and Content Delivery
article

TailorKV: A Hybrid Framework for Long-Context Inference via Tailored KV Cache Optimization

Zheng Lin, Jian Luan, D.D. Yao, Bin Wang, Bowen Shen, Wei Liu, Weiping Wang
article en

Abstract

The Key-Value (KV) cache in generative large language models (LLMs) introduces substantial memory overhead.Existing works mitigate this burden by offloading or compressing the KV cache.However, loading the entire cache incurs significant latency due to PCIe bandwidth bottlenecks in CPU-GPU communication, while aggressive compression causes notable performance degradation.We identify that certain layers in the LLM need to maintain global information and are unsuitable for selective loading.In contrast, other layers primarily focus on a few tokens with dominant activations that potentially incur substantial quantization error.This observation leads to a key insight that loading dominant tokens and quantizing all tokens can complement each other.Building on this insight, we propose a hybrid compression method, TailorKV, which seamlessly integrates quantization and offloading.TailorKV develops an inference framework along with a hardware-friendly implementation that leverages these complementary characteristics.Extensive long-context evaluations exhibit that TailorKV achieves nearly lossless performance under aggressive compression settings, outperforming the state-of-the-art.Particularly, the Llama-3.1-8B with 128k context can be served within a single RTX 3090 GPU, reaching 82 ms per token during decoding 1 .

National Natural Science Foundation of China
Openalex Percentile: Top 79%
Caching and Content Delivery
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.