arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.13361cs.AIcs.CEcs.MA
收藏

我能买你的KV缓存吗?

Can I Buy Your KV Cache?

Harbin Institute of Technology, Shenzhen (HITSZ)(哈尔滨工业大学(深圳))

Luoyuan Zhang

AI总结:

针对AI代理重复计算相同文档KV缓存的问题,提出由发布者预计算KV缓存,其他代理付费加载以跳过预填充,实验表明在Qwen3-4B上计算成本降低9-50倍,并设计了代理原生预填充CDN架构。

摘要:

现在,在世界各地,AI代理正在重复同样的荒谬行为:为了读取一份文档,每个代理都从头开始重新计算。每个代理都重新运行预填充——大型模型最计算密集的步骤——在相同的文本上,只是为了重建一个与之前代理刚刚构建的完全相同的键值(KV)缓存。相同的答案,被计算了一百万次。我们提出了一个几乎粗鲁简单的建议:只计算一次。让发布者预计算文档的KV缓存,然后让每个其他代理购买加载该缓存并跳过预填充的权利。这可行,并且是token精确的:加载预计算的KV并继续与从头开始预填充匹配(24/24个贪婪token,并且在logits级别),没有准确度损失。在Qwen3-4B上,重用比预填充计算便宜9-50倍,并且差距随长度增加而扩大(预填充的注意力与L^2成比例),因此一次重用就足以收回成本。然后关键部分:KV存储在哪里。传输它失败了,因为KV几乎不可压缩,因此每次加载的出口成本比它节省的预填充成本还要高。将其托管在提供方侧,正如生产中的提示缓存那样,完全消除了出口成本。奖励的大小由我们测量的计算节省决定:为80M代理提供一份热门的3774-token文档,重新预填充成本约150万美元,而重用计算成本仅约3万美元(减少49.7倍)。API收取的0.1倍缓存读取关税在测量范围内为用户提供了10倍的折扣,因此10倍是下限,而测量的约50倍计算节省超过了它,与物理约50倍的差距是提供方的利润:每份热门文档数百万美元。我们构建了由此产生的代理原生预填充CDN,并将无损KV压缩和跨方支付层作为开放问题。

英文摘要:

Right now, across the world, AI agents are repeating the same absurd act: to read one document, they each recompute it from scratch. Every agent re-runs prefill, the most compute-intensive step a large model takes, over identical text, only to rebuild a key-value (KV) cache identical to the one the agent before it just built. The same answer, computed a million times. We make a proposal that is almost offensively simple: compute it once. Let a publisher precompute a document's KV cache, and let every other agent buy the right to load it and skip prefill. It works, and it is token-exact: loading a precomputed KV and continuing matches prefilling from scratch (24/24 greedy tokens, and at the logits level), with no accuracy cost. On Qwen3-4B, reuse is 9-50x cheaper in compute than prefill, and the gap widens with length (prefill's attention scales with L^2), so a single reuse already pays it back. Then the part that matters: where the KV lives. Shipping it fails, because KV is nearly incompressible, so per-load egress costs more than the prefill it saves. Hosting it provider-side, exactly as production prompt-caching works, removes egress entirely. The size of the prize is set by our measured compute saving: serving one hot 3774-token document to 80M agents costs ~$1.5M to re-prefill but only ~$0.03M of reuse compute (49.7x less). The 0.1x cache-read tariff APIs charge passes a 10x discount to users while sitting inside this measured envelope, so the 10x is a floor that the measured ~50x compute saving clears, and the gap to the physical ~50x is provider margin: millions of dollars per popular document. We frame the resulting agent-native prefill CDN and leave lossless KV compression and a cross-party payment layer as the open problems.

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

↑