Inference is the phase of the model lifecycle where training is over and the model is put to work: classifying images, recognising speech, generating a language model’s reply. A single pass like this is cheap, but a model is trained once and then receives millions of queries, so the total load from inference usually exceeds that of training — and it is inference that inference servers are built for.
How a request is processed
A request to a language model is split into two phases. First, prefill: the model processes the prompt as a whole and builds the KV cache from it — stored attention states for every prompt token. Then decode: the model produces the reply one token at a time, with each next token building on the accumulated cache.
| Phase | What happens | What limits it | Metric |
|---|---|---|---|
| Prefill | the prompt is processed as a whole, the KV cache is built | compute | TTFT — time to first token |
| Decode | reply tokens are produced one at a time | memory bandwidth | ITL — time between tokens |
The longer the prompt, the longer prefill takes and the higher the TTFT: attention processes the entire input sequence to build the KV cache. After the first token, what matters is keeping the time between tokens steady — that is how the server uses memory and its bandwidth efficiently. The model’s matrix computations are usually done by a GPU or another accelerator, while batching, endpoints and request scheduling are handled by the inference server.
How inference differs from training
- the weights are fixed: the data processed never changes the model’s parameters;
- forward pass only: no gradients are computed or accumulated, so a single request needs far less memory and compute;
- response in fractions of a second: inference is embedded in an application and runs in real time, while training takes hours or even weeks;
- round-the-clock operation: a model is trained only occasionally, but requests must be served continuously — hence the requirements for fault tolerance and for the cost of each request.
That is why the same model is trained on a cluster of many GPUs, while a single card is often enough for inference — as long as the weights fit and the required response rate is sustained.
Sources
the term is written from these pagesVerified 9 Nov