跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 机器学习

arXiv:2403.09054 (cs)
[提交于 2024年3月14日]

标题:Keyformer: KV Cache Reduction through Key Tokens Selection for Efficient Generative Inference

作者:Muhammad Adnan, Akhil Arunkumar, Gaurav Jain, Prashant J. Nair, Ilya Soloveychik, Purushotham Kamath
查看论文《Keyformer: KV Cache Reduction through Key Tokens Selection for Efficient Generative Inference》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Transformers have emerged as the underpinning architecture for Large Language Models (LLMs). In generative language models, the inference process involves two primary phases: prompt processing and token generation. Token generation, which constitutes the majority of the computational workload, primarily entails vector-matrix multiplications and interactions with the Key-Value (KV) Cache. This phase is constrained by memory bandwidth due to the overhead of transferring weights and KV cache values from the memory system to the computing units. This memory bottleneck becomes particularly pronounced in applications that require long-context and extensive text generation, both of which are increasingly crucial for LLMs. This paper introduces "Keyformer", an innovative inference-time approach, to mitigate the challenges associated with KV cache size and memory bandwidth utilization. Keyformer leverages the observation that approximately 90% of the attention weight in generative inference focuses on a specific subset of tokens, referred to as "key" tokens. Keyformer retains only the key tokens in the KV cache by identifying these crucial tokens using a novel score function. This approach effectively reduces both the KV cache size and memory bandwidth usage without compromising model accuracy. We evaluate Keyformer's performance across three foundational models: GPT-J, Cerebras-GPT, and MPT, which employ various positional embedding algorithms. Our assessment encompasses a variety of tasks, with a particular emphasis on summarization and conversation tasks involving extended contexts. Keyformer's reduction of KV cache reduces inference latency by 2.1x and improves token generation throughput by 2.4x, while preserving the model's accuracy.
主题: 机器学习 (cs.LG); 人工智能 (cs.AI); 硬件体系结构 (cs.AR); 计算与语言 (cs.CL)
引用方式: arXiv:2403.09054 [cs.LG]
  (或者 arXiv:2403.09054v1 [cs.LG] 对于此版本)
  https://doi.org/10.48550/arXiv.2403.09054
期刊参考: Proceedings of the 7th Annual Conference on Machine Learning and Systems (MLSys), 2024

提交历史

来自:Prashant Jayaprakash Nair
[v1] 2024年3月14日 星期四 02:42:42 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.LG
< 上一篇   |   下一篇 >
最新 | 近期 | 2024-03
切换浏览方式为:
cs
cs.AI
cs.AR
cs.CL

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站