arXiv:2506.05345cs.LGcs.CL2025-06NeurIPS被引 32

通过压缩键值缓存实现推理时超规模扩展,提升大模型推理精度。

Inference-Time Hyper-Scaling with KV Cache Compression

  • 动态内存稀疏化方法延迟丢弃缓存,实现8倍压缩
  • 在相同计算开销下生成更多文本,准确率显著提升
  • 适用于各类大模型,尤其适合资源受限场景

推理时扩展通过生成更长或更并行的序列来提升推理准确性,但Transformer大模型的生成成本主要受键值(KV)缓存大小限制。本文提出推理时超规模扩展:通过压缩KV缓存,在相同计算预算内生成更多标记,进一步提升推理精度。该方法成功的关键在于压缩技术在高压缩比下仍能保持准确性。为此,我们提出动态内存稀疏化(DMS),仅需1000次训练步即可实现8倍压缩,且精度优于无训练稀疏注意力。DMS不提前丢弃缓存标记,而是延迟剔除,隐式融合表示,保留关键信息。我们在多个大模型家族上验证了该方法的有效性,结果显示,在相当的推理延迟和内存负载下,精度明显提升:例如在Qwen-R1 32B上,AIME 24提升12.0点,GPQA提升8.6点,LiveCodeBench提升9.7点,平均等效内存读取次数不变。

原文摘要 · Abstract (English)

Inference-time scaling trades efficiency for increased reasoning accuracy by generating longer or more parallel sequences. However, in Transformer LLMs, generation cost is bottlenecked by the size of the key-value (KV) cache, rather than the number of generated tokens. Hence, we explore inference-time hyper-scaling: by compressing the KV cache, we can generate more tokens within the same compute budget and further improve the accuracy of scaled inference. The success of this approach, however, hinges on the ability of compression methods to preserve accuracy even at high compression ratios. To make hyper-scaling practical, we introduce Dynamic Memory Sparsification (DMS), a novel method for sparsifying KV caches that only requires 1K training steps to achieve 8$\times$ compression, while maintaining better accuracy than training-free sparse attention. Instead of prematurely discarding cached tokens, DMS delays token eviction, implicitly merging representations and preserving critical information. We demonstrate the effectiveness of inference-time hyper-scaling with DMS on multiple families of LLMs, showing that it boosts accuracy for comparable inference latency and memory load. For instance, we enhance Qwen-R1 32B by 12.0 points on AIME 24, 8.6 on GPQA, and 9.7 on LiveCodeBench on average for an equivalent number of memory reads.

大模型推理缓存压缩高效生成稀疏化

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