CoolFace
Modelpublic

magiccodingman/Apriel-1.5-15b-Thinker-Unsloth-MXFP4-Hybrid-GGUF

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes86downloads
Model Card

DEPRECIATED!

This model was surpassed by the new MagicQuant hybrids. The collection can be found here:

https://huggingface.co/collections/magiccodingman/magic-quant

Use the new version. This shown MXFP4 hybrid is no longer viable in comparison, nor really useable. The data collected is good for understanding and research, but it's not as good for real use.

Unsloth - Apriel 1.5 15B Thinker 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 Models!

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

  • —MXFP4_MOE-output_q5_K-router_gate_emb_q5_K

14.3% smaller than Q8 • 76.24 TPS • 0.0113% 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 Q8_0
MXFP4MOE-outputq5K-routergateembq5_K
(14.3% smaller than Q8 • 76.24 TPS • 0.0113% precision loss)

The following was the conversion script:

bash
llama-quantize \
  --tensor-type token_embd.weight=Q5_K \
  --tensor-type output.weight=Q5_K \
  --tensor-type 'router.*'=Q5_K \
  --tensor-type 'gate.*'=Q5_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 ExampleMeaning
MXFP4_MOEPure MXFP4 pipeline
MXFP4_MOE-Q8Embedding/output in Q8_0
MXFP4_MOE-F16Embedding/output in F16
output_mxfp4-embd_q8Output → MXFP4, Embedding → Q8
output_mxfp4-router_gate_emb_q5_KOutput → MXFP4, Emb/Router/Gate → Q5_K
MXFP4_MOE-Q6_KBoth embedding + output in Q6_K
Q8_0, Q6_K, Q4_K_MPure 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_namesize_reductiontps_change
MXFP4MOE-outputq5K-routergateembq6_K52.57%74.75%
MXFP4MOE-outputq5K-routergateembq5_K54.46%77.59%
MXFP4MOE-Q5K49.89%52.08%
Q6_K58.97%91.36%
MXFP4MOE-Q4K50.93%68.74%
MXFP4MOE-outputq6K-routergateembq6_K51.79%76.57%
MXFP4MOE-outputq6k-routergateembf1634.64%40.27%
MXFP4MOE-Q6K48.81%13.07%
MXFP4MOE-outputq6k-embdf1646.09%55.3%
MXFP4_MOE-F1639.21%41.18%
MXFP4_MOE-Q846.84%49.13%
Q8_046.84%60.89%
MXFP4MOE-outputf16-routergateemb_f1627.79%23.64%
MXFP4MOE-outputf16-routergateembq6k44.9%48.89%
MXFP4MOE-outputmxfp4-embdq4K51.12%70.25%
Q5KM64.43%83%
MXFP4MOE-outputmxfp4-routergateembq6K53.46%87.79%
MXFP4MOE-outputmxfp4-routergateembq5K55.39%56.98%
MXFP4MOE-outputmxfp4-embdq5K50.82%49.64%
MXFP4MOE-outputmxfp4-embd_q849.93%68.46%
MXFP4MOE-outputmxfp4-routergateemb_q849.93%81.41%
MXFP4MOE-outputmxfp4-embd_f1647.77%77.38%
MXFP4MOE-outputmxfp4-routergateemb_f1636.31%53.27%
MXFP4MOE-outputmxfp4-embdq6K50.48%76.68%
Q4KM69.57%110.16%
MXFP4MOE-outputmxfp4-routergateembq4K57.22%89.77%
MXFP4MOE-outputq8-embd_mxfp448.1%62.22%
MXFP4_MOE73.4%78.17%
  • —All percentages compared against the selected family F16 baseline.

Table - File Size + TPS + Avg Precision Loss

model_namefile_size_gbbench_tpsavg_prec_loss
F1626.8842.930
MXFP4MOE-outputq5K-routergateembq6_K12.7575.020.0101
MXFP4MOE-outputq5K-routergateembq5_K12.2476.240.0113
MXFP4MOE-Q5K13.4765.290.0174
Q6_K11.0382.150.1327
MXFP4MOE-Q4K13.1972.440.175
MXFP4MOE-outputq6K-routergateembq6_K12.9675.80.2507
MXFP4MOE-outputq6k-routergateembf1617.5760.220.255
MXFP4MOE-Q6K13.7648.540.262
MXFP4MOE-outputq6k-embdf1614.4966.670.2979
MXFP4_MOE-F1616.3460.610.315
MXFP4_MOE-Q814.2964.020.3162
Q8_014.2969.070.3162
MXFP4MOE-outputf16-routergateemb_f1619.4153.080.322
MXFP4MOE-outputf16-routergateembq6k14.8163.920.3304
MXFP4MOE-outputmxfp4-embdq4K13.1473.090.4468
Q5KM9.5678.560.4736
MXFP4MOE-outputmxfp4-routergateembq6K12.5180.620.5502
MXFP4MOE-outputmxfp4-routergateembq5K11.9967.390.5686
MXFP4MOE-outputmxfp4-embdq5K13.2264.240.5861
MXFP4MOE-outputmxfp4-embd_q813.4672.320.604
MXFP4MOE-outputmxfp4-routergateemb_q813.4677.880.604
MXFP4MOE-outputmxfp4-embd_f1614.0476.150.626
MXFP4MOE-outputmxfp4-routergateemb_f1617.1265.80.6336
MXFP4MOE-outputmxfp4-embdq6K13.3175.850.6434
Q4KM8.1890.220.7801
MXFP4MOE-outputmxfp4-routergateembq4K11.581.470.822
MXFP4MOE-outputq8-embd_mxfp413.9569.641.3901
MXFP4_MOE7.1576.4911.6499
  • —Bench NGL was 35
  • —Utilized CUDA

Table - PPL Columns

model_namegengen_ercodecode_ermathmath_er
F1610.98190.29241.74810.01489.580.2442
MXFP4MOE-outputq5K-routergateembq6_K10.99190.29271.75220.01499.54590.2428
MXFP4MOE-outputq5K-routergateembq5_K10.97870.29241.75110.01489.56310.2435
MXFP4MOE-Q5K11.0050.29321.74970.01489.54610.2429
Q6_K11.04160.29441.75060.01489.47610.24
MXFP4MOE-Q4K11.030.29361.75130.01489.57080.2434
MXFP4MOE-outputq6K-routergateembq6_K11.02930.2941.74980.01489.60140.2449
MXFP4MOE-outputq6k-routergateembf1611.03430.29431.74870.01489.60430.2451
MXFP4MOE-Q6K11.0430.29451.74850.01489.59980.245
MXFP4MOE-outputq6k-embdf1611.04270.29451.74890.01489.60820.2452
MXFP4_MOE-F1611.03910.29441.74880.01489.61680.2455
MXFP4_MOE-Q811.05890.29521.74830.01489.60260.245
Q8_011.05890.29521.74830.01489.60260.245
MXFP4MOE-outputf16-routergateemb_f1611.03750.29441.74920.01489.6180.2456
MXFP4MOE-outputf16-routergateembq6k11.03240.29411.75020.01499.61940.2455
MXFP4MOE-outputmxfp4-embdq4K11.18060.2941.75930.01479.47370.2378
Q5KM11.15510.29811.75170.01489.54530.2425
MXFP4MOE-outputmxfp4-routergateembq6K11.2140.29521.76070.01489.46660.2375
MXFP4MOE-outputmxfp4-routergateembq5K11.20160.2951.76070.01479.48270.2381
MXFP4MOE-outputmxfp4-embdq5K11.22280.29561.75910.01479.4780.2379
MXFP4MOE-outputmxfp4-embd_q811.22810.29561.76020.01479.47250.2377
MXFP4MOE-outputmxfp4-routergateemb_q811.22810.29561.76020.01479.47250.2377
MXFP4MOE-outputmxfp4-embd_f1611.2350.29591.75940.01479.47720.2379
MXFP4MOE-outputmxfp4-routergateemb_f1611.23530.2961.76050.01489.47310.2378
MXFP4MOE-outputmxfp4-embdq6K11.23660.2961.76020.01479.47640.2379
Q4KM11.19520.29931.7590.01499.55840.2428
MXFP4MOE-outputmxfp4-routergateembq4K11.25750.29681.76150.01489.50240.2388
MXFP4MOE-outputq8-embd_mxfp411.15940.29861.75030.01499.81260.2529
MXFP4_MOE13.57790.38281.81470.015910.29860.2704
  • —gen = ppl_general
  • —gener = pplgeneral_error
  • —code = ppl_code
  • —codeer = pplcode_error
  • —math = ppl_math
  • —mather = pplmath_error

Table - Precision Loss Columns

model_nameloss_generalloss_codeloss_math
F16000
MXFP4MOE-outputq5K-routergateembq6_K0.09110.2345-0.3559
MXFP4MOE-outputq5K-routergateembq5_K-0.02910.1716-0.1764
MXFP4MOE-Q5K0.21030.0915-0.3539
Q6_K0.54360.143-1.0846
MXFP4MOE-Q4K0.4380.1831-0.096
MXFP4MOE-outputq6K-routergateembq6_K0.43160.09720.2234
MXFP4MOE-outputq6k-routergateembf160.47710.03430.2537
MXFP4MOE-Q6K0.55640.02290.2067
MXFP4MOE-outputq6k-embdf160.55360.04580.2944
MXFP4_MOE-F160.52090.040.3841
MXFP4_MOE-Q80.70120.01140.2359
Q8_00.70120.01140.2359
MXFP4MOE-outputf16-routergateemb_f160.50630.06290.3967
MXFP4MOE-outputf16-routergateembq6k0.45980.12010.4113
MXFP4MOE-outputmxfp4-embdq4K1.80930.6407-1.1096
Q5KM1.57710.2059-0.3622
MXFP4MOE-outputmxfp4-routergateembq6K2.11350.7208-1.1837
MXFP4MOE-outputmxfp4-routergateembq5K2.00060.7208-1.0157
MXFP4MOE-outputmxfp4-embdq5K2.19360.6293-1.0647
MXFP4MOE-outputmxfp4-embd_q82.24190.6922-1.1221
MXFP4MOE-outputmxfp4-routergateemb_q82.24190.6922-1.1221
MXFP4MOE-outputmxfp4-embd_f162.30470.6464-1.0731
MXFP4MOE-outputmxfp4-routergateemb_f162.30740.7093-1.1159
MXFP4MOE-outputmxfp4-embdq6K2.31930.6922-1.0814
Q4KM1.94230.6235-0.2255
MXFP4MOE-outputmxfp4-routergateembq4K2.50960.7665-0.81
MXFP4MOE-outputq8-embd_mxfp41.61630.12592.428
MXFP4_MOE23.63893.80997.501
  • —lossgeneral = precisionlossgeneralpct
  • —losscode = precisionlosscodepct
  • —lossmath = precisionlossmathpct