Q4 Quantization: Llama, Mistral, Gemma Trade-offs

While Q4 quantization offers a 4x memory reduction for all architectures, Gemma 3 achieves this with virtually no quality loss, whereas Llama models incur a measurable accuracy cost. Mistral 7B at Q4 (around 4.1 GB file size) is a popular choice for its balance of size, speed, and output quality on CPU.

The top 3

  1. Q4 Accuracy King: Gemma's Minimal Performance Drop: Gemma 3 demonstrates exceptional resilience to Q4 quantization, showing a slight perplexity improvement of -0.7%, whereas Llama 3.1 experiences a 2.8% degradation in perplexity, indicating Gemma's superior ability to maintain accuracy at lower precision.
  2. Q4 Throughput Champion: Gemma's Token-per-GB Edge: At Q4 quantization, Gemma 3 achieves approximately 93,000 tokens per GB, significantly surpassing Llama 3.1's roughly 30,500 tokens per GB, highlighting Gemma's amplified memory efficiency and higher throughput capacity.
  3. Gemma's Q4 Secret: Sliding Window Attention's Role: Gemma 3's architectural advantage, specifically its hybrid sliding-window layers, allows its KV-cache to compress more cleanly under Q4 quantization, as local context dependencies are less sensitive to precision reduction compared to global attention layers found in models like Llama.

Sources

Open the full topic