用混合模型思路让大模型集成提速两倍,不求平均只选一个
Rethinking LLM Ensembling from the Perspective of Mixture Models
- 把模型集成看作混合模型,每步随机选一个模型生成词
- 速度提升1.78到2.68倍,效果与传统集成相当
- 揭示集成与分路策略的联系,适合追求效率的研究者
模型集成是提升机器学习性能的经典方法,传统做法是对多个模型输出分布取平均并选择最高概率标签。该方法已自然扩展至大语言模型(LLMs),虽提升性能但计算开销巨大。其低效源于直接将传统集成方式应用于需独立前向传播的LLMs,必须为每个模型显式计算集成分布。本文提出类混合模型集成(ME),将集成重新解释为混合模型,通过在每一步随机选择单个模型生成下一个词,避免显式计算完整集成分布。ME在数学上等价于从集成分布采样,却仅需调用一个模型,速度比传统集成快1.78至2.68倍。此外,该视角揭示了LLM集成与词级路由方法的内在关联,表明集成是路由方法的一种特例。研究为高效LLM集成开辟新路径,并激励对词级路由策略的进一步探索。代码已开源。
原文摘要 · Abstract (English)
Model ensembling is a well-established technique for improving the performance of machine learning models. Conventionally, this involves averaging the output distributions of multiple models and selecting the most probable label. This idea has been naturally extended to large language models (LLMs), yielding improved performance but incurring substantial computational cost. This inefficiency stems from directly applying conventional ensemble implementation to LLMs, which require a separate forward pass for each model to explicitly compute the ensemble distribution. In this paper, we propose the Mixture-model-like Ensemble (ME). By reinterpreting the ensemble as a mixture model, ME stochastically selects a single model at each step to generate the next token, thereby avoiding the need to explicitly compute the full ensemble distribution. ME is mathematically equivalent to sampling from the ensemble distribution, but requires invoking only one model, making it 1.78x-2.68x faster than conventional ensembling. Furthermore, this perspective connects LLM ensembling and token-level routing methods, suggesting that LLM ensembling is a special case of routing methods. Our findings open new avenues for efficient LLM ensembling and motivate further exploration of token-level routing strategies for LLMs. Our code is available at https://github.com/Kamichanw/Mixture-model-like-Ensemble.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。