arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.07518cs.CLcs.AIcs.LG
收藏

TokenButler:令牌重要性是可预测的

TokenButler: Token Importance is Predictable

Cornell University(康奈尔大学);Intel Labs(英特尔实验室)

Yash Akhauri, Ahmed F AbouElhamayed, Yifei Gao, Chi-Chih Chang, Sameh Gobriel, Nilesh Jain, Mohamed S. Abdelfattah

AI总结:

TokenButler通过高粒度查询感知预测器识别关键令牌,减少KV缓存瓶颈,提升解码效率与准确性。

摘要:

大型语言模型(LLMs)依赖于键值(KV)缓存来存储token历史,以实现高效的token解码。随着KV缓存的增长,它成为主要的内存和计算瓶颈。然而,有一个机会可以缓解这个瓶颈,先前的研究表明,只有少量的token对每个解码步骤有实质性贡献。在找到这些关键token时,一个关键挑战是它们是动态的,并且高度依赖于输入查询。现有方法要么通过永久驱逐token而牺牲质量,要么保留完整的KV缓存但依赖于检索token块,而现有的KV缓存稀疏性方法则依赖于不准确的token重要性代理。为了解决这些限制,我们引入了TokenButler,一个高粒度、查询感知的预测器,能够学习识别这些关键token。TokenButler在固定深度步长下预测低维的重要性查询,并将其与学习的KV缓存键投影结合,以廉价地评分token,从而在固定预算下实现动态的per-token选择,同时保持完整的KV缓存。我们通过蒸馏模型的掩码因果注意力分布来训练TokenButler,优化一个轻量级的预测器,参数开销最小。我们在一个新的合成小上下文共指检索任务上评估TokenButler,展示了接近完美准确度的性能,而现有方法则失败。此外,TokenButler在长上下文基准(RULER、LongBench)上实现了竞争性或更优的性能,使用我们提出的*预测区间与邻居获取*方法,可实现约1.6倍的GPU加速,同时保持准确性在约1.1%以内,与密集注意力相比,延迟减少了多达7.6倍。代码已发布:https://github.com/abdelfattah-lab/TokenButler

英文摘要:

Large Language Models (LLMs) rely on the Key-Value (KV) Cache to store token history, enabling efficient decoding of tokens. As the KV-Cache grows, it becomes a major memory and computation bottleneck. However, there is an opportunity to alleviate this bottleneck, prior research has shown that only a small subset of tokens contribute meaningfully to each decoding step. A key challenge in finding these critical tokens is that they are dynamic, and heavily input query-dependent. Existing methods either risk quality by evicting tokens permanently, or retain the full KV-Cache but rely on retrieving chunks of tokens and many existing KV-Cache sparsity methods rely on inaccurate proxies for token importance. To address these limitations, we introduce TokenButler, a high-granularity, query-aware predictor that learns to identify these critical tokens. TokenButler predicts low-dimensional importance queries at a fixed depth stride, and combines them with a learned projection of the real KV-cache keys to score tokens cheaply, enabling dynamic per-token selection under a fixed budget while preserving the full KV cache. We train TokenButler by distilling the model's masked causal attention distributions, optimizing a lightweight predictor with minimal parameter overhead. We evaluate TokenButler on a novel synthetic small-context co-referential retrieval task, demonstrating near-oracle accuracy where existing methods fail. Furthermore, TokenButler achieves competitive or superior performance on long-context benchmarks (RULER, LongBench), up to $\approx1.6\times$ on-GPU speedup using our proposed *prediction interval with neighbor fetching* that amortizes predictor cost while maintaining accuracy within $\approx$1.1\%, and up to 7.6$\times$ reduction in latency compared to Dense Attention with CPU offloading. Code is available: https://github.com/abdelfattah-lab/TokenButler

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

↑