Response speed and acceleration
Last updated
LLM memory bandwidth vs compute: how to find the speed bottleneck
Memory bandwidth and compute performance reduce different kinds of waiting.
Memory bandwidth1 is the amount of data that can move from memory to the compute units each second. GPU2 compute performance is the amount of computation those units can perform on that data. Generating an answer token3 by token and reading a long input involve different workloads, so the two specifications affect them differently.
When summarizing a document, distinguish a late first response from an answer that continues slowly after it starts. The first part involves prefill4, which processes the input; the second involves decode5, which generates the answer. Knowing where you wait helps you decide which hardware specifications to compare first.
Generating tokens one by one repeatedly reads the weights.
An LLM6 uses weights stored in the model to calculate the next token. For one person's answer, each next token follows the preceding token. The required weights are repeatedly fetched from memory. If the compute units are waiting for data, reducing that wait matters before adding more compute units.
Capacity and bandwidth serve different roles here. Enough capacity is needed to hold the model and KV cache7, while bandwidth supplies data for computation quickly. If the model fits but answers are slow, inspect actual decode speed and the data path rather than simply adding more capacity.
- Context length, RoPE and sliding-window attention
- Prefill vs decode: should you look at TTFT or tok/s?
- MoE vs dense: why low active parameters still need memory
- GGUF vs MLX: which model format should you download?
- How to run Nemotron Bolt on an RTX 3090 or 5090
- RTX 3090 BF16 unlock: what opens and what stays the same
- Does the 3090 unlock speed up local LLMs? Prefill, batching, decode
- The RTX 3090 48 GB mod: what to verify before you accept the card

Let's calculate the time to read 20 GB.
Suppose the weights needed for one token occupy 20 GB and the actual transfer rate is 400 GB/s. Reading them takes 20÷400=0.05 seconds. Repeating that read for one second gives 1÷0.05=20 reads. Less data or a higher transfer rate reduces the waiting time.
This example calculates only weight-reading time. Actual tok/s also includes computation, KV-cache access, and runtime8 overhead. We assumed an actual transfer rate rather than a product's peak bandwidth; selective architectures such as MoE9 also change how much is read. Use the formula to understand bandwidth, and compare hardware using results for the same model.
Reading a long document processes many tokens together.
After receiving a document, the model processes the input tokens before answering. Prefill can group the tokens already provided, creating more opportunity to use the compute units. If a long contract produces a long wait before the first answer, compare prefill throughput10 and time to first token11.
Batching requests from several people can reuse the same weights across more computations. The server's aggregate token rate may increase while individual requests wait in a queue. For personal chat, look at one answer's speed; for a shared server, examine individual latency and aggregate throughput together.

Quantization and context length also change data movement.
Quantization12 stores weights in fewer bits and can reduce the amount read. Efficient kernels for that representation can help both capacity and speed. Record the format and runtime even for the same original model so you can identify which combination reduced the time.
As a conversation grows, the KV cache storing previous context grows too. Consulting that cache during generation can add work, making short-question and long-document speeds different. Fix the input length and record output tokens to reduce differences caused by changing workloads.

Compare hardware for the stage that is slow.
First check that the model and actual context fit in memory. Then use the same document and question to record time to first token, generation rate, and completion time. Separating them shows which part of your work a higher-spec machine can shorten.
| Slow stage | Compare first |
|---|---|
| The answer continues slowly. | Same-model decode, bandwidth, and actual execution path |
| The first answer is late after a long input. | Prefill and TTFT at the same input length |
| Several requests queue up. | Individual latency and aggregate throughput under concurrency |
Terminology notes
Memory bandwidth — The amount of data transferable between memory and a processor per unit time, usually expressed in bytes per second (B/s).
Back to the textGPU — A processor designed to handle many calculations in parallel. It performs model computations during AI inference.
Back to the textToken — A unit into which a model divides input or output for processing.
Back to the textPrefill — The stage where an LLM reads the input prompt and computes representations for its tokens. Longer prompts contain more tokens to process.
Back to the textToken decoding — The stage that generates successive output tokens using the input and the response produced so far.
Back to the textLarge language model — A model trained on large text datasets to learn language patterns and process or generate text in context.
Back to the textKV cache — Memory that stores attention keys and values from earlier tokens for reuse during later token generation. Its size depends on context length and batch size.
Back to the textRuntime — The software environment that provides facilities needed while a program runs. In local AI, it can also refer to a model execution engine.
Back to the textMoE — A model architecture that selects some of several expert subnetworks for each input. Total parameters can differ from the number activated for one token.
Back to the textThroughput — The amount of work processed or generated over time. Comparisons need the unit, such as tokens per second or requests per second.
Back to the textTime to First Token — The time from sending a request until its first output token arrives.
Back to the textQuantization — A way to represent model weights or values with fewer bits, reducing storage and memory use. The coarser representation can also affect accuracy.
Back to the text
Frequently asked questions
- What should you check first in this article?
- Memory bandwidth is the amount of data that can move from memory to the compute units each second. GPU compute performance is the amount of computation those units can perform on that data. Generating an answer token by token and reading a long input involve different workloads, so the two specifications affect them differently.
- How much memory does it need?
- An LLM uses weights stored in the model to calculate the next token. For one person's answer, each next token follows the preceding token. The required weights are repeatedly fetched from memory. If the compute units are waiting for data, reducing that wait matters before adding more compute units.
