TensoriumInterview preparation
Deep Dive · where every byte goes · 7 steps

Training Memory

A 70B model in BF16 is 141 GB of weights — and about 1.13 TB of training state before a single activation exists. This module derives all five terms from the update rule that requires them, then hands you a calculator to size real runs. It ends deliberately at the point where parameter sharding stops helping, which is where distributed training has to begin.

Core path ~31 min: 01 → 04 then 07 · Systems deep dive +24 min: 05 → 06

Step 01 of 07CONCEPT~5 min · core path

What problem existed?

Goal: By the end of this step, you can explain why a model that fits in memory still cannot be trained in memory.

Suppose the weights load successfully, but the first training step runs out of memory. What did loading the model leave out? To answer that, follow what training needs to do beyond producing a prediction.

Backward needs gradients for the parameters. Adam also needs a running estimate of each gradient and its square. In the mixed-precision recipe we will use here, an FP32 master copy of the weights accumulates updates that could otherwise be lost when rounded into BF16. Each of those jobs needs storage.

Count one parameter before counting billions: two bytes for its BF16 weight, two for its gradient, four for the master copy, and four for each of Adam’s two moments. That is 16 bytes, not just the two bytes we counted when loading the weights. Other precision and optimizer choices change this recipe, so we will keep that assumption visible.

There is one more category. Backward needs intermediate results from forward: the activations. Their size depends on what we run through the model, not just how many parameters it has. A longer sequence or larger micro-batch can exhaust memory even though the weights have not changed.

Our goal is to separate these costs before choosing a fix. Once we know what is taking the space, reducing memory becomes a concrete trade-off rather than a search through configuration flags.

FIVE TERMS, TWO SCALING LAWS MODEL-STATE MEMORY ACTIVATION MEMORY primarily parameter-scaled runtime + architecture-scaled P × bytes/state f(L, h, heads, s, micro-batch, arch) ──────────────────────── ────────────────────────────────── weights (BF16) stored forward tensors per layer gradients (BF16/FP32) master weights (FP32) ← not obtainable from P alone, optimizer moments (FP32 × 2) though L and h do grow with size Confusing which term a knob moves is the root of most sizing mistakes.

Two different scaling laws under one memory budget. Every lever touches one of them, not both.

How this comes up in interviews

Try answering out loud before revealing.

Prove it before continuing

Which memory term cannot be computed from parameter count alone?

Pick an answer in the quick check above to unlock the next step—committing unlocks it whether right or wrong.
See it in production

You have the mechanism. These teams had to decide with it under a production constraint — and you commit to an architecture before you are shown theirs.