WhoBuilt

Quantization impact on Apex performance

Sep 21, 2026· 20 min· 339 views·Watch on YouTube

Speakers

Artur Morys-Magiera, senior React Native and AI engineer, and Lech Kalinowski, senior AI systems engineer, both at Callstack, present their Apex quantization findings at Agent Conf 2026.

How quantization changes a model

Artur and Lech describe quantization as reducing the precision used to represent model weights, aiming to make a model smaller while preserving quality. Their case study used a 31-billion-parameter, instruction-tuned Gemma 4 model with a merged rank-eight LoRA. They compared ten quantized candidates with a 61 GB BF16 baseline on the same DGX Spark.

Speed and fidelity trade-offs

Higher quantization generally produced smaller files and faster decoding. IQ4_XS decoded at 11.3 tokens per second from a 16.7 GB file, compared with 3.3 tokens per second for the 61.4 GB BF16 baseline; the team reported 3.4 times the measured speed and 27% of the file size. Their distribution and next-token comparisons showed greater drift at lower bit levels, with a steeper agreement drop below five bits per weight.

Benchmarks and cache choices

On MMLU, Q4_K_M and Q8_0 had similar accuracy, answering 346 and 347 questions correctly, but their output probability distributions differed. The team found significant accuracy loss mainly with IQ2_M among the nine quantized models they assessed. For this model family, they recommended pairing a 4-bit model with an 8-bit KV cache; a 4-bit cache caused larger agreement losses.

A code-generation failure and a sweet spot

In a gesture-code prompt that explicitly requested Gesture.Simultaneous, Q4_K_M and Q4_K_S instead used Gesture.Race, which makes competing gestures cancel one another. The team identified IQ4_XS as the best fit for their test machine: 3.4 times the measured code speed, 27% of BF16 file size, and about 92% next-token agreement. Q8_0 was closer to the baseline, with 97% agreement and 1.7 times the speed.

Evaluation setup matters

The team found that a prompt template that constrained reasoning tokens caused MMLU scores to collapse; fixing it raised the BF16 model's score from 57% to 86.5% on the same 400 questions. They also switched to an independent judge, GPT-OSS 120B, and reported its precision rising from 0.05 to 0.7. Their process for choosing a quantization level was to measure speed and file size, then run benchmarks.

Takeaways

  • Benchmark quality as well as speed and file size; similar accuracy scores can hide changes in output confidence.
  • Test the exact workloads your product depends on, including specific code requirements and tool use.
  • For this model family and hardware, IQ4_XS with an 8-bit KV cache was the team's preferred balance.
  • Validate prompt templates and use an independent evaluator before attributing benchmark changes to quantization.

Mentioned in this talk

Search inside this talk

What was claimed 15

Show all 15 facts

Related talks