Model inference is the execution of a trained machine learning model on input data to obtain an output. An algorithm defines a computational procedure; a training algorithm uses examples to learn a model's parameters. The resulting model represents learned relationships, and inference applies those relationships to a particular input. For example, training a delivery-time model uses historical shipments, while inference uses a new shipment's details to estimate its arrival time.
Inference outputs are not limited to predictions about the future. A model might classify an existing email as spam, estimate the probability of a transaction being fraudulent, extract an embedding from a document, or generate a paragraph of text. A prediction is an output of inference, not a guarantee of correctness. A business application typically combines that output with rules or human judgment before taking action. For instance, a fraud score can trigger additional verification rather than automatically rejecting a payment.
In the cloud, engineers commonly expose a model through an application programming interface or run it as a processing job. Real-time inference serves requests while a user or application waits, making latency and availability important. Batch inference processes a collection of records when immediate responses are unnecessary, such as calculating customer churn scores overnight. Asynchronous inference accepts work for later completion and can suit requests with long processing times or large inputs.
A working inference pipeline includes more than the model. Inputs must be validated and transformed into the format the model expects, using preprocessing consistent with training. Outputs may require decoding, thresholding, filtering, or conversion into business-friendly results. Engineers should version the model and its preprocessing together so that a deployment can be reproduced, tested, and rolled back.
Compute choices depend on model size, request volume, memory requirements, and latency targets. CPUs can be sufficient for smaller models, while GPUs or specialized accelerators can benefit demanding workloads. Larger models are not automatically the best choice: evaluate measured task quality against cost and response time. Batching requests can improve throughput but increase waiting time, and scaling down idle capacity can reduce cost while introducing startup delays.
A common misconception is that inference automatically teaches the model from every request. Ordinary inference does not update model parameters; learning from feedback requires a separate training or adaptation process. Similarly, adding retrieved documents to a generative model's prompt supplies context for inference rather than retraining the model. Generated answers can still contain errors, and a classification score should not be assumed to be a calibrated probability.
Production operations should monitor latency, throughput, errors, resource consumption, and output quality where reliable labels or evaluations are available. Changing input patterns can reduce usefulness even when the service remains healthy. Protect sensitive inputs and outputs with access controls, encryption, and appropriate logging policies. Business success depends on whether inference improves the intended outcome, not simply whether an endpoint returns a response.