BUDDY: BUdget-Driven DYnamic Depth Routing for Adaptive Large Language Model Inference
作者: Yuhua Zhou, Shaoqi Yu, Shichao Weng, Changhai Zhou, Mingze Yin, Fei Yang, Aimin Pan
分类: cs.LG
发布日期: 2026-06-08
💡 一句话要点
提出BUDDY框架以解决大语言模型推理中的预算控制问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大语言模型 动态深度路由 推理优化 深度剪枝 计算预算控制 KV缓存重用 机器学习
📋 核心要点
- 现有的深度剪枝方法在用户特定计算预算下控制有限,且通常固定路由路径,无法适应解码过程中上下文的变化。
- BUDDY框架通过轻量级决策模块动态评分中间层,并根据输入条件执行前k层,以满足预算要求,支持解码时的适应性。
- 实验结果显示,BUDDY在准确性与计算效率的权衡上优于静态剪枝基线,且能够实现严格的预算控制和解码时的重新路由。
📝 摘要(中文)
大语言模型(LLMs)由于其深度和参数规模,推理成本高。深度剪枝可以通过跳过冗余的Transformer块来降低延迟,但现有方法在用户特定计算预算下控制有限,并且通常固定路由路径,无法在解码过程中根据上下文的增长进行适应。本文提出了BUDDY,一个基于预算驱动的动态深度路由框架。BUDDY使用轻量级决策模块根据输入对中间层进行评分,并确定性地执行前k层以满足给定预算。为了支持解码时的适应,BUDDY重用第一层的KV缓存作为低开销的全局上下文源,并在每次路由决策前将其与最新的token表示进行汇聚。当没有明确预算时,可选的预算预测器会估计输入依赖的计算水平,以平衡质量和效率。实验结果表明,BUDDY在Llama系列和Qwen模型上与强大的静态剪枝基线竞争,并且通常改善了准确性与计算的权衡,同时独特地支持严格的预算控制、解码时重新路由和单个训练模型内的多个预算。
🔬 方法详解
问题定义:本文旨在解决大语言模型推理中的高成本问题,现有方法在用户特定计算预算下控制有限,且无法动态适应解码过程中的上下文变化。
核心思路:BUDDY框架的核心思路是通过轻量级决策模块动态评分中间层,并根据输入条件执行前k层,以满足预算要求,从而提高推理效率和灵活性。
技术框架:BUDDY的整体架构包括决策模块、KV缓存重用机制和预算预测器。决策模块根据输入评分中间层,KV缓存用于提供全局上下文,预算预测器在缺乏明确预算时估计计算水平。
关键创新:BUDDY的主要创新在于其动态深度路由能力,能够在解码过程中根据上下文变化调整路由路径,与传统的静态剪枝方法相比,提供了更高的灵活性和适应性。
关键设计:BUDDY的设计包括轻量级决策模块的实现、KV缓存的重用策略,以及预算预测器的构建,确保在不同输入条件下能够有效平衡计算效率与模型性能。
🖼️ 关键图片
📊 实验亮点
实验结果表明,BUDDY在Llama系列和Qwen模型上表现出色,能够在准确性与计算效率之间实现更好的平衡。与静态剪枝基线相比,BUDDY在多个预算设置下均显示出显著的性能提升,验证了其在严格预算控制和解码时重新路由方面的优势。
🎯 应用场景
BUDDY框架具有广泛的应用潜力,尤其在需要高效推理的大语言模型场景中,如智能对话系统、文本生成和机器翻译等领域。其动态深度路由能力能够根据实时需求调整计算资源,从而提高系统的响应速度和用户体验。未来,BUDDY的设计理念也可能被应用于其他深度学习模型的推理优化中。
📄 摘要(原文)
Large language models (LLMs) incur high inference cost due to their depth and parameter scale. Depth pruning can reduce latency by skipping redundant Transformer blocks, but existing methods (i) provide limited control under user-specific compute budgets and (ii) typically fix the routing path, failing to adapt as the context grows during decoding. We propose Buddy, a budget-driven dynamic depth routing framework. Buddy uses a lightweight Decision Module to score intermediate layers conditioned on the input and deterministically executes the top-k layers to satisfy a given budget. To support decode-time adaptation, Buddy reuses the first-layer KV cache as a low-overhead global context source and pools it together with the newest token representation before each routing decision. When no explicit budget is provided, an optional Budget Predictor estimates an input-dependent compute level to balance quality and efficiency. Experiments on Llama-family and Qwen models show that Buddy is competitive with strong static pruning baselines and often improves the accuracy-compute trade-off, while uniquely supporting strict budget control, decode-time rerouting, and multiple budgets within a single trained model.