Skip to content

What is inference in AI?

AI inference applies a trained model to new data to produce predictions or responses; latency and cost depend on the workload and the infrastructure behind it.

AI inference is the use of an already trained model to produce a prediction or response from new data. A system might classify an invoice, estimate future demand, or answer a written request: in each case it runs the model on the input it receives and returns a result. Training prepares the model by changing its parameters; inference uses them, unchanged, to perform the task. The model can still be updated or retrained later. For language models, a response consists of tokens, small units of text generated one after another. Response time and the number of requests that can be served depend on both the model and the system running it. Anyone buying or designing an inference service should therefore judge the quality of the result separately from how fast it arrives, and compare options on requests that reflect real work, not just on a provider's published figure.

See also: Continuous batchingContinuous batching changes which LLM requests are processed together at each iteration, freeing capacity when a response ends so others can be served at once.

How to measure an inference service

Latency is the time a request takes to receive a response; throughput is the amount of work completed per unit of time. The MLPerf Inference rules distinguish a server scenario, where requests arrive over time under a latency limit, from an offline scenario, where all the work is available up front and throughput is measured. An offline result alone does not show that an interactive assistant will respond within the required time. Quality must also stay acceptable: speed comparisons only count if they use the same task and a quality criterion.

Choices that change the result

For language models, processing the prompt and generating the response have different requirements, as the prefill and decode entry explains. Processing requests together raises capacity but can slow each response. The Sarathi-Serve paper proposes scheduling that eases this trade-off, and the continuous batching entry explains how to handle concurrent requests. Where to run the model is another choice: edge AI brings processing closer to the data, while a remote service also means checking the data's route and the contract terms.

An enterprise example

A company wants to classify invoices and help employees find information in documents. For invoices, it can measure how many get processed in the time available and how many need correction. For the assistant, it has to measure how long employees wait, even when requests overlap. A fair trial uses representative documents, the same quality criterion, and the expected workload, including the error cases that must go to a person. Cost should be compared per task completed correctly, counting the human corrections, not just per request.

Why it matters for decision makers

Before choosing, ask the provider what data goes into the service, where it is processed, how speed and quality are measured, and what happens when errors occur. The NIST AI RMF Playbook suggests defining acceptable performance thresholds and the fixes to apply if they are breached, and documenting performance before and after deployment. MLOps covers managing a model across its lifecycle.

Frequently asked questions

Training changes model parameters; inference uses them, unchanged, to produce a result from new data.

Measure response times and throughput on representative requests, and check the quality of the results too.
  • Continuous batchingContinuous batching changes which LLM requests are processed together at each iteration, freeing capacity when a response ends so others can be served at once.
  • Prefill, decode, TTFT and ITLPrefill and decode are the phases that process the prompt and generate the answer; TTFT and ITL measure the initial wait and the gaps between streamed outputs.
  • Edge AIAI inference run close to where data is born, not in the cloud: lower latency, data stays in-house, real-time decisions.
  • MLOpsMLOps organizes the training, deployment, monitoring, and updating of machine learning models, connecting data, code, and operational ownership over time.
  • Tensor parallelism vs pipeline parallelismTensor parallelism spreads a model across GPUs by splitting the work within each layer; pipeline parallelism does so by assigning layers to different devices.

See it in the universe

If you need the AI in production, not in a demo, that is my job.

See AI integrations

Or write to me.