动态分配压缩资源,让关键信息更完整地保留。
DepthWeave-KV: Token-Adaptive Cross-Layer Residual Factorization for Long-Context KV Cache Compression

- 按token重要性分配压缩预算,关键词保留更高精度。
- 在64K上下文下实现8.3倍内存压缩,推理速度达72.8 tokens/秒。
- 无需重训练,实时自适应调整,适合长文本生成任务。
长上下文语言模型推理受限于存储键值缓存所需的内存带宽与容量。现有压缩方法多对各层或各令牌统一分配预算,导致语义敏感区域信息丢失。本文提出DepthWeave-KV,一种基于令牌自适应的缓存压缩方法,通过共享低秩通道基底跨相邻层因子分解键值状态,同时保留注意力行为敏感区域的轻量级令牌特异性残差。该方法结合跨深度残差因子分解与令牌条件深度路由,为指令相关及检索关键令牌分配更高重建秩,并利用注意力输出探针实现无需校准的在线误差追踪,在生成过程中动态调整压缩策略,无需重训练基础模型。融合CUDA实现同步完成基底查找、残差反量化与注意力投影,降低解码时内存流量。在LongBench、Needle-in-a-Haystack、L-Eval以及长文本问答与摘要任务上,DepthWeave-KV以显著更低内存开销实现接近全缓存的任务性能,平均得分与检索准确率优于先前压缩方案,达到8.3倍KV缓存压缩与64K上下文下72.8 tokens/秒的推理速度。
原文摘要 · Abstract (English)
Long-context language model inference is increasingly limited by the memory bandwidth and capacity required to store key-value caches, yet existing compression methods often apply uniform budgets across layers or tokens and degrade retrieval when lexical cues and semantic states require different preservation. We introduce DepthWeave-KV, a token-adaptive cache compression method that factorizes key and value states across neighboring transformer layers using shared low-rank channel bases while retaining lightweight token-specific residuals where attention behavior is sensitive. DepthWeave-KV combines cross-depth residual factorization with a token-conditional depth router that allocates higher reconstruction rank to instruction-bearing and retrieval-critical tokens, and uses calibration-free online error tracking from attention-output probes to adapt compression during generation without retraining the base model. A fused CUDA implementation jointly performs basis lookup, residual dequantization, and attention projection to reduce decode-time memory traffic. Across LongBench, Needle-in-a-Haystack, L-Eval, and long-form QA and summarization benchmarks, DepthWeave-KV achieves near-full-cache task quality with substantially lower memory use, improving average score and retrieval accuracy over prior compressed caches while reaching 8.3x KV memory reduction and 72.8 tokens per second at 64K context.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。