Unsloth - Qwen3 4B Thinking 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 The Following Model!

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

  • MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K

    12% smaller than Q8 • 422.92 TPS • 0.0007% precision loss


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 this model 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 Model

This model 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 this in the category of "Q7.5" quantization.

MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K

(12% smaller than Q8 • 422.92 TPS • 0.0007% loss)

This version created beat out everything in every way in the MXFP4 hybrid family created. It not only held the lowest precision loss, but in the Q7.5 category, it was the fastest and smallest model. There was no reason to use any other created version as this one reigned king.

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

Comparing to F16.

model_name size_reduction tps_change
MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K 53.2% 54.47%
MXFP4_MOE-output_q6_K-router_gate_emb_q6_K 51.87% 52.64%
MXFP4_MOE-F16 37.87% 1.15%
MXFP4_MOE-Q6_K 49.2% 58.17%
MXFP4_MOE-output_mxfp4-embd_q6_K 50.53% 47.75%
MXFP4_MOE-Q8 46.8% 41.1%
Q8_0 46.8% 39.87%
Q6_K 58.93% 48.57%
MXFP4_MOE-output_mxfp4-embd_q8 49.33% 37.35%
MXFP4_MOE-output_mxfp4-router_gate_emb_q8 49.33% 42.28%
MXFP4_MOE-output_mxfp4-embd_q5_K 51.2% 65.48%
MXFP4_MOE-Q5_K 50.4% 59.33%
Q5_K_M 64.13% 36.06%
MXFP4_MOE-output_mxfp4-router_gate_emb_q5_K 55.33% 61.68%
MXFP4_MOE-output_mxfp4-embd_q4_K 51.73% 72.76%
Q4_K_M 68.93% 41.05%
MXFP4_MOE-Q4_K 51.6% 67.5%
MXFP4_MOE-output_mxfp4-router_gate_emb_q4_K 57.33% 75.43%
MXFP4_MOE-output_q8-embd_mxfp4 49.47% 72.55%
MXFP4_MOE 73.33% 83.3%
  • 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 273.78 0
MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K 3.51 422.92 0.0007
MXFP4_MOE-output_q6_K-router_gate_emb_q6_K 3.61 417.9 0.0136
MXFP4_MOE-F16 4.66 276.92 0.0282
MXFP4_MOE-Q6_K 3.81 433.03 0.0377
MXFP4_MOE-output_mxfp4-embd_q6_K 3.71 404.51 0.0386
MXFP4_MOE-Q8 3.99 386.31 0.1045
Q8_0 3.99 382.93 0.1047
Q6_K 3.08 406.75 0.1051
MXFP4_MOE-output_mxfp4-embd_q8 3.8 376.03 0.1136
MXFP4_MOE-output_mxfp4-router_gate_emb_q8 3.8 389.54 0.1136
MXFP4_MOE-output_mxfp4-embd_q5_K 3.66 453.04 0.418
MXFP4_MOE-Q5_K 3.72 436.2 0.536
Q5_K_M 2.69 372.51 0.5535
MXFP4_MOE-output_mxfp4-router_gate_emb_q5_K 3.35 442.65 0.6332
MXFP4_MOE-output_mxfp4-embd_q4_K 3.62 472.98 1.2697
Q4_K_M 2.33 386.17 1.6442
MXFP4_MOE-Q4_K 3.63 458.57 1.6896
MXFP4_MOE-output_mxfp4-router_gate_emb_q4_K 3.2 480.29 1.7161
MXFP4_MOE-output_q8-embd_mxfp4 3.79 472.42 2.1993
MXFP4_MOE 2 501.85 7.9522
  • Bench NGL was 35
  • Utilized CUDA

Table - PPL Columns

model_name gen gen_er code code_er math math_er
F16 10.0118 0.2452 1.5919 0.0127 6.8875 0.141
MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K 10.0216 0.2444 1.5916 0.0126 6.8822 0.14
MXFP4_MOE-output_q6_K-router_gate_emb_q6_K 9.9831 0.2441 1.5927 0.0127 6.9066 0.1414
MXFP4_MOE-F16 10.0066 0.245 1.5928 0.0128 6.893 0.1411
MXFP4_MOE-Q6_K 9.9966 0.2445 1.5933 0.0128 6.8997 0.1411
MXFP4_MOE-output_mxfp4-embd_q6_K 10.0333 0.2448 1.5922 0.0127 6.8794 0.1399
MXFP4_MOE-Q8 10.0181 0.2454 1.5933 0.0128 6.8987 0.1412
Q8_0 10.0174 0.2454 1.5931 0.0128 6.9001 0.1413
Q6_K 9.9687 0.2431 1.5926 0.0127 6.8924 0.1409
MXFP4_MOE-output_mxfp4-embd_q8 10.0518 0.2455 1.5918 0.0126 6.8839 0.1401
MXFP4_MOE-output_mxfp4-router_gate_emb_q8 10.0518 0.2455 1.5918 0.0126 6.8839 0.1401
MXFP4_MOE-output_mxfp4-embd_q5_K 10.0796 0.2462 1.5923 0.0127 6.9255 0.1415
MXFP4_MOE-Q5_K 10.0569 0.2465 1.5947 0.0128 6.9551 0.1431
Q5_K_M 10.0857 0.2469 1.5978 0.0128 6.9255 0.1413
MXFP4_MOE-output_mxfp4-router_gate_emb_q5_K 10.1209 0.2476 1.5928 0.0127 6.9394 0.1418
MXFP4_MOE-output_mxfp4-embd_q4_K 10.2105 0.2497 1.5985 0.0128 6.9846 0.1425
Q4_K_M 10.3299 0.2538 1.6081 0.0129 6.9383 0.1412
MXFP4_MOE-Q4_K 10.2603 0.2523 1.6028 0.013 7.0185 0.1439
MXFP4_MOE-output_mxfp4-router_gate_emb_q4_K 10.2553 0.2511 1.6007 0.0128 7.0365 0.144
MXFP4_MOE-output_q8-embd_mxfp4 10.2392 0.2468 1.6014 0.0128 7.1444 0.1455
MXFP4_MOE 10.9465 0.2659 1.6645 0.0138 7.5735 0.1563
  • 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
MXFP4_MOE-output_mxfp4-router_gate_emb_q6_K 0.0979 -0.0188 -0.077
MXFP4_MOE-output_q6_K-router_gate_emb_q6_K -0.2867 0.0503 0.2773
MXFP4_MOE-F16 -0.0519 0.0565 0.0799
MXFP4_MOE-Q6_K -0.1518 0.0879 0.1771
MXFP4_MOE-output_mxfp4-embd_q6_K 0.2147 0.0188 -0.1176
MXFP4_MOE-Q8 0.0629 0.0879 0.1626
Q8_0 0.0559 0.0754 0.1829
Q6_K -0.4305 0.044 0.0711
MXFP4_MOE-output_mxfp4-embd_q8 0.3995 -0.0063 -0.0523
MXFP4_MOE-output_mxfp4-router_gate_emb_q8 0.3995 -0.0063 -0.0523
MXFP4_MOE-output_mxfp4-embd_q5_K 0.6772 0.0251 0.5517
MXFP4_MOE-Q5_K 0.4505 0.1759 0.9815
Q5_K_M 0.7381 0.3706 0.5517
MXFP4_MOE-output_mxfp4-router_gate_emb_q5_K 1.0897 0.0565 0.7535
MXFP4_MOE-output_mxfp4-embd_q4_K 1.9847 0.4146 1.4098
Q4_K_M 3.1773 1.0177 0.7376
MXFP4_MOE-Q4_K 2.4821 0.6847 1.902
MXFP4_MOE-output_mxfp4-router_gate_emb_q4_K 2.4321 0.5528 2.1633
MXFP4_MOE-output_q8-embd_mxfp4 2.2713 0.5968 3.7299
MXFP4_MOE 9.336 4.5606 9.9601
  • loss_general = precision_loss_general_pct
  • loss_code = precision_loss_code_pct
  • loss_math = precision_loss_math_pct
Downloads last month
154
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-Thinking-2507-Unsloth-MXFP4-Hybrid-GGUF

Quantized
(6)
this model

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