JustujuAI, layer by layer.Open in the interactive map

Memory & bandwidth (HBM)

How fast data reaches the chip often limits AI speed more than the chip's raw arithmetic.

Layer 2 · Compute Hardware · Build and run time · Draft, awaiting expert review, reviewed 2026-10-02

D1 · StoryFor young children and total beginners

Picture a narrow kitchen door. Does a faster cook help if ingredients arrive slowly?

Imagine a super-fast cook who has to wait for ingredients to come through a narrow door. The cook's speed doesn't matter if the door is slow.

For AI, the ingredients are the model's numbers, and the door is memory bandwidth.

Like: A fast cook waiting at a narrow pantry door.

D2 · PictureFor curious beginners

Generating each token means reading the model's active weights from memory. If those weights take tens of gigabytes, every new token moves that much data. On a home machine, whether those weights fit in fast memory at all is the first question (see local AI hardware).

High-bandwidth memory (HBM) stacks memory chips right next to the processor so data moves far faster than with ordinary memory.

Rule of thumb for a single user: tokens per second is roughly memory bandwidth divided by the bytes of weights read per token.

Why generation is often memory-bound

  1. Weights: in memory
  2. Read: limited by bandwidth
  3. Compute: fast, often waiting
  4. One token: then repeat

Like: A narrow door between the pantry and the kitchen.
Where it breaks: A pantry door moves each ingredient once. A model's weights are re-read for every single token, so the same data crosses the 'door' over and over; batching many users shares each trip.

D3 · PlayFor motivated learners

To write each new token for one user, the chip has to read every weight of the model from memory once. So the speed limit is simple: tokens per second ≤ memory bandwidth ÷ bytes read per token.

Change the model size, the bytes per weight and the bandwidth. Then turn the compute up and down and watch what happens.

Try the interactive version in the map.

Things to try

D4 · MechanismFor practitioners

A roofline chart asks one question: how much work does the chip do for each byte it reads? That ratio is the arithmetic intensity, in FLOPs per byte.

Below the ridge point (peak compute ÷ bandwidth) the chip is memory-bound and speed follows the bandwidth slope. Above it, the chip is compute-bound and speed hits the flat compute roof.

Generating for one user does about 2 FLOPs per weight but reads the whole weight, so intensity is tiny. Serving many users in a batch reuses each weight read for every user, which moves the point right.

Try the interactive version in the map.

Things to try

flops_per_step = 2 * params * batch          # multiply and add for every weight, per user
bytes_per_step = params * bytes_per_weight    # weights read once and shared by the batch
intensity = flops_per_step / bytes_per_step   # = 2 * batch / bytes_per_weight
ridge = peak_flops / bandwidth
speed = min(peak_flops, bandwidth * intensity)
total_tokens_per_s = speed / (2 * params)
per_user_tokens_per_s = total_tokens_per_s / batch

Trade-offs

D5 · FrontierFor experts

Where it's heading: faster HBM generations, designs with much more on-chip memory, and algorithmic tricks such as speculative decoding that get more tokens out of each memory read.

Sources

  1. Roofline: an insightful visual performance model (Williams, Waterman, Patterson) (2009)
  2. LLM Inference Unveiled: Survey and Roofline Model Insights (2024-02-26)