This is the fourth installment of the series "Current State of Local LLMs." In Part 1 Part 1, we covered the overall picture, and in Part 2 Part 2, we discussed open weights, quantization, and VRAM. In the previous Part 3 Part 3 Prefill and Decode, we explained that inference is divided into two stages: "prefill" and "decode," each with different bottlenecks. In this follow-up, we will examine specifically what determines speed, using numbers to illustrate. We will explain things carefully step by step so that even first-time readers can follow along. We also discuss the same content in a video (YouTube "Explaining the Key to Local LLM Speed: Differences Between Prefill and Decode").
First, an important premise: in local LLMs, the model weights (the chunks of numbers obtained through training) do not change during inference. While we are asking questions and generating answers, the weights remain fixed. What changes is the KV cache. As mentioned in Parts 2 and 3, this is a mechanism that saves and reuses the K (Key) and V (Value) from each layer. The Q (Query) is not saved because it changes with the question. New tokens' K and V are appended to the end of the KV cache (this is not adding numerical values).
Decode is bottlenecked by reading, not computation
In the decode stage, to output one token, the model essentially needs to read all of its weights. The actual computation is minimal, but the amount of data read is large. Therefore, the upper limit of decode speed is generally determined by "memory bandwidth ÷ the amount read per token." Memory bandwidth refers to the amount of data that can be transported from memory to the GPU per second.
For example, if you quantize the Qwen3.8-27B, which has approximately 27.8 billion parameters, to 4 bits, the weights become approximately 13.9 GB. The theoretical upper limit, calculated by dividing this by the bandwidth of each GPU, is shown in the table below.
| Configuration | Memory Capacity | Bandwidth | Theoretical Limit for Qwen3.8-27B (4-bit, ~13.9GB) |
|---|---|---|---|
| RTX 3090 | 24GB | 936GB/sec | ~67 tokens/sec |
| RTX 5090 | 32GB | 1,792GB/sec | ~129 tokens/sec |
| DGX Spark | Shared Memory 128GB | 273GB/sec | ~20 tokens/sec |
What you should note here is that even with the same model, the upper limit changes so drastically depending on the bandwidth. In reality, it will be slower by the amount required for reading the KV cache and performing computation, so please consider the numbers in this table as "the maximum possible limit."

Prefill is bottlenecked by computation
On the other hand, the prefill phase, which produces the first token, has a completely different nature. Since the entire input text is processed together to understand the context, it is a computation-heavy stage that fully utilizes the GPU's compute cores. Here, computational capability matters more than bandwidth.
Therefore, the bottlenecks for prefill and decode are entirely different. Prefill is bottlenecked by computation, while decode is bottlenecked by reading. Separating these two and optimizing for each is the role of the inference engine.

Inference engines optimize by separating the two stages
Inference engines manage and accelerate these two stages separately. Representative examples include Strata, SGLang, and vLLM. For Strata, I have previously summarized how to read its benchmarks, so please check that out as well (How to Read Strata Benchmarks).
Inference engines improve speed even for the same model by devising strategies for how weights are loaded, the order of computations, and how processes are aggregated.
Here are some well-known optimizations:
- Batching requests: Since decode reads weights for each token, reusing those read weights for the calculations of multiple requests allows producing many tokens from a single read.
- KV cache placement: vLLM is known for its mechanism (PagedAttention) that manages KV cache in small chunks to reduce VRAM waste.
- KV cache reuse: SGLang features a mechanism (RadixAttention) that shares the KV cache of the initial portion (such as system instructions or long documents) across requests that start with the same prefix. If sharing is possible, the corresponding prefill process can be skipped.
Strata is an inference engine aimed at running large MoE models on consumer GPUs, as discussed in previous articles. The differentiation between VRAM, main memory, and SSD usage, which we will cover in the latter half of this post, is where Strata shines. The engine you choose affects the perceived speed of the same model. Therefore, it is crucial to select one that matches your machine and the model you wish to use.
Where MoE comes into play
Another topic that frequently arises recently is MoE (Mixture of Experts). In this architecture, the FFN (Feed-Forward Network) part of each layer is divided into smaller "experts." A router within each layer selects only the necessary experts to compute for each token.
The important point is that MoE operates on every token for both prefill and decode. While the computation becomes lighter, all experts must be loaded into memory. You cannot simply ignore the experts you aren't using. This is both the appeal and the challenge of MoE.
Let's look at Qwen3.6-35B-A3B as an example. Although it is a large model overall, only approximately 3 billion parameters are actively used per token, which amounts to about 1.5 GB when quantized to 4 bits. If we calculate the theoretical upper limit by dividing this by the bandwidth of an RTX 3090, we get approximately 624 tokens/sec. Of course, the actual speed will be much slower, but because the computation is lighter, decode can become significantly advantageous.
The hierarchy of VRAM, Main Memory, and SSD
At this point, the question becomes where to place what. Our local machines have a hierarchy: VRAM (closest to the GPU), main memory (RAM, next closest), and SSD (furthest away). Closer to computation means faster speed but smaller capacity. Further away means slower speed but larger capacity.
In MoE, unused experts can be placed on the SSD. However, reading from there takes significant time. While SSDs are convenient as long-term storage, they are slow in scenarios like decode where data must be read for every token. Therefore, we place frequently used items closer and rarely used items further away, prioritizing placement accordingly.
Another distinction exists in memory types. HBM (High Bandwidth Memory) is used in data center GPUs and is extremely fast. Consumer GPUs use GDDR. Even within the same "VRAM," the internal components differ.

Looking ahead
To summarize, achieving speed requires identifying which stage is bottlenecked and optimizing accordingly. The distinctions between prefill and decode, dense and MoE, and VRAM, RAM, and SSD are becoming increasingly fine-grained, leading to optimizations at each layer. Over the past few months to years, local LLMs on our personal machines have undoubtedly become more comfortable to use. I believe the future direction lies in continuing to refine these distinctions and optimize each layer.
Next time
In the next part, Part 5 (Final) Part 5 (Final), we will actually run the inference engine Strata and verify how these optimizations perform in our own environment. Stay tuned.
Next article: Part 5: Actually Running with Strata