arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.08727cs.ARcs.AIcs.DCcs.PF
收藏

ARKV:在有限内存预算下为LLMs长上下文推理实现自适应和资源高效的KV缓存管理

ARKV: Adaptive and Resource-Efficient KV Cache Management under Limited Memory Budget for Long-Context Inference in LLMs

Jianlong Lei, Shashikant Ilager

AI总结:

ARKV通过动态分配精度级别,实现LLMs长上下文推理中的高效内存管理,减少内存使用并保持高精度。

摘要:

大型语言模型(LLMs)越来越多地部署在需要超长上下文推理的场景中,例如代理工作流和深入研究理解。然而,长上下文推理受到KV缓存的限制,这是一种随着序列长度和批处理大小线性增长的临时内存结构,很快会主导GPU内存使用。现有的内存减少技术,包括驱逐和量化,通常依赖于静态启发式方法,在紧预算下质量会下降。在本文中,我们提出了ARKV,一个轻量级且自适应的框架,该框架根据每层注意力动态和令牌级重要性动态分配缓存令牌的精度级别。在短预填充阶段,ARKV通过计算注意力熵、方差和峰度等统计分数来估计每层的原始量化(OQ)比率。在解码过程中,令牌被分配到三种状态之一:原始(全精度)、量化(低精度)或驱逐,根据一种快速的重 hitters 评分策略。我们在LLaMA3和Qwen3模型上跨多样长上下文和短上下文任务进行实验,结果显示,ARKV在长上下文基准上保留约97%的基线准确性,同时将KV内存使用减少4倍,具有最小的吞吐量损失。在短上下文任务中,ARKV与全精度基线匹配;在GSM8K数学推理中,它显著优于均匀量化。这些结果突显了ARKV在可扩展LLM部署中的实际可行性,提供了细粒度、数据驱动的内存控制,无需重新训练或架构修改。源代码和实验结果可在:https://github.com/Large-scale-Sustainable-Computing-LSC/ARKV找到。

英文摘要:

Large Language Models (LLMs) are increasingly deployed in scenarios demanding ultra-long context reasoning, such as agentic workflows and deep research understanding. However, long-context inference is constrained by the KV cache, a transient memory structure that grows linearly with sequence length and batch size, quickly dominating GPU memory usage. Existing memory reduction techniques, including eviction and quantization, often rely on static heuristics and suffer from degraded quality under tight budgets. In this paper, we propose ARKV, a lightweight and adaptive framework that dynamically allocates precision levels to cached tokens based on per-layer attention dynamics and token-level importance. During a short prefill phase, ARKV estimates the original quantization (OQ) ratio of each layer by computing statistical scores such as attention entropy, variance and kurtosis. During decoding, tokens are assigned to one of three states, Original (full precision), Quantization (low precision), or Eviction, according to a fast heavy-hitter scoring strategy. Our experiments on LLaMA3 and Qwen3 models across diverse long- and short-context tasks demonstrate that ARKV preserves ~97% of baseline accuracy on long-context benchmarks while reducing KV memory usage by 4x, with minimal throughput loss. On short-context tasks, ARKV matches full-precision baselines; on GSM8K math reasoning, it significantly outperforms uniform quantization. These results highlight the practical viability of ARKV for scalable LLM deployment, offering fine-grained, data-driven memory control without retraining or architectural modifications. The source code and artifacts can be found in: https://github.com/Large-scale-Sustainable-Computing-LSC/ARKV

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑