What is quantisation, and what are the trade-offs?
Deployment and LLMOps · Pro 1
Short answer
Quantisation stores model weights in fewer bits, for example 8-bit or 4-bit instead of 16-bit, which cuts memory and often speeds up inference, so a larger model fits on a smaller GPU. The cost is some loss of quality, which varies by model, method and task, so measure on your own eval set. Common methods include GPTQ, AWQ and bitsandbytes.
Deeper answer
Rough memory maths: a 7-billion-parameter model needs about 14 GB in 16-bit, about 7 GB in 8-bit and about 3.5 GB in 4-bit, plus room for the KV cache. That can be the difference between needing a data-centre GPU and fitting on a single consumer card.
Quality loss is usually small at 8-bit and more noticeable at 4-bit on reasoning-heavy tasks. Speed gains depend on hardware kernels, so benchmark rather than assume.
What a strong answer covers
- Fewer bits per weight
- Less memory; larger models fit
- Often faster inference
- Some quality loss; measure on evals
- Names methods like GPTQ, AWQ or bitsandbytes
Answer it out loud in the mock interview about 1 min
Follow-ups to expect
- Roughly how much memory does a 7B model need in 4-bit?
- Why might quantisation not make inference faster?
Common mistakes
- Assuming no quality loss
- Forgetting KV cache memory
Learn it
- When would you serve predictions in batch, and when online?
- How would you set up CI/CD for an LLM application?
- What is the difference between data parallelism and model parallelism?
- Why does experiment tracking matter, and what do you record?
- Your model scored well offline but performed badly after launch. What could explain it?
- Explain Kubernetes pods, deployments and services, and why you would use Kubernetes for AI apps.
- What is the KV cache, and why can it cause out-of-memory errors when serving an LLM?
- How would you load test an LLM feature and set a latency budget?
- Your model provider has an outage during peak hours. What should already be in place?
- How do you manage API keys and secrets across environments?
- How do you detect and handle model drift in production?
- A bank wants your AI system but says no data may leave its network. What are the options?
- Why does an LLM reply have a wait before the first word and then a different speed after it?
- When would you use a semantic cache for an LLM app, and what can go wrong?
- How would you serve an LLM feature as an API for a web app?
- How would you serve a model that is too big for one GPU, and how would you scale it to more users?
- How would you add single sign-on to an enterprise AI assistant?
- How do you version prompts and models so you can roll back safely?
- What would you capture in traces for an LLM application?
- Why use Docker for an AI application?
- What does an LLM gateway do, and when do you need one?
- Why use vLLM to serve an open-weight model instead of a simple Hugging Face script?