arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.07616cs.LGcs.AI
收藏

基于相似性的专家重新路由:用于MoE模型高效批量解码

SERE: Similarity-based Expert Re-routing for Efficient Batch Decoding in MoE Models

Taobao & Tmall Group of Alibaba(淘宝与天猫集团);Shenzhen Graduate School, Peking University(北京大学深圳研究生院)

Juntong Wu, Jialiang Cheng, Fuyu Lv, Ou Dan, Li Yuan

AI总结:

SERE通过基于相似性的专家重新路由方法,提升MoE模型在批量解码中的效率,实现2倍速度提升并减少质量损失。

摘要:

混合专家(MoE)架构利用稀疏激活来实现比密集LLM更快的训练和推理,并具有更高的准确性。然而,在生产服务中,MoE模型需要批量推理以优化硬件效率,这可能会导致过多的专家激活,从而减慢内存受限的解码阶段。为了解决批量解码与专家稀疏性之间的根本矛盾,我们提出了SERE,一种基于相似性的专家重新路由方法,用于MoE模型的高效批量解码。SERE通过以输入意识的方式动态减少活跃专家的数量,将标记从次级专家重新路由到其最相似的主级对应者。它还利用相似性模式来识别并保留关键专家,从而防止能力损失。值得注意的是,SERE避免了静态专家修剪或合并,而是通过基于批次层面专家冗余的动态专家跳过。此外,我们提供了一个高效的自定义CUDA内核用于SERE,使其能够在vLLM中仅通过一行代码更改即可使用。在各种复杂推理基准上的广泛实验表明,SERE实现了高达2.0倍的速度提升,同时质量损失很小,为成本效益和延迟敏感的大型MoE部署提供了实用的解决方案。SERE的代码实现可在https://github.com/JL-Cheng/SERE中找到。

英文摘要:

Mixture-of-Experts (MoE) architectures employ sparse activation to deliver faster training and inference with higher accuracy than dense LLMs. However, in production serving, MoE models require batch inference to optimize hardware efficiency, which may cause excessive expert activation and thus slow the memory-bound decoding stage. To address the fundamental tension between batch decoding and expert sparsity, we present SERE, a Similarity-based Expert Re-routing method for Efficient batch decoding in MoE models. SERE dynamically reduces the number of active experts in an input-aware manner by re-routing tokens from secondary experts to their most similar primary counterparts. It also leverages similarity patterns to identify and preserve critical experts, thereby preventing capability loss. Notably, SERE avoids static expert pruning or merging, instead enabling dynamic expert skipping based on batch-level expert redundancy. Additionally, we provide an efficient custom CUDA kernel for SERE, enabling plug-and-play use in vLLM with only a single-line code change. Extensive experiments on various complex reasoning benchmarks demonstrate that SERE achieves up to 2.0x speedup with minimal quality loss, providing a practical solution for cost-efficient and latency-sensitive large-scale MoE deployment. Code implementation of SERE can be found in https://github.com/JL-Cheng/SERE.

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

↑