Optimizing LLM Inference: Breaking Down Bottlenecks Across Control, Execution, and Data Planes
This article examines the remaining optimization headroom in large language model (LLM) inference by decomposing the inference system into three modules: the control plane, the execution plane, and the data plane. It explains the distinct optimization goals and current bottlenecks for each, covering request scheduling, Pareto frontiers for latency vs. throughput, and KV cache management. Practical metrics like masking efficiency for data transfers are introduced, along with code examples for batch formation and front-line analysis. The goal is to help engineering teams identify where further gains are still possible versus where returns are diminishing.
Optimizing LLM inference often feels like chasing diminishing returns: teams invest heavily in one metric, only to see incremental gains shrink. To understand how much room is left, it helps to decompose the inference system into its structural components and examine the optimization targets and current constraints of each.
Three Planes of a Modern Inference Stack
A modern LLM inference framework can be abstracted into three cooperating modules:
- Control plane – everything that happens before the model forward pass and after output generation.
- Execution plane – the efficiency of the model’s forward computation on GPUs.
- Data plane – the storage, routing, and masking of KV caches.
Each plane has distinct goals and optimization levers. Treating them as a single monolithic system often leads to incorrect conclusions about where headroom remains.
Control Plane: Keeping GPUs Focused on Computation
The control plane handles all work that occurs before a request enters the model and after the output is returned. Typical tasks include:
- Tokenizer and detokenizer
- Downloading, storing, and encoding images or videos for multimodal inputs
- Protocol conversion between API interfaces
- Request scheduling based on service-level objectives (SLOs)
- Output constraint enforcement and content checking
The control plane has two primary objectives.
First, ensure that only forward passing is sent to GPU servers. CPU-bound tasks such as string processing, network I/O, and disk reads/writes should not share the same machine as the GPU. If they do, they consume CPU cycles and force the GPU to wait for inputs, leaving compute units idle. Moving these tasks upstream or isolating them keeps GPU utilization stable.
Second, guarantee load balancing. Requests vary widely in input and output length. The scheduler must compose batches without letting long and short requests penalize each other, and without leaving some GPU instances idle while others are overloaded. Scheduling policy directly determines actual GPU utilization and is often the area where the control plane yields the most immediate gains.
A simplified bucketed scheduling approach looks like this:
def form_batches(requests, bucket_edges, max_tokens_per_batch):"""Group requests by input length, keeping lengths similar within a batch to reduce padding waste."""buckets = {edge: [] for edge in bucket_edges}for req in requests:edge = next(e for e in bucket_edges if req.prompt_len <= e)buckets[edge].append(req)batches = []for edge, reqs in buckets.items():current, budget = [], 0for req in reqs:if budget + req.prompt_len > max_tokens_per_batch and current:batches.append(current)current, budget = [], 0current.append(req)budget += req.prompt_lenif current:batches.append(current)return batches
This code illustrates the concept; a production system also needs to consider priorities, timeouts, and GPU memory headroom.
Execution Plane: Pushing the Pareto Frontier Between Latency and Throughput
The execution plane focuses on the efficiency of the model’s forward computation on GPUs. Common techniques include:
- Compute optimization: kernel fusion, lower-precision arithmetic, and memory-access optimization for attention operators.
- Communication optimization: overlapping collective communication with computation in multi-GPU parallelism.
- Mega-kernels: merging multiple small operators into a larger kernel to reduce launch overhead and intermediate read/write operations.
- Graph execution: recording a fixed execution flow and submitting it as a whole, reducing CPU-side scheduling overhead.
The execution plane has a single optimization goal: advance the Pareto frontier between latency and throughput for a given chunk size and concurrency level. Any configuration on the frontier trades latency for throughput — reducing latency requires sacrificing throughput, and vice versa. Configurations not on the frontier indicate that both metrics can be improved simultaneously.
A common approach to evaluate the frontier is to fix the model, hardware, and input distribution, then scan different chunk sizes and concurrency levels, recording p99 latency and throughput for each configuration, and finally selecting the non-dominated solutions.
# The following function is illustrative; run_benchmark and pareto_front need to be implemented in the actual environmentconfigs = [(chunk, conc) for chunk in (512, 1024, 2048) for conc in (4, 8, 16, 32)]records = []for chunk, conc in configs:stats = run_benchmark(chunk_size=chunk, concurrency=conc, trace=real_trace)records.append({"chunk": chunk, "conc": conc,"p99_latency": stats.p99_latency,"throughput": stats.throughput})frontier = pareto_front(records, minimize="p99_latency", maximize="throughput")
To determine whether the execution plane is close to its limit, watch whether the frontier is still moving. If new kernel optimizations or graph optimizations only shift the entire curve without pushing it to the upper-left (better latency and throughput simultaneously), returns are converging on the current hardware.
Data Plane: KV Cache Storage, Routing, and Masking
The data plane is responsible for storing and scheduling KV caches. Its two goals are:
- Maximize the capacity of persistent storage.
- Improve read/write efficiency.
From a performance perspective, the core question is whether KV cache reads and writes can be fully masked by model execution time without landing on the critical path of GPU forward passes.
4.1 Ideal Model
Assume requests do not hit the cache, and the Prefill stage throughput is X. If a class of requests has a prefix hit rate of p, then the tokens that hit the cache require neither computation nor interference with model execution; only the non-hit portion needs to be computed. In that case, the effective system throughput approaches X / (1 − p).
Calculating with this formula:
- p = 0.5 → theoretical throughput = 2X
- p = 0.9 → theoretical throughput = 10X
- p = 0.95 → theoretical throughput = 20X
This is an ideal upper bound. It assumes that reading hit data is completely free, so it serves as a benchmark to measure the gap, not as a realistic expected gain.
4.2 Gap Between Ideal and Reality
In practice, as the hit rate increases, the measured throughput of the non‑hit portion X often decreases, causing the actual curve to deviate from the ideal. Common causes include:
- Batch composition changes: after hits, the remaining non‑hit tokens per request become fewer, reducing the compute density inside a batch. The GPU becomes harder to fully saturate.
- Fixed overhead percentage rises: with shorter requests, fixed costs (scheduling, kernel launches, synchronization) take up a larger share of total execution time.
- Data transfer contention: reading KV caches from storage into GPU memory consumes memory bandwidth, host‑to‑device links, or network bandwidth — all of which are also needed for model computation.
- Insufficient prefetch timing: if prefetching starts too late or the available compute window is too short, data transfer directly adds latency to the critical path.
4.3 Measuring Masking Efficiency
Masking efficiency can be defined as the fraction of transfer time that is hidden by computation:
Masking efficiency = hidden transfer time / total transfer time
The corresponding extra latency added to the critical path is approximated by:
Extra critical‑path latency ≈ max(0, transfer_time − available_compute_overlap)
def exposed_latency_ms(transfer_ms: float, overlap_window_ms: float) -> float:"""Returns the additional latency on the critical path that is not hidden by computation."""return max(0.0, transfer_ms - overlap_window_ms)
Only when masking efficiency is close to 1 is the data plane near its optimization limit. Prefetching should be initiated during the computation of a previous layer or a previous batch. The available overlap window depends on the number of model layers, batch size, and per‑layer compute time, so the prefetch strategy must be co‑designed with the execution plane’s scheduling parameters.
4.4 Common Data Plane Optimizations
- Tiered storage by heat: hot KV caches stay in GPU memory, warm caches in host memory, and cold caches in disks — with an access policy that balances capacity and latency.
- Awareness of model layer and batch size: prefetch depth and granularity should align with the compute time of each layer to maximize overlap.
- Using efficient data formats: quantized or compressed cache entries reduce transfer volume, but require careful handling of precision loss.
Conclusion
The headroom for inference optimization depends on which plane you examine. The control plane often shows immediate wins through better scheduling and isolating CPU work. The execution plane’s gains are bounded by the hardware, but moving the Pareto frontier requires new algorithmic or kernel‑level innovations. The data plane is where many teams see large theoretical multipliers from prefix caching, yet the real gap remains in masking transfer costs — meaning optimization should focus on prefetch strategies and co‑designed scheduling across planes. By separately evaluating each plane, engineering teams can identify which part of the system still holds meaningful headroom and where further tuning is likely to saturate.
