Gemma-4 QAT Special Unsloth quants

#1
by danielhanchen - opened
Unsloth AI org

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

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

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

image

Hey, @danielhanchen ! Thank your for the weights and all the work provided by the Unsloth team!

Could you please answer this question: the graph above compares the top-1% accuracy between the Unsloth UD quantization (green) versus a vanilla direct q4_0 quantization of the QAT BF16 mode using stock llama.cpp (gray)l, right? Not versus the unquantized QAT BF16 weights, nor versus the official qat-q4_0-gguf weights from Google, correct? So "original" above does not mean the original unquantized (BF16) nor the official qat-q4_0-gguf weights from Google, or I missed something?

Thanks again. Regards.

Sign up or log in to comment