arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2503.14647cs.NI
收藏

通过复用已存储的KV缓存实现更经济的上下文增强大语言模型生成

Towards More Economical Context-Augmented LLM Generation by Reusing Stored KV Cache

Hanchen Li, Yuhan Liu, Yihua Cheng, Kuntai Du, Junchen Jiang

AI总结:

本研究针对LLM中KV缓存复用的经济可行性问题,提出并验证了基于多工作负载参数的云成本分析模型,证实长上下文场景下KV缓存复用可同时降延迟和减成本,呼吁发展更经济的上下文增强LLM。

摘要:

在各类大语言模型(LLM)应用中,我们观察到一种新兴趋势:复用KV缓存以减少处理不同LLM输入中重复文本的预填充延迟。这催生了广阔的设计空间,包括将已存储的KV缓存与GPU共置(或靠近GPU)以及各类KV缓存压缩方案。然而一个关键问题仍未解决:这些延迟降低是否也具备经济可行性?具体而言,我们探究开发者能否使用公有云服务存储预计算的KV缓存并复用它们来降低延迟,同时不会在计算、存储和网络方面产生更高成本。为回答该问题,我们提出并验证了一个分析模型,用于评估基于复用频率、生成文本长度、模型规模等各类工作负载参数存储和复用KV缓存的云成本(涵盖计算、存储和网络)。初步结果表明,在一系列长上下文工作负载中,KV缓存复用能够同时降低延迟和云成本。我们呼吁更多研究致力于通过KV缓存复用构建更经济的上下文增强LLM。

英文摘要:

Across large language model (LLM) applications, we observe an emerging trend for reusing KV caches to save the prefill delays of processing repeated input texts in different LLM inputs. This has led to a broad design space, including colocating stored KV caches with (or close to) GPUs to various KV cache compression. However, a key question remains unanswered: can these delay reductions also be economically favorable? Specifically, we ask whether a developer can use public cloud services to store precomputed KV caches and reuse them to save delay without incurring more costs in terms of compute, storage, and network. To answer this question, we propose an validated analytical model for the cloud cost (in compute, storage, and network) of storing and reusing KV caches based on various workload parameters, such as reuse frequency, generated text lengths, model sizes, etc. Preliminary results show that KV cache reusing is able to save both delay and cloud cost across a range of workloads with long context. And we call more efforts on building more economical context augmented LLM by KV cache reusing.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑