SemantiCache: 通过语义分块和聚类合并实现高效的KV缓存压缩
SemantiCache: Efficient KV Cache Compression via Semantic Chunking and Clustered Merging
AI总结:
SemantiCache通过语义分块和聚类合并技术,有效压缩KV缓存,提升解码效率并减少内存占用,同时保持模型性能。
摘要:
现有KV缓存压缩方法通常针对离散令牌或非语义分块操作,导致语义碎片化,造成信息丢失和模型性能下降。为此,我们提出SemantiCache,一种新的压缩框架,通过与语言的语义层级性质对齐,保持语义完整性。具体而言,我们首先通过分隔符将缓存分成语义连贯的分块,然后在每个分块内引入计算高效的贪心种子基聚类(GSC)算法将令牌分组为语义聚类。这些聚类进一步合并为语义核心,通过比例注意力机制重新平衡合并令牌的减少注意力贡献。在多种基准和模型上的广泛实验表明,SemantiCache将推理阶段的解码速度提升高达2.61倍,并显著减少内存占用,同时保持与原始模型相当的性能。
英文摘要:
Existing KV cache compression methods generally operate on discrete tokens or non-semantic chunks. However, such approaches often lead to semantic fragmentation, where linguistically coherent units are disrupted, causing irreversible information loss and degradation in model performance. To address this, we introduce SemantiCache, a novel compression framework that preserves semantic integrity by aligning the compression process with the semantic hierarchical nature of language. Specifically, we first partition the cache into semantically coherent chunks by delimiters, which are natural semantic boundaries. Within each chunk, we introduce a computationally efficient Greedy Seed-Based Clustering (GSC) algorithm to group tokens into semantic clusters. These clusters are further merged into semantic cores, enhanced by a Proportional Attention mechanism that rebalances the reduced attention contributions of the merged tokens. Extensive experiments across diverse benchmarks and models demonstrate that SemantiCache accelerates the decoding stage of inference by up to 2.61 times and substantially reduces memory footprint, while maintaining performance comparable to the original model.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。