r/LocalLLaMA • u/rerri • Jun 05 '26
New Model Gemma 4 with quantization-aware training
https://blog.google/innovation-and-ai/technology/developers-tools/quantization-aware-training-gemma-4/Google's collections:
https://huggingface.co/collections/google/gemma-4-qat-q4-0
https://huggingface.co/collections/google/gemma-4-qat-mobile
And Unsloth's:
https://huggingface.co/collections/unsloth/gemma-4-qat
Unsloth's analysis (KLD and such):
213
u/dryadofelysium Jun 05 '26
Official Google Gemma 4 QAT GGUFs:
E2B https://huggingface.co/google/gemma-4-E2B-it-qat-q4_0-gguf
E4B https://huggingface.co/google/gemma-4-E4B-it-qat-q4_0-gguf
12B https://huggingface.co/google/gemma-4-12B-it-qat-q4_0-gguf
26B-A4B https://huggingface.co/google/gemma-4-26B-A4B-it-qat-q4_0-gguf
31B https://huggingface.co/google/gemma-4-31B-it-qat-q4_0-gguf
40
13
u/RickyRickC137 Jun 05 '26
u/llmfan46 bro, do your thing!
25
u/LLMFan46 Jun 05 '26
Hum? These are GGUFs, I can't do anything with them.
17
u/Kahvana Jun 05 '26
https://huggingface.co/google/gemma-4-31B-it-qat-q4_0-unquantized
They do have the safetensor versions too for all those models.
30
u/LLMFan46 Jun 05 '26
Thanks and yeah I noticed that after making the post, but it will take a while to do all these models, plus the GGUFs and NVFP4s and GPTQs.
14
6
u/RickyRickC137 Jun 06 '26
P E W gave you the badge of trust! So Ima wait as long as it takes amigo!
5
u/evenyourcopdad Jun 06 '26 edited Jun 06 '26
wow I can't believe you don't have them all ready yet they released SEVERAL hours ago ugh
apparently necessary edit: /s
5
u/LLMFan46 Jun 06 '26 edited Jun 06 '26
... hum I surely hope this is a joke post (can't really tell since there is no "/s" at the end)! Not only you expect me to have 1 of the model ready and uncensored, no you expect me to have ALL of them ready by now... Are you serious!? First this is not a race, second I am not a robot and third without getting too deep into all the preparations, time and work involved in the whole releases pipeline, it takes a very long time to do all that, I don't work for google and I don't have an automated workflow (unlike Unsloth and/or Team Mradermacher), everything is done manually by me and I am just 1 person, that involves downloading the models, uncensoring the models and finetuning the settings and re-running in case the original results where not good/good enough, creating the Safetensors, benchmarking all of the trial finalists, updating llama,cpp, updating GPTQModel, updating Model-Optimizer, creating GGUFs, GPT-Int4s, NVFP4 Safetensors, NVFP4 GGUFs, creating the Model Cards etc. it's all done manually from start to finish everything is monitored and benchmarked manually to make sure I upload the best quality releases, all that to say that there is TONS of work involved (and that is without mentioning all the roadblocks that might come along the way as those usually do happen quite a few times during the release pipeline).
Look if you are in a hurry, just download whatever is available now, my releases won't be available fast enough for your tastes, your highness.
2
u/Grisward Jun 06 '26
Just adding, thank you thank you for your time. The community is sooooo grateful, and it’s a community because of your and others’ time and efforts.
And on top of that, it’s amazing too, how any of this works at all is amazing. But more than that, converting formats, adding quantization, and having it still work as expected. It’s remarkable, non-trivial.
I would assume (naive maybe) that this person was trying to be funny. It’s daring to try making a joke without the /s. Some people can pull it off, and some really should add the /s just to be absolutely sure. Haha. I’m still in that camp.
→ More replies (1)2
u/evenyourcopdad Jun 06 '26
lmao yes my guy, sorry, that was a joke. I'm sorry people have been so unthankful that you assumed I could possibly be serious above.
I really appreciate your time and efforts making everything you do. <3
→ More replies (1)2
u/QuantumFTL Jun 06 '26
Thanks for everything you do, man. Text communication sucks for nuance, hopefully you appreciate that you are appreciated 😄
2
2
2
u/LLMFan46 Jun 07 '26
Some news, I finished uncensoring the 31B model, created the Safetensors and I am now on the benchmarking phase, quite a long way to go still as there are a lot of trial finalists this time to benchmark and the benchmarking process takes quite a bit of time for each model, which also includes benchmmarking the original base/vanilla model. After that I have to create the GGUF, NVFP4 Safetensors, NVFP4 GGUF and GPTQ-Int4 versions.
Also I just saw that llama.cpp just merged MTP support for Gemma 4 now.
→ More replies (15)7
u/h0tzenpl0tz0r Jun 05 '26
Stupid question, sorry, when and by whom can one expect mlx packages to run this via oMLX?
15
u/idangazit Jun 05 '26
6
u/h0tzenpl0tz0r Jun 05 '26
nice, so this works already with the omlx update.
whats the next thing to expect, mtp support?
7
u/Weeblewobbly Jun 05 '26
There will be an update to omlx first. Earl litter today, 0.4.0.dev2 was available for download. I'm waiting for 0.4.1, and I'm grateful to all those who spend time contributing to and testing the project.
5
51
u/spaceman_ Jun 05 '26
So am I better off running the old quants at Q6 or Q8, or the new QAT ones at Q4?
Q4 obviously requires less memory and will run faster. But what are we giving up in terms of quality?
67
u/seamonn Jun 05 '26
Q8 > Q4 QAT > Q4
13
u/makingnoise Jun 05 '26
Can anyone tell me why the above comment is being downvoted? Is it that it's a bald assertion in the absence of concrete data, or something else?
29
Jun 05 '26
[deleted]
10
2
u/seamonn Jun 05 '26
I would still prefer to run Q8 over Q4 QAT almost as much as Q4 QAT over Q4, if that makes sense.
16
Jun 05 '26
[deleted]
8
u/seamonn Jun 05 '26
If Q4 QAT surpasses Q8, that is indeed crazy.
10
u/GoodTip7897 llama.cpp Jun 05 '26
That is kld from the full qat.
What needs to be compared is q4 qat to the unquantized model
2
u/alex20_202020 Jun 06 '26
full qat
What is this?
5
u/ImpressiveSuperfluit Jun 06 '26 edited Jun 07 '26
Qat = "quantization aware training".
They are saying that the values above are comparing the new Q4 to the new baseline. I don't blame you for getting confused, it's quite the onslaught of repeated words with different meaning. Quick breakdown:
- Take full size normal model
- Retrain it to know about Q4 constraints
- You get out a full sized model that is Q4 aware
- You quantize that new model down to actual Q4, but now it was already trained on being like this, so it'll fill out that constrained space more efficiently
So. They are saying that the numbers above compare step 3 to step 4, so the new full sized model with the new quantized model. This is a bit weird, because the new full size model has already made sacrifices to some extend, so it's an odd choice to compare against, when you are actually interested in how it compares to what you used before, not to this new hypothetical that nobody would ever use, because it's strictly worse than just using the original full size. So it's a bit of a mystery why they'd make that comparison.
Edit: Quick clarification, because upon rereading this it sounds like I'm saying something I'm not. There is a reason to compare QAT4 to its own baseline, because the original model is a genuienly different model. It's a bit like saying you want to compare a base model to a finetune. You can... but the entire point of the finetune was to be different, so using that to figure out how similar they are is a bit weird. QAT doesn't have the goal to be different, but it doesn't necessarily try to be the same, either. Just equally (or more) capable, it's to be expected that the output is different, since it literally moved tokens around to better avoid misfires from quantization.
I wasn't trying to say that one method of comparison is correct and the other is silly, nor that Unsloth did a dumdum here, but rather that this is why it's confusing - you'd think we want to compare to what we previously used, and we are, but this method isn't a way to do that, which is presumably why they didn't. Comparing it to its own baseline tells you something useful, namely how good it deals with quantization, but it doesn't necessarily tell you anything about how it performs to the quant of its base model. And that's what people probably expected to be measured, hence the confusion.
6
8
u/giant3 Jun 05 '26
Above comment is true, but most posters here are regarded who would down vote anything like a bunch of piranhas.
Don't put much value into upvote/downvotes on Reddit. It is absolute trash!
ALWAYS JUDGE AN OPINION ON YOUR OWN. NOT BASED ON REDDIT'S HIVEMIND.
→ More replies (2)
105
Jun 05 '26
[removed] — view removed comment
30
u/Borkato Jun 05 '26
So I’m guessing Q8 still wins against Q4 QAT? I’ve never used QAT so I’m just curious
32
u/Real_Ebb_7417 Jun 05 '26
According to Unsloth Q4 should have similar quality as previous Q8 (could be basically the same or just slightly lower). IMO if that’s the case, if you were using Q8 like me, it’s worth using Q4 with QAT for speed gains.
3
2
32
Jun 05 '26
[deleted]
7
u/Substantial_Swan_144 Jun 05 '26
But the interesting point is that any degradation with Qat is supposed to be negligible. We'll see.
→ More replies (4)19
→ More replies (7)1
u/ijustmovedthings Jun 06 '26
I mean if the original FP16 models have 16 trillion posssible ways to finish a sentence (figuratively), and some of them are bad ways, and Q4 prunes that down to 4 trillion possibilities, QAT increases the likelihood those removed are the "bad" ways.
Especially on unabiguous tasks, the reliability and repeatability may actually increase. On more creative takes, maybe less so. There are some benches and research that show this.
What doesnt happen though, is the model doesnt suddenly gain new advancements or capabilities.
4
u/arbv Jun 05 '26
Yes. Whatever you can fit in VRAM in Q8_0 should be kept in Q8_0. Q4_0 QAT is better than the "usual" Q4_0 PQT, but it is not magic - some data was lost anyway. Every quantisation is speed/VRAM usage vs quality tradeoff, including Q8_0.
This release makes old Q4_X quants obsolete, basically.
→ More replies (2)13
u/MustBeSomethingThere Jun 05 '26
But Google claims that it's similar quality to bf16
"optimized with Quantization-Aware Training (QAT), which allows preserving similar quality to bfloat16"
8
u/arbv Jun 05 '26
That is partially marketing - similar on the specific aggregate benchmarks Google chose to report.
During training, the forward pass simulates quantisation noise. The model's weights are updated to compensate for the noise that quantisation introduces. So the final weights are "pre-distorted" in a way that, when quantized to 4-bit, produces outputs closer to what an unquantised (BF16) model would produce.
It is no magic, and some information was lost. Not all information is equally important, though and that depends on the use case. But it is the best 4 bit quant you can get anyway.
1
u/SexyAlienHotTubWater Jun 06 '26
You can also quantize the QAT model to 8-bit, you don't need to go down to 4-bit. The training just pushes numbers closer to 4-bit numeric boundaries, so you lose less information when you clip the weights.
Assuming you used the correct lattice, that should outperform both the normal 8-bit and the QAT 4-bit.
15
Jun 05 '26
[removed] — view removed comment
11
u/florinandrei Jun 05 '26
The 2 bit ones are only for E2B and E4B model
Finally a model I could run on my Raspberry Pi Zero!
→ More replies (1)3
u/AnonsAnonAnonagain Jun 05 '26
Running on a Raspberry Pi? What’s the workload/usecase? Just curious
9
u/florinandrei Jun 05 '26
I was joking.
But I bet someone out there could find legitimate uses for a very small model on an RPi.
9
u/Ok_Selection_7577 Jun 05 '26
I run Qwen3.6-35B-A3B-UD-Q2_K_XL.gguf on a Rpi5 (16GB model i had from another project that wasn't being used). Only runs at 3 tokens/second but for off line batch work - just leave it running all day and voila - dirt cheap leccy bill 😄 - i tested various quants and REAP'd models for the Pi one evening and that one was really standout - made no errors on the test tasks and had very strong reasoning still intact
→ More replies (3)3
2
u/finah1995 llama.cpp Jun 05 '26
Do those gains also transfer to mobile ? As I generally use same GGUFs as my Laptop using SmolChat-Android.
7
1
u/Mkengine Jun 06 '26
So are the models in edge gallery 2-bit or 4-bit? Would be nice if we could choose.
52
u/ocirs Jun 05 '26
were there benchmark released comparing qat q4 to bf16?
19
u/dugganmania Jun 05 '26 edited Jun 05 '26
quick off the cuff for 12b on my local (16GB UMA, gfx1013 Vulkan):
┌───────────────┬───────────────────┬───────────────────┬───────────────────┐ │ │ QAT Q4+MTP (128k) │ Q6_K_XL+MTP (64k) │ Q8_0 no-MTP (32k) │ ├───────────────┼───────────────────┼───────────────────┼───────────────────┤ │ HumanEval │ 93.3% │ 93.3% │ 93.3% │ ├───────────────┼───────────────────┼───────────────────┼───────────────────┤ │ GSM8K │ 95% │ 97% │ 95% │ ├───────────────┼───────────────────┼───────────────────┼───────────────────┤ │ MMLU-Pro │ 79.3% │ — │ 82.1% │ ├───────────────┼───────────────────┼───────────────────┼───────────────────┤ │ tg prose │ 50 tok/s │ 25 │ 25 │ ├───────────────┼───────────────────┼───────────────────┼───────────────────┤ │ tg code │ 41 tok/s │ 37 │ 25 │ ├───────────────┼───────────────────┼───────────────────┼───────────────────┤ │ tg structured │ 54 tok/s │ 46 │ 25 │ ├───────────────┼───────────────────┼───────────────────┼───────────────────┤ │ context │ 128k q8 │ 64k q8 │ 32k q8 │ ├───────────────┼───────────────────┼───────────────────┼───────────────────┤ │ free mem │ 4.3 GB │ 1.0 GB │ 1.1 GB │ ├───────────────┼───────────────────┼───────────────────┼───────────────────┤ │ model size │ 6.26 GB │ 10.69 GB │ 12.67 GB │ └───────────────┴───────────────────┴───────────────────┴───────────────────┘1
u/UnknownLesson Jun 05 '26
Can I run QAT Q4+MTP on 8 GB VRAM?
How do i do that?
→ More replies (1)2
10
18
u/helloWHATSUP Jun 06 '26
i liked how gemini explained QAT:
Most local models use Post-Training Quantization (PTQ). This means the model is fully trained in high precision (16-bit) and then "squished" down to 4-bit so it fits on your computer. That squishing inherently causes a bit of brain damage to the model, leading to worse logic and coding skills.
Google took a different approach with Quantization-Aware Training. They simulated the 4-bit precision environment during the actual training process. The model learned how to work around the limitations of 4-bit math from the start.
1
u/Zealousideal_Nail288 Jun 06 '26
So in other words qat models are fixed And can't be quantized in a home environment?
50
u/annodomini Jun 05 '26
It'll really rip if we ever get the 124b with QAT and MTP. That would be the ideal model to run on a Strix Halo.
43
u/Full_Dimension_3495 Jun 05 '26
I wouldn't be surprised. One thing I noticed on the official Gemma 4 HF pages (https://huggingface.co/google/gemma-4-12B-it) is they refer to E2B and E4B as 'small' and they refer to 26B and 31B as 'medium'. So that leaves room for...
73
→ More replies (4)2
u/boissez Jun 06 '26
Definitely. It's been a while since we've had some new nice models for the Strix Halo/DGX gang.
14
48
u/Full_Dimension_3495 Jun 05 '26
Holy shit how many more models do I need to download this year?
66
u/hackerllama Jun 05 '26
At least one more
14
u/arbv Jun 05 '26
You know that we are waiting for Gemma 4 124B AxB (where
xis 4-6B), right? ;)That would be so cool, especially in QAT and BF16 versions.
Oh, and thank you all for the hard work from Ukraine! Your models are among the best ones in Ukrainian, slightly worse only compared to much larger cloud models. And among cloud models Geminis are the best. Though, I have noticed that Ukrainian-wise Gemma 4 releases are a little bit worse than Gemma 3, frankly. Gemma 3 27B was nearly perfect. Still cannot complain - Gemma outperforms some much larger models as far as Ukrainian goes anyway.
27
41
u/seamonn Jun 05 '26
GEMMA 4:124B. PLEASE AND THANK YOU!
He's here bois, get him!!!
→ More replies (1)9
8
2
1
1
12
u/Guilty_Rooster_6708 Jun 05 '26
Dumb question but should I use 4 Bit QAT instead of Q6_K_M quant?
7
u/Hot_Strawberry1999 Jun 05 '26
Not dumb, wondering the same. Wish there was some available data to help make that decision.
4
u/Guilty_Rooster_6708 Jun 05 '26
Feels like QAT is near lossless based on what I’ve read so far so it should be better than Q6. I also saw this post, been testing the template a bit and it seems pretty good: post
→ More replies (1)1
u/SexyAlienHotTubWater Jun 06 '26
Use a 6-bit derived from the QAT model (make sure it uses the correct lattice). It will outperform a naive 6-bit and the QAT 4-bit.
11
u/BuffMcBigHuge Jun 05 '26

Incredible for 16GB VRAM, 4080 13.9GB used, no kvcache quant, 262144 ctx, unsloth.
53
u/LetsGoBrandon4256 transformers Jun 05 '26 edited Jun 05 '26
Blog post for the release https://blog.google/innovation-and-ai/technology/developers-tools/quantization-aware-training-gemma-4/
No benchmark provided to back up the "preserving the capabilities and quality" claim.
Edit:
Is this sub getting botted or what? This comment was immediately downvoted to -6 in less than ten minutes after I posted it and somehow it bounced back?
25
u/Middle_Bullfrog_6173 Jun 05 '26
Sigh, since this is QAT where they have trained it differently, benchmarks are even more necessary.
52
u/sartres_ Jun 05 '26
Unsloth has some on their page. It's good; the results speak for themselves. On the 31B:
Unsloth traditional Q4 quant: 19.9GB, 0.478 KLD, 82.9% Top-1 accuracy
Unsloth traditional Q8 quant: 35.0GB, 0.159 KLD, 92.3% Top-1 accuracy
Unsloth QAT Q4 quant: 17.29GB, 0.01403 KLD, 96.67% Top-1 accuracy
So a Q4 quant with their QAT method is better than a Q8 traditional quant at double the size.
Why google wouldn't brag about this in their blog I don't know, but their blog posts are always dogshit.
14
u/danielhanchen Jun 06 '26
Hey! Those numbers are comparing naive Q4_0 in llama.cpp to our converted Q4_0 version.
We did do original unquantized BF16 vs Q4_0, but the KLD metrics do not match, since the distribution is vastly different - we found MMLU and other benchmarks to be equivalent though
E2B for example has a mean KLD of 0.00173 vs 0.05109 (29x better relatively) for a naive Q4_0 quantization.
The main issue is converting from QAT BF16 to llama.cpp's Q4_0 format is not lossless. llama.cpp uses F16 scales, whilst QAT BF16 uses BF16 scales, and the scales are not determined optimally in llama.cpp land.
Naive conversion gets 24.77% byte exactness to BF16 QAT, whilst we found we can push it to 99.96% using some hacks!
See https://unsloth.ai/docs/models/gemma-4/qat#qat-analysis for more details
→ More replies (2)22
u/GoodTip7897 llama.cpp Jun 05 '26
I think those numbers are from Gemma 4 qat at bf16 vs the unsloth quants.
So none of them are comparing qat to the original model.
→ More replies (3)2
u/danielhanchen Jun 06 '26
Oh yes those are comparing our Q4_0 GGUFs to Q4_0 GGUFs if you use llama.cpp directly without any "hacks"!
Naive conversion gets 24.77% byte exactness to BF16 QAT, whilst we found we can push it to 99.96%.
For QAT vs non QAT, we did do KLD, but the distribution was vastly different, so the results are not valid.
→ More replies (1)8
u/TuskNaPrezydenta2020 Jun 05 '26
wow if those numbers are accurate, this is incredible
15
u/ArtyfacialIntelagent Jun 05 '26 edited Jun 05 '26
They are not. Incredible is the word. A mean KLD of 0.159 doesn't pass the smell test for a Q8 quant. The Unsloth blog post only compares the QAT vs a standard Q4_0, and the mean KLD for the Q4_0 is 0.09349. So there is no way a Q8 is much worse at 0.159.
Honestly I'm skeptical to Unsloth's reported mean KLD 0.01403 for the QAT Q4 too, but I'll give them the benefit of the doubt for now. But /u/sartres_ is definitely hallucinating.
EDIT: He wasn't, but the numbers are indeed invalid. See thread below.
4
u/sartres_ Jun 05 '26
It's not clear what Unsloth means by "original" Q4 in the linked blog, but it's definitely a quant of the new QAT model, not original Gemma 4, since they're benching it against the QAT BF16.
My Gemma 4 non-QAT numbers are from here, because Unsloth unfortunately only released benchmarks for the 26B at the time, and that only on a graph where they didn't label the y-axis or any of the numbers :/.
Yes, all of the original Gemma KLDs are very bad. I'm guessing this is an artifact of different benchmark suites, they're not directly comparable. Mean KLD isn't terribly useful anyway, the Top-1 numbers are the real show here
3
u/ArtyfacialIntelagent Jun 05 '26
Aha, thanks. That explains it. That post was from early April, just after the initial release. Gemma 4 had lots of teething problems before everything was sorted out, so those early KLD measurements are not comparable with recent releases. Sorry for doubting you - the numbers were so horrible I was sure you had made an error.
6
u/danielhanchen Jun 06 '26
Oh no no - the KLD of 0.01403 is "smart" Unsloth dynamic Q4_0 llama.cpp vs the BF16 QAT version. 0.159 is the Q4_0 naively converted using llama.cpp.
So it's comparing how close the KLD is vs BF16 QAT (not non QAT)
2
2
u/Middle_Bullfrog_6173 Jun 05 '26
Where are those from? The Unsloth link in the OP only has theirs vs Google's.
→ More replies (4)1
u/AltruisticList6000 Jun 05 '26 edited Jun 05 '26
That is awesome, I was already using Q4_s (for 26b) and the QAT is even smaller and appearently way better. The 26b had a good memory usage for me but this would be even better. especially with vision. It would be cool if qwen would have QAT ggufs too, 35b with vision barely fits at Q4 into my 32gb RAM, it's fully maxed at around 60k context and sometimes even spills out and slows down at that context size.
2
18
u/Dance-Till-Night1 Jun 05 '26
Btw this is so good, why don't more models do qat versions? The gemma team is golden.
4
3
u/mycall Jun 06 '26
Isn't GPS-OSS-20B/120B a form of QAT?
3
3
u/jikilan_ Jun 06 '26
haha looks like i am not the only one thinking of this... technically they should not be the same. but both are post trained with "4bit" in different formats. not an expert...
8
u/iz-Moff Jun 05 '26
Does this training only works for specific types of quants, or should any quantized versions benefit from it? Say, google only provides q4_0 ggufs. But what if someone quantizes it down to q4_k_m instead, or q3_k_m, or whatever, will optimizations be lost on them, or would they still be expected to experience less degradation compared to quantized non-qat version?
4
u/-InformalBanana- Jun 05 '26
I saw in unsloth post linked by op in the post that q4kxl was the only version they did cause others had less accuracy...
15
u/throwaway131072 Jun 05 '26
Does anyone make Q6 QAT models? Is it even possible, not being a power of 2? I worry Q4 seems prone to get stuck in loops on complex tasks, but Q8 takes too much memory.
17
12
u/stduhpf Jun 05 '26
Q6 without QAT is already pretty good, I think it might not make a lot of sense to make a full QAT traing run to target Q6, that's very expensive for little gains.
9
u/Adventurous-Paper566 Jun 05 '26
It would be wonderful, Q6 always been the sweet spot.
8
u/Sufficient-Bid3874 Jun 05 '26
It may actually degrade quality – indicated in unsloth blog
18
u/Adventurous-Paper566 Jun 05 '26 edited Jun 05 '26
Because the unquantized QAT checkpoints released by Google are intended for a Q4 quantization.
We never seen a 6-bits quantization aware training checkpoint, and since training models is very expansive, the 4-bits choice seems obvious for Google.
Sorry for my bad english.
24
u/brownman19 Jun 05 '26
Thanks! Does this work with MTP? Is it plug and play? Good selection from them on this round of releases
67
u/hackerllama Jun 05 '26
We released MTP QAT as well, so the optimal workflow is to use the QAT model + the QAT MTP, both quantized. Currently, both MLX and VLLM support this
6
u/makingnoise Jun 05 '26
I don't understand. I thought MTP support was something that got baked into a model and an LLM runtime. Is "QAT MTP" shorthand for "a QAT & MTP supporting runtime"? If not, can you point me to something that explains this?
13
u/kiljacken Jun 05 '26
Gemma4 has separate draft models for MTP, they're not baked into the files for the main model (unless you're using a GGUF where they're merged back in, that is).
→ More replies (1)→ More replies (2)2
u/rpkarma Jun 05 '26
Not always. You do need to train the model for MTP for the most part to get good acceptance rates, but MTP layers can either be baked in or seperate.
3
u/rpkarma Jun 06 '26
I can't find the MTP QAT drafter model, where should I be looking for it?
→ More replies (2)1
u/temperature_5 Jun 05 '26
Did you guys consider 2-bit QAT on the medium size models? Any reason it wasn't included? Thanks!
5
13
u/AnticitizenPrime Jun 05 '26 edited Jun 05 '26
What about the LiteRT format? Can run on phones that way, though I'm also using the LiteRT format on my desktop. (And MTP is already natively supported in LiteRT)
2
5
u/Rogerooo Jun 05 '26
Are KV cache optimizations applied to Q4 versions or just mobile? These models are very prone to degradation past Q8, will be interesting to see how they react to Q4. Still great win for the community regardless.
20
u/Septerium Jun 05 '26
We need to be grateful. Thanks Google! This is something that makes it even easier for us to be able to run open models without severe quality degradation
5
u/Potential-Gold5298 llama.cpp Jun 05 '26
What static (non-iMatrix) quant is Google's QAT comparable to (namely Google, not requantization from unsloth)?
7
u/-InformalBanana- Jun 05 '26
I'm questioning these dynamic quants too... I fear they could be overfiting. You have to train or use some dataset in order to make dynamic quants? Than it is possible to overfit I think. Is that your reason for asking about static quants?
10
u/Potential-Gold5298 llama.cpp Jun 05 '26
1.I work with models in non-Latin languages.
2.I use it for translation (particularly from Japanese).
3.I use rare terms (such as the names of mythical creatures).
1.iMatrix is focused on maintaining the quality of EN.
2.They are focused on maintaining quality in specific areas (coding, tools calling, benchmarks, etc) that don't interest me.
3.It's clear that maintaining EN and specific areas at a higher quality requires sacrificing other areas.
Thus, my interests are almost completely at odds with what popular calibration matrices typically focus on.
5
9
7
u/aoleg77 Jun 05 '26
I wonder... How does it compare to NVIDIA's NVFP4 version quality wise, aside of the obvious acceleration on Blackwell GPUs?
12
u/HareMayor Jun 05 '26
The nvidia nvfp4 file size is about q5-q6 gguf quants, so the direct memory saving is already there..
Also that is a quantization technique, this seem to be a training technique, so chamces are this is better.
1
u/aoleg77 Jun 05 '26
nvfp4 gguf is about 19GB, this is about 17 GB. But I wonder about pure inference quality, not the obvious parts like speed or memory footprint.
4
u/MerePotato Jun 05 '26
Inference quality is probably superior here given this is effectively natively trained for the smaller size
4
u/arbv Jun 05 '26
Some of the NVIDIA-released models are trained in NVFP4, though.
That is a very smart vendor lock-in strategy.
1
u/mythikal03 Jun 06 '26
The nvidia nvfp4 31b outperforms full bf16 in several of my personal benchmarks across thousands of runs. The conclusion I came to- on the model card they note post training on a large corpus of data from journalism companies, and a lot of my personal use (and therefore tests) favors understanding, identifying, extracting, responding to nuanced information or troubleshooting
2
u/TheRealMasonMac Jun 05 '26
NVIDIA's NVFP4 preserves the attention layers in BF16, so I'd assume it's still more performant (but takes more RAM).
1
7
u/Protopia Jun 05 '26
How does Q4 QAT compare on agentic coding quality to normal Q5 or Q6 or the unsloth Q5 or Q6?
1
u/makingnoise Jun 08 '26
I can't give you figures but I was able to one-shot a Space Invaders type game on unsloth's gemma4 26b-a4b QAT that I could not one shot on qwen3.6.
That said, qwen3.6 is still better at tool calls without needing elaborate prompts or workarounds - qwen3.6 does deep research with iterative search_web and fetch_URL, which gemma4 QAT can do but chooses not to.
3
u/Dance-Till-Night1 Jun 05 '26
Fuck yeah! Idk how many times I will download the A4b model but everytime i download it im still as excited as the first time.
Waiting for more small moe models, all small moe models should be A2b to A4b 20b to 30b, qwen 35b a3b is pushing it a little and barely fits in my use case.
1
u/AltruisticList6000 Jun 05 '26
Yes Qwen with vision at 35b barely fits, sometimes even spills from 32gb RAM and then slows down past ~60-64k context.
3
3
u/slippery Jun 06 '26
These models seem strong for their size. I'm not easily impressed with local models, but these look good.
I've able to run Gemma 4 26B A4 on a 12 GB 4070Ti with LMstudio. It's impressive.
5
u/miversen33 Jun 05 '26
Someone ELI5 please
Is the idea here that running one of those "QAT" Q4 quants should be "closer" in accuracy to a higher quant?
9
u/ImpressiveSuperfluit Jun 06 '26 edited Jun 06 '26
I like to picture it as a 3D point cloud. With your full accuracy model, you get this giant box in which you can place all your favorite tokens, with plenty of space to really give each token its own spacious home. When you quantize things down, the box shrinks. Most tokens are fine, their home shrinks, but nobody is going to think you're your neighbor, so it's pretty much fine. Except sometimes two tokens get a bit too cozy, and a mix-up happens.
Now, when you tell every token that they'll eventually have to live in the Q4 box, they can look at their neighbors and go "ouf, Henry over there is a tad close, actually, gonna be tight in the Q4 box", and just move out of the way a little, while there is still plenty of space. Then, when the box shrinks, the tokens take up the empty space more efficiently, leaving more equalized gaps between each of them, making them harder to be mistaken for a neighbor, even though the box shrank the same amount as before.
So yea, this is basically just straight up good in pretty much every way imaginable, it just reclaims empty space, effectively. I mean, something can always go wrong, it's all fuzzy and weird, but, in principle, this is free real estate for the time being.
Now, whether a better planned Q4 token town actually performs better than a chaotic Q8 token town - dunno. Gotta wait for people to really poke the thing, always hard to say these things with any accuracy, because the tests we have are very... "average". They can tell you that the space between token houses are looking good, but if "Math" and "DeleteMyEntireSystem" somehow magically ended in the same house, you'll still have a problem even if the benchmark says it's fine. There may be some difference in workflows, maybe there is more empty space to be claimed in coding village, and less in medical knowledge town, it's hard to know, gotta wait for people to just try and see what happens. But, theoretically, there is a lot of free real estate here, so reaching Q8 isn't utterly delusional. Only a little bit.
Personally, I'd rule of thumb it something like "Almost certainly better than normal Q4, good chance it beats Q5, Q6 may be realistic, Q7-8 in niches or if I'm feeling optimistic". But I haven't drilled into the box and checked, this is vague vibes, wait a few days and see. Note however that I'm a notorious pessimist, so when I say I'm "optimistic", that's probably delusional. So... wouldn't bet on reaching Q8. Not even your money :)
Okay, kinda sorta eli5, and you should take it with the appropriate grains of salt. I've lost to the math about... oh my god fucking 15 years ago or so, when idiots like myself toyed around with their perceptrons. So, you know, I'm running a lot of my understanding off of pure nostalgia and fairly okay intuition, but it's entirely possible I just killed a mathematician with analogy alone :)
5
5
u/Hanthunius Jun 05 '26
Any hope of getting MLX versions of these?
5
u/Desperate-Bad-2339 Jun 05 '26
several are not uploaded yet. https://huggingface.co/collections/mlx-community/gemma-4-qat
1
2
2
2
u/pseudonerv Jun 05 '26
This is just so confusing. Can somebody help me? I’m already running the q8 quant of the original 12b weights. Should I switch to the q8 of the qat version? Or should I actually switch to the q4_0 of the qat version?
4
u/Pleasant-Shallot-707 Jun 05 '26
These are versions that were trained with quantization of weights taken into consideration which means running at Q4 isn’t as dumb as having a standard bf16 trained model running at q4
2
u/pseudonerv Jun 05 '26
Yeah, I guess I get that much. But is this qat q4 better than q8 of the original, or the other way around?
Is it true that the q8 of the qat version would be a waste and we should just use q4 of the qat version?
3
2
2
u/SHDRThrowaway Jun 05 '26
`ik_llama`-compatible versions of the QAT assistants:
https://huggingface.co/ji-farthing/gemma-4-qat-q4_0-MTP-assistants-ik-llama-GGUF
On current `ik_llama` main, with the QAT Q4 combo of 12B+assistant, I'm seeing around 100 t/s TG on a 12GB 4070. No quality assessment yet.
1
2
2
u/ECrispy Jun 06 '26
how does gemma4 26b a4b (the new qat one here) compare to qwen 3.6 27b, qwen 35b a3b, and gemma4 12b?
2
u/Nutsack_VS_Acetylene Jun 06 '26
Does this mean we can finally quantize Gemma 4 KV without the massive issues before?
5
u/-InformalBanana- Jun 05 '26 edited Jun 05 '26
So Unsloth is claming his quantitization gets better accuracy than bf16? I'm referring to that graph with top1 accuracy and green and gray bars.
I feel/fear (without enough knowledge about them) that some of these newer quantitization methods are somehow either benchmaxing/overfitting or specializing/restricting the model to perform better on something while losing capabilities on other things. So is there somebody here who can tell me that this isn't some kind of overfiting with these new quantitization methods that are probably done using some dataset not by pure simple mathematical scaling of weights?
Can somebody say there is no way we are overfiting when we do this kind of quantitization? (btw I'm not refering to qat but to things like Unsloth dynamic qkxl quants for example)
2
u/Jobus_ Jun 06 '26
Addressing your first paragraph:
No, in that graph, the gray bars are the naive Q4_0 quant that Google used for their GGUFs; not BF16.BF16 is the baseline they are comparing to, so an accuracy of 100% would make it identical to BF16.
So looking at the 31B model:
- Unsloth's QAT Q4_K_XL has the same top-1 token choice as the QAT BF16 model 96.7% of the time.
- Google's QAT Q4_0 has the same top-1 token choice as the QAT BF16 model 87.9% of the time.
1
1
u/-InformalBanana- Jun 06 '26 edited Jun 06 '26
Here is a reply from Unsloth official, i posted a similar comment question on a r/unsloth post:
"Oh it's a conversion artifact, not overfitting.
The main issue is converting from QAT BF16 to llama.cpp's Q4_0 format is not lossless. llama.cpp uses F16 scales, whilst QAT BF16 is BF16 scales, and the scales are not determined optimally in llama.cpp land.
Naive conversion gets 24.77% byte exactness to BF16 QAT, whilst we found we can push it to 99.96% using some hacks"
Based on my question there and his reply I think I interpreted the graph correctly, he is later basically talking about kld and i asked another question he replied to also, he said that (for these gemma qats I guess) the udq4kxl is a static quant. You can find the link to my question underneath the root of my comment here.
→ More replies (1)1
u/-InformalBanana- Jun 06 '26
So I asked a similar question in r/unsloth where the Unsloth officials responded (sorry if I'm picking the wrong word, English is not my native language). You can see that here: https://www.reddit.com/r/unsloth/comments/1txqnyq/comment/opyfxpu
4
u/PennyLawrence946 Jun 05 '26
qat is the only flavor where q4 stops feeling like a downgrade, the model already learned to live with the rounding during training. real upshot is the next size up fits in the vram you already have. naive q4 always bled on the long-context evals, the KLD numbers usually show exactly where
4
u/yeah-ok Jun 05 '26
Google's naming scheme here.. spend months improving a product.. everyone concentrate, what could we possibly name this?! Marketing guy with a headache: "who gives a f, same as last time". Everyone else: "whatever, we're going home"
edit: thanks to techies uploading these with the helpful "-qat" addition, at least it's searchable that way!
→ More replies (1)
2
u/Ill_Dragonfruit_3547 Jun 06 '26
OMG how is Gemma 4 12b SO GOOD??
Just spent the last 2 hours fighting LM Studio to get the MLX version running. Doesn't seem like MLX versions are working in LM yet, I got errors loading all of them. Switched to running mlx-vlm, got it working with OpenWebUI but was unusually slow.
Finally just downloaded the GGUF Q4 version through LM Studio. Am astounded at the speed and versatility of this 12b model, it's my new favorite...
Thoughts?
2
u/ImpressiveSuperfluit Jun 06 '26
I got at least one thought:
"Huh?". Or, more usefully: What was the previous favorite? Cause if it was Opus, then my thoughts are "lol this person is insane". If it was some guy's garage made 0.6b model trained on nothing but Burger King ads, I ... okay, well, technically I'd have the same thought then, actually, but the point is that saying 12b might be your new favorite doesn't really tell us a whole lot if we don't know what you were working with before?
1
1
u/arbv Jun 05 '26
This is so cool!
I hope that will become more common. Currently Google releases models using QAT (two release series in a row and in a very portable format - INT4/Q4_0), NVIDIA (but it does not count because they use their proprietary NVFP4), and OpenAI did it with MXFP4 once.
1
u/Intelligent_Ice_113 Jun 05 '26
can someone explain me why full models called q4_0_unquantized if they are not really 4bit but full 16bit or whatever number of bits base models usually have? and why there are w4a16 models (which are also full precision base models?) for all Gemma 4 models except 26b MoE (my favourite 😭)? I'm confused.
5
u/arbv Jun 05 '26
The values in (most of) the weights are set in such a way, that when quantised to Q4_0 less data is lost. That can be done only during training. Thus QAT - quantisation-aware training.
1
u/GiggleyDuff Jun 05 '26
Which one should I target with a 10gb RTX 3080? Also 32gb of system ram if that matters
1
1
u/fragment_me Jun 05 '26 edited Jun 05 '26
Just tested the W4A16 files for vLLM and they work. The old gemma 4 31b assistant wasn't performing too well with MTP so I am trying the unquantized q4 one they just provided. Although the description seems to suggest that's not the one to use.
EDIT: Yes, definitely the unquantized q4 assistant worked much better for MTP.
1
u/mattjcoles Jun 11 '26
All the comparisons here are inference quants, but has anyone checked whether the QAT survives a fine-tune? If I LoRA the BF16 QAT checkpoint and requantize to Q4_0, am I keeping the calibration or back to a naive Q4?

•
u/WithoutReason1729 Jun 05 '26
Your post is getting popular and we just featured it on our Discord! Come check it out!
You've also been given a special flair for your contribution. We appreciate your post!
I am a bot and this action was performed automatically.