长上下文推理内存瓶颈有救了!DepthWeave-KV用跨层分解加自适应压缩,8.3倍KV缓存缩减,速度72.8 tokens/s,比其他方法效果更好。
DepthWeave-KV是一种跨层键值缓存压缩方法,通过共享低秩通道基分解相邻层状态,保留令牌特定残差。它使用令牌条件深度路由器为指令型和检索关键令牌分配更高重构秩,并通过注意力输出探头在线追踪误差自适应压缩。在LongBench等基准上,DepthWeave-KV实现近满缓存任务质量,压缩比达8.3倍,64K上下文速度72.8 tokens/s。
DepthWeave-KV: Token-Adaptive Cross-Layer Residual Factorization for Long-Context KV Cache Compression
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.