SubGen:亚线性和亚内存的令牌生成
SubGen: Token Generation in Sublinear Time and Memory
AI总结:
SubGen提出一种基于在线聚类与ℓ2采样的KV缓存压缩方法,实现亚线性内存与时间复杂度的注意力解码,在长上下文问答中优于现有压缩方法。
摘要:
尽管大型语言模型(LLMs)取得了显著成功,但其庞大的内存需求给长上下文令牌生成中的部署带来了挑战。LLM解码器的大量内存占用源于注意力模块中必须存储所有先前令牌的需求,这一要求是由键值(KV)缓存施加的。在这项工作中,我们专注于为KV缓存开发一种高效的压缩技术。经验证据表明,注意力模块中的键嵌入存在显著的聚类倾向。基于这一关键洞察,我们设计了一种具有亚线性复杂度的新型缓存方法,采用对键令牌的在线聚类和对值的在线$\u2113_2$采样。结果是一种可证明准确且高效的注意力解码算法,称为SubGen。该算法不仅确保了亚线性内存占用和亚线性时间复杂度,我们还为我们的方法建立了严格的误差界限。在长上下文问答任务上的实证评估表明,SubGen在性能和效率方面显著优于现有的和最先进的KV缓存压缩方法。
英文摘要:
Despite the significant success of large language models (LLMs), their extensive memory requirements pose challenges for deploying them in long-context token generation. The substantial memory footprint of LLM decoders arises from the necessity to store all previous tokens in the attention module, a requirement imposed by key-value (KV) caching. In this work, our focus is on developing an efficient compression technique for the KV cache. Empirical evidence indicates a significant clustering tendency within key embeddings in the attention module. Building on this key insight, we have devised a novel caching method with sublinear complexity, employing online clustering on key tokens and online $\ell_2$ sampling on values. The result is a provably accurate and efficient attention decoding algorithm, termed SubGen. Not only does this algorithm ensure a sublinear memory footprint and sublinear time complexity, but we also establish a tight error bound for our approach. Empirical evaluations on long-context question-answering tasks demonstrate that SubGen significantly outperforms existing and state-of-the-art KV cache compression methods in terms of performance and efficiency.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。