Enjoying this issue?
Get tomorrow's AI & engineering digest in your inbox — hand-picked, summarized, and always spam-free.
TLDR
Local LLM token generation speed is determined by memory bandwidth, not compute TOPS. The ceiling is memory bandwidth divided by model file size per token. Multi-token prediction can exceed this ceiling by producing multiple tokens per read, as seen with Qwen 3.8 on an RTX 5090 reaching 144 tokens/s against a ~108 tokens/s ceiling.
Key points
Memory bandwidth is the bottleneck for decode phase, not compute TOPS.
Speed ceiling equals memory bandwidth divided by model file size per token.
KV cache grows with context length, slowing long chats by adding bytes per token.
Multi-token prediction can exceed the single-token ceiling by producing multiple tokens per read.
Mixture of experts models only read active parameters per token, reducing bytes per token.
Tools mentioned
Techniques
- multi-token prediction
- KV cache
- mixture of experts
- 4-bit quantization
Stop scrolling. Start reading smarter.
Receive the day's most important AI & engineering updates in one concise email. No spam.
Transcript (captions)
When a local model on your graphics card types each piece of a word, the card reads the whole model from memory. So, how often it can do that decides how fast your answer arrives. For the 27
billion Quen 3.8 in its common 4-bit file, that's about 16 and 1/2 GB read again for every single piece. On an RTX 5090, a card that launched at $1999,
the memory speed works out to a limit near 100 of those reads a second. Nvidia's own page for that card leads with a different number, 3,352 AI tops, which means trillions of AI
operations a second. That arithmetic does real work, too, because it's what tears through your prompt the moment you hit enter. But published runs put the same model on
that card at 66, 78, and 144 tokens a second, a token being one of those word pieces. Meanwhile, a DGX Spark with 128 GB, four times the card's 32, manages about 15. One of those, 144, sits well
above that limit of about 100. So, how does a card go faster than its own speed limit? By the end, you'll be able to estimate that limit for any card and any model with one division, and you'll know
why long chats slow down. You'll also know whether a fast 32 GB card or a slow 128 GB box fits the models you want. A chip sold on trillions of operations a second ends up
waiting on its memory, and the reason starts the moment you hit enter. Your text gets cut into tokens, and each token maps to a number. By OpenAI's rule of thumb, a token is about 3/4 of an
English word, though that figure comes from OpenAI's tokenizer rather than Quen's. Your whole prompt goes through the model together in a phase Nvidia's write-up
calls prefill. Because it's handled in one pass, there's enough math to keep the whole chip busy, all 21,760 CUDA cores of it. That's the job the numbers on the
product page are built for. Quen's model card lays out the model your prompt passes through as a stack of 64 layers. Three of one kind are followed by a fourth of another, and
that pattern repeats 16 times. Each layer holds weights, the learned numbers every token gets multiplied by. Then the answer starts and the work changes shape because the model writes
one token at a time and each token depends on the one before it. Producing a single token means a complete trip through all 64 layers in a phase called decode. At the bottom of the stack, the
token's trip ends at a scoring step. Out of the last layer comes a probability for every entry in the model's vocabulary, and Quinn's config file puts that vocabulary at 248,320
pieces. That's a lot of auditions for a part that might go to a comma. Hugging Face's guide on text generation lays out the choice from there. Take the likeliest piece or draw one from the
probabilities. A temperature setting controls that draw, and as it approaches zero, the draw turns into simply taking the likeliest. Whatever gets picked goes back in at the
top, and the next trip down all 64 layers begins. Each of those trips means every weight gets read out of the card's memory and into the cores. Unsloth's common 4-bit build of this model, the
Q4KM file, is 16 and 1/2 GB, which is roughly what moves for each token you see. At 8-bits, the file is 29 GB, and the full 16-bit one is 54.7,
already too big for a 32 GB card. Nvidia's engineering blog says plainly what that does to the timing. In decode, the speed of moving weights and cached values out of memory is what
dominates, and how fast the arithmetic runs hardly enters into it. So, during the part you sit and watch, those cores spend most of their time waiting for numbers to arrive, which is an odd
number to lead the product page with. Hold on to one piece from all this. Every token reads the whole model, so your speed comes down to how fast the memory can hand over those 16 and 1/2
GB. You'd expect predicting the speed to take core counts, clock speeds, and tops, all before anyone runs a thing. Two numbers do the
The bytes each token reads and how fast the memory moves them. Both of them sit on public pages you can look up. On the RTX 5090, 32 GB of GDDR7 memory on a 512-bit bus move 1,792 GB a second. Spec
listings and reviews are where that figure comes from since the product page leads with compute. Divide 1,792 by 16 and 1/2 and the card can read the whole model about 108 times a second. Since
every token needs one full read, your ceiling is roughly 108 tokens a second. That's arithmetic so far with no measurement behind it yet. Multiply by OpenAI's 3/4 and you get
around 80 English words a second, far quicker than you read. Treat it as a ceiling though because it leaves out everything else the card fetches along the way. Real runs land below it, which
is what a ceiling predicts. VRAM calculator speed page for this model collects a run by the X user Witcher on an RTX 5090 with llama.cpp and no extras switched on.
On an empty chat, it measured 78 tokens a second. People who build these engines have known the pattern behind that gap for a while. In a 2023 llama.cpp discussion, the
project's maintainer puts it in two lines. Prompt processing is compute bound and text generation is memory bandwidth bound. A table in that thread backs it up on Apple chips where an M2
Ultra with 800 GB a second generated about 41 tokens a second on a 16-bit model. A plain M2 with 100 managed 6.7. So, set side by side, eight times the bandwidth
bought about six times the speed. Look up a model's file size and a card's memory speed and you have the rule worth keeping in your head. Your speed ceiling is memory bandwidth
divided by the bytes each token reads. But, Witcher's run didn't stay at 78. At 8,000 tokens of conversation, it measured 76 and at 32,000, it measured 71 with the same model file on the same
card the whole time. Something extra is being read for every token and it grows as you talk. Every token in the conversation leaves a small record in the attention layers,
the parts that look back over the chat. That record, its keys and values, stays on the card so the model doesn't have to recompute it. Nvidia's blog calls that store the KV
cache, and it grows in a straight line with the length of the chat. Qwen's 3+1 layout pays off here because only one layer in four is a full attention layer, 16 of the 64. Each of those has four key
value heads of size 256. As for the other 48, they're a different kind of attention layer, and the math that follows assumes they don't keep a growing record. Take the 16 full
attention layers, their four heads and that head size, and put them into the per token formula on Nvidia's blog at 2 bytes per number. Work it through, and each new token adds about 64 kilobytes
to the cache. Two assumptions hold that figure up, only those 16 layers keep a growing cache, and the cache is stored at 16 bits, which llama.cpp may compress. At 32,000 tokens, the cache
comes to about 2.1 gigabytes. So, each new token reads about 18.6 gigabytes instead of 16 and a half. Pull that through the division, and the ceiling drops from 108 to roughly 96, an 11%
slowdown by that math. Which year's run fell from 78 to 71, about 9%, and that close a match supports the cache as the main cause without proving it. A post on r/localllm
made the same point from the other end. Its author warned that reaching 262,000 tokens of context doesn't mean a model keeps the same speed once all of that context is filled. Long chats slow down
because the chat itself becomes part of the reading, which is the same old cause showing up in a new place, more bytes per token. One token's trip also explains the other machine from the
opening. A DGX Spark holds 128 gigabytes, four times the 5090, so you'd expect it to be the serious machine for local AI. Yet a llama.cpp discussion from August 14th
has a user running this exact model on one at about 15 tokens a second. Nvidia's spec page lists the Spark's memory at 273 GB a second. Put that over 16 and 1/2 and the ceiling lands at
about 16 and 1/2 tokens a second, just above the 15 that user reported. Line the two runs up and the Spark has four times the memory at roughly a fifth of the speed on this model. That makes it a
fine home for a model you're not in a hurry to hear from. How much memory you have decides what fits and how fast that memory moves decides how quickly it runs. When 3.8 flash next is where the
big boxes extra memory starts to pay. It has 125 billion parameters, the weights from earlier, which sounds hopeless next to 27 billion until you learn that only about 6 billion of them work on any
given token. Its model card lists 512 small sub-networks called experts and each token is routed to just 10 of them plus one shared one, which is what makes it a
mixture of experts model. The rest of the weights sit untouched while that token passes through. At the same bits per weight as the 27 billion file, call it 3.7 GB read per token for 6 billion
active parameters. On a 5090 that puts the ceiling near 480 tokens a second and both numbers are estimates with no measured flash next run to check them against. Another 51 billion parameters
sit in what the model card calls N-gram embeddings and it doesn't say how much of those each token touches. So treat 3.7 as rough. Every expert still has to sit in memory though since the next
token can be routed to different ones. By the same reckoning, all those weights come to 75 GB or more. Far beyond anything a 32 GB card can hold. On the Spark, it fits with room left over and
running 3.7 GB through the same bandwidth rule puts its ceiling around 74 tokens a second, an estimate on paper. That's about four and a half times the Spark's own ceiling on the 27
billion. For a model the fast card can't hold, its bandwidth never gets a chance to matter. So fit comes first. Still waiting for the opening is the number that shouldn't exist, the 144.
VRAM calculator's page also collects runs by the X user pseudo ing X with a setting called multi-token prediction, MTP for short, switched on. One RTX 5090, starting from 66 on that
user's own setup, rose to 144 tokens a second, and a second card went from 61 to 135. Set 144 against the ceiling of 108, and it comes in about a third higher. So, if
that ceiling capped tokens directly, this run couldn't have happened. A measured number sitting above a limit you just arrived is usually the moment you go back and check your division.
Your division was fine. What it counts is how many times a second the card can read the weights, and nothing in it says each read has to produce only one token. Multi-token prediction gets more than
one token out of a pass through the model, and Quen's Flash Next model card even lists a 4 billion parameter head built for it. How that turns one read into several tokens isn't spelled out in
what's documented here, so the measured jump is the part to lean on. On the slow box, a smaller version of the same lift shows up in that llama.cpp thread, where the project's maintainer Gerganoff
suggested draft MTP. After that, the user's 15 tokens a second rose to 18.08, past the Sparks single read ceiling of about 16 and a half. So, the rule keeps its shape with one refinement. Anything
that squeezes more tokens out of each read can go past it, because bandwidth divided by bytes per token caps your reads per second. Picture that card from the opening again, reading 16 and a half
gigabytes for every token, because you can now work out its speed limit yourself. Do it in a fixed order, because fit comes before speed. First, check that the model file fits in memory
with room for the chats cache. Then, divide the memory bandwidth by the bytes each token reads. Say you're choosing between a fast 32 gigabyte card and a slow 128 gigabyte box, and the models
you care about are 27 billion class at 4 bits. Divide one ceiling by the other, and the RTX 5090s comes out about six and a half times higher on that file. So, for you, it's the better pick. If
you want 100 billion plus mixture of experts models like Flash Next, the better pick flips to the 128 GB box going by the estimates above. Those models won't fit on a 5090 in the first
place. And since they only read their active experts per token, slow memory stings a lot less there. Whichever you're weighing, the AI tops on the box mostly
tell you how fast your prompt gets read in, and the gigabytes a second tell you how fast the answer comes back out. Which model are you sizing your next machine around, and does it fit before
you even start dividing?