ES EN
Part III · Chapter 04

The Inference Trilemma: Latency, Throughput, and Cost — The Art of Choosing What to Sacrifice

14 min read · revised August 2026

In the previous chapters we saw how to optimize inference (distillation, quantization, batching, KV cache) and how to manage demand in production (latency, throughput, rate limits). But there is a background problem that no optimization solves on its own: you cannot optimize all three at once.

The trilemma: you cannot optimize all three at once

Inference tension triangle Low latency, high throughput, and low cost are connected with no hierarchy: improving one dimension usually pressures at least one other. Low latency Fast response High throughput Many at once Low cost Less hardware
DimensionWhat It MeansWhat Happens If You Prioritize It
Low LatencyEach individual request is fastYou need to over-provision capacity → high cost
High ThroughputMany requests per secondAggressive batching adds latency → high latency
Low CostLittle spend on hardware/inferenceYou accept lower throughput, higher latency, or both

Illustrative example (typical qualitative pattern of a 70B model on high-end GPUs, not measured figures from a specific deployment):

ConfigurationLatency (p95)Throughput (req/s)Relative Cost
Batch=1, unoptimizedLowLowBaseline
Batch=64, optimizedHighHighSame (same hardware)
2× GPUs, batch=1LowMediumDouble
Smaller modelVery lowVery highMuch lower (but with lower quality)

No configuration wins on all three dimensions at once. The trilemma is real: you always have to choose what to sacrifice.

Why LLM inference breaks normal software paradigms

They are stateful: in a typical REST API, each request is independent. In an LLM, context grows with every token generated — the KV cache (Inference optimization) stores the attention state for all previous tokens. That means you cannot load-balance by sending each request to any replica indistinctly (each replica’s cache is different), and switching replica mid-generation means losing that state.

They are memory-bound, not compute-bound: in most software, the bottleneck is compute. In LLMs, it is memory bandwidth — the model weighs gigabytes, and every generated token requires moving all those weights from memory to the processor. The time to move the weights dominates the cost, not the math operations themselves. That is why a GPU that is faster in FLOPS helps little if memory bandwidth does not improve, quantization speeds things up by reducing how much you have to move, and batching works by sharing that fixed cost across several requests.

It depends intimately on the physical hardware: performance is not just “GPU A is faster than GPU B” — it depends on interconnect topology (NVLink, PCIe), memory bandwidth (HBM vs. GDDR), L2 cache size, and the CUDA/driver version. Two GPUs of the same model can perform differently depending on the motherboard and the cooling.

The four engineering decisions that set the performance ceiling

Model architecture: dense vs. MoE

TypeDescriptionImplication for Inference
DenseAll parameters activate per token (70B → move ~140GB of weights in FP16 per step)Bottleneck = memory bandwidth; simpler to deploy
MoE (Mixture of Experts)Only a fraction activates per token (e.g. a 671B total model with 37B active)Fewer active weights per token, but requires communication between GPUs — more complex

A dense 70B model does not fit in FP16 on a single 80GB GPU (it needs ~140GB) — you need quantization or multiple GPUs. A large MoE needs several GPUs from the start, but each token activates only a fraction of the total parameters, which can be faster on certain tasks despite the larger total size. With a single GPU, a quantized dense model is usually the simpler option; with a cluster available, an MoE can be more efficient.

Quantization, going deeper

PrecisionRelative size (e.g. 70B model)Relative speedAccuracy loss (order of magnitude)
FP16/BF16140GB (baseline)1×None
FP8~70GB1.5-2×Very small
INT4 (Q4)~35GB2-3×Perceptible on demanding tasks
INT4 + adapter trained with QLoRA~35GB2-3×Variable; the serving format and the fine-tune must be evaluated separately

Note on the accuracy-loss figures: exact percentages vary widely by model, task, and specific quantization method — there is no reliable universal number. The order relationship (FP16 no loss < FP8 minimal loss < INT4 more noticeable loss) is a consistent, well-documented pattern.

FP8 is usually the reasonable starting point for deployments on compatible production hardware — a good balance between memory and accuracy. INT4 makes sense when hardware is limited, always testing before trusting it on critical tasks.

Parallelism strategy

StrategyWhat it doesBest forEffect on latency
Tensor parallelismSplits the model layers across GPUsMinimizing latency on models that do not fit on a single GPUReduces latency per request
Expert parallelismDistributes the “experts” of an MoE across different GPUsLarge-scale MoE deploymentHigh efficiency, less unnecessary communication
Data parallelismFull replicas of the model, each processing different requestsMaximizing total throughputDoes not speed up individual latency

Illustrative example (typical pattern, not a specific measurement): a 70B model on 2 GPUs with tensor parallelism tends to give lower individual latency but more modest throughput; the same model with data parallelism tends to give noticeably higher throughput at the cost of higher individual latency. The practical choice: tensor parallelism when latency matters more, data parallelism when throughput matters more, and expert parallelism specifically when you deploy an MoE.

Batching and the “elbow of the curve”

Loading the model weights is a fixed cost on every generation step — batching amortizes it by spreading that cost across several requests processed together.

Illustrative example (typical behavior pattern, not a measurement from a specific benchmark):

Batch sizep50 latencyThroughput (req/s)Zone
1Very low22Memory-bound
4Low83Memory-bound
8Low154Good balance
16Moderate258The elbow begins
32Medium-high376Throughput peak
64High356Throughput no longer grows — it starts to drop
128Very high284Compute-bound — throughput falls below the peak
Throughput versus batch size Throughput rises from 22 requests per second at batch 1 to a peak of 376 at batch 32; then it drops to 356 at batch 64 and 284 at batch 128. Throughput (req/s) 0 100 200 300 400 22 83 154 258 376 · peak 356 284 1 4 8 16 32 64 128 Batch size Drop after the elbow
Illustrative example of the pattern described in the table; it does not reproduce a specific benchmark. The optimal point must be measured on real hardware and load.

An important nuance this table reveals, and that is worth highlighting: past the elbow, throughput does not just stop growing — in this pattern, it falls. It is not only “diminishing returns”; it is directly counterproductive to keep raising the batch past a certain point. Finding the elbow of the curve (the point where throughput stops improving) is the optimal batch configuration for your specific hardware — and confirming where that point sits requires measuring on your own system, not assuming a generic value.

The four real dimensions of cost

The cost of an AI system is not just the price of the GPUs:

DimensionWhat it isThe hidden risk
CapExHardware costGPUs with fast interconnect are usually sold in fixed blocks — you cannot buy “half a unit”
OpExEnergy and coolingYou pay the hardware bill even when it is unused — the “idle tax”
Opportunity costIdle capacity on intermittent trafficEvery minute without processing tokens is capacity already paid for and wasted
Engineering costTalent to configure and maintain the systemExpensive time hunting for the optimal configuration — the “benchmarking tax”

Illustrative order-of-magnitude example (not verified figures from a real case — the structure of the argument is what matters, not the exact numbers): a hosted API can have zero hardware cost but a notable integration cost; a small self-hosted deployment with a few GPUs has moderate hardware and operations cost; a large self-hosted deployment has high hardware cost, and the engineering cost to run it well can end up comparable across all three options, even when the hardware cost is very different. The real lesson, independent of the exact figures: the cheapest hardware on paper is rarely the most profitable once you factor in the talent needed to operate it well — sometimes the API turns out cheaper in the long run, even if the cost per individual token is higher.

Two worlds, two completely different strategies

Latency-sensitive world (chatbots, real-time agents): the priority is that the user does not wait. Key metrics: TTFT and inter-token latency. Strategies: tensor parallelism, small batches (1-8), speculative decoding, chunked prefill.

Throughput-sensitive world (massive offline generation, batch summaries): the priority is to process the maximum amount of data at minimum cost. Key metric: tokens per dollar. Strategies: large batches, data parallelism, treat queuing as an asset (keeping a constant queue ensures maximum GPU utilization), not as a failure.

7-step framework for choosing the right configuration

  1. Characterize the load: how many requests per second at peak? what is the latency SLO? what size are typical prompts and answers?
  2. Choose model and quantization: the smallest model that does the job; FP8 as the standard when the hardware supports it, INT4 only if the hardware requires it and you already tested that the loss is acceptable.
  3. Measure on real hardware: your own benchmarks on at least two configurations — never trust published numbers without verifying on your own system.
  4. Locate the elbow of the curve: the point where the system goes from memory-bound to compute-bound — the real useful limit of your configuration.
  5. Size with margin: replicas for the expected peak, with extra buffer for unexpected peaks.
  6. Calculate the real total cost: CapEx + OpEx + engineering cost, compared against the cost of a hosted API if the alternative exists.
  7. Autoscale with judgment: reduce replicas in off-peak hours, accepting the cold-start latency when scaling up.

Connection with Part II: agents multiply the trilemma

Architecture (Part II)Impact on the trilemmaRecommendation
Single agentFewer model calls → lower cost and latencyUse it when the task allows
ReAct (multiple turns)Each turn adds latency and cost — the trilemma multipliesLimit the number of turns; use a fast model for them
CoordinatorAdds an extra call to classifyUse a cheap model specifically for that classification
Multi-agent (home automation)Multiple agents = multiple calls, each one affecting the trilemmaRun in parallel when possible; vary model size by each agent’s task
Human-in-the-loopHuman wait dominates total latency, not inferenceAllows more aggressive batch configurations, because inference latency stops being the critical bottleneck

The 1,500-salesperson case, revisited: the fast client-evaluation model prioritizes throughput and cost (self-hosted, large batch in off-peak hours); the capable email-drafting model prioritizes quality and latency, because the salesperson is waiting for the answer (via API, or self-hosted with tensor parallelism). Each piece of the system sits at a different point on the same triangle, according to what that specific piece needs.

The consulting value

When someone asks “which model is better?”, the honest answer is usually: it is not a model question, it is a trilemma question. The productive conversation is: “given your real traffic pattern, your latency tolerance, and your budget, where on the trilemma should we stand, and which specific configuration gets us there?”

Quick diagnosis: if the system is slow, measure TTFT and tok/s — you are probably missing inference optimization. If it is expensive, measure cost per request — distillation or a smaller model is probably worth it. If it does not scale, measure the rate limit and batching behavior — you probably need continuous batching or more replicas. There is no universal answer — there is a diagnostic process that depends on the specific case.

Chapter summary

  • The trilemma is real: latency, throughput, and cost do not get optimized all three at once — you have to decide consciously what to sacrifice.
  • LLMs are different from traditional software: they have state, they are limited by memory (not by pure compute), and they depend intimately on the physical hardware.
  • Four decisions set the performance ceiling: model architecture (dense vs. MoE), quantization, parallelism strategy, and the optimal batching point.
  • Real cost has four dimensions, not just the price of the GPUs — and the cheapest hardware on paper is not always the most profitable in practice.
  • There are two worlds with opposite strategies: optimize for latency (interactive) or optimize for throughput (massive processing) — rarely both at once.
  • A 7-step framework helps choose the right configuration: characterize, choose, measure, locate the elbow, size, calculate total cost, and autoscale.
  • Part II agents multiply the trilemma’s impact — more autonomy almost always means more calls, and therefore more pressure on all three corners of the triangle.

The final question is never “which configuration is best?” in the abstract — it is “which configuration is best for my use case, with my budget and latency constraints?” The answer is always a conscious balance, not a perfect solution.

Found an error? Suggest a correction