ホーム 格闘技 Google Official QAT vs. Unsloth Version: Which Gemma 4 12B is Superior? — A Serious Test in My Own Environment [Part 1]

Google Official QAT vs. Unsloth Version: Which Gemma 4 12B is Superior? — A Serious Test in My Own Environment [Part 1]

藤崎 健人 藤崎 健人 • 更新: • 公開: • 読了約 18 分
目次

Hello, this is CoolZero.

After watching Fahd Mirza's YouTube video, "Google QAT vs Unsloth Q4_0 - Which Gemma 4 12B Quantization Is Better?", I decided that I needed to replicate this in my own environment. The video concluded that the Unsloth version wins in almost every test, but it is the style of this note not to take someone else's benchmarks at face value.

For this first part, I will cover everything from downloading both models to the initial comparison. I will include the actual measurement logs.

What am I comparing: Two 7GB-class models with different quantization philosophies

nf3da543dfd95

What is interesting is that despite having almost the same file size, the approach to quantization is fundamentally different.

Google Official QAT (gemma-4-12b-it-qat-q4_0.gguf, 6.98GB)

QAT = Quantization-Aware Training. This is a model trained with quantization incorporated from the start. According to Google's published figures, the 12B Q4_0 QAT achieves 67.07% on 5-shot MMLU, which is almost on par with the 67.15% of full BF16 precision. In other words, its selling point is that "there is almost no degradation even when quantized."

Unsloth Version (gemma-4-12B-it-qat-UD-Q4_K_XL.gguf, 6.72GB)

Based on Google's QAT weights, Unsloth re-optimized this for llama.cpp using the Dynamic 2.0 method. According to Unsloth, they discovered that simply converting QAT checkpoints to Q4_0 GGUF actually reduces accuracy, so they applied dynamic processing to increase the consistency between the llama.cpp compatible format and the true BF16 QAT weights. As a result, they claim it has become smaller and more accurate.

  • KLD (distribution shift from the original model): In the example of the small variant (E2B), the mean KLD is 0.00173 vs 0.05109 (a 29x relative improvement), and it is 22% smaller

  • For the large variant, the top-1 accuracy lost in naive Q4_0 conversion is recovered by 8.8 to 15.4 points

Note that Unsloth has a policy of "not releasing GGUFs with higher accuracy than UD-Q4_K_XL." The reason is interesting: they say that increasing the accuracy any further would actually lead to degradation.

Let's verify for ourselves whether these claims are true.

Download

pip install -U huggingface_hub
Google公式版
hf download google/gemma-4-12B-it-qat-q4_0-gguf \
  gemma-4-12b-it-qat-q4_0.gguf \
  --local-dir ~/llm/models/gemma4-12b-qat-google
Unsloth版
hf download unsloth/gemma-4-12B-it-qat-GGUF \
  gemma-4-12B-it-qat-UD-Q4_K_XL.gguf \
  --local-dir ~/llm/models/gemma4-12b-qat-unsloth

In actual measurements, the 6.98GB file downloaded in 4 minutes and 2 seconds, and the 6.72GB file in 3 minutes and 31 seconds (28.8 to 31.8 MB/s).

Verification Environment

  • Machine: GMKtec NucBox EVO-X2 (AMD Ryzen AI MAX+ 395, 128GB Unified Memory) + RTX 5090 32GB (external connection)

  • Execution Device: All layers offloaded to CUDA0 (RTX 5090) (-ngl 99, confirmed in startup logs)

  • Runtime: llama.cpp (build b9536-308f61c31, CUDA build)

  • Settings: Identical for both models — --temp 0.7 --top-p 0.95 --top-k 64

There is only one trick to a fair comparison: perfectly align the temperature, top_p, top_k, and context length. Comparison videos that don't align these are not worth referencing.

Round 1: An unintended test of handling "instruction breakdown"

The initial prompt was intended for SQL optimization, but I actually failed in the setup.

あなたは優秀なプログラマーです。以下のSQLを最適化してください:...

The crucial SQL was left as "...". However, this turned out to be a blessing in disguise. It became a practically important test of "how to handle incomplete instructions." Local LLMs can often hallucinate freely with broken input.

Result: Both passed, but there are differences

The Google QAT version correctly recognized in its thinking process that "the user has not yet provided SQL" and requested it. It also asked for four items: DB product, schema, issues, and data volume, and presented a 5-step analysis process including SARGability checks and JOIN optimization. It was commendable that it didn't just make up non-existent SQL and start "optimizing" it.

The Unsloth version also recognized the missing SQL and requested it. Its inquiry included 5 items; in addition to the four items from the Google version, it requested "the results of EXPLAIN (execution plan)." Its presentation of checkpoints was also more concrete, mentioning principles like "Filter early" and perspectives on "performance, readability, maintainability, and scalability."

I don't intend to make a definitive judgment based on one prompt, but my first impression is that the Unsloth version has slightly higher resolution in its answers. Anyone doing SQL tuning in practice would trust the one that asks for EXPLAIN first.

Speed (Actual Measurement)

Generation speed is almost equal (within the margin of error), but prompt processing is about 17% faster on the Unsloth version. Including the fact that the file is 260MB smaller, lighter is better if the accuracy is in the same range. On an RTX 5090, 12B Q4 easily exceeds 140 t/s. Since it uses 7GB out of 32GB VRAM, there is plenty left even if you stack a massive context.

Current impressions and next preview

Summary as of Round 1:

  • Both are robust against broken instructions. The practicality of the 12B Q4 class is sufficient

  • The Unsloth version leads slightly in the concreteness of answers (EXPLAIN request, explicit perspectives)

  • The Unsloth version also has a slight advantage in speed and size

  • However, it is not yet clear if this difference is due to quantization quality. Since temp is 0.7, there is also some output variance

While this first impression aligns with Fahd's video and Unsloth's claims (KLD improvement), it is nowhere near enough to be definitive. I will conduct a full-scale verification next time. Planned menu:

  1. Coding: Real-world SQL optimization (with EXPLAIN), Python code generation

  2. Multilingual: Accuracy of Japanese ↔ English translation (as a Japanese perspective not found in the video is a strength of this note)

  3. Visualization: Matplotlib/plotly code generation and execution feasibility

  4. Smoothing out output variance with identical prompts × multiple runs(also including deterministic comparisons with temp fixed at 0)

If you have any requests for prompts you'd like me to compare, please leave them in the comments. Reports on follow-up tests using LM Studio or Ollama (just specify the GGUF path in the Modelfile's FROM) are also welcome.

Main Sources
  • Fahd Mirza: Google QAT vs Unsloth Q4_0 - Which Gemma 4 12B Quantization Is Better? (YouTube)

  • Unsloth Docs: Gemma 4 QAT (KLD comparison data)

  • Unsloth Docs: Unsloth Dynamic 2.0 GGUFs

  • Unsloth Docs: Gemma 4 - How to Run Locally

  • Hugging Face: google/gemma-4-12B-it-qat-q4_0-gguf

  • Hugging Face: unsloth/gemma-4-12B-it-qat-GGUF

Hashtags: #LocalLLM #Gemma4 #Quantization #Unsloth #llamacpp

同じカテゴリの記事

藤崎 健人

芸能取材歴10年のデスク。所属事務所の公式リリース、番組公式サイト、配信サービスの告知を一次情報として採用し、裏付けの取れない内容は記事にしていません。

おすすめの関連記事