What is inference?

Inference is the stage in which a trained model processes a prompt to produce a response or prediction without changing its weights.

It differs from model training in the weights: training updates them, while inference produces results with fixed weights and the model does not keep learning. Inference uses most of the GPU capacity in on-premise AI, though small models can also run on CPUs or edge hardware.

Topic
Inference and performance
Also known as
Model inference, AI inference

How inference works

  1. In language models the prompt is tokenised; in the prefill stage all prompt tokens are processed in parallel and the KV cache is filled.
  2. In decoding, answer tokens are generated one at a time, each using the cached keys and values.
  3. An inference engine batches concurrent requests, manages memory and keeps the GPU busy.
  4. Time to first token and time per token set latency; tokens generated per second set throughput.

In more detail

Test-time compute and reasoning models

Reasoning models scaled 'test-time compute' by generating long internal chains of thought before producing a final answer. This shifts inference economics heavily toward the decode phase, increasing end-to-end latency, KV-cache footprint and energy consumption per query even when the user's visible prompt and final answer are short.

Arithmetic intensity, the HBM bandwidth wall and speed-up techniques

Because autoregressive decoding generates one token at a time, each step must stream nearly all model weights and the KV cache from GPU High-Bandwidth Memory (HBM) for just a handful of FLOPs, yielding low arithmetic intensity. Techniques such as continuous batching, Grouped-Query Attention (GQA) / Multi-Head Latent Attention (MLA), speculative decoding and FP8/INT4 quantisation directly attack this memory-bandwidth wall.

Service metrics: TTFT, TPOT and goodput

Production SLAs distinguish Time to First Token (TTFT, governed largely by prefill speed), Time Per Output Token / Inter-Token Latency (TPOT/ITL, governed by decode bandwidth), End-to-End Latency and Goodput, the rate of requests meeting both TTFT and TPOT targets simultaneously rather than raw tokens per second alone.

The limits of determinism in inference

Even at temperature = 0, GPU inference is not strictly bitwise deterministic across varying batch sizes or kernel schedules due to floating-point non-associativity (and MoE routing tie-breaks). Regulated industries requiring reproducible outputs must account for batch-invariant kernels or fixed-seed audit controls.

Commonly confused terms

TermHow it differs
Evaluation and benchmarkingEvaluation (benchmarking) runs inference on curated test sets solely to measure accuracy, latency or safety metrics before deployment, whereas production inference serves live user or application requests under SLAs.

Why inference matters for on-premises AI

In-house hardware is planned around inference: model weights, KV cache, concurrent users and context length together set GPU memory. Prefill is compute-bound while decoding is bound by memory bandwidth, so their bottlenecks differ. Quantisation and cache management make room for more concurrent requests on the same hardware. When inference runs in-house, prompts and answers never leave the organisation.

ON-PREMISES EXAMPLE

A public body runs a petition classification model on in-house servers and sets GPU capacity and batching according to concurrent requests at peak hours.

Common questions

Why does inference need GPUs?

Large models need heavy matrix multiplication and high memory bandwidth, which GPUs accelerate. Small models can run inference on CPUs, though more slowly.

Does the model learn from users during inference?

No. Standard inference does not change the weights. Information in a conversation is used only within that request's context.

Sources

Related page on this site: Supermicro page · In the glossary: Glossary, E to L

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.