Local LLM Inference: Why Decode Speed Alone Doesn't Tell the Whole Story
This article explains why single-point decode speed is an incomplete metric for local AI inference and how to build a more practical evaluation framework. It breaks down prefill, time-to-first-token (TTFT), and decode stages, then defines measurable indicators across throughput, latency, resource usage, quality, and energy. You will find a reproducible local benchmarking workflow, a sample script, four real deployment constraints, and a selection and tuning checklist for evaluating whether a local inference setup can reliably complete tasks at a target context length, concurrency, and power budget.
When a desktop machine with high memory capacity posts a decode rate above 200 tokens/s, the technical community often moves from amazement to re-testing within a day. Putting public data side by side across different context lengths and inference implementations leads to a more useful conclusion: decode speed is only a single-point metric. What local AI really needs to account for is how much time and resources it takes to complete a task. This article starts by breaking down the metrics, rebuilds an evaluation framework for local inference, and provides an executable benchmarking script and a tuning checklist.
1. Why Single-Point Decode Speed Is Not Enough
Decode speed usually refers to the number of tokens produced per second during the autoregressive generation stage. It matters, but it only describes how fast the “text output” portion runs. A real local inference request includes at least three stages:
- Prefill: processing the input prompt in one pass, with computational complexity growing roughly linearly with input length, bounded by matrix-multiply throughput;
- Time-to-first-token (TTFT): the time from sending the request to receiving the first token, determined mainly by prefill and scheduling overhead;
- Decode: generating tokens one by one, affected by memory bandwidth, batch size, and sampling strategy.
A common pattern in public data is that on the same hardware and the same model size, decode can stay high at a 4K context but drops noticeably when the context expands to 32K. The reason is not mysterious: the key-value cache that attention must access grows linearly with length, memory bandwidth pressure rises, and cache swapping and paging management overhead increase. Citing only the peak number from the shortest context will systematically overestimate real-world usability.
Therefore, evaluation must cover at least three tiers: short-context peak, common-context steady state, and long-context decay, while recording the corresponding TTFT and memory usage.
2. Breaking “Task Cost” into Measurable Quantities
Use the following set of indicators instead of a single speed number:
- Throughput: decode tokens/s, prefill tokens/s, end-to-end tokens/s (including input and output);
- Latency: TTFT, average interval per token, tail latency P95/P99;
- Resources: peak memory/VRAM, key-value cache usage, maximum available context;
- Quality: recall of key information under long context, stability of instruction following;
- Energy: whole-machine power draw, energy per thousand tokens, temperature rise and throttling.
A practical approximation helps with quick estimation:
Single-request time ≈ input length / prefill throughput + output length / decode throughput + fixed scheduling overheadEnergy per 1K tokens ≈ average whole-machine power × single-request time / (output tokens / 1000)
Apply it to concrete scenarios: if an AI coding assistant must read a long code context before generating a patch, the input may far exceed the output, so prefill throughput and TTFT matter more than peak decode speed. For long-document summarization or conversational applications, decode decay under long context and key-value cache management are the real bottlenecks.
3. A Reproducible Local Benchmarking Method
Do not make decisions based on “it feels fast.” A minimal viable benchmarking workflow is as follows:
- Fix variables: the same model weights and quantization format, the same context length, the same sampling parameters (such as fixed temperature and top_p), and disable randomness-driven variation;
- Sweep tiers: use context lengths of 1K/4K/8K/16K/32K, with output length fixed at 256 or 512;
- Repeat multiple times: at least 5 runs per tier, taking the median and P95;
- Record resources synchronously: sample memory/VRAM, power, and temperature;
- Vary concurrency: increase gradually from a single stream to multiple streams, observing whether throughput scales linearly and whether latency degrades.
Sample script (pseudocode):
for ctx in [1024, 4096, 8192, 16384, 32768]:for _ in range(5):prompt = build_prompt(target_len=ctx)t0 = now()first = Nonefor tok in stream(infer(prompt, max_new_tokens=256)):if first is None:first = now()last = now()record(ctx, ttft=first - t0, decode_tps=256 / (last - first),peak_mem=sample_peak_mem(), power=sample_power())
Results should be presented in a table containing at least: context length, TTFT, decode tokens/s, peak memory, and whether throttling was triggered. Only such a table can support the judgment of “what this device is suited for.”
4. Four Real Constraints of Local Deployment
1. Memory and Key-Value Cache Budget
Model weights are only part of the usage. The key-value cache grows linearly with context and concurrency. If the budget is underestimated, long-context requests will be forced to truncate or queue. A practical approach is to reserve cache space for the target context and concurrency first, then decide the model size and quantization level that can be loaded.
2. Physical Limits of Bandwidth and Latency
Autoregressive decode is essentially “read-heavy, compute-light,” so performance depends more on memory bandwidth than peak compute. This explains why high-memory-bandwidth devices have an advantage in decode, and why raising compute numbers does not always translate into speed.
3. Sustained Heat and Power
Short bursts can produce impressive numbers, but sustained load depends on cooling and the power wall. For long batch tasks, focus on steady-state speed after temperature rise rather than cold-start peaks.
4. Software Stack and Operator Adaptation
The same hardware can perform noticeably differently across inference implementations, with differences coming from operator fusion, cache paging strategy, quantization kernels, and schedulers. During evaluation, record the “software stack version” as a first-class variable.
5. Selection and Tuning Checklist
- Define the scenario profile first: input/output length ratio, number of concurrent streams, acceptable TTFT;
- Use the three-tier context data to filter out combinations that “look good at peak but do not last”;
- For long-context scenarios, prioritize optimizing cache management and paging strategy, and lower quantization precision for capacity if necessary;
- For interactive scenarios, prioritize reducing TTFT, and consider chunked prefill and request-priority scheduling;
- Set up continuous monitoring: connect TTFT, decode speed, VRAM, and power to logging services and monitoring alerts, and drive capacity planning with data;
- If elasticity and multi-machine coordination are needed, combine local inference with general cloud capabilities such as container platforms, object storage, and message queues to form a layered architecture of “local for low latency, cloud for elastic batch processing.”
6. Conclusion
More than 200 tokens/s is an engineering achievement worth recording, but it is more like a starting speed than a full-course result. Upgrading evaluation from “a single number” to “a cost table” enables developers to answer the truly important question on limited hardware: can this local inference setup reliably complete tasks at the target context, target concurrency, and target power budget. Speed determines the upper limit of experience; cost determines the boundary of deployment.
