LLM Inference Cost Analysis: Batching, MoE Expert Parallelism, and Rack-Level Bottlenecks
A technical analysis of how publicly available API pricing, model scale, and hardware constraints can be used to infer the cost structure of large language models. It examines batch size as the primary driver of inference cost, the pricing trade-off between fast and standard modes, all-to-all communication and rack bandwidth limits in MoE deployment, why pretraining data often exceeds the scaling-law optimum by about 100x, and a reusable framework for evaluating API pricing, private deployment, and service modes.
LLM Inference Cost Analysis: Batching, MoE Expert Parallelism, and Rack-Level Bottlenecks
A blackboard and a few equations may look simple, but they can be enough to infer architecture details that large-model vendors do not usually disclose. Engineers have attempted to reverse-engineer key information about mainstream large models—including training data volume, inference batching strategy, and expert-parallel deployment—using only public API pricing, model parameter scale, and known hardware characteristics. This analytical approach is valuable to developers because it does not rely on internal leaks. It is based on verifiable public data and rigorous engineering reasoning. This article lays out the logical skeleton of that reasoning and breaks down its core conclusions.
1. The 1,000x Inference Cost Gap: Batching Is the First Variable
1.1 Why a single inference request can cost 1,000x more
The biggest difference between large-model inference and training is that training is naturally highly batched and parallel: millions of tokens are fed in at once. In online inference, batch size is determined entirely by traffic. If every user request is processed separately (batch size = 1), GPU compute utilization becomes extremely low. A large amount of time is spent on weight loading and scheduling overhead rather than useful computation.
A simple estimation framework:
cost per token ≈ (GPU time cost) / (total tokens served in that GPU time)= unit price / (throughput × batch size)
When batch size increases from 1 to hundreds or even thousands, cost per token can fall by two to three orders of magnitude. This is the source of the claim that without batching, a single inference request could cost 1,000x more. For service providers, batching is not an optimization item. It is the line between a viable business model and a failed one.
1.2 The fast-mode pricing puzzle: 6x the price for 2.5x the speed
Many large-model products offer a “fast mode” priced at roughly 6x the standard mode, while delivering only about 2.5x the speed. From a batching perspective, this ratio is not surprising:
- Fast mode: It sacrifices batch size—for example, reducing it from 256 to 8—so GPU utilization drops sharply and unit token cost rises several times. This explains the 6x price.
- Where the speedup comes from: A smaller batch reduces queuing and computation latency, but the amount of computation per request is unchanged. Therefore, the speedup is much lower than the cost multiple, at around 2.5x.
The reverse inference also holds: if users are willing to accept slower responses—larger batches and longer queuing—they could theoretically receive a significantly lower price. “Slow mode for a lower price” is entirely consistent with the cost structure. It simply passes part of the economics of batching back to users. This is especially relevant for enterprise scenarios. Offline batch generation, document summarization, and data labeling are not latency-sensitive and are naturally suited to a “large-batch, low-price” service model. This is also the fundamental reason cloud providers can offer offline batch inference products at prices far below online endpoints.
2. The Physical Ceiling of MoE: One Rack, 72 GPUs
2.1 Expert parallelism and all-to-all communication
A typical Mixture-of-Experts (MoE) configuration has hundreds of total experts—for example, 256—but activates only a small subset during each inference pass, such as 32. This “sparse activation” decouples model capacity from computation. Parameters can be made extremely large while the computation per inference pass remains controllable.
However, a key constraint appears in deployment. The most natural approach is expert parallelism: placing different experts on different GPUs. During inference, each token is sent according to its routing result to the GPU that holds the target expert. Because a token on any GPU can be routed to any expert, this creates an all-to-all communication pattern. Every GPU needs to exchange tokens with all other GPUs at high speed.
2.2 The 8x bandwidth gap across racks
Within a rack, GPUs communicate through high-speed interconnects such as NVLink-level topologies, with very high bandwidth and low latency. Once experts are distributed across two racks, tokens crossing racks must travel over the lower-bandwidth cluster network, which may be around 8x slower.
In all-to-all mode, total communication traffic is proportional to the square of the number of participating GPUs, and the slowest link determines overall throughput. If cross-rack traffic accounts for half of the total, this 8x bandwidth gap directly becomes the bottleneck for the entire inference system. Even the strongest GPUs must stop and wait for the network.
This leads to an important engineering conclusion: rack size directly limits the maximum scale of the expert layer. With today’s mainstream 72-GPU racks, the expert layer of an MoE model is essentially locked to what a single rack can hold. To break through this ceiling, vendors must either increase cross-rack network bandwidth with faster cluster interconnect technology, modify routing strategies so that fewer tokens cross racks, or accept the throughput loss caused by the communication bottleneck.
2.3 How rack constraints explain the early advantage in the pretraining race
This physical constraint also helps explain a long-standing industry puzzle: why do some labs appear to have achieved large-scale pretraining success earlier? One reasonable inference is that teams with self-built large-scale clusters have deeper experience in rack-level interconnect and cross-rack network engineering. They can overcome the physical bottlenecks of MoE scaling earlier and therefore train larger sparse models under the same compute budget. In other words, the decisive factor may not be model algorithms but data-center-level network engineering.
3. Pretraining Data Volume: Why It Is 100x the “Theoretical Optimum”
Classic scaling-law conclusions suggest that, given a compute budget, there is a theoretically optimal ratio between model scale and data volume. In practice, however, frontier models often use pretraining data volumes around 100x the theoretical optimum.
There are several engineering considerations behind this:
- Inference cost dominates total cost. Training is a one-time investment, while inference is an ongoing expense. Over the total lifecycle cost, inference spending usually far exceeds training spending. Training a “smaller but smarter” model with more data can save substantial inference cost. Money spent on data during training buys savings during inference.
- Training compute is relatively cheap. Training can use highly batched offline computation with utilization close to peak. Inference is constrained by traffic fluctuations and latency, so effective GPU utilization is much lower. For the same FLOP, training offers better cost-effectiveness.
- Repeated data still has marginal benefits. In practice, multiple passes over high-quality data can still improve performance, as validated in some modified scaling-law research.
The implication for enterprises is this: when planning self-built models or selecting model services, do not look only at the training compute bill. Use “inference cost per million tokens × expected call volume” as a core decision metric. When necessary, prioritize a moderately sized model trained on sufficient data rather than pursuing the largest possible parameter count.
4. Turning Blackboard Reasoning into a Practical Analysis Method
The essence of this reasoning methodology is to use publicly available constraints—pricing, parameter counts, hardware specifications, and network topology—together with an energy-conservation-style cost decomposition to approximate internal decisions that vendors do not disclose. Developers and enterprise users can reuse this framework:
- Evaluate API pricing合理性: Use the model that “batch size determines cost per token” to estimate price floors for different latency tiers and identify premium space.
- Plan private deployment: Before deploying MoE, calculate the ratio of intra-rack interconnect to cross-rack network traffic to avoid all-to-all communication becoming a hidden bottleneck.
- Choose service mode: For latency-insensitive offline tasks, actively choose batch channels to significantly reduce unit cost.
Conclusion
The economics of large models ultimately come down to a few plain numbers: batch size determines the order of magnitude of cost, rack boundaries determine the scale ceiling of MoE, and the trade-off between training data and inference cost determines the optimal model shape. Understanding these underlying constraints helps technical decision-makers see the direction more clearly than chasing the messaging of any single product. In the face of the physical laws of compute, networking, and cost, all vendors are working from the same blackboard.
