← Insights

DE — Deutsche Version

Why Five Bits Aren’t Five Bits: A MiniMax M2.7 Quantization Odyssey

· Filip

In part one of this series we described bolting eight RTX 3090s and 3090 Tis into a local LLM rig with 192 GB of VRAM. That settled the hardware question, for the moment. The next question turned out to be harder: which quant of a very large MoE model not only fits into memory but keeps the model’s abilities intact?

With MiniMax M2.7, that question took us through three very different outcomes. A 4-bit quant was fast and, in our real-world test, useless. One 5-bit quant was bigger and barely better. Another 5-bit quant suddenly wrote clean technical specs again. Nominal bit width explained none of it.

MiniMax M2.7 is a 230B-A10B mixture-of-experts model with 256 experts and roughly ten billion active parameters per token. It’s attractive for reasoning and agentic work, but it’s touchy about quantization. Our Ampere rig narrows the field further: eight cards bring plenty of memory and memory bandwidth, but no hardware acceleration for FP8 or FP4. So a quant has to fit into 192 GB of VRAM, run at a reasonable clip on RTX 3090s, and keep enough quality for long, structured work — all at the same time.

Our acceptance test was deliberately unglamorous

We didn’t start by asking whether a quant drops a few points on some short multiple-choice benchmark. Our test, roughly: take a terse briefing and turn it into a complete, consistent technical specification.

That single task bundles most of what we need daily. The model has to hold requirements in mind across many paragraphs, avoid contradicting itself, build a clean outline, and stick to formatting rules. A damaged MoE can still answer short questions convincingly and fall apart on exactly this kind of job.

The failure mode was often more informative than any single score. Dropped requirements, abrupt topic shifts and fading coherence could still pass as ordinary quality loss. Literal typos in the output of a 230-billion-parameter model were a different kind of alarm. That wasn’t a model losing a bit of stylistic polish; the quant had visibly damaged capabilities that matter.

Attempt 1: four bits, about 90 tokens per second — and unusable

Our first candidate was the W4A16 package published as cyankiwi/MiniMax-M2.7-AWQ-4bit. On vLLM with tensor parallelism across all eight GPUs it hit roughly 90 tok/s. On paper, excellent.

In the spec test the model forgot requirements, lost the thread over longer passages and even produced typos. We could measure the speed; we just couldn’t use the output. For agentic work, a model that runs twice as fast in the wrong direction is no improvement.

A note on naming, because precision matters here. The repo carries AWQ-4bit in its name, but a public discussion questioned whether the package actually contains all the scaling data you’d expect from classic, calibrated AWQ. For our story, what counts is what we actually ran: a W4A16 model published under that name, with attention squeezed down to four bits along with everything else.

For MiniMax specifically, that stacks several bad decisions on top of each other. Attention loses precision, sensitive down-projections get treated like ordinary expert tensors, and a router-driven calibration may only ever reach a fraction of the 256 experts. The result was fast, and too unreliable for our work.

Attempt 2: five bits — bigger, still not smarter

The obvious reaction: fine, throw more bits at it. We grabbed bartowski’s Q5_K_M build of MiniMax M2.7 and launched it with ik_llama. The quant sits at roughly 5.5 bits per weight and eats correspondingly more memory than the 4-bit path.

The practical payoff never showed up. The output was less obviously broken than the W4A16 model’s, but the spec test still failed: requirements vanished, sections got sloppy, and the structure stayed unreliable.

To be clear, this is no verdict on every file named Q5_K_M. It describes exactly the bartowski build we tested, on this task. But it was enough to kill a comfortable assumption: more average bits do not automatically make a smarter quant. Extra precision spread evenly across the model helps little when the sensitive tensors don’t get any of it.

Attempt 3: also five bits — and suddenly the model works

The breakthrough came with ubergarm/MiniMax-M2.7-GGUF in IQ5_K. At roughly 5.9 bpw this quant nominally lives in the same five-bit class, but it treats the weights with intent. Attention stays high-precision, known trouble spots get extra protection, and the bulk of the savings comes out of the big expert tensors.

Same spec test, coherent writing again. Requirements stayed put, the outline held over thousands of tokens, and the typos disappeared. In one run the output was actually better than our unquantized reference. That doesn’t make the quant “better than BF16”; it mostly shows how little a single run says about any general ranking. For our purposes the finding was simpler: IQ5_K restored the model quality we expected, in practice.

After we later reconstructed the exact historical launch, this path did about 49.5 tok/s on short prompts. At around 80,000 tokens of active context we were still decoding at roughly 13.1 tok/s. That’s much slower than the plain 4-bit vLLM path — but the output was usable.

So two quants can both be called “five bit” and still be fundamentally different animals. The number is an average. It says nothing about which tensors keep their precision, which get compressed hard, and how the calibration deals with an MoE router.

Why MiniMax loses capabilities under naive quantization

From our own runs, the community’s quant recipes and later investigations, three sore spots emerged.

1. Attention does not tolerate four bits

The q, k, v and o projections decide how information gets picked up and passed along through the context. Crush those tensors to four bits together with the expert weights and errors accumulate over long sequences. For a model that’s supposed to hold technical specs and agent trajectories together across many thousands of tokens, the savings land exactly where they hurt most.

Good MiniMax quants therefore typically keep attention in Q8, BF16 or FP8. The memory savings have to come from places where they do less damage.

2. Some down-projections carry extreme outliers

The Unsloth investigation into MiniMax-M2.7-GGUF found NaN issues in widely used quantizations. A specific Unsloth commit bumps blk.61.ffn_down_exps to Q6_K to dodge exactly that failure.

Our own notes and quant recipes also treat the down-projections at the very start and end of the model with extra care. The papers “Systematic Outliers in Large Language Models” and “Precision Where It Matters” supply the general background: outliers don’t spread evenly across projections and layers. Neither paper is a direct MiniMax M2.7 experiment, but both support the logic of selective precision.

3. Router calibration does not automatically see every expert

MiniMax has 256 experts, of which only a small subset fires per token. If an AWQ calibration just pushes normal prompts through the router, it only ever visits the experts the router happens to pick. The rest stay unseen and can end up with unsuitable scales.

A quantization scheme for this MoE has to calibrate all experts deliberately. “Given enough prompts, the router will get around to them eventually” is not a strategy you can lean on when most experts barely show up during calibration, if at all.

The naive 4-bit path can hit all three problems at once: four-bit attention, unprotected outlier-heavy down-projections, and incomplete expert scaling. At that point it stops being surprising that a huge model suddenly forgets requirements in our test.

What a sane MiniMax quant looks like

From the community recipes by ubergarm, Unsloth and mratsim’s quantization tooling, plus our own attempts, a fairly clear pattern emerges. mratsim’s AWQ calibration recipe is a useful starting point for code- and software-heavy calibration data; it is not a finished MiniMax M2.7 recipe.

Tensor group Sensible treatment
Attention q/k/v/o Q8, BF16 or FP8; do not reduce to four bits
Embeddings, output, norms, router/gates high precision or unquantized
Critical ffn_down_exps at least Q6_K or an outlier-aware I-quant
The bulk of the expert tensors four bits is often acceptable here
Calibration cover all experts deliberately

The effective quant often lands at roughly five to six bits per weight. Most of the parameters sit in the expert tensors — which is exactly where you can save a lot of bytes without dragging attention and the critical projections into the same precision loss.

The perplexity numbers back this up

ubergarm’s measurements on wiki.test produce the following series; lower is better:

BF16           7.8743
Q8_0           7.8764   (+0.03 %)
IQ5_K          7.8860   (+0.15 %)
smol-IQ4_KSS   8.0990   (+2.9 %)
IQ2_KS         9.0713   (+15 %)

IQ5_K stays very close to BF16. Below roughly four bits per expert tensor, the gap widens sharply. That matches our spec test without replacing it. Perplexity measures prediction quality on a corpus; it doesn’t directly tell you whether a model holds every requirement of a technical spec across several pages.

Which is exactly why we use both lenses. The measurement series helps spot badly broken quants. The practical test shows whether the remaining errors happen to hit the very abilities we run the model for.

Side quest: does a 4-bit KV cache cost quality?

With the KV cache, the worry writes itself. It sits directly in the attention path, and aggressive quantization could wreck long contexts. So we compared q8_0 against q4_0 on the IQ5_K model, using the same spec, reasoning and planning tasks.

In these tests we found no measurable quality difference. q4_0 at 160k context was practically level with q8_0 and our unquantized reference. Decode speed barely moved either, because this run was mostly bound by model-weight bandwidth.

KV cache Max context with balanced split Decode
f16 roughly 32k roughly 42 tok/s
q8_0 roughly 88k roughly 41 tok/s
q4_0 roughly 160k roughly 40 tok/s

These context ceilings come from our split and KV experiments at the time. The graph split carried roughly 21 GiB of extra overhead. The later reconstructed, actually stable production command uses no graph split. So read the numbers as the practical magnitude of the KV effect, not as three perfectly identical production runs.

Our claim stays deliberately narrow: with the prompts we used, we couldn’t detect a downside to q4_0 KV. This was no MMLU run over ten thousand samples, and it’s no blanket guarantee for every workload.

The exact IQ5_K launch mattered more than we’d like to admit

For a while we believed the good IQ5_K path was lost to us. Then we found the historical launch command again, sitting in the local OpenCode database. The differences to our failed reconstructions looked small: a different KV type, a different split mode, the correct tensor split, a known container image, and the original cache and mmap settings. Together they decided whether the model ran cleanly.

The reconstructed launch:

docker run -d --name minimax_iq5k 
  --gpus all --ipc=host --shm-size=64g 
  -e NVIDIA_DISABLE_REQUIRE=1 
  -p 8088:8080 
  -v /bigData/llama-models/ubergarm/MiniMax-M2.7-GGUF:/models 
  --entrypoint /app/llama-server 
  ik-llama-cuda:main-20260612-full 
  --model /models/IQ5_K/MiniMax-M2.7-IQ5_K-00001-of-00005.gguf 
  --alias MiniMax-M2.7-IQ5_K 
  --host 0.0.0.0 --port 8080 
  -c 163840 
  -fa 1 -ngl 999 
  -ts 1,1.008,1,1.008,1.008,1.008,1,0.97 
  -ctk q4_0 -ctv q4_0 
  -muge -gr 
  -b 2048 -ub 256 
  --threads 1 --parallel 1 
  --no-mmap --jinja 
  --cache-ram 32768 --prompt-cache-all

What matters is not only what’s in there, but what’s missing: no -sm graph. The known-good run used the balanced tensor split without graph mode. ik_llama issue #1624 documents problems around -muge and -vhad in combination with graph split; it does not establish that -khad is fundamentally broken in every configuration. Our production command simply sidesteps the extra complexity.

With exactly this setup we measured roughly 49.5 tok/s at short context. At around 80k of active context, decode sat near 13.1 tok/s and prompt throughput at roughly 350 tok/s. A supposed 24 tok/s ceiling we hit later came from a wrongly reconstructed setup — it was never a property of the IQ5_K quant.

Speed versus quality — at first, an uncomfortable choice

On Ampere, this left us with the following picture:

Path Quant Engine Speed Real-world result
very fast W4A16, published as AWQ-4bit vLLM roughly 90 tok/s unreliable
strong quality ubergarm IQ5_K ik_llama roughly 49.5 tok/s short practically reference quality
usable quality EXL3 5.0 bpw ExLlamaV3 roughly 24 tok/s too slow on Ampere

vLLM has no ordinary 5-bit Marlin path. AWQ and GPTQ pack into four or eight bits in practice; five bits doesn’t fit cleanly into those kernel and byte layouts. ik_llama can run finer mixes via GGUF and I-quants, and on our rig it pays for that flexibility with a lot less speed.

The fast reference path launches with the cyankiwi package like this, for example:

vllm serve cyankiwi/MiniMax-M2.7-AWQ-4bit 
  --tensor-parallel-size 8 
  --max-model-len 196608 
  --max-num-seqs 1 
  --enable-prefix-caching 
  --trust-remote-code 
  --reasoning-parser minimax_m2 
  --tool-call-parser minimax_m2 
  --enable-auto-tool-choice 
  --gpu-memory-utilization 0.92

The roughly 87 to 90 tok/s of this path change nothing about our spec-test verdict. The command is documented here because it makes the speed side of the comparison reproducible, not because we recommend this quant for demanding agentic work.

The hybrid AWQ finally delivered both

When we picked ayysasha/MiniMax-M2.7-AWQ-G32-STRIX-2H, its behavior on NVIDIA/Ampere was still an open question. By now we know the answer.

The quant puts the conclusion from the previous attempts straight into practice: INT4 experts save the bulk of the memory while attention stays in BF16. Router and critical regions are also kept at higher precision, and the experts were deliberately calibrated. Some of the late layers remain fully in BF16.

On our rig this hybrid reached roughly 83 to 90 tok/s single-stream. Synthetic tests with four parallel requests hit roughly 181 tok/s aggregate. That put it almost level with the plain W4A16 path and well above IQ5_K under ik_llama.

More importantly, the model wasn’t damaged the way the first 4-bit attempt was. It wrote usable specs and produced complete tool calls. And here comes the plot twist: part of what initially looked like missing model intelligence lived in a different layer entirely. Our proxy only handled tool-call recovery on the non-streaming path. Streaming subagents were therefore printing perfectly well-formed MiniMax tool-call blocks as visible text instead of executing them.

The stable route went straight to vLLM, with no proxy in between. vLLM ships the MiniMaxM2ReasoningParser and the MinimaxM2ToolParser for exactly this. In our configuration we used minimax_m2_append_think for reasoning and minimax_m2 for tool calls. After that, the subagents wrote their files correctly and the raw XML blocks were gone.

For comparison: the widely used QuantTrio/MiniMax-M2.7-AWQ scored somewhere in the mid-80s on HumanEval, while the ayysasha hybrid, at 90.2 percent, sat close to the unquantized reference of 91.5 percent. Those numbers alone don’t prove fitness for our spec task, but they line up with what we saw in practice.

And the originally open question — can INT4 stay fast on an RTX 3090 without quantizing the attention into the ground? — got its answer: yes. Group size 32 is less Marlin-friendly than the common group size 128, yet the hybrid still ran far faster than our IQ5_K path.

Quantization solved — operations, not yet

The takeaway from this odyssey is more precise than “five bits beat four”. A generic 5-bit quant can be weak, a careful IQ5_K can reach near-reference quality, and a hybrid of INT4 experts plus BF16 attention can be fast and smart at the same time.

What decides it is where the precision goes:

  • keep attention high-precision,
  • protect the outlier-heavy down-projections,
  • calibrate all experts,
  • compress the big remainder of the expert tensors aggressively.

None of this yet proved that MiniMax M2.7 stays stable across 60k, 80k or 100k of active context, uses tools reliably, and reaches consistent judgments on repeated evaluation tasks. Those problems no longer belong to pure quantization. They involve model behavior, engine, parsers, context growth — and, in places, the hardware itself.

That’s exactly where the next article picks up, covering our MiniMax experience under real production load (coming soon). The hybrid quant solved the original four-bit problem. What happened afterwards under real agent load is a different story.

Quants and technical sources

Models and quants

Investigations and tooling

Write a comment

Your e-mail address will not be published. A first comment is approved manually.