Gemma-4 QAT Special Unsloth quants

#1
by danielhanchen - opened
Unsloth AI org

Hey folks! We converted Gemma-4 QAT quants in a different way since a direct llama.cpp Q4_0 loses accuracy when converting from BF16 QAT directly.

E2B for example has a mean KLD of 0.00173 vs 0.05109 (29x better relatively) for a naive Q4_0 quantization, and ours is even 22% smaller!

See https://unsloth.ai/docs/models/gemma-4/qat#qat-analysis

image

is there going be a 2 bit XL of this one

Unsloth AI org

is there going be a 2 bit XL of this one

No unfortunately if you go any lower, the accuracy degrades quite a bit

Could you upload MTP GGUF's of the QAT'd assistants?

If mixing QAT LLM with non-QAT MTP, the results are poor.

Was iMatrix used for this gguf?

Could you upload MTP GGUF's of the QAT'd assistants?

If mixing QAT LLM with non-QAT MTP, the results are poor.

+1 QAT assistant. Llama.cpp support has been merged.

Will it be possible to have IQ4_NL rather than Q4_0 ?

I'm just wondering: Which version is better?
unsloth/gemma-4-26B-A4B-it-UD-Q5_K_S.gguf
vs
unsloth/gemma-4-26B-A4B-it-qat-UD-Q4_K_XL.gguf
Maybe the first one, or?

@christian3137 If you only use English and do typical tasks (general chat, coding, tools calling, STEM) then the UD-Q5_K_S will probably be better (and even the UD-Q4_K_XL will probably be better). If you use non-Latin languages ​​(in particular, if you are engaged in translation) and some unusual tasks (like roleplay), then QAT will be better only because it quantizes all data equally (in 4 bits). However, in the latter case, it is better to choose APEX-Balanced (without "I").

wait so why is this a problem for Q4_0 and QAT specifically?

wouldn't it be also a problem for other quants like Q4_K with non-QAT where it also uses FP16 instead of BF16 while the model is BF16?

image

this is insanely fast. laptop 3080 16 vram, no cpu moe offload, ctx 128, kv cache q4, mtp q4

Sign up or log in to comment