PolyKV:一种用于多智能体LLM推理的共享非对称压缩KV缓存池
PolyKV: A Shared Asymmetrically-Compressed KV Cache Pool for Multi-Agent LLM Inference
AI总结:
PolyKV通过非对称压缩技术实现多个并发推理代理共享单一KV缓存池,提升内存效率并减少推理延迟。
摘要:
我们介绍了PolyKV,一种允许多个并发推理代理共享单一非对称压缩KV缓存池的系统。与为每个代理分配单独KV缓存的传统方法不同,PolyKV在一次压缩后通过HuggingFace DynamicCache对象将压缩缓存注入N个独立代理上下文中。压缩是非对称的:键被量化为int8(q8_0)以保持softmax稳定性,而值则使用TurboQuant MSE进行压缩——一种快速沃尔什-哈达玛变换(FWHT)旋转后跟3位Lloyd-Max量化,其中心点经过N(0,1)调整。我们评估了两种模型规模(SmolLM2-1.7B-Instruct和Llama-3-8B-Instruct)、三个上下文长度(600-7,194 tokens)以及最多15个并发代理。PolyKV在所有配置中实现了稳定的2.91倍压缩率。在Llama-3-8B中,15个代理共享4K-token上下文时,PolyKV将KV缓存内存从19.8 GB减少到0.45 GB——减少了97.7%,同时仅导致+0.57%的困惑度退化和平均BERTScore F1为0.928。PPL差异不随代理数量增长,而随着上下文长度增加而改善,在1,851个相干token时达到-0.26%。据我们所知,没有先前工作结合了单一共享、损失性压缩的KV池与多读者并发代理访问。
英文摘要:
We present PolyKV, a system in which multiple concurrent inference agents share a single, asymmetrically compressed KV cache pool. Rather than allocating a separate KV cache per agent -- the standard paradigm -- PolyKV writes a compressed cache once and injects it into N independent agent contexts via HuggingFace DynamicCache objects. Compression is asymmetric: Keys are quantized at int8 (q8_0) to preserve softmax stability, while Values are compressed using TurboQuant MSE -- a Fast Walsh-Hadamard Transform (FWHT) rotation followed by 3-bit Lloyd-Max quantization with centroids tuned to N(0,1). We evaluate across two model scales (SmolLM2-1.7B-Instruct and Llama-3-8B-Instruct), three context lengths (600-7,194 tokens), and up to 15 concurrent agents. PolyKV achieves a stable 2.91x compression ratio across all configurations. On Llama-3-8B with 15 agents sharing a 4K-token context, PolyKV reduces KV cache memory from 19.8 GB to 0.45 GB -- a 97.7% reduction -- while maintaining only +0.57% perplexity degradation and a mean BERTScore F1 of 0.928. PPL delta does not grow with agent count and improves as context length increases, inverting to -0.26% at 1,851 coherent tokens. To our knowledge, no prior work combines a single shared, lossy-compressed KV pool with multi-reader concurrent agent access.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。