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

FOLD:用于长上下文投机解码的无位置远内存与局部顺序

FOLD: Position-Free Far Memory with Local Order for Long-Context Speculative Decoding

Sun Yat-sen University(中山大学);Canva Research(Canva研究院);Peking University(北京大学)

Shuxuan Li, Jialiang Kang, Yanghao Zhou, Ziye Zhu, Zhilin Zhao, Xiao Yang

AI总结:

FOLD是一种无训练长上下文投机解码方法,通过保留局部位置、处理远距条目为远内存并锐化注意力,在多组模型对及256K token基准中实现最高加速比,最佳达4.22×。

摘要:

投机解码通过轻量级草稿模型和并行验证加速大语言模型(LLM)的生成,在长输入场景中尤其具有前景,此时键值缓存(KV-cache)的访问成本可分摊至多个被接受的 token。然而,大多数草稿模型在短序列上训练,在长输入时性能下降,而长上下文训练成本高昂。现有无训练方法要么限制上下文窗口,要么重新缩放位置,要么通过检索远距条目增强近期上下文。草稿模型读取已编码上下文和位置信息的目标隐藏状态,其轻量级架构使全历史注意力具备可行性。我们提出FOLD,一种无训练方法,它保留精确的局部位置,并将所有远距条目视为共享位置的远内存。为应对内存增长导致的注意力稀释,我们对其中的注意力进行锐化以强调相关条目,同时单独控制其相对于局部窗口的总权重。在6组目标-草稿模型对及最高达256K token的多样基准测试中,FOLD大多实现最高加速比,最佳案例较自回归解码的加速比提升超一倍,从2.08×增至4.22×。

英文摘要:

Speculative decoding accelerates LLM generation through lightweight drafting and parallel verification. It is particularly promising for long inputs, where KV-cache access costs can be amortized over multiple accepted tokens. Yet most drafters are trained on short sequences and degrade on long inputs, while long-context training is costly. Existing training-free approaches restrict the context window, rescale positions, or augment recent context with retrieved distant entries. Drafters, however, read target hidden states that already encode contextual and positional information, and their lightweight architecture makes full-history attention affordable. We propose FOLD, a training-free method that preserves exact local positions and treats all distant entries as far memory at a shared position. To counter attention dilution as the memory grows, we sharpen attention within it to emphasize relevant entries while separately controlling its total weight relative to the local window. Across six target-drafter pairs and diverse benchmarks of up to 256K tokens, FOLD predominantly delivers the highest speedup, with the best case more than doubling the speedup over autoregressive decoding, from 2.08$\times$ to 4.22$\times$.

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

↑