arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2410.15332cs.LGcs.CLcs.DCcs.PF
收藏

EPIC:面向大型语言模型服务的高效位置无关缓存

EPIC: Efficient Position-Independent Caching for Serving Large Language Models

Peking University(北京大学);Nanjing University(南京大学);Huawei Cloud(华为云)

Junhao Hu, Wenrui Huang, Weidong Wang, Haoyi Wang, Tiancheng Hu, Qin Zhang, Hao Feng, Xusheng Chen, Yizhou Shan, Tao Xie

AI总结:

EPIC提出位置无关缓存及LegoLink算法,解决LLM服务中前缀不匹配导致的缓存重用受限问题,实现高达8倍TTFT改进和7倍吞吐提升,且几乎不损失精度。

摘要:

大型语言模型(LLMs)在广泛的应用中展现出强大的能力,但随着请求(提示)变得越来越复杂,高效地服务它们变得日益具有挑战性。上下文缓存通过重用键值(KV)向量(即跨请求重复出现的令牌的中间表示)来提升服务性能。然而,现有的上下文缓存要求跨请求的精确前缀匹配,这限制了在少样本学习和检索增强生成等场景中的重用,在这些场景中,不可变内容(例如文档)在请求间保持不变,但其前面有变化的前缀。位置无关缓存(PIC)通过实现KV向量的模块化重用(无论前缀如何)解决了这一问题。我们形式化了PIC,并通过引入EPIC(一种结合了我们新的LegoLink算法的服务系统)推进了先前的工作,该算法减轻了每个文档开头处不恰当的“注意力汇聚”效应,以最小的计算开销保持准确性。实验表明,与现有系统相比,EPIC在首令牌时间(TTFT)上实现了高达8倍的改进,吞吐量提升了7倍,且准确率损失可忽略不计或没有损失。

英文摘要:

Large Language Models (LLMs) show great capabilities in a wide range of applications, but serving them efficiently becomes increasingly challenging as requests (prompts) become more complex. Context caching improves serving performance by reusing Key-Value (KV) vectors, the intermediate representations of tokens that are repeated across requests. However, existing context caching requires exact prefix matches across requests, limiting reuse cases in settings such as few-shot learning and retrieval-augmented generation, where immutable content (e.g., documents) remains unchanged across requests but is preceded by varying prefixes. Position-Independent Caching (PIC) addresses this issue by enabling modular reuse of the KV vectors regardless of prefixes. We formalize PIC and advance prior work by introducing EPIC, a serving system incorporating our new LegoLink algorithm, which mitigates the inappropriate "attention sink" effect at every document beginning, to maintain accuracy with minimal computation. Experiments show that EPIC achieves up to 8x improvements in Time-To-First-Token (TTFT) and 7x throughput gains over existing systems, with negligible or no accuracy loss.

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

↑