Minimax M2 Expert Prune Heal
A research artifact on structurally compressing a 230B Mixture-of-Experts coding agent (MiniMax-M2: 256 experts/layer, top-8) by pruning experts — keeping it a working agent in a real tool-using loop, not just a...
Source du modèle
- Type
- Other
- Taille du fichier
- 55,1 GB
- Modèle de base
- MiniMaxAI/MiniMax-M2
- Version
- vRevision 1f73c5c
- Mis à jour
- 14 oct. 2026
- Éditeur
- @KikoCis
- Téléchargements
- 45
- Source
- Hugging Face
Description de la source
MiniMax-M2 — Expert-Pruned (keep-192/256), GGUF
A research artifact on structurally compressing a 230B Mixture-of-Experts coding agent (MiniMax-M2: 256 experts/layer, top-8) by pruning experts — keeping it a working agent in a real tool-using loop, not just a fluent generator. This is the keep-192 point: 192 of 256 experts kept (top-K by measured code/agentic activation), ~30% smaller, still solves real SWE tasks.
👉 Full field report: ARTICLE.md.
The headline: capability scales smoothly with the expert budget
Evaluated as a real coding agent (a harness driving the model through a Dockerized repo: read, edit, run tests) on a 6-instance SWE-bench Verified probe set (the exact instances the un-pruned model resolves 6/6), served via Ollama:
| Variant | Size (GGUF) | Experts kept | SWE resolved |
|---|---|---|---|
| Full M2 (IQ2_M) | 78 GB | 256 / 256 | 6 / 6 |
| keep-192 (this repo) | ~55 GB | 192 / 256 | 3 / 6 |
| keep-160 | 46 GB | 160 / 256 | 1 / 6 |
| IQ1 (all experts, 1.8-bit) | 48 GB | 256 / 256 | 0 / 6 |
Two findings worth taking away:
- No cliff — agentic capability degrades smoothly as you remove experts (6 → 3 → 1), it doesn't collapse. You can drop a quarter of the experts and keep half the solving.
- At a fixed size, prune > uniform-extreme-quant — keep-160 (46 GB, 160 experts at ~2.7-bit) resolves where IQ1 (48 GB, all 256 at 1.8-bit) resolves nothing. Concentrating the bit budget on fewer experts beats spreading it thin.
These models are untrained (pure pruned quant, no fine-tune) — so the resolves are genuine compressed-M2 capability, not memorization.
Use it
# Ollama (the GGUF is in this repo):
ollama create m2-pruned192 -f Modelfile
ollama run m2-pruned192
Or point any llama.cpp/GGUF runtime at M2-pruned192-IQ2.gguf. Use a generous context for agent loops (the M2 chat template + stop tokens are baked into the Modelfile).
Reproduce
# Prune the kept experts out of an IQ2_M GGUF of MiniMax-M2 (clean slice, no re-quant):
python prune_gguf_experts.py \
--in MiniMax-M2-IQ2_M.gguf --out M2-pruned192.gguf \
--keep 192 --strategy file --keep-file keep192_experts.json
keep192_experts.json is the per-layer expert keep-set (top-K by measured activation on a code/agentic calibration corpus).
Limitations
- Research artifact, not a production release. At ~55 GB it solves 3/6 of this probe set; the full 78 GB quant solves 6/6 — pruning trades size for capability along the curve above.
- Untrained. A recovery fine-tune ("heal") on top should push it further up the curve (separate work).
- Honest framing: this is not "better than the full model" — it's a smaller point on a clean size↔capability curve, and at a fixed budget it beats a same-size uniform low-bit quant.
License
Apache-2.0, inheriting MiniMax-M2's terms. This repo adds a pruning recipe + a pruned GGUF derived from a quantized MiniMax-M2.
Sources
1 source
Sources
1 sourceVérifié 7 août
Artefacts du modèle
1 artefact
Artefacts du modèle
1 artefactExtraits de sources
3 extraits
Extraits de sources
3 extraits--- license: apache-2.0 base_model: MiniMaxAI/MiniMax-M2 tags: - mixture-of-experts - expert-pruning - gguf - agentic - coding-agent - swe-bench library_name: gguf --- # MiniMax-M2 — Expert-Pruned (keep-192/256), GGUF A research artifact on **structurally compressing a 230B Mixture-of-Experts coding agent** (MiniMax-M2: 256 experts/layer, top-8) by **pruning experts** — keeping it a *working agent* in a real tool-using loop, not just a fluent generator. This is the **keep-192** point: 192 of 256 experts kept (top-K by measured code/agentic activation), **~30% smaller, still solves real SWE tasks.** 👉 Full field report: [`ARTICLE.md`](./ARTICLE.md). ## The headline: capability scales smoothly with the expert budget Evaluated as a **real coding agent** (a harness driving the model through a Dockerized repo: read, edit, run tests) on a 6-instance SWE-bench Verified probe set (the exact instances the un-pruned model resolves 6/6), served via Ollama: | Variant | Size (GGUF) | Experts kept | SWE resolved | |---|---|---|---| | Full M2 (IQ2_M) | 78 GB | 256 / 256 | 6 / 6 | | **keep-192 (this repo)** | **~55 GB** | **192 / 256** | **3 / 6** | | keep-160 | 46 GB | 160 / 256 | 1 / 6 | | IQ1 (all experts, 1.8-bit) | 48 GB | 256 / 256 | 0 / 6 | Two findings worth taking away: 1. **No cliff** — agentic capability degrades *smoothly* as you remove experts (6 → 3 → 1), it doesn't collapse. You can drop a quarter of the experts and keep half the solving. 2. **At a fixed size, prune > uniform-extreme-quant** — keep-160 (46 GB, 160 experts at ~2.7-bit) resolves where IQ1 (48 GB, all 256 at 1.8-bit) resolves nothing. Concentrating the bit budget on fewer experts beats spreading it thin. These models are **untrained** (pure pruned quant, no fine-tune) — so the resolves are genuine compressed-M2 capability, not memorization. ## Use it ```bash # Ollama (the GGUF is in this repo): ollama create m2-pruned192 -f Modelfile ollama run m2-pruned192 ``` Or point any llama.cpp/GGUF runtime at `M2-pruned192-IQ2.gguf`. Use a generous context for agent loops (the M2 chat template + stop tokens are baked into the `Modelfile`). ## Reproduce ```bash # Prune the kept experts out of an IQ2_M GGUF of MiniMax-M2 (clean slice, no re-quant): python prune_gguf_experts.py \ --in MiniMax-M2-IQ2_M.gguf --out M2-pruned192.gguf \ --keep 192 --strategy file --keep-file keep192_expert...
Source context: 45 downloads · 1 likes · Library gguf · Repo KikoCis/minimax-m2-expert-prune-heal
Source context: 318 downloads · 1 likes · Library gguf · Repo KikoCis/minimax-m2-expert-prune-heal
