Unsloth - Qwen3 4B Instruct 2507 MXFP4 Hybrid GGUF

Dense model utilizing MXFP4_MOE with hybrid weights on a dense model. Achieving interesting results that show smaller file size, more TPS, and near lossless precision.

Use one of these found magic models!

Stats compared against the standard Q8_0 (precision loss still compared to F16)

  • MXFP4_MOE-Q6_K

    4.5% smaller than Q8 • 388.82 TPS • 0.0178% precision loss

    (TLDR: I'm a scientist or something like that..)


  • MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K

    12% smaller than Q8 • 403.6 TPS • 0.0547% precision loss

    (TLDR: The perfect balance)


This repository contains a set of hybrid MXFP4 quantized GGUF models designed to explore a surprising discovery:

A carefully targeted combination of MXFP4 + high-precision embeddings/output weights can deliver near-Q8 accuracy with Q4–Q6 level throughput and smaller file sizes than Q8.

Unlike pure MXFP4, which heavily degrades dense models. This hybrid method selectively protects tensors that matter most for semantic stability, while allowing MXFP4 to accelerate everything else.

This is experimental. And should be treated as such. I am more than encouraging people to use these models and leave feedback! Though precision loss seemed near lossless, did the hybrid models act strange in certain situations? Worse or better on some topics compared to the original model? Did it do better/worse overall on everything? I'd love to hear back from others!


The Magic Models

Each of these models achieved:

File size reduction compared to the Q8_0

Better precision loss scores than the pure Q6_K

Achieving noticeably better TPS than a Q4_K_M

I have personally deemed these in the category of "Q7.5" quantization.

The following are the special models to note from what was created. Each of the 3 models shown below are being compared to the Q8 model.

MXFP4_MOE-Q6_K

(**4.5% smaller than Q8 • 388.82 TPS • 0.0178% precision loss **)

Honestly, this model feels like Q8 with a gym membership. It's safe for scientific work, most stable for long context, and hits a sweet ~10% boost in TPS.

The following was the conversion script:

llama-quantize \
  --tensor-type token_embd.weight=Q6_K \
  --tensor-type output.weight=Q6_K \
  "Path_To_F16_GGUF.gguf" \
  "Path_To_GGUF.gguf" \
  mxfp4_moe

MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K

(12% smaller than Q8 • 403.6 TPS • 0.0547% precision loss)

This is the most balanced choice for real world use. It's a rock star in long context windows, great TPS, and decent model size savings compared to the Q8 model.

The following was the conversion script:

llama-quantize \
  --tensor-type token_embd.weight=Q6_K \
  --tensor-type output.weight=MXFP4 \
  --tensor-type 'router.*'=Q6_K \
  --tensor-type 'gate.*'=Q6_K \
  "Path_To_F16_GGUF.gguf" \
  "Path_To_GGUF.gguf" \
  mxfp4_moe

MXFP4_MOE Hybrid Naming Scheme & Synopsis

Multiple different combinations of converted models were created. The results were interesting to say the least. The following table will explain my naming scheme to what was done to the model to create it.

Suffix Example Meaning
MXFP4_MOE Pure MXFP4 pipeline
MXFP4_MOE-Q8 Embedding/output in Q8_0
MXFP4_MOE-F16 Embedding/output in F16
output_mxfp4-embd_q8 Output → MXFP4, Embedding → Q8
output_mxfp4-router_gate_emb_q5_K Output → MXFP4, Emb/Router/Gate → Q5_K
MXFP4_MOE-Q6_K Both embedding + output in Q6_K
Q8_0, Q6_K, Q4_K_M Pure model-wide quantizations

The results achieved were interesting to say the least. It was a brute force game of mass creating models with hybrid methods to find combinations that didn't cause too much noise and paired well with MXFP4.

This repo showcases the converted models, whether good or bad that was created. But, I have been testing other models in different combinations as well. The winning hybrid combinations shown in this repo DOES NOT always equate to the same results on different models.

Some models do better or worse with different kinds of combinations. It depends if it's dense, MOE, and much more. Many times the results surprise me. Many models no matter the combination will not play nice with MXFP4. At least with the methods shown here.


Benchmark Methodology

All models were tested with a unified automated harness using llama.cpp tools.

Included tests:

  • Throughput:
    llama-bench with descending GPU offload (-ngl 35 → 0) and automatic OOM retry.
    Highest successful TPS is recorded.

  • Perplexity:
    Three domains: general, code, math.
    Each uses an auto-generated corpus of ~32k tokens.
    Perplexity is computed with llama-perplexity at 2048-token context.
    Same GPU retry logic as above.

  • Precision loss:
    Each model is compared to its family F16 baseline.
    Precision-loss % is computed for all PPL domains, plus an averaged score.
    Models are ranked by this metric.


Table - Overview of Results

model_name size_reduction tps_change
Q8_0 46.8% 53.28%
MXFP4_MOE-Q8 46.8% 46.84%
MXFP4_MOE-Q6_K 49.2% 57.86%
MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K 53.2% 63.86%
MXFP4_MOE-F16 37.87% 14.43%
MXFP4_MOE-output_q6_K-router_gate_emb_q6_K 51.87% 63.88%
MXFP4_MOE-output_mxfp4-embd_q6_K 50.53% 67.09%
MXFP4_MOE-output_mxfp4-embd_q8 49.33% 49.04%
MXFP4_MOE-output_mxfp4-router_gate_emb_q8 49.33% 48.52%
MXFP4_MOE-output_mxfp4-embd_q5_K 51.2% 80.02%
Q6_K 58.93% 71.37%
MXFP4_MOE-Q5_K 50.4% 80.61%
MXFP4_MOE-output_mxfp4-router_gate_emb_q5_K 55.33% 66.17%
Q5_K_M 64.13% 48.74%
MXFP4_MOE-output_mxfp4-embd_q4_K 51.73% 79.91%
Q4_K_M 68.93% 61.01%
MXFP4_MOE-output_mxfp4-router_gate_emb_q4_K 57.33% 84.47%
MXFP4_MOE-Q4_K 51.6% 82.45%
MXFP4_MOE-output_q8-embd_mxfp4 49.47% 87.28%
MXFP4_MOE 73.33% 87.58%
  • All percentages compared against the selected family F16 baseline.

Table - File Size + TPS + Avg Precision Loss

model_name file_size_gb bench_tps avg_prec_loss
F16 7.5 246.31 0
Q8_0 3.99 377.54 0.0049
MXFP4_MOE-Q8 3.99 361.69 0.0126
MXFP4_MOE-Q6_K 3.81 388.82 0.0178
MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K 3.51 403.6 0.0547
MXFP4_MOE-F16 4.66 281.86 0.0647
MXFP4_MOE-output_q6_K-router_gate_emb_q6_K 3.61 403.66 0.1051
MXFP4_MOE-output_mxfp4-embd_q6_K 3.71 411.57 0.1371
MXFP4_MOE-output_mxfp4-embd_q8 3.8 367.11 0.1725
MXFP4_MOE-output_mxfp4-router_gate_emb_q8 3.8 365.83 0.1725
MXFP4_MOE-output_mxfp4-embd_q5_K 3.66 443.4 0.1873
Q6_K 3.08 422.11 0.2635
MXFP4_MOE-Q5_K 3.72 444.85 0.4048
MXFP4_MOE-output_mxfp4-router_gate_emb_q5_K 3.35 409.3 0.5808
Q5_K_M 2.69 366.37 0.7871
MXFP4_MOE-output_mxfp4-embd_q4_K 3.62 443.13 0.8979
Q4_K_M 2.33 396.59 0.9867
MXFP4_MOE-output_mxfp4-router_gate_emb_q4_K 3.2 454.36 1.2362
MXFP4_MOE-Q4_K 3.63 449.39 1.247
MXFP4_MOE-output_q8-embd_mxfp4 3.79 461.3 2.9366
MXFP4_MOE 2 462.03 8.2072
  • Bench NGL was 35
  • Utilized CUDA

Table - PPL Columns

model_name gen gen_er code code_er math math_er
F16 8.8841 0.2056 1.5468 0.0122 6.7111 0.137
Q8_0 8.8754 0.2053 1.5488 0.0123 6.708 0.1367
MXFP4_MOE-Q8 8.8803 0.2055 1.5486 0.0123 6.7087 0.1367
MXFP4_MOE-Q6_K 8.8802 0.2052 1.5484 0.0123 6.7107 0.1365
MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K 8.8822 0.2047 1.546 0.0121 6.705 0.1359
MXFP4_MOE-F16 8.8889 0.2058 1.548 0.0123 6.7153 0.137
MXFP4_MOE-output_q6_K-router_gate_emb_q6_K 8.8798 0.2053 1.548 0.0123 6.7303 0.1372
MXFP4_MOE-output_mxfp4-embd_q6_K 8.8785 0.2046 1.5463 0.0121 6.6899 0.1353
MXFP4_MOE-output_mxfp4-embd_q8 8.8753 0.2047 1.5457 0.0121 6.6878 0.1355
MXFP4_MOE-output_mxfp4-router_gate_emb_q8 8.8753 0.2047 1.5457 0.0121 6.6878 0.1355
MXFP4_MOE-output_mxfp4-embd_q5_K 8.9251 0.206 1.5466 0.0121 6.7187 0.1365
Q6_K 8.8441 0.2034 1.5452 0.0121 6.6952 0.1357
MXFP4_MOE-Q5_K 8.9263 0.2066 1.551 0.0123 6.7425 0.1378
MXFP4_MOE-output_mxfp4-router_gate_emb_q5_K 8.979 0.2081 1.5481 0.0121 6.7507 0.1375
Q5_K_M 8.9731 0.2079 1.554 0.0123 6.7711 0.1384
MXFP4_MOE-output_mxfp4-embd_q4_K 9.0428 0.2099 1.5503 0.0121 6.7568 0.1364
Q4_K_M 8.9569 0.2055 1.5694 0.0125 6.7567 0.1372
MXFP4_MOE-output_mxfp4-router_gate_emb_q4_K 9.0761 0.2108 1.5546 0.0121 6.7811 0.1372
MXFP4_MOE-Q4_K 9.0787 0.2116 1.5573 0.0124 6.7696 0.1372
MXFP4_MOE-output_q8-embd_mxfp4 9.2094 0.2117 1.5598 0.0123 7.0002 0.1427
MXFP4_MOE 9.8799 0.2282 1.6122 0.013 7.3275 0.1494
  • gen = ppl_general
  • gen_er = ppl_general_error
  • code = ppl_code
  • code_er = ppl_code_error
  • math = ppl_math
  • math_er = ppl_math_error

Table - Precision Loss Columns

model_name loss_general loss_code loss_math
F16 0 0 0
Q8_0 -0.0979 0.1293 -0.0462
MXFP4_MOE-Q8 -0.0428 0.1164 -0.0358
MXFP4_MOE-Q6_K -0.0439 0.1034 -0.006
MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K -0.0214 -0.0517 -0.0909
MXFP4_MOE-F16 0.054 0.0776 0.0626
MXFP4_MOE-output_q6_K-router_gate_emb_q6_K -0.0484 0.0776 0.2861
MXFP4_MOE-output_mxfp4-embd_q6_K -0.063 -0.0323 -0.3159
MXFP4_MOE-output_mxfp4-embd_q8 -0.0991 -0.0711 -0.3472
MXFP4_MOE-output_mxfp4-router_gate_emb_q8 -0.0991 -0.0711 -0.3472
MXFP4_MOE-output_mxfp4-embd_q5_K 0.4615 -0.0129 0.1132
Q6_K -0.4502 -0.1034 -0.2369
MXFP4_MOE-Q5_K 0.475 0.2715 0.4679
MXFP4_MOE-output_mxfp4-router_gate_emb_q5_K 1.0682 0.084 0.5901
Q5_K_M 1.0018 0.4655 0.894
MXFP4_MOE-output_mxfp4-embd_q4_K 1.7863 0.2263 0.681
Q4_K_M 0.8194 1.4611 0.6795
MXFP4_MOE-output_mxfp4-router_gate_emb_q4_K 2.1612 0.5043 1.043
MXFP4_MOE-Q4_K 2.1904 0.6788 0.8717
MXFP4_MOE-output_q8-embd_mxfp4 3.6616 0.8404 4.3078
MXFP4_MOE 11.2088 4.2281 9.1848
  • loss_general = precision_loss_general_pct
  • loss_code = precision_loss_code_pct
  • loss_math = precision_loss_math_pct
Downloads last month
139
GGUF
Model size
4B params
Architecture
qwen3
Hardware compatibility
Log In to view the estimation

6-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for magiccodingman/Qwen3-4B-Instruct-2507-Unsloth-MXFP4-Hybrid-GGUF

Quantized
(13)
this model

Collection including magiccodingman/Qwen3-4B-Instruct-2507-Unsloth-MXFP4-Hybrid-GGUF