ToMoE: Converting Dense Large Language Models to Mixture-of-Experts through Dynamic Structural Pruning

Shangqian Gao, Ting Hua, Reza Shirkavand, Chi-Heng Lin, Zhen Tang +8 more
1/25/2025
cs.LGcs.CL

No official code found. Best implementation: gaosh/ToMoE (11 stars, Apache-2.0, last commit 2026-02-07).

Abstract

Large Language Models (LLMs) have demonstrated remarkable abilities in tackling a wide range of complex tasks. However, their huge computational and memory costs raise significant challenges in deploying these models on resource-constrained devices or efficiently serving them. Prior approaches have attempted to alleviate these problems by permanently removing less important model structures, yet these methods often result in substantial performance degradation due to the permanent deletion of model parameters. In this work, we tried to mitigate this issue by reducing the number of active parameters without permanently removing them. Specifically, we introduce a differentiable dynamic pruning method that pushes dense models to maintain a fixed number of active parameters by converting their MLP layers into a Mixture of Experts (MoE) architecture. Our method, even without fine-tuning, consistently outperforms previous structural pruning techniques across diverse model families, including Phi-2, LLaMA-2, LLaMA-3, and Qwen-2.5.

View on arXivView PDF

Code Implementations(1)

gaosh/ToMoECommunity71%
Apache-2.0

[TMLR] Offical Implementation of ToMoE: ToMoE: Converting Dense Large Language Models to Mixture-of-Experts through Dynamic Structural Pruning

111Shell, PythonJan 25, 20258 months agoApache-2.0
compressiondynamic-pruningllmmixture-of-expertstmlr+2 more

Cite this paper

@article{gao2025tomoe,
  title  = {ToMoE: Converting Dense Large Language Models to Mixture-of-Experts through Dynamic Structural Pruning},
  author = {Shangqian Gao and Ting Hua and Reza Shirkavand and Chi-Heng Lin and Zhen Tang and Zhengao Li and Longge Yuan and Fangyi Li and Zeyu Zhang and Alireza Ganjdanesh and Lou Qian and Xu Jie and Yen-Chang Hsu},
  year   = {2025},
  eprint = {2501.15316},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.15316v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.15316.svg)](https://codeofpaper.com/paper/2501.15316)

Discussion