LLM Inference System Architecture: Design Behind Trillion-Token-Scale Throughput

    This article examines how large-scale LLM inference systems determine serving cost and revenue. It covers throughput and unit-economics checks, Prefill/Decode separation with different expert parallelism settings, tiered KVCache storage with bounded replay, and load balancing across the Prefill and Decode stages. It ends with benchmarks engineers can use to compare their own clusters.

    Introduction: Beyond Model Capability, Cost Is Set by the Inference System

    The capability ceiling of a large language model is set by the model itself. But how much each token sells for, and whether the service can make money, depends on the inference system. When a single cluster serves 155 trillion tokens per day and revenue per accelerator reaches tens of US dollars per hour, the question is no longer whether the model answers correctly. The question becomes whether the same hardware can serve more requests at a lower cost.

    This article does not restate any official announcements. Instead, it breaks down this class of very large inference systems to answer three engineering questions: What does each design save? What does it cost? And if you want to reproduce it in your own cluster, which numbers can serve as benchmarks?

    1. Start with the Math: Do Throughput and Revenue Add Up?

    The first step in evaluating any inference system is unit conversion. Convert headline figures into engineering metrics you can reason about.

    Converting 155 trillion tokens per day to a per-second rate:

    1. 155 × 10^12 ÷ 86400 ≈ 1.79 × 10^9 tokens/s

    That is about 1.79 billion tokens per second. Spread across a cluster of several thousand accelerator cards, each card must sustain an average output of tens of thousands to hundreds of thousands of tokens per second. This scale implies two things. First, the system must keep hardware utilization high over long periods, and any scheduling jitter gets amplified at this size. Second, peak throughput measured in offline benchmarks has little reference value. Only effective throughput under online serving can support this math.

    This leads to the core tension in inference system design. Online serving has strict latency constraints, including time to first token and inter-token latency. High throughput, however, requires large concurrent batches. A strong inference system makes batches as large as possible while staying within the latency SLO.

    2. System Shape: E/P/D Separation and Hardware Organized by Stage

    2.1 Why Prefill and Decode Are Split

    Large model inference naturally falls into two phases. Prefill processes the entire input sequence in one pass. It is compute-intensive, and its memory bandwidth pressure is relatively manageable. Decode generates tokens one at a time. It is limited by reading the KVCache, which makes it a memory-access-bound workload. The two phases need very different hardware. Running them on the same machines causes them to interfere with each other’s scheduling and lowers overall utilization.

    For this reason, mainstream large-scale inference systems separate Prefill and Decode and organize heterogeneous hardware by stage. Common 8-card servers handle Prefill because their communication domains are small and they deploy flexibly. Supernodes with 64 to 128 cards handle Decode. Their high-bandwidth interconnects support large-scale expert parallelism.

    2.2 Independent Encoding and Storage

    In this design, preprocessing steps such as encoding and embedding can run on a standalone single card (the VE single-card configuration), so they do not occupy main inference resources. Long-term KVCache storage runs on an independent, high-performance distributed file system, decoupled from the compute cluster. Compute, cache, and storage can therefore scale independently without constraining one another.

    3. Parallelism Strategy: Small EP for Prefill, Wide-EP for Decode

    Parallelism design is the core of Mixture-of-Experts (MoE) inference. The key trade-offs are:

    • Prefill uses small expert parallelism (EP 2 to 8). Prefill is compute-intensive, and its batches are naturally large. Expert routing is relatively even, so a small EP size is enough to saturate compute, and communication overhead stays manageable.
    • Decode uses wide expert parallelism (EP 64 to 128). Each Decode step generates only one token per request, so the compute per request is tiny. Experts must spread across many more cards to reduce the memory each card needs for resident weights. A larger global batch also raises expert utilization.

    These systems deliberately avoid tensor parallelism (TP) and context parallelism (CP). TP introduces frequent intra-layer communication, which costs too much for the latency-sensitive Decode phase. CP mainly serves training with extremely long contexts. An EP-centered design replaces all intra-layer communication with one routing communication step. This is a sound balance between total communication volume and latency.

    4. Tiered KVCache: Turning a 72-Hour Reuse Window into Profit

    4.1 Three-Tier Storage

    The largest cost in long-context serving is repeated Prefill. System prompts and multi-turn conversation history repeat heavily across requests. If the KVCache can be retained long-term and reused on cache hits, the computation for those prefixes is skipped. A typical three-tier cache design works as follows:

    1. HBM (GPU memory): Holds the hottest data for requests currently being served.
    2. Host memory: Holds sliding window attention (SWA) window data, at roughly 1.4 MB per sequence.
    3. Distributed file system: Stores block-organized KV data at about 528 bytes per token, with retention windows of 72 hours or more.

    The key insight is that cache data at different precisions and access frequencies has very different storage costs. Keeping the full KVCache in GPU memory is not sustainable. With tiering, a 72-hour reuse window can push the online cache hit rate to about 85%. Most requests then have their Prefill substantially reduced, and online efficiency can reach about 80% of offline benchmark performance.

    4.2 Recomputation: Bounded Replay

    Caches cannot be kept forever, so misses will happen. The system handles misses pragmatically. SWA windows do not enter the persistent layer. On a miss, the system does not recompute the full context. It uses bounded replay, replaying only the last 128 tokens to approximately rebuild the attention state. When exact reconstruction is required, the replay length increases to 2,560 tokens.

    This is a typical precision-versus-cost trade-off. Replaying 128 tokens costs far less than prefilling the entire context from scratch, and the effect on generation quality is acceptable in most scenarios. Treating recomputation as part of the system design, rather than as an exception path, is a key trait of highly available inference services.

    5. Scheduling and Balance: Pushing Utilization to the Limit

    5.1 Prefill Scheduling: Deriving Chunk Size from a Time Budget

    Prefill scheduling aims to fit as much computation as possible into the latency SLO. A common approach assigns each scheduling step a time budget. The system derives the chunk size that step can process from the per-token processing time, then forms batches dynamically. This keeps large requests from blocking small ones, and it keeps GPUs close to full compute load.

    5.2 Decode Scheduling: Balancing Two Dimensions

    Decode must balance two dimensions at once. The first is the KVCache memory used by active requests on each card. The second is the expert routing load on each card. The first determines whether a card can accept new requests. The second determines how fast each generation step runs.

    The core strategy of expert load balancing (EPLB-style mechanisms) is to minimize the maximum load, not the average. The goal is not to make every card perfectly even, because that would incur high migration costs. The goal is to keep the busiest card from becoming the bottleneck. In a synchronized parallel Decode loop, the slowest card sets the pace for the whole step, so flattening the long tail is worth more than optimizing the arithmetic mean.

    6. Benchmarks for Engineering Teams

    If you plan to reproduce a similar inference system in a self-built cluster, consider these lessons:

    • Separate first, then optimize. Prefill/Decode separation is the prerequisite for all later optimizations. Systems with mixed deployment have a low optimization ceiling.
    • **Cache hit