The Maths You Actually NeedLesson 71 of 76

Module 8 · Numbers inside a machine

Quantisation is rounding with a scale: int8, int4 and the outlier problem

In this lesson

  • 10 min read
  • 9 reading sections
  • Knowledge check
  • Lesson 5 of 10 in this chapter

This chapter’s goalPredict from the bit layout of float32, fp16 and bf16 which computation will overflow, underflow or lose its digits, explain why a long sum drifts and how to fix it, quantise a weight to int8 by hand and say what an outlier does to the rest of the tensor, derive the initialisation scale that keeps variance constant through a layer, and diagnose a NaN in training back to the operation that produced it.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
What one outlier does to a tensor of 4,096 weightsNo outlier, one scale forthe whole tensor1One weight of 5.0, onescale for the whole tensor95One weight of 5.0, a scaleper block of 1284per cent of the weights that round to zero at int8The step size is set by the largest value in the group, so one weight a hundred times the rest roundsalmost everything else to zero. A scale per channel or per block of 128 confines the damage to theblock the outlier sits in, for about an eighth of a bit per weight.
The step size is set by the largest value in the group, so one weight a hundred times the rest rounds almost everything else to zero. A scale per channel or per block of 128 confines the damage to the block the outlier sits in, for about an eighth of a bit per weight.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 10Free · no account needed
Lesson steps

The whole idea in one line

To store a float weight as an 8-bit integer, pick a scale and round:

Text
q = round(w / scale)          an integer from −127 to 127
w ≈ q × scale                 to recover it

The scale is chosen so that the largest weight in the tensor lands on 127: scale = max|w| / 127. That is symmetric int8 quantisation, and it is most of what the word means. The course running-models-yourself covers the tools; this lesson is the arithmetic those tools perform.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Stuck on something?Ask Funke, your AI tutor

How to cite: Addaly (2026) ‘Quantisation is rounding with a scale: int8, int4 and the outlier problem’, in The Maths You Actually Need. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/maths-you-need/quantisation-as-rounding (Accessed: 29 November 2026).