根据预测不确定性动态切换模型大小,显著降低推理成本。
Entropy Adaptive Decoding: Dynamic Model Switching for Efficient Inference
- 通过滚动熵监控预测置信度,自动选择大小模型切换
- 在数学题上用43%令牌达96.7%大模型性能,省41.5%算力
- 适合追求高效推理且可容忍微小误差的部署场景
我们提出熵自适应解码(EAD),一种基于预测不确定性动态切换不同规模模型的高效语言模型推理方法。通过监测模型输出对数概率分布的滚动熵,该方法识别出小模型足以应对的文本区域,仅在预测不确定性超过阈值时切换至大模型。与需验证以保证输出一致性的推测解码不同,EAD接受可控的输出偏差以换取计算效率。在MATH基准测试中,使用LLaMA系列模型时,仅用43%的令牌即可保持11B模型96.7%的性能(50.4% vs 52.1%),计算成本降低41.5%;在Qwen系列中,仅用25%令牌即达14B模型92.9%的性能(74.3% vs 80.0%),计算成本下降67%。跨模型对的一致性结果表明,可通过按生成复杂度局部调配模型容量大幅优化语言模型计算。研究指出当前推理策略在追求完美输出一致性方面可能过于保守,接受轻微性能损失可实现显著降本。
原文摘要 · Abstract (English)
We present Entropy Adaptive Decoding (EAD), a novel approach for efficient language model inference that dynamically switches between different-sized models based on prediction uncertainty. By monitoring rolling entropy in model logit distributions, our method identifies text regions where a smaller model suffices and switches to a larger model only when prediction uncertainty exceeds a threshold. Unlike speculative decoding approaches that maintain perfect output fidelity through verification, EAD accepts controlled output divergence in exchange for computational efficiency. Our experiments on the MATH benchmark demonstrate remarkable efficiency gains across different model families. Using the LLaMA family, we maintain 96.7\% of the 11B model's performance (50.4\% vs 52.1\%) while using it for only 43\% of tokens, decreasing computational cost by 41.5\%. These gains become more pronounced with larger size differentials in the Qwen family, where we achieve 92.9\% of the 14B model's performance (74.3\% vs 80.0\%) while using it for just 25\% of tokens, decreasing computational cost by 67\%. The consistency of these results across model pairs suggests that language model computation can be significantly optimized by selectively deploying model capacity based on local generation complexity. Our findings indicate that current approaches to model inference may be unnecessarily conservative in their pursuit of perfect output fidelity, and that accepting minor performance trade-offs can enable dramatic reductions in computational costs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。