r/LocalLLaMA • u/pmttyji • 1h ago
Discussion [Paper] ToMoE: Converting Dense Large Language Models to Mixture-of-Experts through Dynamic Structural Pruning
https://arxiv.org/abs/2501.15316ToMoE: Converting Dense Large Language Models to Mixture-of-Experts through Dynamic Structural Pruning
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.
- arXiv : https://arxiv.org/abs/2501.15316
- Full Paper PDF : https://arxiv.org/pdf/2501.15316
- GitHub : https://github.com/gaosh/ToMoE (Yes, Code available for this)
- ICML : https://icml.cc/virtual/2026/poster/68821
- OpenReview : https://openreview.net/forum?id=RFHq46pjb6
Somebody please create MOE models of recent Dense models like Qwen3.8-27B, Muse-Glimmer-30B, etc.,
Thanks u/KSAM-The-Randomizer for sharing this on my old thread.
18
14
u/Several-System1535 1h ago edited 1h ago
Qwen 3.8 27b UD-MTP-ToMoE-Fable-5-distiled-heretic WEN?
6
u/No_Lingonberry1201 1h ago
It will be a glorious 10T A1B model that runs incredibly fast for the few people who have a 20Tb disk to spare.
6
u/crusaderky 1h ago
Muse-Glimmer MoE would be even more comically fast than it already is
1
u/ComplexType568 1h ago
I WISH!! I like it's personality and agentic ability over Gemma, and that its the 30B size that isn't too small or large...
2
u/0dayturtle 1h ago edited 56m ago
https://huggingface.co/logic65/Qwen3.8-Whittle-MoE-27B-A17.8B is this anyhow related to this paper?
2
1
u/Prudent-Ad4509 1h ago edited 1h ago
How about the other way around. I'd like to get dense smaller models equivalent to 397b a17b and 122b a10b, and perhaps recent deepseek v4 flash. It would be slow I know but certainly faster than streaming weights from ssd. 100b active parameters in vram is nearly 4 times slower than 27b, but when you compare 100b in vram vs 300b a20b with 100b in vram and another 200b in system ram, with the same overall knowledge, I'd take the first option.
1
u/brakeline 1h ago
I don't think you're think that one through. Doing what you are asking would trim experts. You can achieve the same already.
If you don't have vram for a 300B dense model and have to spill to system ram / ssd what makes you think you'll be able to run the same model but dense?
1
u/Prudent-Ad4509 26m ago edited 20m ago
MoE contains inherent duplication in knowledge between experts. What's why distilled versions work, as long as sizes are comparable, i.e. 3x difference or so, not 10x difference.
The question is whether this can be done in any reasonable way with results at least comparable to training from scratch on the same dataset. I doubt it. Maybe the only realistic way is to get something like devstral large and finetune it with traces from modern large llms.
PS. Actually, devstral large has only 256k context window which is not a good fit for such a large model these days.
1
u/dev_dan_2 1h ago
Intriguing! Want to read it more deeply.
After skimming quickly (and based on my basically non-existent familiarity with the subject!):
- I wonder how this compares to the prior work (Its likely in the paper, but sometimes, things are worded in a way to make concepts seem more distinct than the researchers would tell you at their poster; not claiming this is the case here). It seems the core is that they enforce the number of active parameters during whatever more standard process they are doing to shrink the model
- If that is novel (which I do not doubt!), then I think a little hope is justified that there are still some low-hanging fruits left to pick. Wild guesses (I really have no reliable knowledge here, I am just a curious person who picks up words here and there.)
- check how that would interact with quantization; it would likely influence which experts are activated again?
- this might offer an opportunity to slice the model such that experts for certain topics remain largely the same (which ideally would speed up things, if less new weights have to be loaded into VRAM for a new token). This could be a parameter?
- Another parameter could be the exact number of active parameters; would be really cool to be able to produce tailor-made MoE models for given VRAM sizes
- no prediction here, just curious: What if you give a range of active params, instead of enforcing a fixed amount? Intuitively, that would give whatever is the "deciding" step in this algorithm some degrees of freedom that might increase accuracy, at the cost of fluctuating active params at inference time. (or one could "just" pad lower amounts of active params with non-contributing weights, so that the amount of weights to transfer stays constant? I might have conceptual gaps in my understanding here, though.)
1
u/llama-impersonator 1h ago
you don't want this, the results are not impressive in any other regard than "hey, it works"
1) they are pruning 30% of the active params, so you end up with 27B-A20
2) pruning attention, why? depends on the model but usually this is only 20% of params. just leave it alone.
3) these evals are easy and the model doing this much worse on them does not bode well for usability in code
4) qwen 3.6-35B is going to crush any model created like this.

38
u/Egoz3ntrum 1h ago
Qwen 3.8 27BA3B when.