arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.06833cs.LGcs.AIcs.CL
收藏

熵自适应解码:用于高效推理的动态模型切换

Entropy Adaptive Decoding: Dynamic Model Switching for Efficient Inference

Tufa Labs(图法实验室)

Toby Simonds

AI总结:

该研究提出熵自适应解码(EAD),通过监测logit分布的滚动熵动态切换不同大小模型,在MATH基准上实现显著效率提升,证明选择性部署模型容量可大幅降低计算成本。

摘要:

我们提出熵自适应解码(EAD),这是一种用于高效语言模型推理的新方法,它基于预测不确定性在不同大小的模型之间动态切换。通过监测模型logit分布中的滚动熵,我们的方法识别出较小模型足够处理的文本区域,仅当预测不确定性超过阈值时才切换到较大模型。与通过验证保持完美输出保真度的推测解码方法不同,EAD接受可控的输出差异以换取计算效率。我们在MATH基准上的实验表明,不同模型家族均获得显著效率提升。使用LLaMA家族时,我们保持11B模型96.7%的性能(50.4% vs 52.1%),同时仅用其处理43%的token,计算成本降低41.5%。在Qwen家族中,模型大小差异更大时收益更明显:我们实现14B模型92.9%的性能(74.3% vs 80.0%),仅用其处理25%的token,计算成本降低67%。跨模型对的结果一致性表明,通过根据局部生成复杂度选择性部署模型容量,语言模型计算可显著优化。我们的研究结果表明,当前模型推理方法在追求完美输出保真度方面可能过于保守,接受轻微性能权衡可大幅降低计算成本。

英文摘要:

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.

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

↑