Cross-Family Speculative Prefill: Training-Free Long-Context Compression with Small Draft Models
作者: Shubhangi Upasani, Ravi Shanker Raju, Bo Li, Mengmeing Ji, John Long, Chen Wu, Urmish Thakker, Guangtao Wang
分类: cs.CL
发布日期: 2026-03-03
💡 一句话要点
提出跨模型家族推测预填充,利用小模型草稿实现免训练长文本压缩。
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 长文本压缩 推测预填充 跨模型家族 Agentic LLM 注意力机制
📋 核心要点
- Agentic LLM应用中,长prompt导致预填充成本高昂,现有方法依赖同族小模型进行prompt压缩。
- 提出跨模型家族推测预填充方法,利用不同模型家族的小型草稿模型压缩目标模型的prompt。
- 实验表明,该方法在多种任务中保持了90~100%的性能,并显著降低了首个token的时间。
📝 摘要(中文)
在Agentic LLM工作负载中,prompt长度是主要瓶颈,重复的推理步骤和多轮调用循环导致大量预填充成本。最近关于推测预填充的研究表明,基于注意力机制的token重要性估计可以实现免训练的prompt压缩,但前提是存在与目标模型共享相同tokenizer的草稿模型。然而,在实践中,Agentic pipelines经常使用没有任何同族小型草稿模型的模型。本文研究了跨模型家族的推测预填充,其中来自一个模型家族的轻量级草稿模型用于压缩来自不同家族的目标模型的prompt。使用与先前工作相同的推测预填充机制,我们评估了一系列跨模型家族的草稿-目标组合,包括Qwen、LLaMA和DeepSeek模型。在广泛的任务中,我们发现基于注意力机制的token重要性估计可以在不同的模型家族之间可靠地迁移,尽管草稿模型和目标模型之间存在模型架构和tokenizer的差异。跨模型prompt压缩在很大程度上保留了90~100%的完整prompt基线性能,并且在某些情况下,由于去噪效果,略微提高了准确性,同时显著减少了首个token的时间(TTFT)。这些结果表明,推测预填充主要依赖于任务先验和语义结构,因此可以作为一种通用的prompt压缩原语。我们讨论了我们的发现对Agentic系统的影响,在Agentic系统中,重复的长文本推理和异构模型堆栈使得跨模型prompt压缩既必要又实用。
🔬 方法详解
问题定义:现有Agentic LLM应用中,prompt长度是性能瓶颈,尤其是在需要重复推理和多轮对话的场景下。虽然推测预填充技术可以通过token重要性估计进行prompt压缩,但它依赖于与目标模型共享相同tokenizer的同族小型草稿模型。然而,实际应用中,往往难以找到满足这一条件的草稿模型,限制了推测预填充的适用性。
核心思路:本文的核心思路是探索跨模型家族的推测预填充。即,使用来自不同模型家族的轻量级草稿模型来压缩目标模型的prompt。作者认为,基于注意力机制的token重要性估计具有跨模型家族的迁移能力,即使模型架构和tokenizer不同,草稿模型也能有效地指导目标模型的prompt压缩。
技术框架:该方法沿用已有的推测预填充机制,主要包括两个阶段:1) 使用草稿模型对原始prompt进行token重要性评估,并根据重要性得分选择保留的token,从而生成压缩后的prompt;2) 将压缩后的prompt输入目标模型进行推理。关键在于选择合适的草稿模型和目标模型,并验证跨模型家族的token重要性估计的有效性。
关键创新:该方法最重要的创新点在于打破了推测预填充对同族模型的限制,实现了跨模型家族的prompt压缩。这使得在更广泛的Agentic LLM应用场景中,可以利用现有的各种小型模型作为草稿模型,从而降低预填充成本,提高推理效率。
关键设计:论文的关键设计在于实验验证了不同模型家族(Qwen、LLaMA、DeepSeek)之间的跨模型prompt压缩效果。作者通过在多种任务上进行评估,证明了基于注意力机制的token重要性估计具有良好的跨模型迁移能力。此外,论文还分析了跨模型压缩对模型性能的影响,发现适当的压缩甚至可以提高模型准确性,这可能是由于去噪效应。
📊 实验亮点
实验结果表明,跨模型prompt压缩在保留90~100%完整prompt基线性能的同时,显著减少了首个token的时间(TTFT)。在某些情况下,由于去噪效应,压缩后的prompt甚至略微提高了模型准确性。这些结果验证了跨模型家族推测预填充的有效性和泛化能力。
🎯 应用场景
该研究成果可广泛应用于Agentic LLM系统,尤其是在需要处理长文本prompt和进行多轮交互的场景中。通过利用小型、异构的草稿模型进行prompt压缩,可以显著降低推理成本,提高响应速度,从而提升用户体验。此外,该方法还有助于在资源受限的环境中部署大型语言模型。
📄 摘要(原文)
Prompt length is a major bottleneck in agentic large language model (LLM) workloads, where repeated inference steps and multi-call loops incur substantial prefill cost. Recent work on speculative prefill demonstrates that attention-based token importance estimation can enable training-free prompt compression, but this assumes the existence of a draft model that shares the same tokenizer as the target model. In practice, however, agentic pipelines frequently employ models without any smaller in-family draft model. In this work, we study cross-family speculative prefill, where a lightweight draft model from one model family is used to perform prompt compression for a target model from a different family. Using the same speculative prefill mechanism as prior work, we evaluate a range of cross-family draft-target combinations, including Qwen, LLaMA, and DeepSeek models. Across a broad diversity of tasks, we find that attention-based token importance estimation transfers reliably across different model families despite differences in model architectures and tokenizers between draft and target models. Cross-model prompt compression largely retains 90~100% of full-prompt baseline performance and, in some cases, slightly improves accuracy due to denoising effects, while delivering substantial reductions in time to first token (TTFT). These results suggest that speculative prefill depends mainly on task priors and semantic structure, thus serving as a generalizable prompt compression primitive. We discuss the implications of our findings for agentic systems, where repeated long-context inference and heterogeneous model stacks make cross-model prompt compression both necessary and practical.