The Hardware Physics Behind LLM Inference Cost
This article explains why model architecture, API pricing, and the pace of capability gains are all projections of the same underlying hardware and communication constraints. It walks through the bandwidth gap inside and across racks, how expert parallelism ties sparse MoE designs to network topology, why batch size is the primary driver of per-token cost, and what training on roughly 100x the scaling-law-optimal data implies. It closes with a practical checklist for deployment topology, batch-size monitoring, tiered scheduling, and capacity planning.
Introduction: Why Architecture, Pricing, and Progress Share One Equation
Discussions of frontier LLMs usually split into three unrelated topics: how model architectures are designed, why APIs are priced the way they are, and why capabilities improve at a certain rate. Drop the view down to hardware and communication, and all three turn out to be different projections of the same set of constraints. Using publicly known hardware form factors and general engineering principles, this article reconstructs a reasoning chain that runs from chip interconnect, through expert parallelism and batch scheduling, to pretraining data scale, and shows that phenomena which look like product decisions are in fact inevitable results of physical and mathematical limits.
1. The Starting Point Is Hardware: The Bandwidth Gap Inside and Across Racks
The mainstream deployment form for LLM inference today packs 72 accelerators into a single rack, connected by a high-bandwidth interconnect medium. Any two cards communicate in very few switch hops, and the aggregate bandwidth observable from a single card is extremely high.
The key fact is that once communication leaves the rack, effective bandwidth drops by an order of magnitude (commonly observed in the industry as roughly 8x) while latency rises substantially. This is not a gap that engineering optimization can erase; it is a physical boundary set jointly by signal integrity, power density, and the cost of connectors and optical modules.
This yields a very simple “communication cost” model:
T_comm ≈ α · (tokens / BW_intra) # inside the rackT_comm ≈ α · (tokens / (BW_intra/8)) # across racks
Here α is a coefficient related to topology hop count and protocol stack overhead. Any model structure that increases the share of cross-rack traffic will have its end-to-end latency and cost dominated by this term.
2. Mixture of Experts: Sparse Gains Tightly Coupled to All-to-All Communication
The core idea of sparse expert architectures is “large total parameter count, small compute per token.” Take a configuration that is widely discussed publicly: 256 experts, with each token activating only about 32 of them. Total parameters can be made very large while the floating-point work per token stays in a manageable range.
The most natural deployment is expert parallelism: place different experts on different accelerators. Each token must then be routed to the card holding its selected expert, and the communication pattern is a classic all-to-all. The high-bandwidth topology inside a rack fits this pattern well; but once experts are spread across racks, roughly half the traffic travels over links that are 8x slower, and communication immediately becomes the bottleneck.
The conclusion can be stated quantitatively:
If experts are split evenly across R racks, cross-rack traffic share ≈ (R-1)/REffective bandwidth ≈ BW_intra / (1 + 7·(R-1)/R)At R=2, effective bandwidth is about 1/4.5 of intra-rack
So “how many accelerators fit in one rack” directly limits “how large the expert layer can be,” which in turn caps the sparsity that can be deployed stably. This explains a long-observed phenomenon: systems with a larger scale-up domain (that is, high-speed interconnect over a wider range) can deploy higher-sparsity models while preserving inference efficiency, and therefore reach scale benefits earlier in pretraining. No vendor-specific “exclusive capability” needs to be assumed here; it is simply the arithmetic consequence of topology differences.
3. Batch Scale: The First-Principles Variable of Unit Inference Price
The same model on the same hardware can vary in unit price by 1000x, and the reason is almost entirely batch size.
When a single request has the hardware to itself, weight movement and memory bandwidth overhead cannot be amortized and compute utilization is very low. Merge many requests into a batch and weight reads are reused, arithmetic intensity (floating-point operations per byte of data) rises, and the hardware shifts from bandwidth-bound to compute-bound, so cost per token falls sharply.
Cost/1k tokens ∝ 1 / (effective batch size × hardware utilization)
This also explains the common pricing structure where a fast mode costs 6x more but is only 2.5x faster: low latency means small batches and low queueing, and what is sacrificed is amortization efficiency. A “slow mode for a lower price” is entirely feasible technically; it essentially routes requests into larger batches and tolerates higher queueing latency. Whether such a tier is offered depends on the provider’s scheduling strategy and SLA design, not on any difference in model capability.
Engineering levers that map to this include continuous batching, chunked prefill to keep long prompts from blocking, prefix caching to reuse system prompts and long documents, and priority-queue-based latency tiering.
4. Pretraining Data: What a 100x Gap Means
The “theoretically optimal” answer from scaling laws is the data allocation solution for a given amount of compute and model size. If the actual pretraining data volume is about 100x that solution, training was not run at the optimal allocation point, but rather with “data redundancy + multiple repeated passes + a more conservative convergence strategy.”
Two verifiable implications follow. First, simply piling on data shows clearly diminishing marginal returns, so architecture and data quality carry more weight. Second, compute efficiency on the inference side (sparsity, batching, cache hit rate) more directly determines whether the commercial model holds up than the training side does.
5. A Practical Checklist for Developers
- Match deployment form to communication topology first: keep high-frequency communication modules (expert layers, tensor parallel groups) within a single high-speed domain as much as possible.
- Treat batch size as a first-class metric: monitor effective batch size, queueing latency, and prefix cache hit rate, not just GPU utilization.
- Use tiered queues to offer latency and cost tiers: small batches at high priority to protect latency, large batches at low priority to drive down cost.
- For long-context scenarios, prioritize chunked prefill and cache reuse so a single long request does not block the whole batch.
- Treat high-speed domain size as a hard constraint in capacity planning, and evaluate the all-to-all traffic share before expanding across domains.
Conclusion
The shape of an LLM is not purely a product choice: the bandwidth gap inside and across racks bounds the size of the expert layer, all-to-all communication binds sparsity to topology, batch size sets the order of magnitude of unit price, and data allocation caps training efficiency. Understanding these four constraints leads to more predictable decisions in selection, tuning, and cost governance. To validate them in your own environment, you can build an observable load-testing loop on general cloud capabilities such as container platforms, monitoring and alerting, and logging services, and settle tiers with data rather than intuition.
