Inference

Authors 7 articles 73 min total read

This topic is curated by our AI council — see how it works.

Every AI product’s operating cost is decided here, not in the training run: inference is the piece of the stack that runs on every single request, which is exactly why it anchors inference optimization — the theme’s other levers all act on this one process. Get the mechanism wrong and the tools you reach for next — compression, scheduling, sampling — turn into guesswork instead of engineering. The six articles below trace that mechanism from a single forward pass to a production fleet, with the market forces and real costs layered in as they become relevant.

  • Inference is bound by memory movement, not raw compute, and generation is sequential — one token depends on the last, which is why more GPUs multiply capacity, not the speed of a single response.
  • Serving-framework choice (vLLM, TensorRT-LLM, SGLang) is a constraint match, not a popularity contest — profile the workload before picking one.
  • Custom silicon like Cerebras and Groq is repricing inference speed, but GPU clouds still own the flexibility floor — the right architecture depends on the workload, not a universal winner.
  • Inference runs around the clock, so its environmental and access cost scales with usage — a recurring draw, not a one-time line item.

Reading the inference stack: mechanism first, market last

Start with what model inference is and how LLMs generate text through autoregressive decoding — it establishes the one fact everything else in this topic assumes: generation happens one token at a time, each conditioned on every token before it. From there, KV-cache, PagedAttention, and the building blocks every inference pipeline needs names the machinery that makes that loop fast enough to serve, and memory walls, quadratic context costs, and the hard engineering limits of LLM inference is the honest read on where that machinery stops helping.

Once the mechanism is solid, the vLLM, TensorRT-LLM, and SGLang deployment guide turns it into a running server, with the framework-selection logic a benchmark table alone won’t give you. For where the hardware market is moving underneath that choice, Cerebras vs. Groq vs. GPU clouds maps the custom-silicon bet reshaping inference economics. Close with the environmental price and access inequality of large-scale inference — once inference runs continuously in production, this is the cost the cloud bill doesn’t show.

MAX asks: 'My cluster has more GPUs than ever — why can't I just throw them at one slow response to speed it up?' MONA answers: 'Because each token waits on the one before it. More GPUs serve more requests, not one faster.' — comic dialog.
Inference is sequential by construction — parallel hardware buys throughput, not speed for a single response.

How inference differs from training, and from the levers that shape it

Inference and training share the same weights but sit on opposite sides of the cost equation. Training happens once, offline, in a controlled batch job. Inference runs continuously, on live traffic, and its cost compounds with every request instead of every model version — a distinction that usage-based billing makes concrete and always-on deployment makes expensive.

A second confusion sits one level down: inference is the process, not the technique. Quantization, continuous batching, and temperature and sampling are levers applied to inference, not different names for it — quantization changes what the weights weigh, continuous batching changes how requests share the GPU, sampling changes which token gets picked. None of them replace understanding the loop itself; they tune it.

Common questions about inference

Q: Is LLM inference actually more expensive than training the model, over its lifetime? A: Usually, yes — training is a one-time job, but inference reruns on every single request for as long as the product is live, and at scale that recurring draw includes real electricity, water, and carbon, not just a per-token charge. The environmental price of always-on inference traces where that bill actually lands.

Q: Will adding more GPU memory alone fix slow inference at long context lengths? A: Only partially — more memory buys headroom for a bigger KV-cache, but the attention computation itself still grows worse than linearly with context length, so the wall moves rather than disappears. The hard engineering limits of LLM inference covers where teams hit it anyway.

Q: Does the custom-silicon race between Groq and Cerebras matter if I’m just calling a hosted API? A: Indirectly, yes — the speed and cost gains custom silicon delivers show up as pricing and latency changes at the API layer even if you never touch the hardware, and hyperscalers are already buying in rather than competing. Cerebras vs. Groq vs. GPU clouds tracks who’s adopting what.

Q: Do I need to understand the inference mechanism before picking a serving framework? A: Yes, in practice — framework choice sits on top of the mechanism, not in place of it. Read how KV-cache and PagedAttention work first, then let the deployment guide match a framework to your constraints.

Part of inference optimization · closest neighbour: continuous batching. New to inference from a software background? Start with the story: Inference Optimization for Developers: What Transfers and What Breaks.

1

Understand the Fundamentals

Inference is where training meets reality, converting static model weights into dynamic output one token at a time. These articles unpack the mechanisms that make generation possible and the constraints that shape it.

2

Build with Inference

Deploying inference at scale means choosing the right serving framework, configuring batching strategies, and managing GPU memory under load. These guides walk through the practical decisions that determine cost and speed.

4

Risks and Considerations

Running inference at scale raises questions about energy consumption, equitable access, and the hidden costs of always-available AI. These articles examine what responsible deployment looks like beyond raw performance.