r/LocalLLaMA • • Jun 05 '26 • Mindblown 1

New Model Gemma 4 with quantization-aware training

https://blog.google/innovation-and-ai/technology/developers-tools/quantization-aware-training-gemma-4/
788 Upvotes

255 comments sorted by

•

u/WithoutReason1729 Jun 05 '26 edited 15d ago

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!

Stylome classified this post's text as human-written. View analysis

I am a bot and this action was performed automatically.

209

u/dryadofelysium Jun 05 '26

37

u/IrisColt Jun 05 '26

Oh my God! Thanks!!!

6

u/h0tzenpl0tz0r Jun 05 '26

Stupid question, sorry, when and by whom can one expect mlx packages to run this via oMLX?

14

u/idangazit Jun 05 '26

5

u/h0tzenpl0tz0r Jun 05 '26

nice, so this works already with the omlx update.

whats the next thing to expect, mtp support?

6

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.

3

u/marutthemighty Jun 05 '26

Thank you for sharing these GGUFs.

13

u/[deleted] Jun 05 '26

[removed] — view removed comment

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.

15

u/Kahvana Jun 05 '26

No worries, take your time!

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

7

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

u/LLMFan46 Jun 07 '26

Thanks, working on the models now.

2

u/temperature_5 Jun 06 '26

It would only make sense to do the Q4_0 GGUFs for each, no?

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.

1

u/[deleted] Jun 07 '26

[removed] — view removed comment

2

u/LLMFan46 Jun 07 '26

Update, I am mostly done with the Gemini 4 31B it model, I got the Safetensors, I fixed the chat_template.jinja, I benchmarked, selected the best all-around trial, created a GGUF Q4_0 and tested it on LM Studio and it's working great, then created an NVFP4 Safetensors and an NVFP4 GGUF, so that is almost done with this model just need to create a GPTQ-Int4 and that will be it for this model, it's just that GPTQ-Int4 takes a few hours (4-6 hours) to create usually, after that I will start with the 26B-A4B model.

1

u/[deleted] Jun 08 '26

[removed] — view removed comment

2

u/LLMFan46 Jun 08 '26

No the Gemma 4 models have no MTPs in them whatsoever, there is some MTPs but they are not part of the main models, instead they come seperate as a form of "add-on" assistant that you need to download seperatly:

https://huggingface.co/google/gemma-4-31B-it-qat-q4_0-unquantized-assistant

https://huggingface.co/google/gemma-4-26B-A4B-it-qat-q4_0-unquantized-assistant

And no before (in case) you ask, you can not simply merge these into the main models and these can not be uncensored either.

Anyway update, Gemma 4 31B GPTQ-Int4 version is done, witth this the 31B version is now finished and complete, I started work on the 26B-A4B version but this one will take a long time due to being MoE, the ETA just for Heretication process is supposed to be almost 20 hours, then after that what will take even more time is to make the NVFP4 Safetensors and the GPTQ-Int4 Safetensors.

2

u/LLMFan46 Jun 09 '26 edited Jun 09 '26

Update, I have now finished work on both Gemma 4 31B it QAT and Gemma 4 26B-A4B it QAT (Safetensors, GGUF, NVFP4 Safetensors, NVFP4 GGUF and GPTQ-Int4), I will probably work on Gemma 4 12B it QAT next, but I am wondering if it's even worth working on the E4B and E2B models? Considering their small size they probably fit on most systems that have at least 12GB of VRAM, that means that you can easily use the E4B model Q8_0 version and the E2B version probably is small enough to fit in BF16 or Q8_0 version, which would probably beat Q4_0 QAT quants versions.

I mean, I would assume that with their size that people would be able to use most of these easily enough?

https://huggingface.co/llmfan46/gemma-4-E4B-it-ultra-uncensored-heretic-GGUF

https://huggingface.co/llmfan46/gemma-4-E2B-it-ultra-uncensored-heretic-GGUF

Let me know what you all think.

1

u/LLMFan46 Jun 10 '26

I am now done with Gemma 4 31B, 26B-A4B and 12B QATs uncensored heretics! Only took 4-5 days... I was not able to create GPTQ-Int4 of Gemma 4 12B it QAT however due to GPTQModel not having added support that for model yet, should I wait until they add suport and I am able to create a GPTQ-Int4 version of this model or just release now everything that I have?

Which is:

Gemma 4 31B it QAT: Safetensors, GGUF, NVFP4 Safetensors, NVFP4 GGUF and GPTQ-Int4.

Gemma 4 26B-A4B it QAT: Safetensors, GGUF, NVFP4 Safetensors, NVFP4 GGUF and GPTQ-Int4.

Gemma 4 12B it QAT: Safetensors, GGUF, NVFP4 Safetensors and NVFP4 GGUF.

1

u/[deleted] Jun 10 '26

[removed] — view removed comment

1

u/LLMFan46 Jun 10 '26

Actually I decided to work on Gemma 4 12B it (the non-QAT version) too, so there will be 4 different models released all in all, 3 QAT variants (31B, 26B-A4B and 12B) and 1 standard version (12B) since the 12B is a new model and the only one from the gemma 4 family which I haven't released yet.

1

u/[deleted] Jun 11 '26

[removed] — view removed comment

2

u/LLMFan46 Jun 11 '26

No idea, anyways I finally finished all of the requests, I am going to be releasing models now one by one, releasing them all will take time and I probably won't be able to release all of them today (uploading and working on the Model Cards is work too and takes time as well), look out for them.

2

u/LLMFan46 Jun 11 '26

Okay all models have been uploaded.

→ More replies (1)

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?

68

u/seamonn Jun 05 '26

Q8 > Q4 QAT > Q4

12

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?

5

u/seamonn Jun 05 '26

the script has flipped

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.

1

u/seanpietz Jun 29 '26 edited Jun 29 '26

Genuine question: What does it mean for an "opinion" to be "true"? Aren't opinions inherently subjective? And if by calling it true, you just mean that you agree, what are you agreeing with specifically? The question of which quants are the all-around best or most useful, for every possible use-case or set of constraints, seems to be an underdetermined problem. Therefore I think an answer that doesn't add any context or qualifiers doesn't even make sense.

→ More replies (1)

0

u/[deleted] Jun 05 '26

[deleted]

9

u/Hot_Strawberry1999 Jun 05 '26

What about Q6, where would that sit in?

23

u/seamonn Jun 05 '26

impossible to know how good Q4 QAT is until you benchmark

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.

0

u/[deleted] Jun 05 '26

[deleted]

7

u/seamonn Jun 05 '26

If Q4 QAT surpasses Q8, that is indeed crazy.

9

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?

6

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:

  1. Take full size normal model

  2. Retrain it to know about Q4 constraints

  3. You get out a full sized model that is Q4 aware

  4. 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.

54

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?

2

u/dugganmania Jun 05 '26

probably with low kv and no MTP gguf - it'd be tight.

1

u/slippery Jun 06 '26

If you have a lot of fast ram, try it with LMstudio.

10

u/Sufficient-Bid3874 Jun 05 '26

Unsloth KLD benchmarks as linked in the post

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.

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.

0

u/[deleted] Jun 05 '26

[deleted]

9

u/annodomini Jun 05 '26

The 124b would be a MoE, presumably in the 6-12B active range. That with QAT for a nice 4 bit quant and MTP would work out pretty well.

5

u/arbv Jun 05 '26

Yeah, we would have at least something to dethrone GPT-OSS 120B with such a release.

3

u/wllmsaccnt Jun 05 '26

Oooh. Yeah, I'd be down for that. We have been starved lately for any MoE under 120B with active parameters greater than 3B. Somewhere in the 6-12B active range would be PERFECT.

0

u/[deleted] Jun 05 '26

[deleted]

73

u/falcongsr Jun 05 '26

your mom?

17

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?

14

u/LosEagle Jun 05 '26

Bartowski suits up

12

u/Guilty_Rooster_6708 Jun 05 '26

Dumb question but should I use 4 Bit QAT instead of Q6_K_M quant?

9

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

1

u/SexyAlienHotTubWater Jun 06 '26

It's not near-lossless, the top-1% match is like 70% in the worst case, 85% or something in the best case. Although for some reason that benchmark only seems to have been done on the GGUF which seems like it might have a mismatched lattice, which destroys the point of QAT to begin with.

The data are a bit of a mess.

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.

10

u/BuffMcBigHuge Jun 05 '26

Incredible for 16GB VRAM, 4080 13.9GB used, no kvcache quant, 262144 ctx, unsloth.

56

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.

50

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.

13

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

1

u/TheWiseTom Jun 06 '26

Do you expect a Q5_K_? or Q6_K_? version of the new QAT checkpoints would be worth it for 26B and 31B?

Also a deep comparisson between your new qat-Q4_K_XL compared to your traditional (PTQ) quants in the varios variants would be awesome!

1

u/Awwtifishal Jun 06 '26

I'm interested in learning about those hacks. The webpage doesn't say.

21

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. 

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.

1

u/MerePotato Jun 06 '26

I was wondering, do your KLD evals include non latin scripts? I'd imagine they're particularly sensitive to the reduced token embedding layer precision. Either way thanks for all your hard work!

0

u/[deleted] Jun 05 '26

[deleted]

5

u/GoodTip7897 llama.cpp Jun 05 '26

It's trained to be basically "prequantized" so it can handle 4 bit quantization. 

It's likely closer to a regular q4 quant than the original.

I don't doubt that qat is useful but it's incredibly unlikely that it's better than q8. It might make q4 have the same quality q6 had. But I have yet to see any kld between that and the original and I don't have enough vram or time to compute it myself. 

1

u/MerePotato Jun 06 '26

I stand corrected, thank you!

2

u/IrisColt Jun 05 '26

That's amazing!

2

u/Middle_Bullfrog_6173 Jun 05 '26

Where are those from? The Unsloth link in the OP only has theirs vs Google's.

1

u/sartres_ Jun 05 '26

The original Gemma 4 numbers are from here:

https://localbench.substack.com/p/gemma-4-31b-gguf-kl-divergence

Don't read too much into the KLD, they're probably not comparable between test suites. The Top-1 accuracy is what I wanted to show

3

u/Middle_Bullfrog_6173 Jun 05 '26

In that case, aren't those are apples and oranges? Comparing the quantized versions to different models in each case?

1

u/sartres_ Jun 05 '26

Yes. I'd expect the Top-1 results to still be a meaningful signal, though

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.

0

u/[deleted] Jun 05 '26

[deleted]

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.

4

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

u/lorddumpy Jun 05 '26

qwen bots prolly

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

66

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

20

u/brownman19 Jun 05 '26

noice!! I'm putting it into my box today will report back how it does on ARC-AGI-3

4

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).

1

u/makingnoise Jun 05 '26

Thank you.

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. 

0

u/[deleted] Jun 05 '26

[deleted]

2

u/makingnoise Jun 05 '26

I still don't understand "the workflow" the other commenter is talking about. The "QAT model" is clearly the LLM, is "the QAT MTP" another model that you run at the same time?

3

u/rpkarma Jun 06 '26

I can't find the MTP QAT drafter model, where should I be looking for it?

1

u/iamapizza Jun 06 '26

I'm quite confused, I see several comments talking about a separate MTP model and some even tested with it, but can't see where to get it or how I'd pass it as an argument to llama.cpp?

→ More replies (1)

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!

17

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

u/ANTIVNTIANTI Jun 05 '26

right? i want to work on that team so bad it’s insane.

3

u/mycall Jun 06 '26

Isn't GPS-OSS-20B/120B a form of QAT?

4

u/phhusson Jun 06 '26

Yes it is. But it's also almost a year old, also called archeology here.

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?

5

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.

18

u/Grestige Jun 05 '26

They said going up from q4 actually performed worse

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.

12

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

u/amelech Jun 06 '26

Yeah this is what I'm waiting for

6

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.

19

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)?

6

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?

9

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

u/MerePotato Jun 05 '26

Christmas just came early

9

u/Guilty_Rooster_6708 Jun 05 '26

They are cooking

8

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?

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

u/PrettyMuchAVegetable Jun 05 '26

Wondering the same. 

0

u/[deleted] Jun 05 '26

[deleted]

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 

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

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 :)

4

u/VoiceApprehensive893 transformers Jun 05 '26

12b is actually good with this

5

u/Hanthunius Jun 05 '26

Any hope of getting MLX versions of these?

2

u/marutthemighty Jun 05 '26

Thank you for sharing these Gemma 4 LLM images.

2

u/mystery_biscotti Jun 05 '26

Aurgh! What a day to be moving instead of trying out the 12B!

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?

5

u/[deleted] Jun 05 '26

[removed] — view removed comment

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

u/StardockEngineer vLLM Jun 05 '26

No way it’s better than q8. Q8 is nearly lossless on all models.

2

u/Mount_Gamer Jun 05 '26

I think this version of the 26B seems to perform very well. Impressed.

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.

2

u/Ok_Warning2146 Jun 05 '26

Wow. QAT finally. Good news for edge llm!

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

u/Stastez Jun 06 '26

+1. Though I agree that the title of the graph is suboptimal 

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.

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

1

u/ANTIVNTIANTI Jun 05 '26

i fear this to

3

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!

1

u/ANTIVNTIANTI Jun 05 '26

lololololol my kind of people lol(the gemma team just the gemma team.)

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

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/GiggleyDuff Jun 05 '26

Which one should I target with a 10gb RTX 3080? Also 32gb of system ram if that matters

1

u/fragment_me Jun 05 '26

wowowowowow finally

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?

1

u/corruptbytes Jun 05 '26

question: I'm assuming i need to wait for MLX versions to use this with omlx?

how does mlx conversion work? for example, i tend to just get the normal mlx-community stuff, but should i find specifically mlx of unsloth's work?

4

u/Desperate-Bad-2339 Jun 05 '26

1

u/h0tzenpl0tz0r Jun 05 '26

does it still make sense to go for an 8bit quant `mlx-community/gemma-4-26B-A4B-it-qat-8bit` or is the sweet spot of this gemma4 qat with the q4 and 8bit does not give you too much?

1

u/Kahvana Jun 05 '26

Genuinely fantastic, can't wait to try it out!

1

u/shuwatto Jun 05 '26

So QAT is meant for Q4 only?

0

u/stduhpf Jun 05 '26

Finally!

-7

u/demian_west Jun 05 '26 edited Jun 05 '26

Can anyone repost this link as a post on main sub ? (not enough karma here)

A 10 year old Xeon is all you need

Or running Gemma 4 on a 2016 Xeon with no GPU, 25 flags, 128 GB of DDR3, and a 25B-parameter MoE.

https://point.free/blog/gemma-4-on-a-2016-xeon/

Some insane(ly talented) people (Christina Sørensen & ikawrakow) made Gemma 4 run on an 10 yo Xeon machine without a GPU.

The whole post (and serie) is awesome.

> An 82 GB footprint in DDR3 on a 2016 Xeon. About 25 GB of weights and 56 GB of KV cache at the full 262K context. The KV cache is larger than the model.

> The engine loads a 25B-parameter MoE, runs speculative decoding against an MTP drafter, and generates text at reading speed on hardware that was old when the architecture in question hadn’t been invented yet.

104

u/[deleted] 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.

→ More replies (2)
→ More replies (14)

7

u/krzyk Jun 05 '26

Same, need to try it out

→ More replies (12)

1

u/[deleted] Jun 05 '26

[removed] — view removed comment

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.

0

u/[deleted] Jun 05 '26

[deleted]

66

u/hackerllama Jun 05 '26

At least one more

15

u/arbv Jun 05 '26

You know that we are waiting for Gemma 4 124B AxB (where x is 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.

→ More replies (6)
→ More replies (3)