Skip to content
RED SAGSkills
hardMachine Learning Engineer interview question

You need to cut the serving cost of a large model by quantising it. How do you do it without hurting quality?

What the interviewer wants to hear

  • Choose the scheme: weight-only versus weights and activations, 8-bit versus 4-bit
  • Use calibration data from the real domain
  • Handle outliers with per-channel or group scales or mixed precision
  • Evaluate on task metrics, not only perplexity
  • Measure real latency, memory and throughput on target hardware

Model answer

I start by setting a quality bar on our own evaluation set and measuring the full-precision model as a baseline. Then I try the least risky option first, usually 8-bit weight-only quantisation, which often has almost no quality loss and halves memory. If I need more savings I try 4-bit weights with group-wise scales using a post-training method that uses calibration data. That data should look like real production inputs. Quantising activations as well gives more speed, but outlier channels can hurt accuracy, so I use per-token or per-channel scales or keep sensitive layers in higher precision. I evaluate on task metrics and edge cases, not just perplexity, since small averages can hide failures. Finally I benchmark latency, throughput and memory on the actual serving hardware, because the speed-up depends on kernel support.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard Machine Learning Engineer questions