LLM Inference Cost Reduction: Engineering Practices for Higher Efficiency

    This article explains how to lower large language model inference costs by evaluating cluster-level throughput and per-GPU-hour unit economics together. It covers three engineering directions: heterogeneous chip compatibility, Prefill-Decode disaggregation, and long-window KV cache reuse. It also outlines the metrics to benchmark and common pitfalls for teams building a similar inference system on their own clusters.

    Competition among large model serving providers has shifted from “can the model answer?” to “with the same compute, how many more requests can be served at a lower cost?” A Chinese large model provider recently published two figures that illustrate this shift. One cluster delivers daily throughput on the order of tens of trillions of tokens, and the revenue per accelerator per hour works out to tens of US dollars. The first figure shows scale, and the second shows unit economics. Only by reading them together can you understand what an inference system needs to solve. This article uses that starting point to break down three engineering directions for reducing inference cost, and it discusses how to benchmark against these figures when building a comparable cluster.

    1. Why Throughput and Unit Economics Must Be Considered Together

    Throughput alone is meaningless. A cluster can reach impressive total throughput by adding more accelerators, but if each accelerator produces little output, the business model does not hold. Looking only at per-accelerator efficiency is also insufficient. Strong results from small test environments often shrink considerably in clusters with tens of thousands of accelerators, because of communication, scheduling, and fault tolerance problems.

    A healthy inference system must satisfy two conditions at once:

    • Scale: Cluster-level total throughput is high enough to show that the scheduling, networking, and storage architecture holds up at scale.
    • Economics: The revenue (or cost savings) generated per accelerator per unit of time covers hardware depreciation, electricity, operations, and other overhead.

    A common mental model treats the inference service as a “token factory”: GPU-hours go in, and effective tokens come out. The optimization target is therefore not simply maximum throughput. It is maximum net profit per GPU-hour under a given latency SLA. Every optimization should answer two questions: Does it increase the effective output per unit of compute? Does it introduce new hidden costs?

    2. Track 1: Heterogeneous Chip Compatibility to Avoid Single-Vendor Lock-In

    The first direction is compatibility with accelerators from multiple vendors. Chips from different generations and vendors vary widely in supply stability, procurement price, and energy efficiency. If an inference stack runs on only one type of hardware, the team’s negotiating power and supply chain resilience are limited.

    In engineering terms, the key challenge is not making models run on a new chip but making them run at full utilization. This requires solving problems at several layers:

    1. Operator layer: Build a unified operator interface on top of the compute libraries for each hardware platform. Tune performance-critical operators, such as attention and matrix multiplication, for each platform. Generic implementations can cut hardware utilization by half.
    2. Communication layer: Collective communication libraries and chip-to-chip interconnect topologies differ significantly across vendors. Communication patterns for tensor parallelism and expert parallelism must be redesigned for each topology. Otherwise, communication overhead will consume the gains from parallelism.
    3. Scheduling layer: The cluster scheduler must be aware of hardware heterogeneity. It should route requests to the most suitable chip pool and balance load across mixed deployments.

    The benchmark for this is not whether a platform is “supported” but the gap in Model FLOPs Utilization (MFU) across platforms. If MFU on a second platform reaches only 60% of the primary platform’s MFU, the compatibility exists only on paper.

    3. Track 2: Organizing Hardware by Phase with Prefill-Decode Disaggregation

    LLM inference naturally splits into two phases. The Prefill phase processes all input tokens at once and is compute-intensive. The Decode phase generates output tokens one at a time and is memory-access-intensive. The two phases need very different hardware resources, so running them on the same pool causes resource mismatch.

    The mainstream industry approach is Prefill-Decode (PD) disaggregation:

    • Prefill pool: Standard 8-accelerator servers are sufficient. Prefill can keep the hardware busy at moderate parallelism, so it depends less on very large interconnects.
    • Decode pool: Supernodes with dozens to hundreds of accelerators support large-scale expert parallelism and tensor parallelism over high-bandwidth chip-to-chip interconnects. This maximizes memory access and communication efficiency during decoding.

    After separating the pools, two supporting problems must be solved. First, KVCache must move efficiently from Prefill nodes to Decode nodes. This requires RDMA-class high-speed transport and fine-grained traffic scheduling. Second, the capacity ratio between the two pools must be adjusted dynamically based on actual input and output length distributions. Otherwise, one pool starves while the other sits idle.

    To replicate this architecture, benchmark these metrics: per-accelerator Prefill throughput (tokens/s), per-accelerator Decode output throughput, bandwidth utilization of KV transfers between pools, and whether end-to-end TTFT (time to first token) and TPOT (time per output token) meet the SLA.

    4. Track 3: Long-Window KVCache Reuse to Eliminate Redundant Prefill

    Real traffic often contains shared prefixes across requests, such as system prompts, multi-turn conversation history, and common retrieval context. If every request runs Prefill from scratch, the cost of recomputing those prefixes is substantial.

    The third direction extends the KVCache retention window to tens of hours and builds a multi-tier cache hierarchy:

    • Accelerator memory: The fastest tier, but with limited capacity. It holds the hottest prefix caches.
    • Host memory: An extension of accelerator memory with roughly an order of magnitude more capacity.
    • Distributed storage: High-speed SSDs or remote storage pools hold the long retention window. Efficient indexing and prefetching hide read latency.

    You can estimate the benefit of long-window reuse with a simple formula: saved Prefill compute ≈ matched prefix length × hit rate. If the prefix hit rate for a workload rises from 30% to 70%, the Prefill pool’s compute demand could be cut by about half.

    The trade-offs are also clear. Caches consume significant storage, and index consistency, eviction policies, and multi-replica disaster recovery add system complexity. When evaluating this optimization, monitor the prefix hit rate, the effect of cache read latency on TTFT, and the share of storage cost in total compute cost.

    5. Benchmarking Checklist and Common Pitfalls for Self-Built Clusters

    Teams that plan to build a similar inference system on their own clusters can use compute, container, storage, and monitoring services from cloud platforms such as Baidu AI Cloud. Benchmark each item on this checklist:

    • Daily cluster throughput and daily per-accelerator throughput, with input and output tokens counted separately.
    • Revenue per accelerator-hour, or the equivalent cost savings, with attention to peak and off-peak electricity pricing.
    • MFU on each hardware platform and the performance gap across platforms.
    • P50 and P99 distributions of TTFT and TPOT, and the SLA attainment rate.
    • Prefix cache hit rate and its distribution across each cache tier.
    • Throughput degradation curve and recovery time under failure scenarios.

    Common pitfalls include the following. Optimizing single-point latency while ignoring cluster-level scheduling produces local optima that are not global optima. Extending cache windows without evaluating storage cost lets storage expenses consume the compute savings. Extrapolating small-scale benchmark results linearly to a cluster of ten thousand accelerators ignores the nonlinear growth of communication and fault tolerance overhead.

    6. Conclusion

    Competition on LLM inference cost is fundamentally a systems engineering problem. Heterogeneous compatibility keeps supply flexible, PD disaggregation matches resources to demand, and long-window KV reuse removes redundant computation. These three directions depend on each other, and a weakness in any one of them drags down overall unit economics. Teams planning inference infrastructure should first define net profit per GPU-hour as one shared metric, then break down optimization opportunities around it. That approach moves a team from making models run to making them run cheaply.