Advanced level · Module 1: Advanced Foundation Model Concepts · Lesson 2 of 3
Quantisation and Running Models Efficiently
Learners see how storing weights in fewer bits makes models smaller and faster, and measure the quality and speed trade-off on a CPU.
In this lesson you will
- Explain quantisation and its effects
- Measure quantised vs full-precision models
Key concepts
32/16-bit vs 8/4-bit weightsmemory footprintCPU inferencequality lossquantised local runtimes
The lesson
Quantisation stores weights with fewer bits (for example 8 or 4 instead of 16 or 32), reducing memory roughly in proportion, so larger models fit on modest machines. Local runtimes such as Ollama commonly serve quantised models.
Lower precision can reduce quality, especially at 4 bits and for small models. Always compare on your own evaluation tasks.
Memory needed ≈ parameters × bytes per parameter, plus working memory for the context. A 1-billion-parameter model needs about 2 GB at 16-bit and about 0.5 GB at 4-bit for weights.
Step by step
- Calculate memory for three model sizes at 16, 8 and 4 bits.
- Run a model at two precisions if available.
- Compare quality on ten tasks and speed.
- Choose a precision for the lab laptops.
Practice activity
Produce a memory calculation and a quantisation comparison.
Expected result: Correct calculations and a measured quality/speed trade-off.
Check your understanding
-
Roughly how much memory do the weights of a 1-billion-parameter model need at 4-bit?
Show answer
About 0.5 GB.
-
What is the main risk of aggressive quantisation?
Show answer
Reduced output quality.
Further learning
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.