arXiv:2510.22556cs.CL2025-10被引 4

SABlock通过语义感知自适应块大小,高效压缩大模型长文本缓存。

SABlock: Semantic-Aware KV Cache Eviction with Adaptive Compression Block Size

  • 按语义结构分段,精准评估词元重要性。
  • 96个缓存条目达99.9%检索准确率,仅需全量缓存的1.2%。
  • 相同内存下提速9.5倍,适合长文本生成场景。

随着键值(KV)缓存内存需求增长,长上下文大语言模型推理面临严重可扩展性瓶颈。尽管缓存淘汰能有效缓解问题,但现有基于词元、块或句子的压缩方法难以兼顾语义连贯性与内存效率。为此,我们提出SABlock——一种语义感知的自适应块大小缓存淘汰框架。首先进行语义分割,使压缩边界对齐语言结构;其次采用分段引导的词元评分优化重要性判断;最后针对每段使用预算驱动的搜索策略,自适应确定最优块大小,在保障语义完整性的同时提升压缩效率。在多个长文本基准测试中,SABlock在相同内存预算下持续优于当前最优基线。例如,在Needle-in-a-Haystack(NIAH)任务中,仅用96个KV条目即达到99.9%的检索准确率,接近保留8,000条的全缓存基线表现。在固定缓存预算1,024条件下,峰值内存降低46.28%,128K上下文长度下解码速度最高提升9.5倍。

原文摘要 · Abstract (English)

The growing memory footprint of the Key-Value (KV) cache poses a severe scalability bottleneck for long-context Large Language Model (LLM) inference. While KV cache eviction has emerged as an effective solution by discarding less critical tokens, existing token-, block-, and sentence-level compression methods struggle to balance semantic coherence and memory efficiency. To this end, we introduce SABlock, a \underline{s}emantic-aware KV cache eviction framework with \underline{a}daptive \underline{block} sizes. Specifically, SABlock first performs semantic segmentation to align compression boundaries with linguistic structures, then applies segment-guided token scoring to refine token importance estimation. Finally, for each segment, a budget-driven search strategy adaptively determines the optimal block size that preserves semantic integrity while improving compression efficiency under a given cache budget. Extensive experiments on long-context benchmarks demonstrate that SABlock consistently outperforms state-of-the-art baselines under the same memory budgets. For instance, on Needle-in-a-Haystack (NIAH), SABlock achieves 99.9% retrieval accuracy with only 96 KV entries, nearly matching the performance of the full-cache baseline that retains up to 8K entries. Under a fixed cache budget of 1,024, SABlock further reduces peak memory usage by 46.28% and achieves up to 9.5x faster decoding on a 128K context length.

大模型推理缓存优化语义压缩

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。