Proof of concept, 2026-11-15/16. Single laptop GPU (RTX 4070, 8 GB). All numbers are single runs.
Idea. Keep a large MoE's expert weights shared and hosted centrally. A device downloads only the experts a task needs plus a small patch, and runs locally and privately at a fraction of the memory.
Result on ibm-granite/granite-3.1-1b-a400m-base (24 layers, 32 experts per layer, 8 active per token).
The loading and selection machinery works; the packs do not keep the model's ability.
Real task accuracy, packs trained on benchmark-free data, only the pack's experts in memory:
| Test | Full model (32 experts) | Pack, 16 experts | Pack, 12 | Pack, 8 |
|---|---|---|---|---|
| Code: HumanEval pass@1 (164 problems) | 12.2% (20) | 9.8% (16) | 8.5% (14) | 5.5% (9) |
| Qa: multiple-choice accuracy (1000 items, chance 25%) | 36.2% | 25.4% | - | 25.5% |
Perplexity on held-out contexts from the packs' own training distribution (this overstated quality):
| Task | Full model | Pack, 16 experts | Pack, 8 experts |
|---|---|---|---|
| code | 3.65 | 3.51 | 3.79 |
| qa (ARC-style contexts) | 6.93 | 7.43 | 9.89 |
| math | 2.05 | 3.00 | 3.61 |
| prose | 9.31 | 13.83 | 23.81 |
What is missing is step 3 producing a pack that keeps the full model's ability (section 10). No novelty is claimed for this pipeline: choosing a model or adapter from the prompt is established practice (model routers, adapter retrieval), and prompt-to-expert maps exist (fMoE). Whether pack selection for partially loaded MoE experts has been published was not checked beyond the searches listed under prior work.
For one task: per layer a list of C experts to load, router weights, and a low-rank delta (rank 8 or 32) on the
kept experts' output projection. The shared expert weights are never modified. Packs are trained by distilling
the original full model while the missing experts are actually blocked (scripts/14_task_pack.py).
Packs are nested: the pack shrinks 16 -> 12 -> 8 during training, so a 12-pack is the 8-pack plus 4 experts per layer.
Between-task routing divergence is 54-161x the within-task divergence on every layer, and the task can be predicted from routing with 85-94% accuracy. But a task still uses 24-28 of the 32 experts for 95% of its routing mass; the top-8 experts carry 40-50%. The top-1 expert is predictable from the token id alone (88% in layer 0, 45-55% in deep layers): routing follows tokens more than topics.
Merging experts (any grouping, with neuron alignment) destroys the model (perplexity in the thousands).
Cutting to 16 code experts and fine-tuning the experts' output weights recovered code to 4.61 vs 4.58
(published separately as Pantelispanka/granite-moe-code-specialist-0.7b-v0; that model modifies the experts).
Training only the routers to concentrate routing trades quality for concentration (code: 10.7 experts for 99% of routing at perplexity 4.40 vs 3.83; mixed tasks: 12.7 experts at 5.89/4.14/19.95/10.86 vs 4.58/1.97/10.15/6.21). It concentrates every context onto the same experts, so per-context sets equal the global set.
Ridge regression from the routing of the first 32 tokens to the continuation's expert usage: static hit rate at
8 experts 0.490 vs 0.452 (global set), 0.484 (task label), 0.513 (oracle). In partial-load perplexity, predicted,
global and oracle sets are within a few percent of each other. A graph-network predictor was written
(scripts/12_gnn_predictor.py) but only smoke-tested (0.461 vs ridge 0.466 vs oracle 0.481); the full run was
stopped twice by a low-memory guard and is not reported.
Only C experts per layer exist, routers untouched: perplexity 15.5 / 34 / 126 at 16 / 12 / 8 experts vs 4.37 full. This already includes the first-token fix (below); without it the numbers are 127 and about 2000.
Per-task router patch trained with missing experts blocked, 150 contexts, 500 steps, 16 experts: code 3.87, math 4.07, qa 11.45, prose 38.17 (full: 3.65 / 2.05 / 6.93 / 9.31). Training 2000 steps on the same data was worse (code 3.98, math 4.69); learning rate 1e-3 diverged. Tuned routers only work with their own restricted set (code routers give 4.65 with all experts loaded).
| Task | Full | 16 experts | 12 | 8 | Larger pack, 16 experts |
|---|---|---|---|---|---|
| code | 3.65 | 3.51 | 3.56 | 3.78 | - |
| math | 2.05 | 3.14 | 3.20 | 3.58 | 2.98 |
| qa | 6.93 | 8.71 | 8.71 | 9.75 | 7.43 |
| prose | 9.31 | 16.84 | 18.37 | 23.80 | 13.81 |
Standard pack: rank 8, 500 steps per size, 750 training contexts (code: 167, no more data available). Larger pack: rank 32, 2000 steps, 1112-2150 contexts. Code scoring below the full model reflects adaptation to the code data, not a better model. Selecting experts by loss (first-order gate importance) instead of usage gives a small gain on math, the only task with a control: 3.14 vs 3.18 (16), 3.20 vs 3.42 (12), 3.58 vs 3.77 (8). The loss-chosen set overlaps the usage-chosen set by 52-79%.
Routers + rank-16 delta on all experts, 1500 steps; each sequence trains with a random number of experts and a random or context-shaped subset. Afterwards, loading each task's most-used experts with no per-task training:
| Full | 16 experts | 12 | 8 | |
|---|---|---|---|---|
| Original base | 4.70 | 13.9 | 32.1 | 98.5 |
| After tolerance fine-tune | 5.28 | 7.8 | 9.5 | 12.8 |
It makes the model much more tolerant but damages the full model (math 2.05 -> 2.83) and is worse than per-task packs on every task. It was still improving at the last checkpoint.
| Setup | Original routers | Light concentration | Strong concentration |
|---|---|---|---|
| All 32 experts on GPU | 16.5 | 15.8 | 15.9 |
| 16 GPU slots, swap on miss | 12.6 (hit 0.75, 149 MB/token) | 14.8 (0.91, 55 MB) | 15.6 (0.99, 6.5 MB) |
| 8 GPU slots, swap on miss | 10.6 (hit 0.49, 310 MB/token) | 11.8 (0.68, 196 MB) | 14.1 (0.87, 78 MB) |
| Only 16 / 8 experts exist | 15.4 / 15.4 | 15.3 / 15.2 | 15.0 / 14.8 |
Partial load never swaps, so it runs at full speed. A predicted warm-up set makes no difference to swapping. Granite's experts are tiny (3.15 MB), so tokens/s shows direction only; MB moved per token is what transfers to larger models. The "only C experts exist" rows of this table measure speed only (those routers were not trained for the restricted set); usable-quality partial load is the pack table in the summary.
scripts/17_task_accuracy.py)Packs retrained with nothing from the benchmarks in their data (code: MBPP only, 125 contexts; qa: the 1000 test items removed, 1017 contexts). Numbers are in the summary table. Held-out perplexity of these packs: code 3.23 / 3.24 / 3.44 at 16 / 12 / 8 experts vs 3.49 full; qa 9.31 / 10.98 at 16 / 8 vs 6.20 full. HumanEval was run greedily with the function body opened by an indent (the base model otherwise ends the text); the full model's completions averaged 23 tokens, the 16-expert pack's about 100. The qa test scores the likelihood of each answer's text after the bare question, a format the packs were not trained on; scoring answer letters is at chance for the full model too, so "lost the knowledge" and "lost the format" cannot be separated here. Not analysed: which problems the packs lose.
scripts/18_pack_selector.py)182 held-out contexts, the four 16-expert packs, logistic regression on the mean token embedding of the first tokens:
| Pack chosen by | Correct pack | Mixed-task perplexity |
|---|---|---|
| Random | 29% | 12.44 |
| First 4 tokens | 80% | 6.90 |
| First 8 tokens | 84% | 6.50 |
| First 32 tokens | 92% | 6.28 |
| True task | 100% | 5.75 |
| Full model | - | 4.70 |
The task's own pack was the best pack by loss for all 182 contexts. A wrong pack is costly (code under the math pack: 15.3 vs 3.5). Only four clean categories; mixed prompts untested. These packs are the non-clean ones of section 7.
scripts/19_routing_concentration.py)Share of a model's experts a task needs for 95% of its routing, and share of routing carried by the task's top half:
| Granite-1B (8 of 32 active) | OLMoE-1B-7B (8 of 64 active) | |
|---|---|---|
| Experts for 95%, mean of 4 tasks | 81% (26.0 of 32) | 77% (49.2 of 64) |
| Experts for 99% | 94% | 90% |
| Top half carries | 75% | 79% |
| Top quarter carries | 47% | 55% |
| Code: experts for 95% / top half carries | 75% / 80% | 66% / 88% |
| Prose: experts for 95% / top half carries | 86% / 71% | 84% / 70% |
Halving the active fraction barely changes the picture: tasks still spread over about three quarters of the experts. Code is moderately more concentrated on OLMoE; prose is the same. OLMoE was measured on fewer tokens per task (12k vs 20k), which if anything makes it look slightly more concentrated than it is. Inference only; no packs were trained on OLMoE.
Two one-off fine-tunes of the shared model (routers + low-rank delta on every expert, distilled to the original):
(a) Random expert removal (scripts/15_subset_robust_base.py --clean, rank 32, planned 4000 steps). Stopped at
step 2250: it stalled with GPU memory full. Last checkpoint (step 2000), mixed perplexity: all experts 7.71
(original 4.50); task's most-used 16 / 12 / 8 experts 9.6 / 11.1 / 14.5 (original 15.2 / 31.4 / 107). No packs, no accuracy tests.
(b) "Use few experts" as the objective (scripts/20_sparse_objective.py, rank 16, 2500 steps). Each task learns a
score per layer and expert; a global budget shrinking from 32 to 12 experts per layer and task is spent on the
highest scores; one sequence in five trains with all experts.
| Original | Fine-tuned, all 32 experts | Fine-tuned, 12-expert pack | |
|---|---|---|---|
| Mixed perplexity (clean held-out) | 4.51 | 5.07 | 9.69 |
| Code perplexity | 3.36 | 3.32 | 4.58 |
| HumanEval pass@1 | 12.2% (20) | 2.4% (4) | 0% (0) |
| Qa accuracy (chance 25%) | 36.2% | 28.4% | 25.5% |
The fine-tune damaged the model even with every expert loaded, and the packs are worse than the per-task packs of section 10. The code pack degenerates into repetition under greedy decoding (one output inspected). Perplexity missed it entirely: code perplexity is unchanged while pass@1 falls from 20 to 4 problems. The learned budget came out nearly uniform (10.5 experts per layer for math to 12.9 for qa) and tasks share few experts (27 of 32 per layer needed to serve all four). Single run; hyperparameters not searched; the 84-minute runtime of the code pack test (vs 11 minutes with all experts) is unexplained.
Not novel in its parts. Task-specific expert pruning with fine-tuning (arXiv 2206.00277, SEER-MoE 2404.05089, MoE-Pruner 2410.12013, 2504.05586, 2402.14800, 2607.16721); nested / elastic MoE (Matryoshka MoE 2509.26520); self-distillation of a trained MoE to skip expert compute (ZEDA 2605.18643, keeps all experts in memory); prunable-by-pretraining (EMO, described in 2605.28207); expert offloading and on-device loading (MobileMoE 2605.27358, MoE-CORE 2610.01950, fMoE 2502.05370, ReMoE 2605.27081, StickyMoE 2607.08780); expert-specialised fine-tuning (ESFT). Not found in four searches, so possibly new but unverified: frozen shared experts plus small nested per-task packs trained with the missing experts absent from memory.
See PLAN.md. In short: (1) find out why packs lose ability (train packs on broad text instead of narrow task text;
larger packs; per-layer budgets); (2) more experts alone does not concentrate tasks (section 12), so a larger model is not expected to fix this by itself.
src/moe_lab/, scripts/ - all code. Key scripts: 13_restricted_tuning.py, 14_task_pack.py,
15_subset_robust_base.py, 16_run_pack.py, 10_predict_and_swap.py.results/ - JSON results of every experiment. packs/ - trained packs (keep, routers, A, B).robust/ - the tolerance fine-tune patch. routers/ - router-only patches.packs/pack_prose_loss_r32_big_C16.pt 39 MBpacks/pack_math_loss_r32_big_C16.pt 39 MBpacks/pack_qa_loss_r32_clean_C16.pt 39 MBpacks/pack_qa_loss_r32_big_C16.pt 39 MBrobust/base_r16_s1500.pt 39 MBpacks/pack_qa_loss_r32_clean_C8.pt 20 MBpacks/pack_code_loss_r8_clean_C16.pt 11 MBpacks/pack_math_usage_r8_C16.pt 11 MBpacks/pack_prose_loss_r8_C16.pt 11 MBpacks/pack_code_loss_r8_C16.pt 11 MBpacks/pack_math_loss_r8_C16.pt 11 MBpacks/pack_qa_loss_r8_C16.pt 11 MBpacks/pack_code_loss_r8_clean_C12.pt 9 MBpacks/pack_math_usage_r8_C12.pt 9 MBpacks/pack_prose_loss_r8_C12.pt 9 MBpacks/pack_code_loss_r8_C12.pt 9 MBpacks/pack_math_loss_r8_C12.pt 9 MBpacks/pack_qa_loss_r8_C12.pt 9 MBpacks/pack_code_loss_r8_clean_C8.pt 6 MBpacks/pack_math_usage_r8_C8.pt 6 MBpacks/pack_prose_loss_r8_C8.pt 6 MBpacks/pack_code_loss_r8_C8.pt 6 MBpacks/pack_math_loss_r8_C8.pt 6 MBpacks/pack_qa_loss_r8_C8.pt 6 MBrouters/restricted/routers_code_global_C16_s2000.pt 2 MBrouters/restricted/routers_math_global_C16_s2000.pt 2 MBrouters/restricted/routers_prose_global_C12.pt 2 MBrouters/restricted/routers_prose_global_C16.pt 2 MBrouters/restricted/routers_code_global_C12.pt 2 MBrouters/restricted/routers_code_global_C16.pt 2 MBrouters/restricted/routers_math_global_C12.pt 2 MBrouters/restricted/routers_math_global_C16.pt 2 MBrouters/restricted/routers_prose_global_C8.pt 2 MBrouters/restricted/routers_code_global_C8.pt 2 MBrouters/restricted/routers_math_global_C8.pt 2 MBrouters/restricted/routers_percontext_C12.pt 2 MBrouters/restricted/routers_percontext_C16.pt 2 MBrouters/restricted/routers_qa_global_C12.pt 2 MBrouters/restricted/routers_qa_global_C16.pt 2 MBrouters/restricted/routers_qa_global_C8.pt 2 MBrouters/restricted/routers_global_C12.pt 2 MBrouters/restricted/routers_global_C16.pt 2 MBrouters/concentration/routers_s0_m1_e0_d1.pt 2 MBrouters/concentration/routers_s0_m3_e0_d3.pt 2 MBrouters/concentration/routers_s0_m3_e0_d6.pt 2 MBrouters/concentration/routers_s0_m0_e0.pt 2 MBrouters/concentration/routers_s0_m1_e0.pt 2 MBrouters/concentration/routers_s0_m3_e0.pt 2 MBrouters/concentration/routers_s3_m3_e0.pt 2 MBibm-granite/granite-3.1-1b-a400m-base