A neural network is, underneath, one operation repeated trillions of times: matrix multiplication. GPUs win because they do that one thing with thousands of cores at once — while a CPU, built for a few fast sequential tasks, does it a handful at a time.
01The answer, then the intuition
Strip a transformer down and almost all of its work is multiplying big grids of numbers — every attention step and every weight layer is a matrix multiply. And a matrix multiply is embarrassingly parallel: each output number is an independent dot product that doesn't depend on the others, so in principle you could compute all of them at the same time.
A CPU has a few very powerful cores tuned for fast, branchy, sequential work. A GPU has thousands of simpler cores built to run the exact same arithmetic on many numbers at once — plus huge memory bandwidth to feed them. For AI's one repeated operation, that's a perfect match. Race them on the same matrix multiply:
Illustrative. Each tile is a chunk of output; cores fill tiles in parallel. The animation shows the shape of the gap — the real number is in the readout.
02Mechanics
This is also why the field is a hardware story as much as a software one: progress is gated by how many parallel multiply-adds per second per dollar the silicon can deliver.
04The math
expand ▾Multiplying two $d \times d$ matrices produces $d^2$ outputs, each a dot product of length $d$ (a multiply and an add per term), so the cost is:
Wall-clock time is just that divided by the hardware's throughput. For $d = 8192$ that's about $1.1 \times 10^{12}$ FLOPs. A CPU delivering ~0.5 TFLOP/s of usable fp32 takes seconds; a GPU's tensor cores deliver on the order of ~1,000 TFLOP/s:
A roughly 2,000× difference on a single operation — and a model is billions of these. The gap isn't that the GPU's individual cores are faster (they're slower); it's that there are thousands of them doing independent work at once. Parallelism, not clock speed, is the whole game.
05The code
expand ▾One large matrix multiply, timed against a CPU's and a GPU's throughput.
cpu_vs_gpu.py
def matmul_flops(d):
return 2 * d**3 # d^2 outputs, each a length-d dot product
d = 8192
flops = matmul_flops(d)
cpu = 0.5e12 # CPU: ~0.5 TFLOP/s usable fp32
gpu = 990e12 # GPU tensor cores: ~990 TFLOP/s bf16 (H100-class)
print(f"{d}x{d} matmul: {flops:.2e} FLOPs")
print(f"CPU: {flops/cpu:.3f} s")
print(f"GPU: {flops/gpu*1000:.3f} ms")
print(f"speedup: {(flops/cpu)/(flops/gpu):.0f}x")
# 8192x8192 matmul: 1.10e+12 FLOPs
# CPU: 2.199 s
# GPU: 1.111 ms
# speedup: 1980x
06The economics
Parallelism → money
Because AI's appetite is for parallel matrix-multiply throughput, the entire build-out resolves to one scarce thing: GPUs. The hundreds of billions in capital expenditure are, concretely, orders for accelerators and the power and buildings to run them. When people say a lab is "compute-constrained," they mean it cannot get enough of these chips.
That scarcity is why a single company, Nvidia, captures so much of the value in AI — it sells the one input everyone needs — and why its data-center revenue became a real-time gauge of the build-out itself. The chip is the bottleneck, the capital line, and the moat all at once.
For the Circuit, this is the supply side of the equation: the cost of intelligence is set by GPU throughput per dollar, and it falls only as fast as the silicon improves. Every efficiency trick in this section is ultimately about extracting more useful tokens from each very expensive chip.
07Going deeper
expand ▾
NVIDIA — GPU Performance Background · cores, throughput, and the roofline.
NVIDIA — Tensor Core architecture · the matrix-multiply-accumulate unit.
Dao et al. (2022) — FlashAttention · why memory movement, not FLOPs, often dominates.
SemiAnalysis · ongoing economic analysis of the AI hardware supply chain.
"First Principles — how AI actually works", chapter "Why AI needs GPUs", by The Catch. CC-BY 4.0. Hosted at TheCatch.AI / Tech Stack / AI Principles.
Chips can now do arithmetic far faster than they can fetch the numbers to work on. That widening gap is the memory wall — and it's why AI accelerators are defined by their high-bandwidth memory (HBM) as much as their compute.
01The answer, then the intuition
For decades, the arithmetic units on chips got faster far quicker than the memory feeding them. Compute has roughly tripled each hardware generation while memory bandwidth grew only about 1.6× — so with every generation, the processor spends more of its time waiting on data and less doing math. That is the memory wall, and modern AI slammed straight into it: decode is memory-bound precisely because it moves the whole model per token but does little arithmetic with it.
Drag through the generations and watch the two bars diverge — compute racing ahead, bandwidth trailing, and the gap you must somehow bridge growing wider each step:
Illustrative model of the documented trend (Gholami et al. 2024): compute ×3.0 / generation, bandwidth ×1.6 / generation. Bars are relative to generation 0.
The gap: ×1.0
At generation 0 they start even. Drag right to open the wall.
02Mechanics
So the mental model flips: for AI, a chip's memory system is often the real product, and the compute is the part that's easy to oversupply.
04The math
expand ▾The roofline model says achievable performance is capped by whichever runs out first — compute or bandwidth — given a workload's arithmetic intensity $I$ (FLOPs done per byte moved):
The crossover — the ridge point — sits at:
A workload is memory-bound when $I < I^{*}$. As compute grows ×3 per generation and bandwidth only ×1.6, $I^{*}$ climbs by ×$(3/1.6) \approx 1.9$ each generation — the bar for staying compute-bound keeps rising. LLM decode at batch 1 has an intensity of roughly 1–2 FLOPs/byte, far below a modern GPU's ridge point of several hundred — which is exactly why it wastes most of the chip's compute, and why batching (raising $I$) is the escape.
05The code
expand ▾Relative compute, bandwidth, and the widening gap, using the documented per-generation growth rates.
memory_wall.py
# Gholami et al. "AI and Memory Wall" (2024): per ~2-year generation,
# peak compute grows ~3x, memory bandwidth ~1.6x.
C, B = 3.0, 1.6
for k in range(6):
comp, bw = C**k, B**k
gap = comp / bw # extra arithmetic-per-byte you must find to stay busy
print(f"gen {k} (+{2*k}yr): compute x{comp:6.1f} bandwidth x{bw:5.1f} gap x{gap:5.2f}")
# gen 0 (+0yr): compute x 1.0 bandwidth x 1.0 gap x 1.00
# gen 3 (+6yr): compute x 27.0 bandwidth x 4.1 gap x 6.59
# gen 5 (+10yr): compute x 243.0 bandwidth x 10.5 gap x23.17 <- the wall
06The economics
The wall → money
The memory wall rewrites what a GPU purchase really is. Because inference is memory-bound, buyers are often paying for capacity and bandwidth — and getting compute they can't fully use as a side effect. HBM is the scarce, expensive component inside the accelerator, made by just three suppliers (SK Hynix, Samsung, Micron), and its availability has become a genuine gate on how many AI chips can be built at all.
That reshapes the capex story. The bottleneck isn't only fabricating logic; it's stacking enough high-bandwidth memory around it. When a frontier chip is supply-constrained, HBM is frequently why — a detail that turns an obscure memory technology into a macro variable.
For the Circuit, the wall sets a hard floor under costs: no matter how cheap arithmetic gets, moving data stays expensive, so the price of serving a token can't fall faster than memory improves. Every efficiency lever in this section — fewer bits, batching, better caching — is ultimately a way to do more with each precious byte of bandwidth.
07Going deeper
expand ▾
Gholami et al. (2024) — AI and Memory Wall · the documented compute-vs-bandwidth divergence.
Williams, Waterman & Patterson (2009) — Roofline · the performance model.
Dao et al. (2022) — FlashAttention · beating the wall by minimizing memory traffic.
SemiAnalysis · HBM supply and its role in accelerator availability.
"First Principles — how AI actually works", chapter "Memory, HBM & the memory wall", by The Catch. CC-BY 4.0. Hosted at TheCatch.AI / Tech Stack / AI Principles.
A frontier model is enormous. Two techniques shrink it to run cheaply: quantization stores each weight in fewer bits, and distillation trains a small "student" to copy a big "teacher" — keeping most of the quality at a fraction of the size.
01The answer, then the intuition
From the parameters chapter you know the rule: memory = parameter count × bytes per parameter. The second factor is the lever. By default each weight is a 16-bit number, but most of that precision is wasted — the model works almost as well if each weight is squeezed into 8 bits, or even 4. That's quantization, and it cuts memory and cost in direct proportion.
Distillation attacks the first factor. Instead of compressing one model, you train a much smaller one to imitate the big model's outputs — learning from the teacher's full probability distribution, not just the right answer. The student ends up far smaller while inheriting much of the teacher's skill.
Quantization is the bigger everyday lever. Pick a model and drag the precision down — watch the hardware bill collapse:
Memory = parameters × (bits / 8). GPUs assume 80 GB each with ~20% runtime overhead.
02Mechanics
w ≈ scale × round(w / scale). 16→8 bits roughly halves memory for almost no quality loss; 4-bit (with careful methods like GPTQ or AWQ) quarters it with a small, often acceptable hit. The weights are the same model — just stored coarsely.Both are lossy. The craft is spending the loss where it doesn't matter — and measuring honestly whether the smaller model still does your task, rather than trusting a benchmark.
04The math
expand ▾Memory for the weights is linear in the bit-width $b$:
Quantization to $b$ bits picks a scale $s$ for a group of weights and rounds each to the nearest representable level, then dequantizes on use:
Distillation trains the student distribution $p_S$ to match the teacher's softened distribution $p_T$ (temperature $T$ flattens both), minimizing the KL divergence:
The teacher's soft probabilities — "70% cat, 25% dog, 5% fox" — teach the student the structure a hard label ("cat") never could. That extra signal is why a small student can punch so far above its size.
05The code
expand ▾The same 70B model at four precisions — memory and GPUs. This is the calculator above, in seven lines.
quantize.py
import math
def mem_gb(N, bits): return N * bits / 8 / 1e9
def gpus(m, cap=80, overhead=1.2): return math.ceil(m * overhead / cap)
N = 70e9 # a 70-billion-parameter model
for bits in [32, 16, 8, 4]:
m = mem_gb(N, bits)
print(f"{bits:>2}-bit: {m:6.1f} GB -> {gpus(m)} GPU(s)")
# 32-bit: 280.0 GB -> 5 GPU(s)
# 16-bit: 140.0 GB -> 3 GPU(s)
# 8-bit: 70.0 GB -> 2 GPU(s)
# 4-bit: 35.0 GB -> 1 GPU(s) <- a 70B model on a single GPU
06The economics
Compression → money
Quantization and distillation are the deflationary force in AI. Every bit you drop is a proportional cut in memory, hardware, and energy per token served — and distillation moves a capability from an expensive frontier model into one a fraction of the size. Together they are why the price of a given level of intelligence keeps falling fast even as the frontier rises.
This is the optimistic half of the Circuit's ledger. The build-out spends ever more on the frontier, but compression relentlessly drives down the cost of serving everything below it — pushing models onto single GPUs, laptops, and phones, where the marginal cost approaches electricity. The open tier rides this hardest.
It also sharpens the central tension. If a distilled, quantized open model captures most of the value at a tenth of the cost, what exactly is the frontier premium being paid for — and for how long? That question, asked with real numbers, is the whole point of this desk.
Part II complete
From a base model learning language by guessing the next word, through alignment, the real differences between models, vision, and the compression that makes any of it affordable — you've followed the model from raw weights to a product with a price tag. Part I built the machine; Part II made it a model.
Part III opens the machinery that runs it — inference, GPUs, the memory wall, the KV cache, and the data-center cluster: what it actually takes to serve a model to millions at once, and where the real costs live. See the full curriculum →
07Going deeper
expand ▾
Hinton et al. (2015) — Distilling the Knowledge in a Neural Network · the soft-target idea.
Dettmers et al. (2022) — LLM.int8() · 8-bit inference for large models with no quality loss.
Frantar et al. (2022) — GPTQ · accurate 4-bit post-training quantization.
Dettmers et al. (2023) — QLoRA · fine-tuning a 4-bit model on a single GPU.
"First Principles — how AI actually works", chapter "Quantization & distillation", by The Catch. CC-BY 4.0. Hosted at TheCatch.AI / Tech Stack / AI Principles.
Behind every GPU is a chain that runs from a Dutch lithography machine to a Taiwanese fab to a power substation — and nearly every link is held by one to three companies. It's the most concentrated supply chain in modern industry, and the tightest link sets the pace of the whole build-out.
01The answer, then the intuition
A finished AI accelerator passes through a startling gauntlet, and at almost every stage there is effectively one supplier the world depends on. The extreme-ultraviolet lithography machines that print the smallest features? One company, ASML. The fabrication of leading-edge chips? Overwhelmingly one, TSMC. The AI GPUs themselves? Overwhelmingly one, Nvidia. The high-bandwidth memory? Three makers. The advanced packaging that stitches it together? Capacity-constrained at a handful.
Because it's a chain, its output is set by the tightest link — not the average. Click through the stages; the highlighted one is the current bottleneck that caps how many chips the whole industry can actually ship:
Illustrative relative capacity per stage; the red stage is the binding constraint. Click any node.
02Mechanics
Each link is both a pricing-power point — a near-monopoly that captures margin — and a fragility point, where one disruption ripples through everything downstream. Concentration is efficient and lucrative right up until it isn't.
04The math
expand ▾A serial supply chain obeys Liebig's law of the minimum: total throughput is the capacity of its smallest stage, not the sum or the average:
Adding capacity anywhere except the binding stage does nothing — a fact that makes bottleneck identification the entire game. And because each stage is a near-monopoly, its reliability $r_i$ is a single point of failure; the chain's reliability is the product:
With many stages each held by one supplier, even high individual reliability multiplies down — six stages at 98% each give $0.98^{6} \approx 0.89$. Concentration raises margins at every link and lowers the reliability of the whole. The build-out can only proceed as fast as its scarcest input allows, which is why a shortage in one unglamorous component — memory, packaging, a transformer for the substation — can throttle the entire industry.
05The code
expand ▾The chain's real output is its minimum stage — and which stage that is, is where all the leverage lives.
bottleneck.py
stages = { # illustrative annual capacity, GPU-equivalent units
"EUV litho (ASML)": 6.0, "Leading-edge fab (TSMC)": 5.0,
"GPU design (Nvidia)": 5.5, "HBM (3 makers)": 3.5,
"CoWoS packaging": 3.8, "Data-center power": 4.0,
}
cap = min(stages.values())
binding = next(n for n, v in stages.items() if v == cap)
print(f"chain output capped at {cap} by: {binding}")
# chain output capped at 3.5 by: HBM (3 makers)
# -> adding fab or litho capacity changes nothing; only more HBM raises output
06The economics
The chain → money
This is the physical supply side of the Circuit, and it explains where the money pools. Each chokepoint is a near-monopoly, so each captures outsized margin — Nvidia's, TSMC's, and ASML's economics are what a single-supplier link looks like on an income statement. When a stage is the binding constraint, its owner has extraordinary pricing power; the shortages are the profits.
They're also the fragility. A serial chain of near-monopolies means one disrupted link — an HBM shortage, a packaging constraint, a grid it can't power, or a shock to Taiwan — throttles everything downstream. The build-out's pace isn't set by ambition or capital; it's set by the tightest link, whatever it happens to be this quarter.
For a research desk, tracking the chain is how you separate a genuine acceleration from a temporary squeeze. When one link loosens, output jumps; when another tightens, it stalls — regardless of demand. Reading the bottleneck is reading the real speed limit of AI, and it's exactly the kind of ground-truth signal the Circuit is built to watch.
07Going deeper
expand ▾
SemiAnalysis · deep coverage of HBM, CoWoS packaging, and accelerator supply.
ASML — EUV lithography · the sole supplier of leading-edge lithography.
IEA — Electricity & data-center demand · power as the emerging constraint.
CSIS — Mapping the Semiconductor Supply Chain · concentration and geographic risk.
"First Principles — how AI actually works", chapter "The compute supply chain", by The Catch. CC-BY 4.0. Hosted at TheCatch.AI / Tech Stack / AI Principles.