The Maths You Actually NeedLesson 61 of 76

Module 7 · Counting the cost: complexity and the arithmetic of scale

Bytes per parameter, and the arithmetic of what fits on a card

In this lesson

  • 9 min read
  • 7 reading sections
  • Knowledge check
  • Lesson 4 of 9 in this chapter

This chapter’s goalCount the FLOPs of a forward pass and a training run from a parameter count, compute the memory a model needs at each precision and in training, say from arithmetic intensity whether a workload is bound by compute or by memory bandwidth, recognise a quadratic cost in a pipeline and name the sub-quadratic replacement, and estimate the time or cost of an ML job to within a factor of three before running 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
A seven-billion-parameter model, four waysInference, int43.5Inference, fp1614Inference, float3228Training: 16 bytes aparameter, before anyactivations112GB of memoryInference fits on a consumer card and training the same model does not, and almost all of thedifference is optimiser state. Freeze the base and train adapters, and the sixteen bytes apply only tothe half per cent of parameters you are training.
Inference fits on a consumer card and training the same model does not, and almost all of the difference is optimiser state. Freeze the base and train adapters, and the sixteen bytes apply only to the half per cent of parameters you are training.

Figure

A little at a time

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

Step 1 of 8Free · no account needed
Lesson steps

A model is a number of bytes

Before a model can do anything it has to fit in memory, and the arithmetic for that is a multiplication: parameters times bytes per parameter. The bytes per parameter depend on the number format, which module 8 opens up; for now the four sizes are enough.

Text
float32   4 bytes
bf16/fp16 2 bytes
int8      1 byte
int4      0.5 byte

A seven-billion-parameter model:

Text
float32  28 GB
fp16     14 GB
int8      7 GB
int4    3.5 GB

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) ‘Bytes per parameter, and the arithmetic of what fits on a card’, in The Maths You Actually Need. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/maths-you-need/memory-arithmetic (Accessed: 29 November 2026).