Pit stop · 2026-11-30

It answers, but slowly: what sets tokens per second

Prompt processing and generation are two different measurements, and only one of them is the memory bus. Prefill reads the whole prompt and behaves like a matrix multiplication: hundreds or thousands of tokens per second, capped by compute. Generation reads the weights again for every single token, and that is capped by memory bandwidth. When someone says a model “answers slowly”, it is almost always the second number.

The ceiling, in one line

Bandwidth in GB/s divided by the bytes read per token, in GB. A dense 27B model at Q4_K_M weighs about 15.4 GB, so one token costs one read of 15.4 GB:

CardBandwidthDense 27B at Q4_K_MDense 7B at Q4_K_M
RTX 3060 12 GB360 GB/s23 tok/s90 tok/s
RTX 3090936 GB/s61 tok/s234 tok/s
RTX 40901008 GB/s66 tok/s252 tok/s
RTX 50901792 GB/s116 tok/s448 tok/s
Radeon AI PRO R9700640 GB/s42 tok/s160 tok/s
H100 80 GB SXM3350 GB/s218 tok/s838 tok/s

These are ceilings for a single stream, not promises. Real runs land below them because the cache and the working buffers add bytes, and because a desktop holds some of the card.

Where the bytes go

  • Weights: the model file itself, read once per token. This is the dominant term.
  • The context cache: grows with every token of the conversation. At 32K tokens a cache can be larger than a small model’s weights, so a run that was fast on an empty prompt slows down as the chat fills.
  • Working buffers: small and roughly constant, they matter only at the memory limit.

A mixture-of-experts model breaks the weights term on purpose: it stores every expert but reads only the few that fire. That is why a measured 30B model with 3B active runs at 208 tok/s on an RTX 3090 while the 61 tok/s ceiling for a dense 27B sits above it as a reminder that the two are not comparable. /leaderboard/ carries the rows that were measured, not estimated.

What slows a run, and what to change first

  1. Layers left in system RAM. A model that does not fit gets split between VRAM and RAM, and every token then crosses the PCIe bus. System RAM moves about 40 GB/s in practice: a dense 27B at Q4_K_M read from RAM lands under 3 tok/s. If the report says “offloaded to CPU”, this is the number you are looking at. Fix the fit first: /will-it-fit/.
  2. A grown context cache. Every token of context costs memory and, past the point where the card is full, costs speed. Shortening the context or quantising the cache is the cheapest change; the order is on /pit-stop/out-of-memory/.
  3. Two cards of different speeds. Layers run one after the other, so the slower card sets the pace and the pair can be slower than the faster card alone if the split is uneven. See /tuning/mixed-gpus/.
  4. A power or thermal cap. A card held at a lower clock answers more slowly; it is a straight measurement, so measure it rather than assume. /tuning/power-limit/ covers the setting and the trade.
  5. A bigger quant than the job needs. Q8_0 costs about twice the bytes of Q4_K_M per token. If the model fits at Q4_K_M, that is where the speed is.

Measure before you tune

Run the same prompt twice, once with an empty context and once with the context you actually use, and compare. A one-line benchmark of the model alone tells you the ceiling; the difference between the two runs tells you what your own setup is spending.

Questions

What decides tokens per second on a local model?
Memory bandwidth divided by the bytes the model reads to produce one token. Generation reads the active weights once per token, so a card that moves 936 GB/s reading 15.4 GB per token tops out near 61 tok/s, whatever the compute units can do.
Why is my model slower than the same model in a review?
Reviews usually quote a short prompt and a small model. A long prompt, a large context cache, a batch of one, layers offloaded to system RAM or two mismatched cards splitting the work all land below the bandwidth ceiling, and each has its own fix.
Does a bigger quant make generation slower?
Yes, in direct proportion on a bandwidth-bound run: Q8_0 weights are about 1.9 times the bytes of Q4_K_M, so the ceiling drops by roughly that factor. The reason to stay at Q4_K_M is memory and speed together, not memory alone.
Why does a 30B mixture-of-experts model beat a dense 13B?
Because it reads only the experts that fire. A 30B model with 3B active reads roughly 3B worth of weights per token, not 30B, so its bytes per token are smaller than a dense 13B’s.