arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2506.08373cs.CLcs.AI
收藏

基于草案的近似推理用于大语言模型

Draft-based Approximate Inference for LLMs

FuriosaAI;UW-Madison(威斯康星大学麦迪逊分校);Seoul National University(首尔国立大学);Ajou University(全州大学);KRAFTON

Kevin Galim, Ethan Ewer, Wonjun Kang, Minjae Lee, Hyung Il Koo, Kangwook Lee

AI总结:

本文提出基于草案的近似推理方法,通过结合lookahead技术和小模型预测,实现更精确的KV缓存丢弃和提示压缩,提升LLM在长上下文任务中的推理效率和准确性。

摘要:

为了优化长上下文大语言模型(LLMs)的推理,由于Transformer的二次计算和线性内存成本,这变得越来越重要。现有的近似推理方法,包括键值(KV)缓存丢弃、稀疏注意力和提示压缩,通常依赖于粗略预测token或KV对的重要性。我们通过引入一个框架来统一和扩展最近的工作,该框架利用小的草案模型更准确地预测token和KV对的重要性。我们提供了新颖的理论和实证分析,证明了lookahead-based重要性估计技术。在此框架中,我们提出了:(i)SpecKV,首次使用lookahead和小草案模型实现精确的KV缓存丢弃;(ii)SpecPC,利用草案模型注意力激活来识别并丢弃不重要的提示token;(iii)SpecKV-PC,结合两种技术的级联压缩策略。在长上下文基准上的大量实验表明,我们的方法在保持内存使用、延迟和吞吐量的相同效率增益的同时,始终比现有基线方法具有更高的准确性。

英文摘要:

Optimizing inference for long-context large language models (LLMs) is increasingly important due to the quadratic compute and linear memory cost of Transformers. Existing approximate inference methods, including key-value (KV) cache dropping, sparse attention, and prompt compression, typically rely on coarse predictions of token or KV pair importance. We unify and extend recent work by introducing a framework for approximate LLM inference that leverages small draft models to more accurately predict token and KV pair importance. We provide novel theoretical and empirical analyses justifying lookahead-based importance estimation techniques. Within this framework, we present: (i) SpecKV, the first method to use lookahead with a small draft model to enable precise KV cache dropping; (ii) SpecPC, which leverages draft model attention activations to identify and discard less important prompt tokens; and (iii) SpecKV-PC, a cascaded compression strategy combining both techniques. Extensive experiments on long-context benchmarks demonstrate that our methods consistently achieve higher accuracy than existing baselines while retaining the same efficiency gains in memory usage, latency, and throughput.

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

↑