TesseraKV:基于共检索的KV分页技术
TesseraKV: KV Paging via Co-retrieval
AI总结:
TesseraKV从共检索推导KV分页的页面构建与评分,在匹配KV预算下,于多类LLM及智能体任务中提升生成质量,Claw-Eval任务成功率较SOTA提升27.74个百分点。
摘要:
智能体工作负载越来越多地在长上下文上运行,导致KV缓存快速增长,使得内存带宽成为生成过程中的主要瓶颈。KV分页通过保留缓存,仅在每个解码步骤检索所需页面来缓解这一成本。KV分页存在两个关键挑战:如何将键分组为页面,以及如何对页面进行检索评分。现有方法使用启发式方法构建页面,并使用单独的标准对这些页面进行评分。相反,这两个决策应源自一个共同目标:页面中的键是否可能被一起检索。我们提出TesseraKV,它从共检索中推导页面构建和页面评分:当键在注意力头的查询分布下的注意力logit倾向于共同变化时,它们应共享一个页面。这一共同原则产生了用于划分键的协方差加权几何,以及用于估计每个页面注意力质量的感知扩散评分。由于构建缓存时无法获得解码查询分布,我们进一步研究如何从预先可用的查询中估计这一几何。我们发现,预填充查询为解码查询几何提供了有用但依赖于任务的信号,而纳入下游指令的查询显著改善了与划分相关的共检索结构。在一系列使用NoPE的LLM、长上下文任务和智能体工作负载中,TesseraKV在匹配的KV预算下,始终比最先进的KV检索方法提高了下游生成质量。例如,在Claw-Eval智能体任务上,TesseraKV实现了70.32的总体成功率,比之前的最先进水平42.58提高了27.74个百分点。我们还报告了TesseraKV在RoPE模型上的实验结果及其与KV CPU卸载的集成情况。
英文摘要:
Agentic workloads increasingly operate over long contexts, causing KV caches to grow rapidly and making memory bandwidth a major bottleneck during generation. KV paging alleviates this cost by retaining the cache while retrieving only the pages needed at each decoding step. There are two critical challenges in KV paging: how keys are grouped into pages and how pages are scored for retrieval. Existing methods construct pages using heuristics, and score those pages using a separate criterion. These two decisions should instead be derived from a common objective: whether the keys in a page are likely to be retrieved together. We propose TesseraKV, which derives both page construction and page scoring from co-retrieval: keys should share a page when their attention logits tend to vary together under the query distribution of a head. This common principle yields a covariance-weighted geometry for partitioning keys and a spread-aware score for estimating the attention mass of each page. Because the decoding-query distribution is unavailable when the cache is constructed, we further study how to estimate this geometry from queries available beforehand. We find that prefill queries provide a useful but task-dependent signal for decoding-query geometry, while incorporating queries from the downstream instruction substantially improves the co-retrieval structure relevant to partitioning. Across a range of LLMs with NoPE, long-context tasks, and agentic workloads, TesseraKV consistently improves downstream generation quality over state-of-the-art KV retrieval methods at matched KV budgets. For example, on Claw-Eval agentic tasks, TesseraKV achieves an overall success rate of 70.32, improving over the previous state of the art at 42.58 by 27.74 points. We further report empirical results of TesseraKV on RoPE models and its integration with KV CPU offloading.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。